From 93cd435aebfb6a26d60ad339204b392231a7f9af Mon Sep 17 00:00:00 2001 From: Thomas Lenz <Thomas.Lenz@mni.thm.de> Date: Sun, 8 Apr 2018 11:38:48 +0200 Subject: [PATCH] Implement logic and view for content-delete-component --- src/app/app.module.ts | 3 +- .../content-delete.component.ts | 32 +++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 1db85b1a4..8ed8ab623 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -130,7 +130,8 @@ import { ContentDeleteComponent } from './components/dialogs/content-delete/cont ContentChoiceCreatorComponent, ContentLikertCreatorComponent, ContentTextCreatorComponent, - ContentYesNoCreatorComponent + ContentYesNoCreatorComponent, + ContentDeleteComponent ], imports: [ AppRoutingModule, diff --git a/src/app/components/dialogs/content-delete/content-delete.component.ts b/src/app/components/dialogs/content-delete/content-delete.component.ts index 56ebf1851..ec6dcefb7 100644 --- a/src/app/components/dialogs/content-delete/content-delete.component.ts +++ b/src/app/components/dialogs/content-delete/content-delete.component.ts @@ -1,4 +1,14 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; +import { RoomService } from '../../../services/http/room.service'; +import { Router } from '@angular/router'; +import { NotificationService } from '../../../services/util/notification.service'; +import { ContentChoiceCreatorComponent } from '../../fragments/content-choice-creator/content-choice-creator.component'; +import { ContentLikertCreatorComponent } from '../../fragments/content-likert-creator/content-likert-creator.component'; +import { ContentYesNoCreatorComponent } from '../../fragments/content-yes-no-creator/content-yes-no-creator.component'; +import { ContentTextCreatorComponent } from '../../fragments/content-text-creator/content-text-creator.component'; +import { ContentType } from '../../../models/content-type.enum'; +import { Content } from '../../../models/content'; @Component({ selector: 'app-content-delete', @@ -6,10 +16,26 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./content-delete.component.scss'] }) export class ContentDeleteComponent implements OnInit { + format: ContentType; + content: Content; - constructor() { } + constructor(private roomService: RoomService, + private router: Router, + private notification: NotificationService, + public dialogRef: MatDialogRef<ContentChoiceCreatorComponent>, + public dialogRefLikert: MatDialogRef<ContentLikertCreatorComponent>, + public dialogRefYesNo: MatDialogRef<ContentYesNoCreatorComponent>, + public dialogRefText: MatDialogRef<ContentTextCreatorComponent>, + @Inject(MAT_DIALOG_DATA) public data: any) { + } - ngOnInit() { + onNoClick(): void { + switch (this.format) { + + dialogRef.close(); + } } + ngOnInit() { + } } -- GitLab