mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[Imagery] Start off with empty timestamp
Show nothing in the timestamp area when there is no data yet available for image telemetry, WTD-1170.
This commit is contained in:
parent
1e332da11b
commit
6aaa887e65
@ -59,6 +59,7 @@ define(
|
||||
releaseSubscription();
|
||||
self.date = "";
|
||||
self.time = "";
|
||||
self.zone = "";
|
||||
self.imageUrl = "";
|
||||
self.handle = domainObject && telemetryHandler.handle(
|
||||
domainObject,
|
||||
@ -78,11 +79,16 @@ define(
|
||||
ImageryController.prototype.updateValues = function () {
|
||||
var imageObject =
|
||||
this.handle && this.handle.getTelemetryObjects()[0],
|
||||
timestamp,
|
||||
m;
|
||||
if (imageObject && !this.isPaused) {
|
||||
m = moment.utc(this.handle.getDomainValue(imageObject));
|
||||
this.date = m.format(DATE_FORMAT);
|
||||
this.time = m.format(TIME_FORMAT);
|
||||
timestamp = this.handle.getDomainValue(imageObject);
|
||||
m = timestamp !== undefined ?
|
||||
moment.utc(timestamp) :
|
||||
undefined;
|
||||
this.date = m ? m.format(DATE_FORMAT) : "";
|
||||
this.time = m ? m.format(TIME_FORMAT) : "";
|
||||
this.zone = m ? "UTC" : "";
|
||||
this.imageUrl = this.handle.getRangeValue(imageObject);
|
||||
}
|
||||
};
|
||||
@ -112,7 +118,7 @@ define(
|
||||
* @returns {string} the time
|
||||
*/
|
||||
ImageryController.prototype.getZone = function () {
|
||||
return "UTC";
|
||||
return this.zone;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -146,6 +146,19 @@ define(
|
||||
expect(controller.getImageUrl()).toEqual(testUrl);
|
||||
});
|
||||
|
||||
it("initially shows an empty string for date/time", function () {
|
||||
// Call the subscription listener while domain/range
|
||||
// values are still undefined
|
||||
mockHandle.getDomainValue.andReturn(undefined);
|
||||
mockHandle.getRangeValue.andReturn(undefined);
|
||||
mockTelemetryHandler.handle.mostRecentCall.args[1]();
|
||||
|
||||
// Should have empty strings for date/time/zone
|
||||
expect(controller.getTime()).toEqual("");
|
||||
expect(controller.getDate()).toEqual("");
|
||||
expect(controller.getZone()).toEqual("");
|
||||
expect(controller.getImageUrl()).toBeUndefined();
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user