Commit 7f2f4054 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

fix: logo on list

parent ed09eae5
......@@ -64,7 +64,7 @@ export class AdminInstitutionListRoutable extends AbstractListRoutable<Instituti
this.columns = [
{
field: "avatar",
header: LabelTranslateEnum.avatar,
header: LabelTranslateEnum.logo,
order: OrderEnum.none,
resourceNameSpace: adminInstitutionActionNameSpace,
resourceState: this.adminInstitutionState as any,
......@@ -75,6 +75,7 @@ export class AdminInstitutionListRoutable extends AbstractListRoutable<Instituti
skipIfAvatarMissing: true,
idResource: (institution: Institution) => institution.resId,
isLogoPresent: (institution: Institution) => isNotNullNorUndefined(institution.logo),
width: "45px",
} as DataTableColumns<Institution>,
{
field: "name",
......
......@@ -74,7 +74,7 @@ export class AdminOrganizationalUnitListRoutable extends AbstractListRoutable<Or
this.columns = [
{
field: "avatar",
header: LabelTranslateEnum.avatar,
header: LabelTranslateEnum.logo,
order: OrderEnum.none,
resourceNameSpace: adminOrganizationalUnitActionNameSpace,
resourceState: this.adminOrganizationalUnitState as any,
......@@ -85,6 +85,7 @@ export class AdminOrganizationalUnitListRoutable extends AbstractListRoutable<Or
skipIfAvatarMissing: true,
idResource: (organizationalUnit: OrganizationalUnit) => organizationalUnit.resId,
isLogoPresent: (organizationalUnit: OrganizationalUnit) => isNotNullNorUndefined(organizationalUnit.logo),
width: "45px",
} as DataTableColumns<OrganizationalUnit>,
{
field: "name",
......
......@@ -78,7 +78,7 @@ export class PreservationSpaceContributorListRoutable extends AbstractListRoutab
this.columns = [
{
field: "avatar",
header: LabelTranslateEnum.avatar,
header: LabelTranslateEnum.logo,
order: OrderEnum.none,
resourceNameSpace: preservationSpaceContributorActionNameSpace,
resourceState: this.preservationSpaceContributorState as any,
......@@ -88,6 +88,7 @@ export class PreservationSpaceContributorListRoutable extends AbstractListRoutab
isUser: true,
idResource: (contributor: Contributor) => contributor.resId,
isLogoPresent: (contributor: Contributor) => isNotNullNorUndefined(contributor.avatar),
width: "45px",
} as UserInfoDataTableColumn<Contributor>,
{
field: "lastName",
......
......@@ -202,7 +202,7 @@ export class PreservationSpaceOrganizationalUnitListRoutable extends AbstractLis
this.columns = [
{
field: "avatar",
header: LabelTranslateEnum.avatar,
header: LabelTranslateEnum.logo,
order: OrderEnum.none,
resourceNameSpace: preservationSpaceOrganizationalUnitActionNameSpace,
resourceState: this.preservationSpaceOrganizationalUnitState as any,
......@@ -213,6 +213,7 @@ export class PreservationSpaceOrganizationalUnitListRoutable extends AbstractLis
skipIfAvatarMissing: true,
idResource: (organizationalUnit: OrganizationalUnit) => organizationalUnit.resId,
isLogoPresent: (organizationalUnit: OrganizationalUnit) => isNotNullNorUndefined(organizationalUnit.logo),
width: "45px",
} as DataTableColumns<OrganizationalUnit>,
{
field: "name",
......
......@@ -7,7 +7,7 @@
>
<img *ngIf="sanitizeUrl(photoObs | async) as image"
[src]="image"
alt="photo"
alt=""
>
</div>
<ng-template #noPhoto>
......
......@@ -8,7 +8,7 @@
>
<img *ngIf="sanitizeUrl(photoObs | async) as image"
[src]="image"
alt="photo"
alt=""
>
</div>
<ng-template #noPhoto>
......
......@@ -22,6 +22,7 @@ import {OrganizationalUnit} from "@models";
import {TranslateService} from "@ngx-translate/core";
import {Store} from "@ngxs/store";
import {SharedAbstractContainer} from "@shared/components/containers/shared-abstract/shared-abstract.container";
import {LabelTranslateEnum} from "@shared/enums/label-translate.enum";
import {RoutesEnum} from "@shared/enums/routes.enum";
import {BaseFormDefinition} from "@shared/models/base-form-definition.model";
import {sharedOrganizationalUnitActionNameSpace} from "@shared/stores/organizational-unit/shared-organizational-unit.action";
......@@ -67,7 +68,7 @@ export class SharedTableOrgunitContainer extends SharedAbstractContainer impleme
columns: DataTableColumns<BaseResource>[] = [
{
field: "name",
header: MARK_AS_TRANSLATABLE("org_unit"),
header: LabelTranslateEnum.organizationalUnit,
type: DataTableFieldTypeEnum.string,
order: OrderEnum.descending,
isFilterable: false,
......
......@@ -6,6 +6,6 @@
<img *ngIf="photoUserSanitize | isNotNullNorUndefined"
[src]="photoUserSanitize"
alt="photo"
alt=""
class="photo"
>
\ No newline at end of file
>
......@@ -10,7 +10,10 @@ import {
} from "@angular/platform-browser";
import {SharedAbstractPresentational} from "@app/shared/components/presentationals/shared-abstract/shared-abstract.presentational";
import {UserInfo} from "@models";
import {isNullOrUndefined} from "solidify-frontend";
import {
isNotNullNorUndefinedNorWhiteString,
isNullOrUndefined,
} from "solidify-frontend";
@Component({
selector: "dlcm-shared-avatar",
......@@ -63,7 +66,9 @@ export class SharedAvatarPresentational extends SharedAbstractPresentational {
if (isNullOrUndefined(this._userInfo)) {
this.initial = this.DEFAULT_INITIAL;
} else {
this.initial = this._userInfo.firstName.substring(0, 1) + this._userInfo.lastName.substring(0, 1);
const firstNameInitial = isNotNullNorUndefinedNorWhiteString(this._userInfo.firstName) ? this._userInfo.firstName.substring(0, 1) : "";
const lastNameInitial = isNotNullNorUndefinedNorWhiteString(this._userInfo.lastName) ? this._userInfo.lastName.substring(0, 1) : "";
this.initial = firstNameInitial + lastNameInitial;
}
}
......
......@@ -6,6 +6,6 @@
<img *ngIf="photoUserSanitize | isNotNullNorUndefined"
[src]="photoUserSanitize"
alt="photo"
alt=""
class="photo"
>
\ No newline at end of file
>
......@@ -385,6 +385,7 @@ export class LabelTranslateEnum {
static guidedTour: string = MARK_AS_TRANSLATABLE("general.label.guidedTour");
static lastSelection: string = MARK_AS_TRANSLATABLE("general.label.lastSelection");
static avatar: string = MARK_AS_TRANSLATABLE("general.label.avatar");
static logo: string = MARK_AS_TRANSLATABLE("general.label.logo");
static packages: string = MARK_AS_TRANSLATABLE("general.label.packages");
static packagesInformation: string = MARK_AS_TRANSLATABLE("general.label.packagesInformation");
static descriptionOther: string = MARK_AS_TRANSLATABLE("general.label.descriptionOther");
......
......@@ -1228,6 +1228,7 @@
"list": "Liste",
"listInvalidCharacter": "Die folgenden Sonderzeichen sind in Dateinamen nicht erlaubt: ~ ! @ # $ % ^ & * ` ; ? , \\\\",
"listView": "Listenansicht",
"logo": "Logo",
"maintainer": "Erhaltung",
"maintenanceInProgress": "Wartungsarbeiten im Gange",
"mandatory": "Pflichtfelder",
......@@ -2143,4 +2144,4 @@
"title": "Benutzerhandbuch",
"tooltipClose": "Benutzerhandbuch schliessen"
}
}
}
\ No newline at end of file
......@@ -1228,6 +1228,7 @@
"list": "List",
"listInvalidCharacter": "The following special characters are not allowed in file names: ~ ! @ # $ % ^ & * ` ; ? , \\\\",
"listView": "List view",
"logo": "Logo",
"maintainer": "Maintainer",
"maintenanceInProgress": "Maintenance in progress",
"mandatory": "Mandatory",
......@@ -2143,4 +2144,4 @@
"title": "User guide",
"tooltipClose": "Close user guide"
}
}
}
\ No newline at end of file
......@@ -1228,6 +1228,7 @@
"list": "Liste",
"listInvalidCharacter": "Les caractères spéciaux suivants ne sont pas autorisés dans les noms de fichiers: ~ ! @ # $ % ^ & * ` ; ? , \\\\",
"listView": "Vue liste",
"logo": "Logo",
"maintainer": "Mainteneur",
"maintenanceInProgress": "Maintenance en cours",
"mandatory": "Obligatoire",
......@@ -2143,4 +2144,4 @@
"title": "Guide d'utilisation",
"tooltipClose": "Fermer le guide d'utilisation"
}
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment