Compare commits

...

4 Commits

Author SHA1 Message Date
2def6dd634 add mmgis dependency 2021-07-19 11:32:24 -07:00
16fe1b55c6 bubble activity logic to parent 2021-07-13 17:06:11 -07:00
8037c372b0 add missing copyrights 2021-07-13 16:33:26 -07:00
216a349282 allow custom details while retaining current domain object details 2021-07-13 16:32:22 -07:00
12 changed files with 394 additions and 105 deletions

View File

@ -2,7 +2,9 @@
"name": "openmct", "name": "openmct",
"version": "1.7.4", "version": "1.7.4",
"description": "The Open MCT core platform", "description": "The Open MCT core platform",
"dependencies": {}, "dependencies": {
"openmct-mmgis": "git+https://trunk.arc.nasa.gov/bitbucket/scm/vipergds/openmct-mmgis.git#api-mmgis-inspector"
},
"devDependencies": { "devDependencies": {
"angular": ">=1.8.0", "angular": ">=1.8.0",
"angular-route": "1.4.14", "angular-route": "1.4.14",

View File

@ -65,7 +65,8 @@ define([
'./interceptors/plugin', './interceptors/plugin',
'./performanceIndicator/plugin', './performanceIndicator/plugin',
'./CouchDBSearchFolder/plugin', './CouchDBSearchFolder/plugin',
'./timeline/plugin' './timeline/plugin',
'/node_modules/openmct-mmgis/dist/openmct-mmgis'
], function ( ], function (
_, _,
UTCTimeSystem, UTCTimeSystem,
@ -111,7 +112,8 @@ define([
ObjectInterceptors, ObjectInterceptors,
PerformanceIndicator, PerformanceIndicator,
CouchDBSearchFolder, CouchDBSearchFolder,
Timeline Timeline,
Mmgis
) { ) {
const bundleMap = { const bundleMap = {
LocalStorage: 'platform/persistence/local', LocalStorage: 'platform/persistence/local',
@ -212,6 +214,7 @@ define([
plugins.PerformanceIndicator = PerformanceIndicator.default; plugins.PerformanceIndicator = PerformanceIndicator.default;
plugins.CouchDBSearchFolder = CouchDBSearchFolder.default; plugins.CouchDBSearchFolder = CouchDBSearchFolder.default;
plugins.Timeline = Timeline.default; plugins.Timeline = Timeline.default;
plugins.Mmgis = Mmgis.default;
return plugins; return plugins;
}); });

View File

@ -0,0 +1,43 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template>
<li class="c-inspect-properties__row">
<div class="c-inspect-properties__label">
{{ detail.name }}
</div>
<div class="c-inspect-properties__value">
{{ detail.value }}
</div>
</li>
</template>
<script>
export default {
props: {
detail: {
type: Object,
required: true
}
}
};
</script>

View File

@ -0,0 +1,50 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template>
<li class="c-inspect-properties__row">
<div class="c-inspect-properties__label">
{{ detail.name }}
</div>
<div class="c-inspect-properties__value">
{{ formattedTime }}
</div>
</li>
</template>
<script>
import Moment from 'moment';
export default {
props: {
detail: {
type: Object,
required: true
}
},
computed: {
formattedTime() {
return Moment.utc(this.detail.value).format('YYYY-MM-DD[\n]HH:mm:ss') + ' UTC';
}
}
};
</script>

View File

@ -1,3 +1,25 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template> <template>
<li <li
draggable="true" draggable="true"

View File

@ -1,3 +1,25 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template> <template>
<div class="c-elements-pool"> <div class="c-elements-pool">
<Search <Search

View File

@ -1,3 +1,25 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template> <template>
<div class="c-inspector"> <div class="c-inspector">
<object-name /> <object-name />
@ -19,7 +41,9 @@
type="vertical" type="vertical"
> >
<pane class="c-inspector__properties"> <pane class="c-inspector__properties">
<properties /> <Properties
v-if="!activity"
/>
<location /> <location />
<inspector-views /> <inspector-views />
</pane> </pane>
@ -98,7 +122,8 @@ export default {
key: '__styles', key: '__styles',
name: 'Styles' name: 'Styles'
}], }],
currentTabbedView: {} currentTabbedView: {},
activity: undefined
}; };
}, },
mounted() { mounted() {
@ -111,9 +136,12 @@ export default {
methods: { methods: {
updateInspectorViews(selection) { updateInspectorViews(selection) {
this.refreshComposition(selection); this.refreshComposition(selection);
if (this.openmct.types.get('conditionSet')) { if (this.openmct.types.get('conditionSet')) {
this.refreshTabs(selection); this.refreshTabs(selection);
} }
this.setActivity(selection);
}, },
refreshComposition(selection) { refreshComposition(selection) {
if (selection.length > 0 && selection[0].length > 0) { if (selection.length > 0 && selection[0].length > 0) {
@ -150,6 +178,12 @@ export default {
}, },
isCurrent(view) { isCurrent(view) {
return _.isEqual(this.currentTabbedView, view); return _.isEqual(this.currentTabbedView, view);
},
setActivity(selection) {
this.activity = selection
&& selection.length
&& selection[0].length
&& selection[0][0].activity;
} }
} }
}; };

View File

@ -1,3 +1,25 @@
/*****************************************************************************
* 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.
*****************************************************************************/
export const mockTelemetryTableSelection = [ export const mockTelemetryTableSelection = [
[{ [{
context: { context: {

View File

@ -1,10 +1,29 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template> <template>
<div></div> <div></div>
</template> </template>
<style>
</style>
<script> <script>
export default { export default {
inject: ['openmct'], inject: ['openmct'],

View File

@ -1,3 +1,25 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template> <template>
<div class="c-inspect-properties c-inspect-properties--location"> <div class="c-inspect-properties c-inspect-properties--location">
<div <div

View File

@ -1,3 +1,25 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template> <template>
<div class="c-inspector__header"> <div class="c-inspector__header">
<div v-if="!multiSelect" <div v-if="!multiSelect"

View File

@ -1,105 +1,149 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template> <template>
<div v-if="!activity" <div class="c-inspector__properties c-inspect-properties">
class="c-inspector__properties c-inspect-properties"
>
<div class="c-inspect-properties__header"> <div class="c-inspect-properties__header">
Details Details
</div> </div>
<ul <ul
v-if="!multiSelect && !singleSelectNonObject" v-if="hasDetails"
class="c-inspect-properties__section" class="c-inspect-properties__section"
> >
<li class="c-inspect-properties__row"> <Component
<div class="c-inspect-properties__label"> :is="getComponent(detail)"
Title v-for="detail in details"
</div> :key="detail.name"
<div class="c-inspect-properties__value"> :detail="detail"
{{ item.name }} />
</div>
</li>
<li class="c-inspect-properties__row">
<div class="c-inspect-properties__label">
Type
</div>
<div class="c-inspect-properties__value">
{{ typeName }}
</div>
</li>
<li
v-if="item.created"
class="c-inspect-properties__row"
>
<div class="c-inspect-properties__label">
Created
</div>
<div class="c-inspect-properties__value">
{{ formatTime(item.created) }}
</div>
</li>
<li
v-if="item.modified"
class="c-inspect-properties__row"
>
<div class="c-inspect-properties__label">
Modified
</div>
<div class="c-inspect-properties__value">
{{ formatTime(item.modified) }}
</div>
</li>
<li
v-for="prop in typeProperties"
:key="prop.name"
class="c-inspect-properties__row"
>
<div class="c-inspect-properties__label">
{{ prop.name }}
</div>
<div class="c-inspect-properties__value">
{{ prop.value }}
</div>
</li>
</ul> </ul>
<div <div
v-if="multiSelect" v-else
class="c-inspect-properties__row--span-all" class="c-inspect-properties__row--span-all"
> >
No properties to display for multiple items {{ noDetailsMessage }}
</div>
<div
v-if="singleSelectNonObject"
class="c-inspect-properties__row--span-all"
>
No properties to display for this item
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Moment from "moment"; import DetailText from './DetailText.vue';
import DetailTime from './DetailTime.vue';
export default { export default {
components: {
DetailText,
DetailTime
},
inject: ['openmct'], inject: ['openmct'],
data() { data() {
return { return {
domainObject: {}, selection: undefined
activity: undefined,
multiSelect: false
}; };
}, },
computed: { computed: {
item() { details() {
return this.domainObject || {}; return this.customDetails ? this.customDetails : this.domainObjectDetails;
}, },
type() { customDetails() {
return this.openmct.types.get(this.item.type); if (this.context === undefined) {
}, return;
typeName() {
if (!this.type) {
return `Unknown: ${this.item.type}`;
} }
return this.type.definition.name; return this.context.details;
},
domainObject() {
if (this.context === undefined) {
return;
}
return this.context.item;
},
type() {
if (this.domainObject === undefined) {
return;
}
return this.openmct.types.get(this.domainObject.type);
},
domainObjectDetails() {
if (this.domainObject === undefined) {
return;
}
const title = this.domainObject.name;
const typeName = this.type ? this.type.definition.name : `Unknown: ${this.domainObject.type}`;
const timestampLabel = this.domainObject.modified ? 'Modified' : 'Created';
const timestamp = this.domainObject.modified ? this.domainObject.modified : this.domainObject.created;
const details = [
{
name: 'Title',
value: title
},
{
name: 'Type',
value: typeName
}
];
if (timestamp !== undefined) {
details.push(
{
name: timestampLabel,
value: timestamp,
component: 'time'
}
);
}
return [...details, ...this.typeProperties];
},
context() {
if (
!this.selection
|| !this.selection.length
|| !this.selection[0].length
) {
return;
}
return this.selection[0][0].context;
},
hasDetails() {
return Boolean(
this.details
&& this.details.length
&& !this.multiSelection
);
},
multiSelection() {
return this.selection && this.selection.length > 1;
},
noDetailsMessage() {
return this.multiSelection
? 'No properties to display for multiple items'
: 'No properties to display for this item';
}, },
typeProperties() { typeProperties() {
if (!this.type) { if (!this.type) {
@ -129,12 +173,9 @@ export default {
name: field.name, name: field.name,
value: field.path.reduce((object, key) => { value: field.path.reduce((object, key) => {
return object[key]; return object[key];
}, this.item) }, this.domainObject)
}; };
}); });
},
singleSelectNonObject() {
return !this.item.identifier && !this.multiSelect;
} }
}, },
mounted() { mounted() {
@ -145,26 +186,13 @@ export default {
this.openmct.selection.off('change', this.updateSelection); this.openmct.selection.off('change', this.updateSelection);
}, },
methods: { methods: {
updateSelection(selection) { getComponent(detail) {
if (selection.length === 0 || selection[0].length === 0) { const component = detail.component ? detail.component : 'text';
this.domainObject = {};
return; return `detail-${component}`;
}
if (selection.length > 1) {
this.multiSelect = true;
this.domainObject = {};
return;
} else {
this.multiSelect = false;
this.domainObject = selection[0][0].context.item;
this.activity = selection[0][0].context.activity;
}
}, },
formatTime(unixTime) { updateSelection(selection) {
return Moment.utc(unixTime).format('YYYY-MM-DD[\n]HH:mm:ss') + ' UTC'; this.selection = selection;
} }
} }
}; };