-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #313 from swisstopo/feature/assets-70-disclaimer
Feature 70: add disclaimer
- Loading branch information
Showing
52 changed files
with
539 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
apps/client-asset-sg/src/app/components/disclaimer-dialog/disclaimer-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div> | ||
<div class="header"> | ||
<h2 translate>disclaimer.title</h2> | ||
<asset-sg-language-selector></asset-sg-language-selector> | ||
</div> | ||
<mat-divider></mat-divider> | ||
<div mat-dialog-content class="content"> | ||
<h1 translate>disclaimer.subtitle</h1> | ||
<p [innerHTML]="disclaimerText$ | async"></p> | ||
<a *rxLet="legalUrl$; let lang" [href]="lang" target="_blank" rel="noopener nofollow">{{ lang }}</a> | ||
</div> | ||
<mat-divider></mat-divider> | ||
<div mat-dialog-actions class="actions"> | ||
<button asset-sg-primary (click)="close()" translate>disclaimer.accept</button> | ||
</div> | ||
</div> |
34 changes: 34 additions & 0 deletions
34
apps/client-asset-sg/src/app/components/disclaimer-dialog/disclaimer-dialog.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
::ng-deep .cdk-overlay-dark-backdrop { | ||
background-color: grey; | ||
} | ||
|
||
h1 { | ||
color: black; | ||
font-weight: 500; | ||
} | ||
|
||
h2 { | ||
margin: 0; | ||
} | ||
|
||
p { | ||
margin: 0; | ||
} | ||
|
||
.header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 24px 24px 16px 24px; | ||
} | ||
|
||
.content { | ||
padding: 24px; | ||
} | ||
|
||
.actions { | ||
display: flex; | ||
justify-content: flex-end; | ||
padding: 24px; | ||
align-items: center; | ||
} |
31 changes: 31 additions & 0 deletions
31
apps/client-asset-sg/src/app/components/disclaimer-dialog/disclaimer-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Component, inject } from '@angular/core'; | ||
import { MatDialogRef } from '@angular/material/dialog'; | ||
import { CURRENT_LANG } from '@asset-sg/client-shared'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
import { map } from 'rxjs'; | ||
|
||
const LEGAL_BASE_URL = 'https://www.swissgeol.ch/datenschutz'; | ||
|
||
@Component({ | ||
selector: 'asset-sg-disclaimer-dialog', | ||
templateUrl: './disclaimer-dialog.component.html', | ||
styleUrl: './disclaimer-dialog.component.scss', | ||
}) | ||
export class DisclaimerDialogComponent { | ||
public text = ''; | ||
private readonly dialogRef = inject(MatDialogRef<DisclaimerDialogComponent>); | ||
private readonly translateService = inject(TranslateService); | ||
|
||
private readonly currentLang$ = inject(CURRENT_LANG); | ||
public readonly legalUrl$ = this.currentLang$.pipe( | ||
map((lang) => (lang === 'de' ? LEGAL_BASE_URL : `${LEGAL_BASE_URL}-${lang}/`)) | ||
); | ||
|
||
public readonly disclaimerText$ = this.currentLang$.pipe( | ||
map(() => this.translateService.instant(`disclaimer.content`).replaceAll('\n', '<br>')) | ||
); | ||
|
||
public close() { | ||
this.dialogRef.close(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
apps/client-asset-sg/src/app/components/redirect-to-lang/redirect-to-lang.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.