-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Attila Németh
committed
Jan 3, 2021
1 parent
2b87a46
commit 634923f
Showing
6 changed files
with
79 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div mat-dialog-content> | ||
<p class="mat-title">{{ data.question }}</p> | ||
<p class="mat-subheading-2" *ngIf="data.hint !== undefined && data.hint !== ''"> | ||
{{ data.hint }} | ||
</p> | ||
</div> | ||
<div mat-dialog-actions> | ||
<button mat-button mat-dialog-close="0"> | ||
<mat-icon>close</mat-icon> | ||
{{ data.cancel }} | ||
</button> | ||
<button mat-button mat-dialog-close="1"> | ||
<mat-icon>check</mat-icon> | ||
{{ data.ok }} | ||
</button> | ||
</div> |
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,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ConfirmComponent } from './confirm.component'; | ||
|
||
describe('ConfirmComponent', () => { | ||
let component: ConfirmComponent; | ||
let fixture: ComponentFixture<ConfirmComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ ConfirmComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ConfirmComponent); | ||
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,33 @@ | ||
/** | ||
* @file Confirm Component | ||
* | ||
* @author Attila Németh | ||
* @date 11.06.2020 | ||
*/ | ||
|
||
import {Component, Inject} from '@angular/core'; | ||
import {MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; | ||
|
||
export interface ConfirmQuestion { | ||
question: string | ||
hint?: string | ||
cancel?: string | ||
ok?: string | ||
} | ||
|
||
@Component({ | ||
templateUrl: './confirm.component.html', | ||
}) | ||
export class AttusConfirmDialogComponent { | ||
|
||
constructor(public dialogRef: MatDialogRef<AttusConfirmDialogComponent>, | ||
@Inject(MAT_DIALOG_DATA) public data: ConfirmQuestion) { | ||
if (data.cancel === undefined) { | ||
data.cancel = 'Cancel'; | ||
} | ||
if (data.ok === undefined) { | ||
data.ok = 'OK'; | ||
} | ||
} | ||
|
||
} |
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