-
Notifications
You must be signed in to change notification settings - Fork 2
Contacts page and profiles
The solution manage 2 types of profile {user, desk}
Use profiles are automatically created on first login. User.auth are the minimum properties required to signup user. They are filled by
-
mandatory fields, extracted from auth data
- firstName, lastName, email, domain
-
extra fields, predefined fields editable by user on its account page
- picture, displayName (pre-filled with concat of firstName and lastName), title, birthdate
-
optional fields,
- landlinePhone, mobilePhone, skype, other (edit label/value)
Sometimes it could not be obvious if a property is related to user profile or app settings, for ex. Notification or Preferred language. A good check it to define if the property is cross devices or not, user can silence notification on a specific device (App Settings), does it make sense to select different language on 2 devices ? maybe not (User profile).
-
mandatory fields
- displayName, domain
-
extra fields, predefined fields editable by user on its account page
- picture, title
-
optional fields,
- email, landlinePhone, mobilePhone, skype, address, other (edit label/value)
List all ContactProfile whose isPublished == true
By default always show title, picture and displayName. Others fields are displayed only if isPublished == true.
the search is applied on fields displayName and title.
contact-profile.ts
export class ContactProfile {
_id?: string;
type: string;
picture: string;
displayName: string;
title: string;
created: number;
published: number;
modified: number;
isPublished: boolean;
domain: string;
constructor(type: string) {
this.type = type;
this.created = Date.now();
this.published = Date.now();
this.modified = Date.now();
}
}
export interface BirthDate {
day: number,
month: number,
year: number
}
export class UserProfile extends ContactProfile {
firstName: string;
lastName: string;
email: string;
birthdate: string;
options: Object // options: {landlinePhone: "", mobilePhone: "", skype: ""}
constructor() {
super('user');
}
}
export class DeskProfile extends ContactProfile {
options: Object // options: {landlinePhone: "", mobilePhone: "", skype: ""}
constructor() {
super('desk');
}
}
[{
_id: "1",
type: 'user',
firstName: "Jennifer",
lastName: "Wu",
title: "Senior Broker",
landlinePhone: "617-244-3672",
mobilePhone: "617-244-3672",
email: "[email protected]",
picture: "https://s3-us-west-1.amazonaws.com/sfdc-demo/people/jennifer_wu.jpg",
displayName: "Jenni Wu",
created: 1531852963067,
published: 1531852963067,
modified: 1531852963067,
isPublished: true,
domain: "meumobibox.meumobi.com"
}, {
}, {
}]