diff --git a/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.html b/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.html new file mode 100644 index 0000000000000000000000000000000000000000..a1dd80b05386de871d3083c2287ec891644ffe61 --- /dev/null +++ b/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.html @@ -0,0 +1,10 @@ +<h1>{{ 'room-page.sure' | translate }}</h1> +<mat-divider></mat-divider> +<p>{{ 'room-page.really-delete-comments' | translate }}</p> +<app-dialog-action-buttons + buttonsLabelSection="content" + confirmButtonLabel="delete" + [confirmButtonType]=confirmButtonType + [cancelButtonClickAction]="buildCloseDialogActionCallback()" + [confirmButtonClickAction]="buildCommentsDeleteActionCallback()" +></app-dialog-action-buttons> diff --git a/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.scss b/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.spec.ts b/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..52b7d8e6303a5c246270df8c7ccae4e4e3647d29 --- /dev/null +++ b/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BonusDeleteComponent } from './bonus-delete.component'; + +describe('BonusDeleteComponent', () => { + let component: BonusDeleteComponent; + let fixture: ComponentFixture<BonusDeleteComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BonusDeleteComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BonusDeleteComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.ts b/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..2fbda4c08434ed90318edd78c1edfcf04b9f0f09 --- /dev/null +++ b/src/app/components/creator/_dialogs/bonus-delete/bonus-delete.component.ts @@ -0,0 +1,43 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { DialogConfirmActionButtonType } from '../../../shared/dialog/dialog-action-buttons/dialog-action-buttons.component'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; +import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { TranslateService } from '@ngx-translate/core'; +import { BonusTokenComponent } from '../bonus-token/bonus-token.component'; + +@Component({ + selector: 'app-bonus-delete', + templateUrl: './bonus-delete.component.html', + styleUrls: ['./bonus-delete.component.scss'] +}) +export class BonusDeleteComponent implements OnInit { + + confirmButtonType: DialogConfirmActionButtonType = DialogConfirmActionButtonType.Alert; + + + constructor(public dialogRef: MatDialogRef<BonusTokenComponent>, + @Inject(MAT_DIALOG_DATA) public data: any, + private liveAnnouncer: LiveAnnouncer, + private translationService: TranslateService ) { } + + + ngOnInit() { + this.translationService.get('room-page.really-delete-bonuses').subscribe(msg => { + this.liveAnnouncer.announce(msg); + }); + } + + /** + * Returns a lambda which closes the dialog on call. + */ + buildCloseDialogActionCallback(): () => void { + return () => this.dialogRef.close('abort'); + } + + /** + * Returns a lambda which executes the dialog dedicated action on call. + */ + buildCommentsDeleteActionCallback(): () => void { + return () => this.dialogRef.close('delete'); + } +} diff --git a/src/app/components/creator/creator.module.ts b/src/app/components/creator/creator.module.ts index b6ec2e716b7c1a2c85e344ab1f5620fe5eee073a..73602de17683d0b896f7717ce5238184de2daac9 100644 --- a/src/app/components/creator/creator.module.ts +++ b/src/app/components/creator/creator.module.ts @@ -28,6 +28,7 @@ import { CommentSettingsComponent } from './_dialogs/comment-settings/comment-se import { ModeratorDeleteComponent } from './_dialogs/moderator-delete/moderator-delete.component'; import { DeleteCommentComponent } from './_dialogs/delete-comment/delete-comment.component'; import { DeleteCommentsComponent } from './_dialogs/delete-comments/delete-comments.component'; +import { BonusDeleteComponent } from './_dialogs/bonus-delete/bonus-delete.component'; @NgModule({ imports: [ @@ -65,6 +66,7 @@ import { DeleteCommentsComponent } from './_dialogs/delete-comments/delete-comme ModeratorDeleteComponent, DeleteCommentsComponent, DeleteCommentComponent, + BonusDeleteComponent, ], exports: [], entryComponents: [