This repository has been archived by the owner on Jul 22, 2023. It is now read-only.
-
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.
* added consent dialog with timeout * expanded config model * fixed consent stuff * make prettier happy Co-authored-by: crapStone <[email protected]>
- Loading branch information
Showing
9 changed files
with
125 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<h2 mat-dialog-title>Wichtige Information! | Important!</h2> | ||
<p> | ||
Bei CaBr<sub>2</sub> handelt es sich um ein Open-Source-Projekt und daher basiert die Verwendung der generierten | ||
Betriebsanweisungen auf Eigenverantwortung. | ||
</p> | ||
<p> | ||
Weder das Programm, noch die Entwickler sind für den Inhalt verantwortlich und können für unkorrekte oder | ||
unvollständige Informationen zur Rechenschaft gezogen werden. | ||
</p> | ||
<mat-divider></mat-divider> | ||
<p> | ||
CaBr<sub>2</sub> is an open-source project and therefore the use of the generated operating instructions is based on | ||
personal responsibility. | ||
</p> | ||
<p> | ||
Neither the program, nor the developers are responsible for the content and can be held liable for incorrect or | ||
incomplete information. | ||
</p> | ||
<mat-divider></mat-divider> | ||
<mat-dialog-actions> | ||
<button (click)="dialogRef.close()" [disabled]="timer > 0" mat-raised-button> | ||
{{ strings.base.ok }} {{ timer > 0 ? '(' + timer + ')' : '' }} | ||
</button> | ||
</mat-dialog-actions> |
Empty file.
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,24 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ConsentComponent } from './consent.component'; | ||
|
||
describe('ConsentComponent', () => { | ||
let component: ConsentComponent; | ||
let fixture: ComponentFixture<ConsentComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ConsentComponent], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ConsentComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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, OnInit } from '@angular/core'; | ||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; | ||
|
||
import { GlobalModel } from '../@core/models/global.model'; | ||
import { LocalizedStrings } from '../@core/services/i18n/i18n.service'; | ||
|
||
@Component({ | ||
selector: 'app-consent', | ||
templateUrl: './consent.component.html', | ||
styleUrls: ['./consent.component.scss'], | ||
}) | ||
export class ConsentComponent implements OnInit { | ||
strings!: LocalizedStrings; | ||
timer = this.data.duration; | ||
|
||
constructor( | ||
public dialogRef: MatDialogRef<ConsentComponent>, | ||
@Inject(MAT_DIALOG_DATA) public data: { duration: number }, | ||
private globals: GlobalModel, | ||
) { | ||
this.globals.localizedStringsObservable.subscribe((strings) => (this.strings = strings)); | ||
} | ||
|
||
ngOnInit(): void { | ||
setInterval(() => { | ||
if (this.timer > 0) { | ||
this.timer -= 1; | ||
} | ||
}, 1000); | ||
} | ||
} |
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