Skip to content

Commit

Permalink
fix: add logo database if no source logo
Browse files Browse the repository at this point in the history
  • Loading branch information
abelkhay committed Mar 27, 2024
1 parent 5a6d627 commit 66505df
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<a
class="nav-link bg-secondary lh-sm p-3"
[attr.href]="getFirstUpdateLink(sources) || null"
target="_blank"
rel="noopener noreferrer"
title="S'inscrire au webinaire (nouvel onglet)">
<div class="row align-items-center g-0">
<div class="col-auto d-flex g-2">
<span *ngFor="let source of sources" class="circle-wrapper-light square-xl me-2">
<div class="row align-items-center g-0 bg-secondary p-3">
<div class="col-auto d-flex g-2">
<a
class="nav-link lh-sm"
[ngClass]="source.label === 'France Services' ? ['opacity-50', 'pointer-events-none'] : 'opacity-100'"
*ngFor="let source of sources"
[attr.href]="getUpdateLink(source)"
target="_blank"
rel="noopener noreferrer"
[title]="source.label === 'France Services' ? '' : 'Mettre 脿 jour les donn茅es (nouvel onglet)'">
<span class="circle-wrapper-light square-xl me-2">
<img
*ngIf="source.update_link as update_link; else noUpdateLink"
*ngIf="source.update_link || source.label === 'France Services'; else noUpdateLink"
class="img-fluid p-2"
[src]="assetsConfiguration.path + '/img/logo/source-update/' + source.logo + '.svg'"
alt="{{ source.label }}" />
Expand All @@ -19,12 +21,14 @@
alt="{{ source.label }}" />
</ng-template>
</span>
</a>
</div>
<div class="col">
<div
[ngClass]="sources?.[0]?.label === 'France Services' && sources?.length === 1 ? 'text-muted' : 'text-primary'"
class="fw-bold">
Mettre 脿 jour les donn茅es
</div>
<div class="col">
<div [ngClass]="sources?.[0]?.label === 'France Services' ? 'text-muted' : 'text-primary'" class="fw-bold">
Mettre 脿 jour les donn茅es
</div>
<small class="text-muted-dark fst-italic">Vos modifications seront prises en compte dans quelques jours</small>
</div>
<small class="text-muted-dark fst-italic">Vos modifications seront prises en compte dans quelques jours</small>
</div>
</a>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export class SourceFooterComponent {

public constructor(@Inject(ASSETS_TOKEN) public assetsConfiguration: AssetsConfiguration) {}

public getFirstUpdateLink(sources: SourcePresentation[] | undefined): string {
return (
sources?.find((source) => source.update_link)?.update_link ||
'https://dora.inclusion.beta.gouv.fr/auth/connexion?next=%2F'
);
public getUpdateLink(source: SourcePresentation | undefined): string | null {
if (source?.update_link) return source.update_link;
else if (!source?.update_link && source?.label !== 'France Services')
return 'https://dora.inclusion.beta.gouv.fr/auth/connexion?next=%2F';
else return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const availableSourcesMap: Map<string, SourcePresentation> = new Map<string, Sou
label: 'Aidants Connect',
link: 'https://www.data.gouv.fr/fr/datasets/lieux-de-mediation-numerique-sur-le-territoire-national-fournis-par-aidants-connect/',
detail: "Formulaire d'habilitation Aidants Connect",
update_link: 'https://aidantsconnect.beta.gouv.fr/habilitation/demandeur/',
update_link: 'https://aidantsconnect.beta.gouv.fr/accounts/login/',
logo: 'aidants-connect'
}
],
Expand Down

0 comments on commit 66505df

Please sign in to comment.