feat: Use display_name instead of name of the agent (#1097)

* feat: Use display_name instead of name of the agent
This commit is contained in:
Pranav Raj S
2020-07-27 22:19:26 +05:30
committed by GitHub
parent f30c8943d9
commit 2b1d445003
21 changed files with 80 additions and 41 deletions

View File

@@ -291,16 +291,9 @@ export default {
inboxId: this.currentInboxId,
});
const {
data: { payload },
data: { payload: inboxMembers },
} = response;
payload.forEach(el => {
const [item] = this.agentList.filter(
agent => agent.id === el.user_id
);
if (item) {
this.selectedAgents.push(item);
}
});
this.selectedAgents = inboxMembers;
} catch (error) {
console.log(error);
}

View File

@@ -26,6 +26,17 @@
{{ $t('PROFILE_SETTINGS.FORM.NAME.ERROR') }}
</span>
</label>
<label :class="{ error: $v.displayName.$error }">
{{ $t('PROFILE_SETTINGS.FORM.DISPLAY_NAME.LABEL') }}
<input
v-model="displayName"
type="text"
:placeholder="
$t('PROFILE_SETTINGS.FORM.DISPLAY_NAME.PLACEHOLDER')
"
@input="$v.displayName.$touch"
/>
</label>
<label :class="{ error: $v.email.$error }">
{{ $t('PROFILE_SETTINGS.FORM.EMAIL.LABEL') }}
<input
@@ -130,6 +141,7 @@ export default {
avatarFile: '',
avatarUrl: '',
name: '',
displayName: '',
email: '',
password: '',
passwordConfirmation: '',
@@ -141,6 +153,7 @@ export default {
name: {
required,
},
displayName: {},
email: {
required,
email,
@@ -188,6 +201,7 @@ export default {
this.email = this.currentUser.email;
this.avatarUrl = this.currentUser.avatar_url;
this.availability = this.currentUser.availability_status;
this.displayName = this.currentUser.display_name;
},
async updateUser() {
this.$v.$touch();
@@ -203,6 +217,7 @@ export default {
email: this.email,
avatar: this.avatarFile,
password: this.password,
displayName: this.displayName,
availability: this.availability,
password_confirmation: this.passwordConfirmation,
});