mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 04:38:15 +00:00
[Core] Add specs for action support
Add specs for core components for dealing with actions; part of ongoing platform/core transition, WTD-573.
This commit is contained in:
@ -32,7 +32,7 @@ define(
|
||||
// declarative bindings, as well as context,
|
||||
// unless the action has defined its own.
|
||||
if (!action.getMetadata) {
|
||||
metadata = Object.create(Action.definition);
|
||||
metadata = Object.create(Action.definition || {});
|
||||
metadata.context = context;
|
||||
action.getMetadata = function () {
|
||||
return metadata;
|
||||
|
@ -20,13 +20,14 @@ define(
|
||||
// it emits a log message whenever performed.
|
||||
function addLogging(action) {
|
||||
var logAction = Object.create(action),
|
||||
domainObject =
|
||||
action.getMetadata().context.domainObject;
|
||||
metadata = action.getMetadata() || {},
|
||||
context = metadata.context || {},
|
||||
domainObject = context.domainObject;
|
||||
|
||||
logAction.perform = function () {
|
||||
$log.info([
|
||||
"Performing action ",
|
||||
action.getMetadata().key,
|
||||
metadata.key,
|
||||
" upon ",
|
||||
domainObject && domainObject.getId()
|
||||
].join(""));
|
||||
|
Reference in New Issue
Block a user