diff --git a/platform/commonUI/dialog/bundle.json b/platform/commonUI/dialog/bundle.json index eab8fb000a..87ef06f764 100644 --- a/platform/commonUI/dialog/bundle.json +++ b/platform/commonUI/dialog/bundle.json @@ -36,8 +36,16 @@ "templateUrl": "templates/dialog.html" }, { - "key": "blocking-message", - "templateUrl": "templates/blocking-message.html" + "key": "overlay-blocking-message", + "templateUrl": "templates/overlay-blocking-message.html" + }, + { + "key": "message", + "templateUrl": "templates/message.html" + }, + { + "key": "message-list", + "templateUrl": "templates/message-list.html" } ], "containers": [ diff --git a/platform/commonUI/dialog/res/templates/blocking-message.html b/platform/commonUI/dialog/res/templates/message-list.html similarity index 66% rename from platform/commonUI/dialog/res/templates/blocking-message.html rename to platform/commonUI/dialog/res/templates/message-list.html index 4f2caf3df5..67fbdb28d0 100644 --- a/platform/commonUI/dialog/res/templates/blocking-message.html +++ b/platform/commonUI/dialog/res/templates/message-list.html @@ -1,17 +1,17 @@ -
!
+
{{ngModel.dialog.title}}
{{ngModel.dialog.hint}}
-
- {{ngModel.dialog.actionText}} -
- +
    +
  • + Message: {{msg.title}} + +
  • +
!
+ \ No newline at end of file diff --git a/platform/commonUI/dialog/res/templates/overlay-blocking-message.html b/platform/commonUI/dialog/res/templates/overlay-blocking-message.html new file mode 100644 index 0000000000..a4d4dc7276 --- /dev/null +++ b/platform/commonUI/dialog/res/templates/overlay-blocking-message.html @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/platform/commonUI/dialog/src/DialogService.js b/platform/commonUI/dialog/src/DialogService.js index 99d361cf81..836805304e 100644 --- a/platform/commonUI/dialog/src/DialogService.js +++ b/platform/commonUI/dialog/src/DialogService.js @@ -239,7 +239,7 @@ define( // Add the overlay using the OverlayService, which // will handle actual insertion into the DOM this.overlay = this.overlayService.createOverlay( - "blocking-message", + "overlay-blocking-message", {dialog: dialogModel}, "t-dialog-sm" ); @@ -253,6 +253,24 @@ define( }; + DialogService.prototype.showMessageList = function(dialogModel) { + if (this.canShowDialog(dialogModel)) { + // Add the overlay using the OverlayService, which + // will handle actual insertion into the DOM + this.overlay = this.overlayService.createOverlay( + "message-list", + {dialog: dialogModel}, + "t-dialog t-message-list" + ); + this.dialogVisible = true; + return true; + } else { + //Could not show a dialog, so return indication of this to + //client code. + return false; + } + + }; return DialogService; } diff --git a/testing/dialogTest/res/dialog-launch.html b/testing/dialogTest/res/dialog-launch.html index 1b117c2ebf..2b01ca60bb 100644 --- a/testing/dialogTest/res/dialog-launch.html +++ b/testing/dialogTest/res/dialog-launch.html @@ -3,7 +3,8 @@ Known | Unknown | - Error + Error | + Messages Dialogs \ No newline at end of file diff --git a/testing/dialogTest/src/DialogLaunchController.js b/testing/dialogTest/src/DialogLaunchController.js index 374e43a150..7f51a91329 100644 --- a/testing/dialogTest/src/DialogLaunchController.js +++ b/testing/dialogTest/src/DialogLaunchController.js @@ -99,6 +99,53 @@ define( $log.error("Could not display modal dialog"); } }; + + $scope.launchMessages = function () { + var model = { + title: "Messages", + severity: messageSeverity.MESSAGES, + actions: [ + { + label: "Done", + action: function () { + $log.debug("Done pressed"); + dialogService.dismiss(); + } + } + ], + messages: [] + }; + + function createMessage (messageNumber) { + var messageModel = { + ngModel: { + dialog: { + title: "Message " + messageNumber, + severity: messageSeverity.INFO, + actions: [ + { + label: "Cancel Duplication", + action: function () { + $log.debug("Cancel Duplication pressed"); + $log.debug("Message should be dismissed"); + } + } + ] + } + } + }; + return messageModel; + } + + if (dialogService.showMessageList(model)) { + //Do processing here + for (var i = 0; i < 4; i++) { + model.messages.push(createMessage(i)); + } + } else { + $log.error("Could not display modal dialog"); + } + }; } return DialogLaunchController; }