Introduce basic user and profile management

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-06-11 19:13:21 +02:00
parent da4ea84baf
commit beb35a09c6
51 changed files with 1808 additions and 254 deletions

View File

@@ -66,3 +66,10 @@ export function usernameWithDomain(actor: IActor): string {
}
return actor.preferredUsername;
}
export function displayNameAndUsername(actor: IActor): string {
if (actor.name) {
return `${actor.name} (@${usernameWithDomain(actor)})`;
}
return usernameWithDomain(actor);
}

View File

@@ -15,6 +15,7 @@ export interface IPerson extends IActor {
goingToEvents: IEvent[];
participations: IParticipant[];
memberships: Paginate<IMember>;
user?: ICurrentUser;
}
export class Person extends Actor implements IPerson {
@@ -26,6 +27,8 @@ export class Person extends Actor implements IPerson {
memberships!: Paginate<IMember>;
user!: ICurrentUser;
constructor(hash: IPerson | {} = {}) {
super(hash);

View File

@@ -19,6 +19,14 @@ export interface ICurrentUser {
settings: IUserSettings;
}
export interface IUser extends ICurrentUser {
confirmedAt: Date;
confirmationSendAt: Date;
locale: String;
actors: IPerson[];
disabled: boolean;
}
export enum INotificationPendingParticipationEnum {
NONE = "NONE",
DIRECT = "DIRECT",

View File

@@ -39,11 +39,13 @@ export enum ActionLogAction {
REPORT_UPDATE_RESOLVED = "REPORT_UPDATE_RESOLVED",
EVENT_DELETION = "EVENT_DELETION",
COMMENT_DELETION = "COMMENT_DELETION",
ACTOR_SUSPENSION = "ACTOR_SUSPENSION",
ACTOR_UNSUSPENSION = "ACTOR_UNSUSPENSION",
}
export interface IActionLog {
id: string;
object: IReport | IReportNote | IEvent;
object: IReport | IReportNote | IEvent | IComment | IActor;
actor: IActor;
action: ActionLogAction;
insertedAt: Date;