add Mass talk detail View

This commit is contained in:
leejh 2019-10-14 09:50:48 +09:00
parent 57957cc164
commit 6aa2602dd0
3 changed files with 42 additions and 10 deletions

View File

@ -19,6 +19,11 @@ import { CommonApiService } from '@ucap-webmessenger/api-common';
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types'; import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import {
DialogService,
AlertDialogComponent,
AlertDialogData
} from '@ucap-webmessenger/ui';
@Injectable() @Injectable()
export class Effects { export class Effects {
@ -52,9 +57,25 @@ export class Effects {
exhaustMap(req => { exhaustMap(req => {
return this.commonApiService.massTalkDownload(req).pipe( return this.commonApiService.massTalkDownload(req).pipe(
map(res => { map(res => {
this.logger.debug(res);
if (res.statusCode === StatusCode.Success) { if (res.statusCode === StatusCode.Success) {
this.store.dispatch(massTalkDownloadSuccess(res)); this.store.dispatch(massTalkDownloadSuccess(res));
const result = this.dialogService.open<
AlertDialogComponent,
AlertDialogData
>(
AlertDialogComponent,
{
width: '100%',
height: '500px',
disableClose: false,
data: {
title: '전체보기',
html: `<pre>` + res.content + `</pre>`
}
}
);
} else { } else {
this.store.dispatch(massTalkDownloadFailure({ error: res })); this.store.dispatch(massTalkDownloadFailure({ error: res }));
} }
@ -71,6 +92,7 @@ export class Effects {
private actions$: Actions, private actions$: Actions,
private commonApiService: CommonApiService, private commonApiService: CommonApiService,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private dialogService: DialogService,
private store: Store<any>, private store: Store<any>,
private logger: NGXLogger private logger: NGXLogger
) {} ) {}

View File

@ -4,16 +4,12 @@
<!-- <mat-card-subtitle>Confirm</mat-card-subtitle> --> <!-- <mat-card-subtitle>Confirm</mat-card-subtitle> -->
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<p class="notice"> <div #messageContainer class="notice">
{{ data.message }} {{ data.message }}
</p> </div>
</mat-card-content> </mat-card-content>
<mat-card-actions class="button-farm flex-row"> <mat-card-actions class="button-farm flex-row">
<button <button mat-stroked-button (click)="onClickConfirm(false)" class="mat-primary">
mat-stroked-button
(click)="onClickConfirm(false)"
class="mat-primary"
>
Confirm Confirm
</button> </button>
</mat-card-actions> </mat-card-actions>

View File

@ -1,9 +1,16 @@
import { Component, OnInit, Inject } from '@angular/core'; import {
Component,
OnInit,
Inject,
ViewChild,
ElementRef
} from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
export interface AlertDialogData { export interface AlertDialogData {
title: string; title: string;
message?: string; message?: string;
html?: string;
} }
// tslint:disable-next-line: no-empty-interface // tslint:disable-next-line: no-empty-interface
@ -15,6 +22,9 @@ export interface AlertDialogResult {}
styleUrls: ['./alert.dialog.component.scss'] styleUrls: ['./alert.dialog.component.scss']
}) })
export class AlertDialogComponent implements OnInit { export class AlertDialogComponent implements OnInit {
@ViewChild('messageContainer', { static: true })
messageContainer: ElementRef;
tempAgeLimits = []; tempAgeLimits = [];
constructor( constructor(
@ -22,7 +32,11 @@ export class AlertDialogComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public data: AlertDialogData @Inject(MAT_DIALOG_DATA) public data: AlertDialogData
) {} ) {}
ngOnInit(): void {} ngOnInit(): void {
if (!!this.data.html) {
this.messageContainer.nativeElement.innerHTML = this.data.html;
}
}
onClickConfirm(): void { onClickConfirm(): void {
this.dialogRef.close({}); this.dialogRef.close({});