feat(Account Setting): Change user info display
This commit is contained in:
@@ -19,21 +19,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<h3 class="subtitle is-3" v-t="'account.users'"></h3>
|
<h3 class="subtitle is-3" v-t="'account.users'"></h3>
|
||||||
<div class="columns is-multiline is-centered">
|
<div class="columns is-multiline is-centered">
|
||||||
<div v-for="(user, k) in account.users" :key="k" class="column is-one-third">
|
<div class="column">{{ account.users.map(u => getUserInfo(u)).join(', ')}}</div>
|
||||||
<div class="card">
|
|
||||||
<div class="card-content">
|
|
||||||
<div class="content">
|
|
||||||
<span class="user-id">{{ user.userId }}</span>
|
|
||||||
(
|
|
||||||
{{ user.alias }}
|
|
||||||
<span
|
|
||||||
v-if="user.email"
|
|
||||||
>- {{ user.email }}</span>
|
|
||||||
)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<h3 class="subtitle is-3">Ajouter des amis</h3>
|
<h3 class="subtitle is-3">Ajouter des amis</h3>
|
||||||
<div class="columns is-centered">
|
<div class="columns is-centered">
|
||||||
@@ -164,15 +150,25 @@ export default class AccountSetting extends BaseAccount {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.account.users = [...this.account.users, ...this.newUsers]
|
this.account.users = [...this.account.users, ...this.newUsers]
|
||||||
const ok: boolean = await accountService.update(this.account._id, this.account)
|
const ok: boolean = await accountService.update(
|
||||||
|
this.account._id,
|
||||||
|
this.account
|
||||||
|
)
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
notif.error(`Une erreur s'est produite.`)
|
notif.error(`Une erreur s'est produite.`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
notif.success(this.$tc('account.newUserAdded', this.newUsers.length).toString())
|
notif.success(
|
||||||
|
this.$tc('account.newUserAdded', this.newUsers.length).toString()
|
||||||
|
)
|
||||||
this.newUsers = []
|
this.newUsers = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getUserInfo(user: IUser): string {
|
||||||
|
const email = (user.email && ` - ${user.email}`) || ''
|
||||||
|
return `${user.alias} (${user.userId}${email})`
|
||||||
|
}
|
||||||
|
|
||||||
public validate(): boolean {
|
public validate(): boolean {
|
||||||
if (!this.account) {
|
if (!this.account) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user