[Imagery] Normalize whitespace in policy

This commit is contained in:
Victor Woeltjen 2017-05-31 16:05:57 -07:00
parent f6cd35a631
commit e300b49c95

View File

@ -25,37 +25,35 @@ define([
], function ( ], function (
objectUtils objectUtils
) { ) {
/**
* Policy preventing the Imagery view from being made available for
* domain objects which do not have associated image telemetry.
* @implements {Policy.<View, DomainObject>}
* @constructor
*/
function ImageryViewPolicy(openmct) {
this.openmct = openmct;
}
/** ImageryViewPolicy.prototype.hasImageTelemetry = function (domainObject) {
* Policy preventing the Imagery view from being made available for var newDO = objectUtils.toNewFormat(
* domain objects which do not have associated image telemetry. domainObject.getModel(),
* @implements {Policy.<View, DomainObject>} domainObject.getId()
* @constructor );
*/
function ImageryViewPolicy(openmct) { var metadata = this.openmct.telemetry.getMetadata(newDO);
this.openmct = openmct; var values = metadata.valuesForHints(['image']);
return values.length >= 1;
};
ImageryViewPolicy.prototype.allow = function (view, domainObject) {
if (view.key === 'imagery') {
return this.hasImageTelemetry(domainObject);
} }
ImageryViewPolicy.prototype.hasImageTelemetry = function (domainObject) { return true;
var newDO = objectUtils.toNewFormat( };
domainObject.getModel(),
domainObject.getId()
);
var metadata = this.openmct.telemetry.getMetadata(newDO); return ImageryViewPolicy;
var values = metadata.valuesForHints(['image']); });
return values.length >= 1;
};
ImageryViewPolicy.prototype.allow = function (view, domainObject) {
if (view.key === 'imagery') {
return this.hasImageTelemetry(domainObject);
}
return true;
};
return ImageryViewPolicy;
}
);