replaced 'question mark' with 'SY' avatar and 'Unknown' with 'System' value on CREATED BY column for dossier templates listing
This commit is contained in:
parent
e5a1177a68
commit
6f85ee585d
@ -80,6 +80,7 @@
|
||||
[defaultValue]="'unknown' | translate"
|
||||
[user]="dossierTemplate.createdBy"
|
||||
[withName]="true"
|
||||
[showSystem]="true"
|
||||
></redaction-initials-avatar>
|
||||
</div>
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
[matTooltipPosition]="tooltipPosition"
|
||||
[matTooltip]="userName"
|
||||
>
|
||||
{{ _user | name: { showInitials: true } }}
|
||||
{{ _user | name: { showInitials: true, showSystem: showSystem } }}
|
||||
</div>
|
||||
<div *ngIf="withName" [class.disabled]="disabled" class="clamp-2 username">
|
||||
{{ userName }}
|
||||
|
||||
@ -16,6 +16,7 @@ export class InitialsAvatarComponent extends AutoUnsubscribe implements OnInit,
|
||||
@Input() size: 'small' | 'large' = 'small';
|
||||
@Input() withName = false;
|
||||
@Input() showYou = false;
|
||||
@Input() showSystem = false;
|
||||
@Input() tooltipPosition: 'below' | 'above' = 'above';
|
||||
@Input() defaultValue = this._translateService.instant('initials-avatar.unassigned');
|
||||
colorClass: string;
|
||||
@ -80,6 +81,7 @@ export class InitialsAvatarComponent extends AutoUnsubscribe implements OnInit,
|
||||
this.namePipeOptions = {
|
||||
showYou: this.showYou,
|
||||
defaultValue: this.defaultValue,
|
||||
showSystem: this.showSystem,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ function getInitials(name: string) {
|
||||
export interface NamePipeOptions {
|
||||
showYou?: boolean;
|
||||
showInitials?: boolean;
|
||||
showSystem?: boolean;
|
||||
defaultValue?: string;
|
||||
}
|
||||
|
||||
@ -32,6 +33,10 @@ export class NamePipe implements PipeTransform {
|
||||
transform(value?: User | string, options = this._defaultOptions): string {
|
||||
let name;
|
||||
|
||||
if (!value && options?.showSystem) {
|
||||
value = 'system';
|
||||
}
|
||||
|
||||
if (!value && options?.showInitials) {
|
||||
return '?';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user