chore: 🤖 add user "account name" wherever users are listed

This commit is contained in:
Randall Morey committed 2021-10-06 16:00:23 -04:00
1 parent 84242dc014
commit 02682cb008
6 files changed
+59 -12

No files matched your search

+30
View File
@@ -1,5 +1,6 @@
import GeneratedUserModel from '../generated/models/user';
import { attr } from '@ember-data/model';
import { computed } from '@ember/object';
import { A } from '@ember/array';
export default class UserModel extends GeneratedUserModel {
@@ -16,6 +17,35 @@ export default class UserModel extends GeneratedUserModel {
})
account_ids;
/**
* Represents the user's primary account email, if any.
* @type {string}
*/
@attr('string', { readOnly: true }) email;
/**
* Represents the user's primary account full_name, if any.
* @type {string}
*/
@attr('string', { readOnly: true }) full_name;
/**
* Represents the user's primary account login_name, if any.
* @type {string}
*/
@attr('string', { readOnly: true }) login_name;
/**
* Convenience for getting a reasonable string that names the account.
* There are many options, so we fallback in order of precedence.
* @type {string}
*/
@computed('email,full_name,login_name,displayName')
get accountName() {
const { email, full_name, login_name } = this;
return email || full_name || login_name;
}
// =methods
/**