Skip to content

Commit

Permalink
#57 added option for a privacy link inside login mask (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
rojansen authored and johannesheucher-gip committed Nov 7, 2023
1 parent 2da95d5 commit b4f43fe
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
4 changes: 4 additions & 0 deletions api/zeta-environment.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ export interface ZetaProjectOptions {
* holds options about how the user is able to login to the GUI - default: only credentials login and no language change
*/
auth?: AuthenticationOptions;
/**
* returns the Privacy Link with the language parameter
*/
getPrivacyLink?(lang: string): string;
}


Expand Down
4 changes: 4 additions & 0 deletions auth/locale/auth-translations.de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export const authTranslations_deDE: I18nTranslation[] = [
key: 'zeta.auth-login.login-button',
value: 'Anmelden'
},
{
key: 'privacy-button',
value: 'Datenschutz'
},

// typescript
{
Expand Down
5 changes: 4 additions & 1 deletion auth/locale/auth-translations.en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const authTranslations_enUS: I18nTranslation[] = [
key: 'zeta.auth-login.login-button',
value: 'Login'
},

{
key: 'privacy-button',
value: 'Privacy Policy'
},
// typescript
{
key: 'zeta.auth-login.error',
Expand Down
10 changes: 8 additions & 2 deletions auth/login/auth-login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ <h1 class="title" xc-i18n>login-title</h1>
<credentials-login [data]="credentialsTabItem.data"></credentials-login>
</section>
</ng-template>
<footer class="items-right">

<footer>
<xc-button
class="items-left" *ngIf="privacyLinkDefined"
(click)="openPrivacyLink()"
xc-i18n
>privacy-button</xc-button>
<xc-button
class="login-button"
class="login-button items-right"
color="primary"
[busy]="pending"
[disabled]="pending"
Expand Down
11 changes: 11 additions & 0 deletions auth/login/auth-login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class AuthLoginComponent {
smartCardDomain = '';

private _pending = false;
privacyLinkDefined = !!environment.zeta.getPrivacyLink;


constructor(
Expand Down Expand Up @@ -128,6 +129,16 @@ export class AuthLoginComponent {
}


openPrivacyLink() {
if (this.privacyLinkDefined) {
window.open(environment.zeta.getPrivacyLink(this.i18n.language), '_blank').focus();
}
else {
console.log('PrivacyLink is not Defined');
}
}


smartCardInfo() {
this.authService.fetchSmartCardInfo().pipe(
filter(info => !!info)
Expand Down

0 comments on commit b4f43fe

Please sign in to comment.