Compare commits
18 Commits
revert-402
...
1.7.5-mast
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d61cdc40a | ||
|
|
f8f2e7da9b | ||
|
|
240f58b2d0 | ||
|
|
7d3baee7b5 | ||
|
|
1312c9ef89 | ||
|
|
36fc4929fc | ||
|
|
0f848d9f4c | ||
|
|
b6cc1924aa | ||
|
|
3e97f32dba | ||
|
|
558b802228 | ||
|
|
de13f67ae5 | ||
|
|
0256cc4830 | ||
|
|
8422add614 | ||
|
|
2114697d6f | ||
|
|
412eaf599e | ||
|
|
0691a35dab | ||
|
|
f57191fd89 | ||
|
|
14066b5c4d |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openmct",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"description": "The Open MCT core platform",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
This bundle provides the Timeline domain object type, as well
|
||||
as other associated domain object types and relevant views.
|
||||
|
||||
# Implementation notes
|
||||
|
||||
## Model Properties
|
||||
|
||||
The properties below record properties relevant to using and
|
||||
understanding timelines based on their JSON representation.
|
||||
Additional common properties, such as `modified`
|
||||
or `persisted` timestamps, may also be present.
|
||||
|
||||
### Timeline Model
|
||||
|
||||
A timeline's model looks like:
|
||||
|
||||
```
|
||||
{
|
||||
"type": "timeline",
|
||||
"start": {
|
||||
"timestamp": <number> (milliseconds since epoch),
|
||||
"epoch": <string> (currently, always "SET")
|
||||
},
|
||||
"capacity": <number> (optional; battery capacity in watt-hours)
|
||||
"composition": <string[]> (array of identifiers for contained objects)
|
||||
}
|
||||
```
|
||||
|
||||
The identifiers in a timeline's `composition` field should refer to
|
||||
other Timeline objects, or to Activity objects.
|
||||
|
||||
### Activity Model
|
||||
|
||||
An activity's model looks like:
|
||||
|
||||
```
|
||||
{
|
||||
"type": "activity",
|
||||
"start": {
|
||||
"timestamp": <number> (milliseconds since epoch),
|
||||
"epoch": <string> (currently, always "SET")
|
||||
},
|
||||
"duration": {
|
||||
"timestamp": <number> (duration of this activity, in milliseconds)
|
||||
"epoch": "SET" (this is ignored)
|
||||
},
|
||||
"relationships": {
|
||||
"modes": <string[]> (array of applicable Activity Mode ids)
|
||||
},
|
||||
"link": <string> (optional; URL linking to associated external resource)
|
||||
"composition": <string[]> (array of identifiers for contained objects)
|
||||
}
|
||||
```
|
||||
|
||||
The identifiers in a timeline's `composition` field should only refer to
|
||||
other Activity objects.
|
||||
|
||||
### Activity Mode Model
|
||||
|
||||
An activity mode's model looks like:
|
||||
|
||||
```
|
||||
{
|
||||
"type": "mode",
|
||||
"resources": {
|
||||
"comms": <number> (communications utilization, in Kbps)
|
||||
"power": <number> (power utilization, in watts)
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,52 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
define([
|
||||
"./res/templates/deprecated-timeline-message.html"
|
||||
], function (
|
||||
deprecatedTimelineMessage
|
||||
) {
|
||||
return {
|
||||
name: 'platform/features/timeline',
|
||||
definition: {
|
||||
extensions: {
|
||||
types: [
|
||||
{
|
||||
key: "timeline",
|
||||
name: "Timeline",
|
||||
description: "Timeline, Activity and Activity Mode objects have been deprecated and will no longer be supported. (07/18/2018)",
|
||||
priority: 502
|
||||
}
|
||||
],
|
||||
views: [
|
||||
{
|
||||
key: "timeline",
|
||||
name: "Timeline",
|
||||
type: "timeline",
|
||||
description: "Timeline, Activity and Activity Mode objects have been deprecated and will no longer be supported. (07/18/2018)",
|
||||
template: deprecatedTimelineMessage
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -1,10 +0,0 @@
|
||||
<div>
|
||||
Timeline, Activity and Activity Mode objects have been deprecated and will no longer be supported.
|
||||
</div>
|
||||
<div>
|
||||
Please open an issue in the
|
||||
<a href="https://github.com/nasa/openmct/issues" target="_blank">
|
||||
Open MCT Issue tracker
|
||||
</a>
|
||||
if you have any questions about the timeline plugin.
|
||||
</div>
|
||||
@@ -173,10 +173,11 @@ define([
|
||||
const limitEvaluator = oldObject.getCapability("limit");
|
||||
|
||||
return {
|
||||
limits: function () {
|
||||
return limitEvaluator.limits();
|
||||
limits: () => {
|
||||
return limitEvaluator.limits.then !== undefined
|
||||
? limitEvaluator.limits()
|
||||
: Promise.resolve(limitEvaluator.limits());
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ const DEFAULTS = [
|
||||
'platform/telemetry',
|
||||
'platform/features/clock',
|
||||
'platform/features/hyperlink',
|
||||
'platform/features/timeline',
|
||||
'platform/forms',
|
||||
'platform/identity',
|
||||
'platform/persistence/aggregator',
|
||||
@@ -84,7 +83,6 @@ define([
|
||||
'../platform/features/my-items/bundle',
|
||||
'../platform/features/hyperlink/bundle',
|
||||
'../platform/features/static-markup/bundle',
|
||||
'../platform/features/timeline/bundle',
|
||||
'../platform/forms/bundle',
|
||||
'../platform/framework/bundle',
|
||||
'../platform/framework/src/load/Bundle',
|
||||
|
||||
@@ -41,8 +41,13 @@
|
||||
|
||||
<script>
|
||||
const COLLAPSE_THRESHOLD_PX = 40;
|
||||
const HIDE_TREE_PARAM = 'hideTree';
|
||||
const HIDE_INSPECTOR_PARAM = 'hideInspector';
|
||||
const PANE_INSPECTOR = 'Inspect';
|
||||
const PANE_TREE = 'Browse';
|
||||
|
||||
export default {
|
||||
inject: ['openmct'],
|
||||
props: {
|
||||
handle: {
|
||||
type: String,
|
||||
@@ -70,20 +75,59 @@ export default {
|
||||
this.type = this.$parent.type;
|
||||
this.styleProp = (this.type === 'horizontal') ? 'width' : 'height';
|
||||
},
|
||||
async mounted() {
|
||||
await this.$nextTick();
|
||||
// Hide tree and/or inspector pane if specified in URL
|
||||
this.handleHideUrl();
|
||||
this.openmct.router.on('change:params', this.handleHideUrl);
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.openmct.router.off('change:params', this.handleHideUrl);
|
||||
},
|
||||
methods: {
|
||||
toggleCollapse: function () {
|
||||
toggleCollapse: function (e) {
|
||||
let target = this.label === PANE_TREE ? HIDE_TREE_PARAM : HIDE_INSPECTOR_PARAM;
|
||||
this.collapsed = !this.collapsed;
|
||||
if (this.collapsed) {
|
||||
// Pane is expanded and is being collapsed
|
||||
this.currentSize = (this.dragCollapse === true) ? this.initial : this.$el.style[this.styleProp];
|
||||
this.$el.style[this.styleProp] = '';
|
||||
this.handleCollapse();
|
||||
this.addHideParam(target);
|
||||
} else {
|
||||
// Pane is collapsed and is being expanded
|
||||
this.$el.style[this.styleProp] = this.currentSize;
|
||||
delete this.currentSize;
|
||||
delete this.dragCollapse;
|
||||
this.handleExpand();
|
||||
this.removeHideParam(target);
|
||||
}
|
||||
},
|
||||
handleHideUrl: function () {
|
||||
if (!this.collapsable) {
|
||||
return;
|
||||
}
|
||||
|
||||
let hideTreeParam = this.openmct.router.getSearchParam(HIDE_TREE_PARAM);
|
||||
let hideInspectorParam = this.openmct.router.getSearchParam(HIDE_INSPECTOR_PARAM);
|
||||
let hideTree = hideTreeParam === 'true' && this.label === PANE_TREE;
|
||||
let hideInspector = hideInspectorParam === 'true' && this.label === PANE_INSPECTOR;
|
||||
if (hideTree || hideInspector) {
|
||||
this.collapsed = true;
|
||||
this.handleCollapse();
|
||||
} else {
|
||||
this.collapsed = false;
|
||||
this.handleExpand();
|
||||
}
|
||||
},
|
||||
addHideParam: function (target) {
|
||||
this.openmct.router.setSearchParam(target, 'true');
|
||||
},
|
||||
removeHideParam: function (target) {
|
||||
this.openmct.router.deleteSearchParam(target);
|
||||
},
|
||||
handleCollapse: function () {
|
||||
this.currentSize = (this.dragCollapse === true) ? this.initial : this.$el.style[this.styleProp];
|
||||
this.$el.style[this.styleProp] = '';
|
||||
},
|
||||
handleExpand: function () {
|
||||
this.$el.style[this.styleProp] = this.currentSize;
|
||||
delete this.currentSize;
|
||||
delete this.dragCollapse;
|
||||
},
|
||||
trackSize: function () {
|
||||
if (!this.dragCollapse === true) {
|
||||
if (this.type === 'vertical') {
|
||||
|
||||
90
src/ui/layout/paneSpec.js
Normal file
90
src/ui/layout/paneSpec.js
Normal file
@@ -0,0 +1,90 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
import {
|
||||
createOpenMct,
|
||||
resetApplicationState
|
||||
} from 'utils/testing';
|
||||
|
||||
describe("the pane", () => {
|
||||
let openmct;
|
||||
let appHolder;
|
||||
let element;
|
||||
let child;
|
||||
let resolveFunction;
|
||||
|
||||
beforeEach((done) => {
|
||||
openmct = createOpenMct();
|
||||
|
||||
appHolder = document.createElement('div');
|
||||
appHolder.style.width = '640px';
|
||||
appHolder.style.height = '480px';
|
||||
|
||||
openmct = createOpenMct();
|
||||
openmct.install(openmct.plugins.MyItems());
|
||||
openmct.install(openmct.plugins.LocalTimeSystem());
|
||||
openmct.install(openmct.plugins.UTCTimeSystem());
|
||||
|
||||
element = document.createElement('div');
|
||||
child = document.createElement('div');
|
||||
element.appendChild(child);
|
||||
|
||||
openmct.on('start', done);
|
||||
openmct.start(appHolder);
|
||||
|
||||
document.body.append(appHolder);
|
||||
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
return resetApplicationState(openmct);
|
||||
});
|
||||
it('toggling tree will toggle tree hide params', (done) => {
|
||||
document.querySelector('.l-shell__pane-tree .l-pane__collapse-button').click();
|
||||
expect(openmct.router.getSearchParam('hideTree')).toBe('true');
|
||||
done();
|
||||
});
|
||||
|
||||
it('tree pane collapses when adding hide tree param in URL', () => {
|
||||
openmct.router.setSearchParam('hideTree', 'true');
|
||||
expect(document.querySelector('.l-shell__pane-tree.l-pane--collapsed')).toBeDefined();
|
||||
});
|
||||
|
||||
it('inspector pane collapses when adding hide inspector param in URL', () => {
|
||||
openmct.router.setSearchParam('hideInspector', 'true');
|
||||
expect(document.querySelector('.l-shell__pane-inspector.l-pane--collapsed')).toBeDefined();
|
||||
});
|
||||
|
||||
it('toggle inspector pane will toggle inspector hide param', (done) => {
|
||||
// There's a short delay on addubg the param.
|
||||
resolveFunction = () => {
|
||||
setTimeout(() => {
|
||||
expect(openmct.router.getSearchParam('hideInspector')).toBe('true');
|
||||
done();
|
||||
}, 500);
|
||||
};
|
||||
|
||||
openmct.router.on('change:params', resolveFunction);
|
||||
document.querySelector('.l-shell__pane-inspector .l-pane__collapse-button').click();
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user