mirror of
https://github.com/nasa/openmct.git
synced 2025-05-06 02:28:21 +00:00
added conditions and condition components
This commit is contained in:
parent
f93d5a6fbf
commit
99c7bd4c10
24
src/plugins/condition/components/Condition.vue
Normal file
24
src/plugins/condition/components/Condition.vue
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<div id="conditionArea"
|
||||||
|
class="c-cs-editui__conditions widget-condition"
|
||||||
|
>
|
||||||
|
<span v-if="isEditing">[editable condition data]</span>
|
||||||
|
<span v-else>[read-only condition data]</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
inject: ['openmct'],
|
||||||
|
props: {
|
||||||
|
isEditing: Boolean
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
conditionData: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -23,47 +23,51 @@
|
|||||||
import ConditionSet from './components/ConditionSet.vue';
|
import ConditionSet from './components/ConditionSet.vue';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
export default function ConditionSetViewProvider(openmct) {
|
export default class ConditionSetViewProvider {
|
||||||
return {
|
constructor(openmct) {
|
||||||
key: 'conditionSet.view',
|
this.openmct = openmct;
|
||||||
name: 'Condition Set',
|
this.key = 'conditionSet.view';
|
||||||
cssClass: 'icon-summary-widget',
|
this.cssClass = 'icon-summary-widget';
|
||||||
canView: function (domainObject) {
|
}
|
||||||
return domainObject.type === 'conditionSet';
|
|
||||||
},
|
canView(domainObject) {
|
||||||
canEdit: function (domainObject) {
|
return domainObject.type === 'conditionSet';
|
||||||
return domainObject.type === 'conditionSet';
|
}
|
||||||
},
|
|
||||||
view: function (domainObject, objectPath) {
|
canEdit(domainObject) {
|
||||||
let component;
|
return domainObject.type === 'conditionSet';
|
||||||
return {
|
}
|
||||||
show(container) {
|
|
||||||
component = new Vue({
|
view(domainObject, objectPath) {
|
||||||
el: container,
|
let component;
|
||||||
components: {
|
const openmct = this.openmct;
|
||||||
ConditionSet
|
return {
|
||||||
},
|
show: (container, isEditing) => {
|
||||||
provide: {
|
component = new Vue({
|
||||||
openmct,
|
el: container,
|
||||||
domainObject,
|
components: {
|
||||||
objectPath
|
ConditionSet
|
||||||
},
|
},
|
||||||
data() {
|
provide: {
|
||||||
return {
|
openmct,
|
||||||
domainObject
|
domainObject,
|
||||||
};
|
objectPath
|
||||||
},
|
},
|
||||||
template: '<condition-set></condition-set>'
|
data() {
|
||||||
});
|
return {
|
||||||
},
|
isEditing: isEditing
|
||||||
destroy() {
|
}
|
||||||
component.$destroy();
|
},
|
||||||
component = undefined;
|
template: '<condition-set :isEditing="isEditing"></condition-set>'
|
||||||
}
|
});
|
||||||
};
|
},
|
||||||
},
|
onEditModeChange: function (isEditing) {
|
||||||
priority() {
|
component.isEditing = isEditing;
|
||||||
return 100;
|
},
|
||||||
}
|
destroy: () => {
|
||||||
};
|
component.$destroy();
|
||||||
|
component = undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,13 +37,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="test-data">
|
<section v-show="isEditing"
|
||||||
|
class="test-data"
|
||||||
|
>
|
||||||
<div class="c-sw-edit__ui__header">
|
<div class="c-sw-edit__ui__header">
|
||||||
<span class="c-disclosure-triangle is-enabled t-view-control-test-data c-disclosure-triangle--expanded"></span>
|
<span class="c-disclosure-triangle is-enabled t-view-control-test-data c-disclosure-triangle--expanded"></span>
|
||||||
<span class="c-sw-edit__ui__header-label">Test Data</span>
|
<span class="c-sw-edit__ui__header-label">Test Data</span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
|
||||||
<section class="conditions">
|
|
||||||
<div class="c-sw-edit__ui holder l-flex-accordion flex-elem grows widget-edit-holder expanded-widget-rules expanded-widget-test-data">
|
<div class="c-sw-edit__ui holder l-flex-accordion flex-elem grows widget-edit-holder expanded-widget-rules expanded-widget-test-data">
|
||||||
<div class="flex-accordion-holder t-widget-test-data-content w-widget-test-data-content">
|
<div class="flex-accordion-holder t-widget-test-data-content w-widget-test-data-content">
|
||||||
<div class="l-enable">
|
<div class="l-enable">
|
||||||
@ -60,6 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="holder add-rule-button-wrapper align-right">
|
<div class="holder add-rule-button-wrapper align-right">
|
||||||
<button
|
<button
|
||||||
|
v-show="isEditing"
|
||||||
id="addRule"
|
id="addRule"
|
||||||
class="c-button c-button--major add-test-condition icon-plus"
|
class="c-button c-button--major add-test-condition icon-plus"
|
||||||
>
|
>
|
||||||
@ -69,44 +70,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="c-sw-edit__ui__header">
|
|
||||||
<span class="c-disclosure-triangle c-disclosure-triangle--expanded is-enabled t-view-control-rules"></span>
|
|
||||||
<span class="c-sw-edit__ui__header-label">Conditions</span>
|
|
||||||
</div>
|
|
||||||
<div class="t-test-data-config">
|
|
||||||
<div id="ruleArea"
|
|
||||||
class="c-sw-editui__rules widget-rules"
|
|
||||||
>
|
|
||||||
<span>[data]</span>
|
|
||||||
</div>
|
|
||||||
<div class="holder add-rule-button-wrapper align-right">
|
|
||||||
<button
|
|
||||||
id="addRule"
|
|
||||||
class="c-button c-button--major add-rule-button icon-plus"
|
|
||||||
>
|
|
||||||
<span class="c-button__label">Add Rule</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
|
<Conditions :is-editing="isEditing" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Conditions from './Conditions.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
inject: ["openmct", "objectPath", "domainObject"],
|
||||||
|
components: {
|
||||||
|
Conditions
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
domainObject: {
|
isEditing: Boolean
|
||||||
type: Object,
|
}
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
internalDomainObject: this.domainObject
|
|
||||||
};
|
|
||||||
},
|
|
||||||
inject: ["openmct", "objectPath", "domainObject"]
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
46
src/plugins/conditionSet/components/Conditions.vue
Normal file
46
src/plugins/conditionSet/components/Conditions.vue
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<template>
|
||||||
|
<section id="conditions">
|
||||||
|
<div class="c-sw-edit__ui__header">
|
||||||
|
<span class="c-disclosure-triangle c-disclosure-triangle--expanded is-enabled t-view-control-conditons"></span>
|
||||||
|
<span class="c-sw-edit__ui__header-label">Conditions</span>
|
||||||
|
</div>
|
||||||
|
<div class="t-test-data-config">
|
||||||
|
<div id="conditionArea"
|
||||||
|
class="c-cs-editui__conditions widget-condition"
|
||||||
|
>
|
||||||
|
<Condition :is-editing="isEditing" />
|
||||||
|
<Condition :is-editing="isEditing" />
|
||||||
|
</div>
|
||||||
|
<div class="holder add-condition-button-wrapper align-right">
|
||||||
|
<button
|
||||||
|
v-show="isEditing"
|
||||||
|
id="addCondition"
|
||||||
|
class="c-button c-button--major add-condition-button icon-plus"
|
||||||
|
>
|
||||||
|
<span class="c-button__label">Add Condition</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Condition from '../../condition/components/Condition.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
inject: ['openmct'],
|
||||||
|
components: {
|
||||||
|
Condition
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
isEditing: Boolean
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
conditionData: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -23,7 +23,7 @@
|
|||||||
import { createOpenMct } from 'testTools';
|
import { createOpenMct } from 'testTools';
|
||||||
import ConditionSetPlugin from './plugin';
|
import ConditionSetPlugin from './plugin';
|
||||||
|
|
||||||
describe('The plugin', () => {
|
fdescribe('The plugin', () => {
|
||||||
let openmct;
|
let openmct;
|
||||||
let conditionSetDefinition;
|
let conditionSetDefinition;
|
||||||
let element;
|
let element;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user