diff --git a/platform/commonUI/dialog/res/templates/message.html b/platform/commonUI/dialog/res/templates/message.html index 0f4fcd901b..290c0cad7e 100644 --- a/platform/commonUI/dialog/res/templates/message.html +++ b/platform/commonUI/dialog/res/templates/message.html @@ -4,7 +4,7 @@
{{ngModel.title}}
-
{{ngModel.hint}}
+
{{ngModel.hint + " [" + ngModel.timestamp + "]"}}
{{ngModel.actionText}} diff --git a/platform/commonUI/notification/src/NotificationService.js b/platform/commonUI/notification/src/NotificationService.js index 0a62a7de5e..5b16fb4689 100644 --- a/platform/commonUI/notification/src/NotificationService.js +++ b/platform/commonUI/notification/src/NotificationService.js @@ -31,8 +31,8 @@ * @namespace platform/commonUI/notification */ define( - [], - function () { + ['moment'], + function (moment) { /** * A representation of a user action. Options are provided to @@ -313,6 +313,7 @@ define( topic = this.topic(); notificationModel.severity = notificationModel.severity || "info"; + notificationModel.timestamp = moment.utc().format('YYYY-MM-DD hh:mm:ss.ms'); notification = { model: notificationModel, diff --git a/platform/entanglement/src/actions/CopyAction.js b/platform/entanglement/src/actions/CopyAction.js index 8577db3487..537582626a 100644 --- a/platform/entanglement/src/actions/CopyAction.js +++ b/platform/entanglement/src/actions/CopyAction.js @@ -111,9 +111,11 @@ define( CopyAction.prototype.perform = function () { var self = this; - function success() { + function success(domainObject) { + var domainObjectName = domainObject.model.name; + self.notification.dismiss(); - self.notificationService.info("Copying complete."); + self.notificationService.info(domainObjectName + " copied successfully."); } function error(errorDetails) { @@ -160,4 +162,3 @@ define( return CopyAction; } ); - diff --git a/platform/entanglement/test/actions/CopyActionSpec.js b/platform/entanglement/test/actions/CopyActionSpec.js index 0817ded2db..0330fae052 100644 --- a/platform/entanglement/test/actions/CopyActionSpec.js +++ b/platform/entanglement/test/actions/CopyActionSpec.js @@ -47,6 +47,7 @@ define( mockDialog, mockLog, abstractComposePromise, + domainObject = {model: {name: "mockObject"}}, progress = {phase: "copying", totalObjects: 10, processed: 1}; beforeEach(function () { @@ -108,7 +109,7 @@ define( abstractComposePromise.then.andCallFake(function (success, error, notify) { notify(progress); - success(); + success(domainObject); }); locationServicePromise.then.andCallFake(function (callback) { @@ -199,6 +200,10 @@ define( expect(notificationService.info).toHaveBeenCalled(); }); + it("notifies the user with name of object copied", function () { + expect(notificationService.info) + .toHaveBeenCalledWith("mockObject copied successfully."); + }); }); });