mirror of
https://github.com/nasa/openmct.git
synced 2025-05-29 13:44:21 +00:00
WIP
This commit is contained in:
parent
6a25cb0a58
commit
ea45f0f4aa
@ -27,7 +27,7 @@ export default function ConditionSet(openmct) {
|
|||||||
return {
|
return {
|
||||||
key: 'conditionSet',
|
key: 'conditionSet',
|
||||||
name: 'Condition Set',
|
name: 'Condition Set',
|
||||||
cssClass: 'icon-summary-widget',
|
cssClass: 'icon-folder',
|
||||||
canView: function (domainObject) {
|
canView: function (domainObject) {
|
||||||
return domainObject.type === 'conditionSet';
|
return domainObject.type === 'conditionSet';
|
||||||
},
|
},
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
import ConditionSetViewProvider from './ConditionSetViewProvider.js';
|
||||||
|
|
||||||
export default function ConditionSetPlugin() {
|
export default function ConditionSetPlugin() {
|
||||||
const conditionSetType = {
|
const conditionSetType = {
|
||||||
@ -26,7 +27,7 @@ export default function ConditionSetPlugin() {
|
|||||||
key: 'conditionSet',
|
key: 'conditionSet',
|
||||||
description: 'A set of one or more conditional rules based on user-specified criteria.',
|
description: 'A set of one or more conditional rules based on user-specified criteria.',
|
||||||
creatable: true,
|
creatable: true,
|
||||||
cssClass: 'icon-summary-widget',
|
cssClass: 'icon-folder',
|
||||||
initialize: function (domainObject) {
|
initialize: function (domainObject) {
|
||||||
domainObject.composition = [];
|
domainObject.composition = [];
|
||||||
domainObject.telemetry = {};
|
domainObject.telemetry = {};
|
||||||
@ -34,6 +35,8 @@ export default function ConditionSetPlugin() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
|
openmct.objectViews.addProvider(new ConditionSetViewProvider(openmct));
|
||||||
|
|
||||||
openmct.types.addType('conditionSet', conditionSetType);
|
openmct.types.addType('conditionSet', conditionSetType);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -25,28 +25,32 @@ import { createOpenMct } from 'testTools';
|
|||||||
|
|
||||||
fdescribe("The plugin", () => {
|
fdescribe("The plugin", () => {
|
||||||
let openmct;
|
let openmct;
|
||||||
let conditionSetType;
|
|
||||||
let mockDomainObject;
|
let mockDomainObject;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
mockDomainObject = {};
|
|
||||||
|
|
||||||
openmct = createOpenMct();
|
openmct = createOpenMct();
|
||||||
openmct.install(new ConditionSetPlugin());
|
openmct.install(new ConditionSetPlugin());
|
||||||
conditionSetType = openmct.types.get('conditionSet');
|
|
||||||
|
mockDomainObject = {
|
||||||
|
identifier: {
|
||||||
|
key: 'testKey',
|
||||||
|
namespace: ''
|
||||||
|
},
|
||||||
|
type: 'conditionSet'
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
it('defines a conditionSet object with the correct key', () => {
|
it('defines a conditionSet object type with the correct key', () => {
|
||||||
expect(conditionSetType.definition.key).toEqual('conditionSet');
|
expect(openmct.types.get('conditionSet').definition.key).toEqual('conditionSet');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('defines a conditionSet object that is creatable', () => {
|
it('defines a conditionSet object type that is creatable', () => {
|
||||||
expect(conditionSetType.definition.creatable).toBeTrue();
|
expect(openmct.types.get('conditionSet').definition.creatable).toBeTrue();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("shows the conditionSet object is initialized with", () => {
|
describe("shows the conditionSet object is initialized with", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
conditionSetType.definition.initialize(mockDomainObject);
|
openmct.types.get('conditionSet').definition.initialize(mockDomainObject);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('a composition array', () => {
|
it('a composition array', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user