Skip to content

Commit cf90311

Browse files
Resul AvanResul Avan
authored andcommitted
profile settings form updates
1 parent cc69703 commit cf90311

File tree

5 files changed

+21
-27
lines changed

5 files changed

+21
-27
lines changed

functions/modules/types-module/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ export interface User extends BaseModel {
179179
email?: string
180180
profilePhoto?: Image
181181
coverPhoto?: Image
182+
biography?: string
182183
privacy?: PrivacyType
183184
followersPrivacy?: PrivacyType
184185
followingPrivacy?: PrivacyType

src/components/form/ProfilePrivacyForm.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,13 @@ import { User } from 'types-module'
5252
import { StateNamespace } from '~/types'
5353
import InputWithValidation from '~/components/ui/input/InputWithValidation.vue'
5454
import InputNoValidation from '~/components/ui/input/InputNoValidation.vue'
55-
import FieldWithValue from '~/components/ui/FieldWithValue.vue'
5655
import { getDangerNotificationMessage, showSuccessToaster } from '~/service/notification-service'
5756
import { handleError } from '~/service/error-service'
5857
import PrivacyDropdown from '~/components/ui/dropdown/PrivacyDropdown.vue'
5958
import { reloadUserFromDatabase } from '~/service/rx-service'
6059
6160
@Component({
62-
components: { PrivacyDropdown, FieldWithValue, InputNoValidation, ValidationObserver, InputWithValidation }
61+
components: { PrivacyDropdown, InputNoValidation, ValidationObserver, InputWithValidation }
6362
})
6463
export default class ProfilePrivacyForm extends Vue {
6564
@Prop({ required: true }) user: User

src/components/form/ProfileUpdateForm.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@
44
<FieldWithValue
55
:value="updatedUser.id"
66
:label="$t('common.field.id')"
7-
:disabled="true"
8-
label-position="on-border"
97
class="has-margin-bottom-15"
108
/>
119

1210
<FieldWithValue
1311
:value="updatedUser.email"
1412
:label="$t('common.field.email')"
15-
:disabled="true"
16-
label-position="on-border"
1713
class="has-margin-bottom-15"
1814
/>
1915

16+
<hr>
17+
2018
<InputWithValidation
2119
v-model="updatedUser.username"
2220
:label="$t('common.field.username')"
@@ -46,7 +44,7 @@
4644
class="has-margin-5"
4745
/>
4846

49-
<InputWithValidation
47+
<InputNoValidation
5048
v-model="updatedUser.biography"
5149
input-type="textarea"
5250
:label="$t('common.field.biography')"
@@ -89,7 +87,7 @@ import { reloadUserFromDatabase } from '~/service/rx-service'
8987
})
9088
export default class ProfileUpdateForm extends Vue {
9189
@Prop({ required: true }) user: User
92-
updatedUser = { ...this.user }
90+
updatedUser: User = { ...this.user }
9391
9492
@StateNamespace.profile.Action updateUser: (user: User) => Promise<User>;
9593
@StateNamespace.loading.Action saveLoading: (loading: boolean) => Promise<void>

src/components/form/SetEmailPasswordForm.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ import { Component, Prop, Vue } from 'nuxt-property-decorator'
5757
import { ValidationObserver } from 'vee-validate'
5858
import InputWithValidation from '~/components/ui/input/InputWithValidation.vue'
5959
import { LoginCredentials } from '~/types'
60-
import FieldWithValue from '~/components/ui/FieldWithValue.vue'
6160
6261
@Component({
6362
components: {
64-
FieldWithValue,
6563
ValidationObserver,
6664
InputWithValidation
6765
}

src/components/ui/FieldWithValue.vue

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<template>
2-
<b-field
3-
:type="type"
4-
:horizontal="horizontal"
5-
:label="$attrs.label"
6-
:label-position="labelPosition"
7-
>
8-
<b-input
9-
:disabled="disabled"
10-
:value="value"
11-
type="text"
12-
/>
13-
</b-field>
2+
<nav class="level is-mobile">
3+
<div class="level-left has-margin-left-5">
4+
<p class="level-item">
5+
<strong>{{ label }}:</strong>
6+
</p>
7+
</div>
8+
9+
<div class="level-right">
10+
<p class="level-item">
11+
{{ value }}
12+
</p>
13+
</div>
14+
</nav>
1415
</template>
1516

1617
<script lang="ts">
@@ -20,10 +21,7 @@ import { Component, Prop, Vue } from 'nuxt-property-decorator'
2021
components: {}
2122
})
2223
export default class FieldWithValue extends Vue {
23-
@Prop({ type: String, required: true, default: '' }) value: any;
24-
@Prop({ type: String, required: false, default: 'text' }) type: string;
25-
@Prop({ type: String, required: false, default: '' }) labelPosition: string;
26-
@Prop({ type: Boolean, required: false, default: false }) horizontal: boolean;
27-
@Prop({ type: Boolean, required: false, default: false }) disabled: boolean;
24+
@Prop({ type: String, required: true, default: '' }) readonly label: string;
25+
@Prop({ required: false, default: '' }) readonly value: any;
2826
}
2927
</script>

0 commit comments

Comments
 (0)