mirror of
https://github.com/nasa/openmct.git
synced 2025-06-25 18:50:11 +00:00
Compare commits
8 Commits
fix-github
...
bugfix/iss
Author | SHA1 | Date | |
---|---|---|---|
064e517031 | |||
7096710b1f | |||
ecfbabcfe3 | |||
a76b843fde | |||
7f0367b838 | |||
04c3728eff | |||
afa89ae6b5 | |||
58844799be |
@ -195,6 +195,7 @@
|
||||
));
|
||||
openmct.install(openmct.plugins.Clock({ enableClockIndicator: true }));
|
||||
openmct.install(openmct.plugins.Timer());
|
||||
openmct.install(openmct.plugins.StaticRootPlugin({ namespace: 'something', exportUrl: './dist/static-root.json' }));
|
||||
openmct.start();
|
||||
</script>
|
||||
</html>
|
||||
|
@ -151,7 +151,7 @@ define([
|
||||
|
||||
plugins.MyItems = MyItems.default;
|
||||
|
||||
plugins.StaticRootPlugin = StaticRootPlugin;
|
||||
plugins.StaticRootPlugin = StaticRootPlugin.default;
|
||||
|
||||
/**
|
||||
* A tabular view showing the latest values of multiple telemetry points at
|
||||
|
@ -1,45 +1,139 @@
|
||||
define([
|
||||
'objectUtils'
|
||||
], function (
|
||||
objectUtils
|
||||
) {
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2022, 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.
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
* Transforms an import json blob into a object map that can be used to
|
||||
* provide objects. Rewrites root identifier in import data with provided
|
||||
* rootIdentifier, and rewrites all child object identifiers so that they
|
||||
* exist in the same namespace as the rootIdentifier.
|
||||
*/
|
||||
import objectUtils from 'objectUtils';
|
||||
|
||||
class StaticModelProvider {
|
||||
constructor(importData, rootIdentifier) {
|
||||
this.objectMap = {};
|
||||
this.rewriteModel(importData, rootIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms an import json blob into a object map that can be used to
|
||||
* provide objects. Rewrites root identifier in import data with provided
|
||||
* rootIdentifier, and rewrites all child object identifiers so that they
|
||||
* exist in the same namespace as the rootIdentifier.
|
||||
* Standard "Get".
|
||||
*/
|
||||
function rewriteObjectIdentifiers(importData, rootIdentifier) {
|
||||
const rootId = importData.rootId;
|
||||
let objectString = JSON.stringify(importData.openmct);
|
||||
get(identifier) {
|
||||
const keyString = objectUtils.makeKeyString(identifier);
|
||||
if (this.objectMap[keyString]) {
|
||||
return this.objectMap[keyString];
|
||||
}
|
||||
|
||||
Object.keys(importData.openmct).forEach(function (originalId, i) {
|
||||
let newId;
|
||||
if (originalId === rootId) {
|
||||
newId = objectUtils.makeKeyString(rootIdentifier);
|
||||
} else {
|
||||
newId = objectUtils.makeKeyString({
|
||||
namespace: rootIdentifier.namespace,
|
||||
key: i
|
||||
throw new Error(keyString + ' not found in import models.');
|
||||
}
|
||||
|
||||
parseObjectLeaf(objectLeaf, idMap, namespace) {
|
||||
Object.keys(objectLeaf).forEach((nodeKey) => {
|
||||
if (idMap.get(nodeKey)) {
|
||||
const newIdentifier = objectUtils.makeKeyString({
|
||||
namespace,
|
||||
key: idMap.get(nodeKey)
|
||||
});
|
||||
}
|
||||
|
||||
while (objectString.indexOf(originalId) !== -1) {
|
||||
objectString = objectString.replace(
|
||||
'"' + originalId + '"',
|
||||
'"' + newId + '"'
|
||||
);
|
||||
objectLeaf[newIdentifier] = { ...objectLeaf[nodeKey] };
|
||||
delete objectLeaf[nodeKey];
|
||||
objectLeaf[newIdentifier] = this.parseTreeLeaf(newIdentifier, objectLeaf[newIdentifier], idMap, namespace);
|
||||
} else {
|
||||
objectLeaf[nodeKey] = this.parseTreeLeaf(nodeKey, objectLeaf[nodeKey], idMap, namespace);
|
||||
}
|
||||
});
|
||||
|
||||
return JSON.parse(objectString);
|
||||
return objectLeaf;
|
||||
}
|
||||
|
||||
parseArrayLeaf(arrayLeaf, idMap, namespace) {
|
||||
return arrayLeaf.map((leafValue, index) => this.parseTreeLeaf(
|
||||
null, leafValue, idMap, namespace));
|
||||
}
|
||||
|
||||
parseBranchedLeaf(branchedLeafValue, idMap, namespace) {
|
||||
if (Array.isArray(branchedLeafValue)) {
|
||||
return this.parseArrayLeaf(branchedLeafValue, idMap, namespace);
|
||||
} else {
|
||||
return this.parseObjectLeaf(branchedLeafValue, idMap, namespace);
|
||||
}
|
||||
}
|
||||
|
||||
parseTreeLeaf(leafKey, leafValue, idMap, namespace) {
|
||||
const hasChild = typeof leafValue === 'object';
|
||||
if (hasChild) {
|
||||
return this.parseBranchedLeaf(leafValue, idMap, namespace);
|
||||
}
|
||||
|
||||
if (leafKey === 'key') {
|
||||
return idMap.get(leafValue);
|
||||
} else if (leafKey === 'namespace') {
|
||||
return namespace;
|
||||
} else if (leafKey === 'location') {
|
||||
if (idMap.get(leafValue)) {
|
||||
const newLocationIdentifier = objectUtils.makeKeyString({
|
||||
namespace,
|
||||
key: idMap.get(leafValue)
|
||||
});
|
||||
|
||||
return newLocationIdentifier;
|
||||
}
|
||||
|
||||
return null;
|
||||
} else if (idMap.get(leafValue)) {
|
||||
const newIdentifier = objectUtils.makeKeyString({
|
||||
namespace,
|
||||
key: idMap.get(leafValue)
|
||||
});
|
||||
|
||||
return newIdentifier;
|
||||
} else {
|
||||
return leafValue;
|
||||
}
|
||||
}
|
||||
|
||||
rewriteObjectIdentifiers(importData, rootIdentifier) {
|
||||
const namespace = rootIdentifier.namespace;
|
||||
const idMap = new Map();
|
||||
const objectTree = importData.openmct;
|
||||
|
||||
Object.keys(objectTree).forEach((originalId, index) => {
|
||||
let newId = index.toString();
|
||||
if (originalId === importData.rootId) {
|
||||
newId = rootIdentifier.key;
|
||||
}
|
||||
|
||||
idMap.set(originalId, newId);
|
||||
});
|
||||
|
||||
const newTree = this.parseTreeLeaf(null, objectTree, idMap, namespace);
|
||||
|
||||
return newTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts all objects in an object make from old format objects to new
|
||||
* format objects.
|
||||
*/
|
||||
function convertToNewObjects(oldObjectMap) {
|
||||
convertToNewObjects(oldObjectMap) {
|
||||
return Object.keys(oldObjectMap)
|
||||
.reduce(function (newObjectMap, key) {
|
||||
newObjectMap[key] = objectUtils.toNewFormat(oldObjectMap[key], key);
|
||||
@ -49,7 +143,7 @@ define([
|
||||
}
|
||||
|
||||
/* Set the root location correctly for a top-level object */
|
||||
function setRootLocation(objectMap, rootIdentifier) {
|
||||
setRootLocation(objectMap, rootIdentifier) {
|
||||
objectMap[objectUtils.makeKeyString(rootIdentifier)].location = 'ROOT';
|
||||
|
||||
return objectMap;
|
||||
@ -59,24 +153,11 @@ define([
|
||||
* Takes importData (as provided by the ImportExport plugin) and exposes
|
||||
* an object provider to fetch those objects.
|
||||
*/
|
||||
function StaticModelProvider(importData, rootIdentifier) {
|
||||
const oldFormatObjectMap = rewriteObjectIdentifiers(importData, rootIdentifier);
|
||||
const newFormatObjectMap = convertToNewObjects(oldFormatObjectMap);
|
||||
this.objectMap = setRootLocation(newFormatObjectMap, rootIdentifier);
|
||||
rewriteModel(importData, rootIdentifier) {
|
||||
const oldFormatObjectMap = this.rewriteObjectIdentifiers(importData, rootIdentifier);
|
||||
const newFormatObjectMap = this.convertToNewObjects(oldFormatObjectMap);
|
||||
this.objectMap = this.setRootLocation(newFormatObjectMap, rootIdentifier);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard "Get".
|
||||
*/
|
||||
StaticModelProvider.prototype.get = function (identifier) {
|
||||
const keyString = objectUtils.makeKeyString(identifier);
|
||||
if (this.objectMap[keyString]) {
|
||||
return this.objectMap[keyString];
|
||||
}
|
||||
|
||||
throw new Error(keyString + ' not found in import models.');
|
||||
};
|
||||
|
||||
return StaticModelProvider;
|
||||
|
||||
});
|
||||
export default StaticModelProvider;
|
||||
|
@ -1,133 +1,149 @@
|
||||
define([
|
||||
'./StaticModelProvider',
|
||||
'./static-provider-test.json'
|
||||
], function (
|
||||
StaticModelProvider,
|
||||
testStaticData
|
||||
) {
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2022, 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.
|
||||
*****************************************************************************/
|
||||
|
||||
describe('StaticModelProvider', function () {
|
||||
import testStaticData from './static-provider-test.json';
|
||||
import StaticModelProvider from './StaticModelProvider';
|
||||
|
||||
let staticProvider;
|
||||
describe('StaticModelProvider', function () {
|
||||
|
||||
let staticProvider;
|
||||
|
||||
beforeEach(function () {
|
||||
const staticData = JSON.parse(JSON.stringify(testStaticData));
|
||||
staticProvider = new StaticModelProvider(staticData, {
|
||||
namespace: 'my-import',
|
||||
key: 'root'
|
||||
});
|
||||
});
|
||||
|
||||
describe('rootObject', function () {
|
||||
let rootModel;
|
||||
|
||||
beforeEach(function () {
|
||||
const staticData = JSON.parse(JSON.stringify(testStaticData));
|
||||
staticProvider = new StaticModelProvider(staticData, {
|
||||
rootModel = staticProvider.get({
|
||||
namespace: 'my-import',
|
||||
key: 'root'
|
||||
});
|
||||
});
|
||||
|
||||
describe('rootObject', function () {
|
||||
let rootModel;
|
||||
it('is located at top level', function () {
|
||||
expect(rootModel.location).toBe('ROOT');
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
rootModel = staticProvider.get({
|
||||
namespace: 'my-import',
|
||||
key: 'root'
|
||||
});
|
||||
});
|
||||
|
||||
it('is located at top level', function () {
|
||||
expect(rootModel.location).toBe('ROOT');
|
||||
});
|
||||
|
||||
it('has new-format identifier', function () {
|
||||
expect(rootModel.identifier).toEqual({
|
||||
namespace: 'my-import',
|
||||
key: 'root'
|
||||
});
|
||||
});
|
||||
|
||||
it('has new-format composition', function () {
|
||||
expect(rootModel.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
expect(rootModel.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '2'
|
||||
});
|
||||
it('has new-format identifier', function () {
|
||||
expect(rootModel.identifier).toEqual({
|
||||
namespace: 'my-import',
|
||||
key: 'root'
|
||||
});
|
||||
});
|
||||
|
||||
describe('childObjects', function () {
|
||||
let swg;
|
||||
let layout;
|
||||
let fixed;
|
||||
|
||||
beforeEach(function () {
|
||||
swg = staticProvider.get({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
layout = staticProvider.get({
|
||||
namespace: 'my-import',
|
||||
key: '2'
|
||||
});
|
||||
fixed = staticProvider.get({
|
||||
namespace: 'my-import',
|
||||
key: '3'
|
||||
});
|
||||
it('has new-format composition', function () {
|
||||
expect(rootModel.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
|
||||
it('match expected ordering', function () {
|
||||
// this is a sanity check to make sure the identifiers map in
|
||||
// the correct order.
|
||||
expect(swg.type).toBe('generator');
|
||||
expect(layout.type).toBe('layout');
|
||||
expect(fixed.type).toBe('telemetry.fixed');
|
||||
expect(rootModel.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '2'
|
||||
});
|
||||
|
||||
it('have new-style identifiers', function () {
|
||||
expect(swg.identifier).toEqual({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
expect(layout.identifier).toEqual({
|
||||
namespace: 'my-import',
|
||||
key: '2'
|
||||
});
|
||||
expect(fixed.identifier).toEqual({
|
||||
namespace: 'my-import',
|
||||
key: '3'
|
||||
});
|
||||
});
|
||||
|
||||
it('have new-style composition', function () {
|
||||
expect(layout.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
expect(layout.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '3'
|
||||
});
|
||||
expect(fixed.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
});
|
||||
|
||||
it('rewrites locations', function () {
|
||||
expect(swg.location).toBe('my-import:root');
|
||||
expect(layout.location).toBe('my-import:root');
|
||||
expect(fixed.location).toBe('my-import:2');
|
||||
});
|
||||
|
||||
it('rewrites matched identifiers in objects', function () {
|
||||
expect(layout.configuration.layout.panels['my-import:1'])
|
||||
.toBeDefined();
|
||||
expect(layout.configuration.layout.panels['my-import:3'])
|
||||
.toBeDefined();
|
||||
expect(layout.configuration.layout.panels['483c00d4-bb1d-4b42-b29a-c58e06b322a0'])
|
||||
.not.toBeDefined();
|
||||
expect(layout.configuration.layout.panels['20273193-f069-49e9-b4f7-b97a87ed755d'])
|
||||
.not.toBeDefined();
|
||||
expect(fixed.configuration['fixed-display'].elements[0].id)
|
||||
.toBe('my-import:1');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
describe('childObjects', function () {
|
||||
let swg;
|
||||
let layout;
|
||||
let fixed;
|
||||
|
||||
beforeEach(function () {
|
||||
swg = staticProvider.get({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
layout = staticProvider.get({
|
||||
namespace: 'my-import',
|
||||
key: '2'
|
||||
});
|
||||
fixed = staticProvider.get({
|
||||
namespace: 'my-import',
|
||||
key: '3'
|
||||
});
|
||||
});
|
||||
|
||||
it('match expected ordering', function () {
|
||||
// this is a sanity check to make sure the identifiers map in
|
||||
// the correct order.
|
||||
expect(swg.type).toBe('generator');
|
||||
expect(layout.type).toBe('layout');
|
||||
expect(fixed.type).toBe('telemetry.fixed');
|
||||
});
|
||||
|
||||
it('have new-style identifiers', function () {
|
||||
expect(swg.identifier).toEqual({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
expect(layout.identifier).toEqual({
|
||||
namespace: 'my-import',
|
||||
key: '2'
|
||||
});
|
||||
expect(fixed.identifier).toEqual({
|
||||
namespace: 'my-import',
|
||||
key: '3'
|
||||
});
|
||||
});
|
||||
|
||||
it('have new-style composition', function () {
|
||||
expect(layout.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
expect(layout.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '3'
|
||||
});
|
||||
expect(fixed.composition).toContain({
|
||||
namespace: 'my-import',
|
||||
key: '1'
|
||||
});
|
||||
});
|
||||
|
||||
it('rewrites locations', function () {
|
||||
expect(swg.location).toBe('my-import:root');
|
||||
expect(layout.location).toBe('my-import:root');
|
||||
expect(fixed.location).toBe('my-import:2');
|
||||
});
|
||||
|
||||
it('rewrites matched identifiers in objects', function () {
|
||||
expect(layout.configuration.layout.panels['my-import:1'])
|
||||
.toBeDefined();
|
||||
expect(layout.configuration.layout.panels['my-import:3'])
|
||||
.toBeDefined();
|
||||
expect(layout.configuration.layout.panels['483c00d4-bb1d-4b42-b29a-c58e06b322a0'])
|
||||
.not.toBeDefined();
|
||||
expect(layout.configuration.layout.panels['20273193-f069-49e9-b4f7-b97a87ed755d'])
|
||||
.not.toBeDefined();
|
||||
expect(fixed.configuration['fixed-display'].elements[0].id)
|
||||
.toBe('my-import:1');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
@ -1,52 +1,63 @@
|
||||
define([
|
||||
'./StaticModelProvider'
|
||||
], function (
|
||||
StaticModelProvider
|
||||
) {
|
||||
/**
|
||||
* Static Root Plugin: takes an export file and exposes it as a new root
|
||||
* object.
|
||||
*/
|
||||
function StaticRootPlugin(namespace, exportUrl) {
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2022, 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.
|
||||
*****************************************************************************/
|
||||
|
||||
const rootIdentifier = {
|
||||
namespace: namespace,
|
||||
key: 'root'
|
||||
};
|
||||
import StaticModelProvider from './StaticModelProvider';
|
||||
|
||||
let cachedProvider;
|
||||
export default function StaticRootPlugin(options) {
|
||||
const rootIdentifier = {
|
||||
namespace: options.namespace,
|
||||
key: 'root'
|
||||
};
|
||||
|
||||
function loadProvider() {
|
||||
return fetch(exportUrl)
|
||||
.then(function (response) {
|
||||
return response.json();
|
||||
})
|
||||
.then(function (importData) {
|
||||
cachedProvider = new StaticModelProvider(importData, rootIdentifier);
|
||||
let cachedProvider;
|
||||
|
||||
return cachedProvider;
|
||||
});
|
||||
}
|
||||
function loadProvider() {
|
||||
return fetch(options.exportUrl)
|
||||
.then(function (response) {
|
||||
return response.json();
|
||||
})
|
||||
.then(function (importData) {
|
||||
cachedProvider = new StaticModelProvider(importData, rootIdentifier);
|
||||
|
||||
function getProvider() {
|
||||
if (!cachedProvider) {
|
||||
cachedProvider = loadProvider();
|
||||
}
|
||||
|
||||
return Promise.resolve(cachedProvider);
|
||||
}
|
||||
|
||||
return function install(openmct) {
|
||||
openmct.objects.addRoot(rootIdentifier);
|
||||
openmct.objects.addProvider(namespace, {
|
||||
get: function (identifier) {
|
||||
return getProvider().then(function (provider) {
|
||||
return provider.get(identifier);
|
||||
});
|
||||
}
|
||||
return cachedProvider;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return StaticRootPlugin;
|
||||
});
|
||||
function getProvider() {
|
||||
if (!cachedProvider) {
|
||||
cachedProvider = loadProvider();
|
||||
}
|
||||
|
||||
return Promise.resolve(cachedProvider);
|
||||
}
|
||||
|
||||
return function install(openmct) {
|
||||
openmct.objects.addRoot(rootIdentifier);
|
||||
openmct.objects.addProvider(options.namespace, {
|
||||
get: function (identifier) {
|
||||
return getProvider().then(function (provider) {
|
||||
return provider.get(identifier);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
1
static-root.json
Normal file
1
static-root.json
Normal file
@ -0,0 +1 @@
|
||||
{"openmct":{"a2de0f92-e1a9-4ab0-b815-8226eb016b33":{"identifier":{"key":"a2de0f92-e1a9-4ab0-b815-8226eb016b33","namespace":""},"name":"Parent Folder","type":"folder","composition":[{"key":"9cdda73d-9b0c-4b6d-8405-f90c33844e54","namespace":""},{"key":"d0ef5482-8bda-4082-b2e2-73807320d1d9","namespace":""},{"key":"97891e2c-6000-464f-a65d-e928fa0d172d","namespace":""}],"modified":1645824127466,"location":"mine","persisted":1645824127468},"9cdda73d-9b0c-4b6d-8405-f90c33844e54":{"identifier":{"key":"9cdda73d-9b0c-4b6d-8405-f90c33844e54","namespace":""},"name":"Child Folder","type":"folder","composition":[{"key":"aa6e8428-fe16-4033-9b04-8c63d559fe05","namespace":""},{"key":"f473b125-3aa3-419e-8fd9-004e08d42ba3","namespace":""}],"modified":1645824073376,"location":"a2de0f92-e1a9-4ab0-b815-8226eb016b33","persisted":1645824073378},"d0ef5482-8bda-4082-b2e2-73807320d1d9":{"identifier":{"key":"d0ef5482-8bda-4082-b2e2-73807320d1d9","namespace":""},"name":"Sibling Child Folder","type":"folder","composition":[{"key":"b9d53ee9-d5f0-404e-90c1-b0e4b30c3d54","namespace":""}],"modified":1645824073375,"location":"a2de0f92-e1a9-4ab0-b815-8226eb016b33","persisted":1645824073375},"97891e2c-6000-464f-a65d-e928fa0d172d":{"identifier":{"key":"97891e2c-6000-464f-a65d-e928fa0d172d","namespace":""},"name":"A Clock","type":"clock","configuration":{"baseFormat":"YYYY/MM/DD hh:mm:ss","use24":"clock12","timezone":"UTC"},"modified":1645824127465,"location":"a2de0f92-e1a9-4ab0-b815-8226eb016b33","persisted":1645824127465},"aa6e8428-fe16-4033-9b04-8c63d559fe05":{"identifier":{"key":"aa6e8428-fe16-4033-9b04-8c63d559fe05","namespace":""},"name":"Grandchild Folder","type":"folder","composition":[{"key":"f8f9dd1f-50fe-4bed-b0e4-dd85ce6d3498","namespace":""}],"modified":1645824155758,"location":"9cdda73d-9b0c-4b6d-8405-f90c33844e54","persisted":1645824155760},"f473b125-3aa3-419e-8fd9-004e08d42ba3":{"identifier":{"key":"f473b125-3aa3-419e-8fd9-004e08d42ba3","namespace":""},"name":"Secret Web Page","type":"webPage","url":"https://www.youtube.com/embed/dQw4w9WgXcQ","modified":1645823979349,"location":"9cdda73d-9b0c-4b6d-8405-f90c33844e54","persisted":1645823979349},"b9d53ee9-d5f0-404e-90c1-b0e4b30c3d54":{"identifier":{"key":"b9d53ee9-d5f0-404e-90c1-b0e4b30c3d54","namespace":""},"name":"Linky","type":"hyperlink","displayFormat":"link","linkTarget":"_self","url":"https://www.nasa.gov/viper/","displayText":"Viper Info","modified":1645824073374,"location":"d0ef5482-8bda-4082-b2e2-73807320d1d9","persisted":1645824073374},"f8f9dd1f-50fe-4bed-b0e4-dd85ce6d3498":{"identifier":{"key":"f8f9dd1f-50fe-4bed-b0e4-dd85ce6d3498","namespace":""},"name":"Display Layout","type":"layout","composition":[{"key":"f473b125-3aa3-419e-8fd9-004e08d42ba3","namespace":""},{"key":"b9d53ee9-d5f0-404e-90c1-b0e4b30c3d54","namespace":""},{"key":"97891e2c-6000-464f-a65d-e928fa0d172d","namespace":""}],"configuration":{"items":[{"width":58,"height":30,"x":1,"y":3,"identifier":{"key":"f473b125-3aa3-419e-8fd9-004e08d42ba3","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"f7b49d10-d606-467f-bc08-5d660b8ae693"},{"width":11,"height":2,"x":60,"y":3,"identifier":{"key":"b9d53ee9-d5f0-404e-90c1-b0e4b30c3d54","namespace":""},"hasFrame":false,"fontSize":"default","font":"default","type":"subobject-view","id":"483b5762-455f-485e-a17d-24699dbcbe06"},{"width":31,"height":6,"x":60,"y":6,"identifier":{"key":"97891e2c-6000-464f-a65d-e928fa0d172d","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"53026423-72c4-4b5f-9290-9c7abbd1bec7"}],"layoutGrid":[10,10]},"modified":1645824197324,"location":"aa6e8428-fe16-4033-9b04-8c63d559fe05","persisted":1645824201302}},"rootId":"a2de0f92-e1a9-4ab0-b815-8226eb016b33"}
|
@ -1,5 +1,6 @@
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.common');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
@ -14,6 +15,14 @@ module.exports = merge(common, {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
__OPENMCT_ROOT_RELATIVE__: '"dist/"'
|
||||
}),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: './static-root.json',
|
||||
to: '.'
|
||||
}
|
||||
]
|
||||
})
|
||||
],
|
||||
devtool: 'eval-source-map'
|
||||
|
Reference in New Issue
Block a user