diff options
author | Yoav Schneiderman <yoav.schneiderman@intl.att.com> | 2020-01-22 11:07:00 +0200 |
---|---|---|
committer | Yoav Schneiderman <yoav.schneiderman@intl.att.com> | 2020-01-27 17:36:26 +0200 |
commit | 3f216a5ba38d70c193256f05c634093da9599984 (patch) | |
tree | 29bb202d705bf1426d3cda3c4ac98c59b84fb0d7 /vid-webpack-master/src/app/shared/components/messageModal/message-modal.service.ts | |
parent | 212806afa99581acd7618add8be958d945690867 (diff) |
When feature toggle is active then SDNC preload files is enable.
Issue-ID: VID-752
Change-Id: I96ef914bfe37d82da20085227b930523fcdba8fc
Signed-off-by: Yoav Schneiderman <yoav.schneiderman@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/shared/components/messageModal/message-modal.service.ts')
-rw-r--r-- | vid-webpack-master/src/app/shared/components/messageModal/message-modal.service.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/components/messageModal/message-modal.service.ts b/vid-webpack-master/src/app/shared/components/messageModal/message-modal.service.ts new file mode 100644 index 000000000..e1f85bdb0 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/messageModal/message-modal.service.ts @@ -0,0 +1,39 @@ +import {Injectable} from "@angular/core"; +import {MessageBoxService} from '../messageBox/messageBox.service'; +import {MessageBoxData} from '../messageBox/messageBox.data'; +import {SdcUiCommon} from "onap-ui-angular"; +import {MessageModalModel} from "./message-modal.model"; + +@Injectable() +export class MessageModal { + static showMessageModal(message: MessageModalModel): void { + setTimeout(() => { + let messageBoxData: MessageBoxData = new MessageBoxData( + message.title, + message.text, + this.getModalType(message), + SdcUiCommon.ModalSize.medium, + message.buttons); + MessageBoxService.openModal.next(messageBoxData); + } + , 500); + }; + + + static getModalType = (message: MessageModalModel): string => { + switch (message.type) { + case "error": { + return SdcUiCommon.ModalType.error + } + case "info": { + return SdcUiCommon.ModalType.info; + } + case "success": { + return SdcUiCommon.ModalType.success; + } + } + }; +} + + + |