This user model is used in order to access the GC User model within the app, which depends on Group Control. This has abundant use cases, and all of our current apps use the user model. To make sure that any changes to the GC User model are accommodated within the apps, you must import this user model rather than defining your own. That can be done by making a model/user.js file in your app, and setting it to the following export statment:

export {default} from '@bennerinformatics/ember-fw-gc/models/user';

Additionally, in order to properly make this model work, you must accompany it with the proper adapter (so that it doesn't look for a User Serverside Model in your own app). See fw-app if you need more information about that.

After you have done these two steps, you can use user as any other Ember model, and it will properly get the data from Group Control.

Show:
nameMatches
(
  • name
)
Boolean

Checks if the passed in name matches this user. Used for search functionality.

Parameters:

Returns:

Boolean:

True if the name matches this user's id, full name, or full name without preferred name

inDept

String

This property is saved in Group Control and a boolean of whether the user is in the current department (as a regular user, not a guest user). This is used to filter dropdowns so not all users show up in them (you should almost always filter all your dropdowns by inDept = true, unless you have a clear reason for wanting all possible users).


Default: true

nameFirst

String

This property is saved in Group Control and is a string of the first name of the user.

nameFormalLower

Computed

nameFormalLower is a computed property used in nameMatches and other lookups, which is simply the lowercase version of the user's formal name (ie {nameFirst nameLast} regardless if there is a namePref defined or not).

nameFull

Computed

nameFull is a computed property, which returns the full name of the user ({nameSort nameLast}). If either nameSort or nameLast is empty, it will return the userId instead.

nameFullLower

Computed

nameFullLower is a computed property used in nameMatches and other lookups, which is simply the lowercase version of nameFull.

nameLast

String

This property is saved in Group Control and is a string of the last name of the user.

namePref

String

This property is saved in Group Control and is a string of the preferred name (nickname) of the user.

nameSort

Computed

nameSort is a computed property, which returns the preferred first name (so namePref if it is defined or nameFirst if it isn't). This is used by the nameFull property.