mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 15:43:48 +00:00
[Persistence] Show user, modification time
Show user name and modification time in dialog when revision-checking detects modifications. WTD-1033.
This commit is contained in:
@ -2,5 +2,7 @@
|
||||
|
||||
define({
|
||||
REVISION_ERROR_KEY: "revision",
|
||||
OVERWRITE_KEY: "overwrite"
|
||||
OVERWRITE_KEY: "overwrite",
|
||||
TIMESTAMP_FORMAT: "YYYY-MM-DD HH:mm:ss\\Z",
|
||||
UNKNOWN_USER: "unknown user"
|
||||
});
|
@ -0,0 +1,32 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['moment', './PersistenceFailureConstants'],
|
||||
function (moment, Constants) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Controller to support the template to be shown in the
|
||||
* dialog shown for persistence failures.
|
||||
*/
|
||||
function PersistenceFailureController() {
|
||||
return {
|
||||
/**
|
||||
* Format a timestamp for display in the dialog.
|
||||
*/
|
||||
formatTimestamp: function (timestamp) {
|
||||
return moment.utc(timestamp)
|
||||
.format(Constants.TIMESTAMP_FORMAT);
|
||||
},
|
||||
/**
|
||||
* Format a user name for display in the dialog.
|
||||
*/
|
||||
formatUsername: function (username) {
|
||||
return username || Constants.UNKNOWN_USER;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return PersistenceFailureController;
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user