feat: 🎸 add type-aware account display in admin UI

This commit is contained in:
Randall Morey committed 2021-06-17 14:09:31 -04:00
1 parent 5659df3336
commit 0a57865270
8 files changed
+61 -35

No files matched your search

+4 -9
View File
@@ -26,15 +26,10 @@ export default class AccountModel extends GeneratedAccountModel {
* Convenience for getting username in account.
* @type {string}
*/
@computed('type', 'attributes.login_name')
get username() {
let username = '';
switch (this.type) {
case 'password':
username = this.attributes.login_name;
break;
}
return username;
@computed('attributes.{email,full_name,login_name}')
get accountName() {
const { email, full_name, login_name } = this.attributes;
return email || full_name || login_name;
}
// =methods