Compare commits
120 Commits
remove-dep
...
vue3-compa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdfca3ac1a | ||
|
|
62db57b758 | ||
|
|
8d2068ff3b | ||
|
|
aa8f60f672 | ||
|
|
5095e87c2d | ||
|
|
c2749e4081 | ||
|
|
67fd649416 | ||
|
|
c8379538b7 | ||
|
|
826599ff57 | ||
|
|
75072e3c0d | ||
|
|
6a1b1dbb54 | ||
|
|
4fc8233c36 | ||
|
|
fe2ae0f89f | ||
|
|
8a6bbcae22 | ||
|
|
7b112365f3 | ||
|
|
53fb7d7c30 | ||
|
|
4f1a58b446 | ||
|
|
9d3709beb6 | ||
|
|
0185d5fc2a | ||
|
|
da63de2431 | ||
|
|
29a492cb51 | ||
|
|
637c2a5c35 | ||
|
|
eca17ae3f5 | ||
|
|
66738ebcde | ||
|
|
9447c609e6 | ||
|
|
8f11b0f1a2 | ||
|
|
12085d673a | ||
|
|
344993ae2f | ||
|
|
0b55361e54 | ||
|
|
fae18bd1cd | ||
|
|
888c3fda6a | ||
|
|
8c808d9bb8 | ||
|
|
4452b98097 | ||
|
|
c62a314015 | ||
|
|
08a3cd7ade | ||
|
|
a70859daf7 | ||
|
|
db2bdb878b | ||
|
|
d1f3c22d47 | ||
|
|
315b39a5ea | ||
|
|
fc9889630b | ||
|
|
3a9cc42107 | ||
|
|
6c49bbaf70 | ||
|
|
9eaaa8199a | ||
|
|
068ba69cde | ||
|
|
b2ff80f2c0 | ||
|
|
1f4408eb16 | ||
|
|
f269f33edd | ||
|
|
3a83f2a584 | ||
|
|
1e19485f6d | ||
|
|
dfb4b53cd3 | ||
|
|
a7ad89592a | ||
|
|
a5734e80f5 | ||
|
|
6ac980c500 | ||
|
|
810c67a27b | ||
|
|
09f58ef85c | ||
|
|
fd37d88ac4 | ||
|
|
23906c7649 | ||
|
|
7d53ffa30f | ||
|
|
a63c9457dd | ||
|
|
679fe76412 | ||
|
|
089a19c843 | ||
|
|
bb26169b88 | ||
|
|
7b9958e094 | ||
|
|
28917443cf | ||
|
|
7b4e4af2bd | ||
|
|
34111c98f7 | ||
|
|
d56ad6d286 | ||
|
|
ee454029b9 | ||
|
|
96af897cfd | ||
|
|
9489ee4fc4 | ||
|
|
93f3093d85 | ||
|
|
690fd4285a | ||
|
|
103ad6c995 | ||
|
|
ffaedc97ed | ||
|
|
88382797c3 | ||
|
|
4994433347 | ||
|
|
c1263c3823 | ||
|
|
70b3db0f84 | ||
|
|
f20aa8c6d9 | ||
|
|
7db0d5191d | ||
|
|
710fd2e1dc | ||
|
|
bb3a367f1d | ||
|
|
4bacbc03c1 | ||
|
|
fd6cb38596 | ||
|
|
41a540ab49 | ||
|
|
fa4bdbcdba | ||
|
|
fc170fd2fe | ||
|
|
eefd3ac322 | ||
|
|
3338e594f1 | ||
|
|
43f10befac | ||
|
|
c994d05c78 | ||
|
|
44cbbe9791 | ||
|
|
d8f0b6e3a8 | ||
|
|
45bd00bea6 | ||
|
|
120e907486 | ||
|
|
fd848972b4 | ||
|
|
ac1e1ef54c | ||
|
|
22796377c7 | ||
|
|
55ebfcdf7c | ||
|
|
68ac6b6fc2 | ||
|
|
59bde3151d | ||
|
|
90459c3d41 | ||
|
|
8cfa812241 | ||
|
|
609b3c2b1b | ||
|
|
12a0a6f7b2 | ||
|
|
5438711228 | ||
|
|
9f66843ed6 | ||
|
|
bc61b32930 | ||
|
|
8fce444885 | ||
|
|
41d280934e | ||
|
|
afce9344f4 | ||
|
|
432295606d | ||
|
|
5bdfa04eb4 | ||
|
|
e7d9e37fc7 | ||
|
|
2896520d37 | ||
|
|
6610793a8d | ||
|
|
e3dffc5c12 | ||
|
|
e323d4f441 | ||
|
|
3f7d071347 | ||
|
|
5169676eb0 |
@@ -28,6 +28,8 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
'vue/no-v-for-template-key': 'off',
|
||||||
|
'vue/no-v-for-template-key-on-child': 'error',
|
||||||
'prettier/prettier': 'error',
|
'prettier/prettier': 'error',
|
||||||
'you-dont-need-lodash-underscore/omit': 'off',
|
'you-dont-need-lodash-underscore/omit': 'off',
|
||||||
'you-dont-need-lodash-underscore/throttle': 'off',
|
'you-dont-need-lodash-underscore/throttle': 'off',
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ const config = {
|
|||||||
MCT: path.join(projectRootDir, 'src/MCT'),
|
MCT: path.join(projectRootDir, 'src/MCT'),
|
||||||
testUtils: path.join(projectRootDir, 'src/utils/testUtils.js'),
|
testUtils: path.join(projectRootDir, 'src/utils/testUtils.js'),
|
||||||
objectUtils: path.join(projectRootDir, 'src/api/objects/object-utils.js'),
|
objectUtils: path.join(projectRootDir, 'src/api/objects/object-utils.js'),
|
||||||
utils: path.join(projectRootDir, 'src/utils')
|
utils: path.join(projectRootDir, 'src/utils'),
|
||||||
|
vue: path.join(projectRootDir, 'node_modules/@vue/compat/dist/vue.esm-bundler.js'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
@@ -121,7 +122,15 @@ const config = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.vue$/,
|
test: /\.vue$/,
|
||||||
use: 'vue-loader'
|
loader: 'vue-loader',
|
||||||
|
options: {
|
||||||
|
compilerOptions: {
|
||||||
|
whitespace: 'preserve',
|
||||||
|
compatConfig: {
|
||||||
|
MODE: 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.html$/,
|
test: /\.html$/,
|
||||||
|
|||||||
@@ -25,11 +25,6 @@ module.exports = merge(common, {
|
|||||||
'**/.*' // dotfiles and dotfolders
|
'**/.*' // dotfiles and dotfolders
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
vue: path.join(projectRootDir, 'node_modules/vue/dist/vue.js')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
__OPENMCT_ROOT_RELATIVE__: '"dist/"'
|
__OPENMCT_ROOT_RELATIVE__: '"dist/"'
|
||||||
|
|||||||
@@ -13,11 +13,6 @@ const projectRootDir = path.resolve(__dirname, '..');
|
|||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
vue: path.join(projectRootDir, 'node_modules/vue/dist/vue.min.js')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
__OPENMCT_ROOT_RELATIVE__: '""'
|
__OPENMCT_ROOT_RELATIVE__: '""'
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ test.describe('Form Validation Behavior', () => {
|
|||||||
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
await page.goto('./', { waitUntil: 'domcontentloaded' });
|
||||||
|
|
||||||
await page.click('button:has-text("Create")');
|
await page.click('button:has-text("Create")');
|
||||||
await page.click(':nth-match(:text("Folder"), 2)');
|
await page.getByRole('menuitem', { name: ' Folder' }).click();
|
||||||
|
|
||||||
// Fill in empty string into title and trigger validation with 'Tab'
|
// Fill in empty string into title and trigger validation with 'Tab'
|
||||||
await page.click('text=Properties Title Notes >> input[type="text"]');
|
await page.click('text=Properties Title Notes >> input[type="text"]');
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function SimpleVuePlugin() {
|
|||||||
container.appendChild(vm.$mount().$el);
|
container.appendChild(vm.$mount().$el);
|
||||||
},
|
},
|
||||||
destroy: function (container) {
|
destroy: function (container) {
|
||||||
vm.$destroy();
|
//vm.$destroy();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,9 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body></body>
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
</body>
|
||||||
<script>
|
<script>
|
||||||
const THIRTY_SECONDS = 30 * 1000;
|
const THIRTY_SECONDS = 30 * 1000;
|
||||||
const ONE_MINUTE = THIRTY_SECONDS * 2;
|
const ONE_MINUTE = THIRTY_SECONDS * 2;
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
"@types/eventemitter3": "1.2.0",
|
"@types/eventemitter3": "1.2.0",
|
||||||
"@types/jasmine": "4.3.4",
|
"@types/jasmine": "4.3.4",
|
||||||
"@types/lodash": "4.14.192",
|
"@types/lodash": "4.14.192",
|
||||||
|
"@vue/compat": "^3.1.0",
|
||||||
|
"@vue/compiler-sfc": "^3.1.0",
|
||||||
"babel-loader": "9.1.0",
|
"babel-loader": "9.1.0",
|
||||||
"babel-plugin-istanbul": "6.1.1",
|
"babel-plugin-istanbul": "6.1.1",
|
||||||
"codecov": "3.8.3",
|
"codecov": "3.8.3",
|
||||||
@@ -22,8 +24,8 @@
|
|||||||
"d3-scale": "3.3.0",
|
"d3-scale": "3.3.0",
|
||||||
"d3-selection": "3.0.0",
|
"d3-selection": "3.0.0",
|
||||||
"eslint": "8.43.0",
|
"eslint": "8.43.0",
|
||||||
"eslint-plugin-compat": "4.1.4",
|
|
||||||
"eslint-config-prettier": "8.8.0",
|
"eslint-config-prettier": "8.8.0",
|
||||||
|
"eslint-plugin-compat": "4.1.4",
|
||||||
"eslint-plugin-playwright": "0.12.0",
|
"eslint-plugin-playwright": "0.12.0",
|
||||||
"eslint-plugin-prettier": "4.2.1",
|
"eslint-plugin-prettier": "4.2.1",
|
||||||
"eslint-plugin-vue": "9.15.0",
|
"eslint-plugin-vue": "9.15.0",
|
||||||
@@ -66,11 +68,10 @@
|
|||||||
"style-loader": "3.3.3",
|
"style-loader": "3.3.3",
|
||||||
"typescript": "5.1.3",
|
"typescript": "5.1.3",
|
||||||
"uuid": "9.0.0",
|
"uuid": "9.0.0",
|
||||||
"vue": "2.6.14",
|
"vue": "^3.1.0",
|
||||||
"vue-eslint-parser": "9.3.1",
|
"vue-eslint-parser": "9.3.1",
|
||||||
"vue-loader": "15.9.8",
|
|
||||||
"vue-template-compiler": "2.6.14",
|
|
||||||
"webpack": "5.88.0",
|
"webpack": "5.88.0",
|
||||||
|
"vue-loader": "^16.0.0",
|
||||||
"webpack-cli": "5.1.1",
|
"webpack-cli": "5.1.1",
|
||||||
"webpack-dev-server": "4.15.1",
|
"webpack-dev-server": "4.15.1",
|
||||||
"webpack-merge": "5.9.0"
|
"webpack-merge": "5.9.0"
|
||||||
|
|||||||
37
src/MCT.js
37
src/MCT.js
@@ -343,7 +343,17 @@ define([
|
|||||||
* @param {HTMLElement} [domElement] the DOM element in which to run
|
* @param {HTMLElement} [domElement] the DOM element in which to run
|
||||||
* MCT; if undefined, MCT will be run in the body of the document
|
* MCT; if undefined, MCT will be run in the body of the document
|
||||||
*/
|
*/
|
||||||
MCT.prototype.start = function (domElement = document.body, isHeadlessMode = false) {
|
MCT.prototype.start = function (
|
||||||
|
domElement = document.body.firstElementChild,
|
||||||
|
isHeadlessMode = false
|
||||||
|
) {
|
||||||
|
// Create element to mount Layout if it doesn't exist
|
||||||
|
if (domElement === null) {
|
||||||
|
domElement = document.createElement('div');
|
||||||
|
document.body.appendChild(domElement);
|
||||||
|
}
|
||||||
|
domElement.id = 'openmct-app';
|
||||||
|
|
||||||
if (this.types.get('layout') === undefined) {
|
if (this.types.get('layout') === undefined) {
|
||||||
this.install(
|
this.install(
|
||||||
this.plugins.DisplayLayout({
|
this.plugins.DisplayLayout({
|
||||||
@@ -370,25 +380,30 @@ define([
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!isHeadlessMode) {
|
if (!isHeadlessMode) {
|
||||||
const appLayout = new Vue({
|
const appLayout = Vue.createApp({
|
||||||
components: {
|
components: {
|
||||||
Layout: Layout.default
|
Layout: Layout.default
|
||||||
},
|
},
|
||||||
provide: {
|
provide: {
|
||||||
openmct: this
|
openmct: Vue.markRaw(this)
|
||||||
},
|
},
|
||||||
template: '<Layout ref="layout"></Layout>'
|
template: '<Layout ref="layout"></Layout>'
|
||||||
});
|
});
|
||||||
domElement.appendChild(appLayout.$mount().$el);
|
const component = appLayout.mount(domElement);
|
||||||
|
component.$nextTick(() => {
|
||||||
|
this.layout = component.$refs.layout;
|
||||||
|
this.app = appLayout;
|
||||||
|
Browse(this);
|
||||||
|
window.addEventListener('beforeunload', this.destroy);
|
||||||
|
this.router.start();
|
||||||
|
this.emit('start');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
window.addEventListener('beforeunload', this.destroy);
|
||||||
|
|
||||||
this.layout = appLayout.$refs.layout;
|
this.router.start();
|
||||||
Browse(this);
|
this.emit('start');
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('beforeunload', this.destroy);
|
|
||||||
|
|
||||||
this.router.start();
|
|
||||||
this.emit('start');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MCT.prototype.startHeadless = function () {
|
MCT.prototype.startHeadless = function () {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
import objectUtils from '../objects/object-utils';
|
import objectUtils from '../objects/object-utils';
|
||||||
import CompositionProvider from './CompositionProvider';
|
import CompositionProvider from './CompositionProvider';
|
||||||
|
import { toRaw } from 'vue';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('../objects/ObjectAPI').DomainObject} DomainObject
|
* @typedef {import('../objects/ObjectAPI').DomainObject} DomainObject
|
||||||
@@ -167,7 +168,7 @@ export default class DefaultCompositionProvider extends CompositionProvider {
|
|||||||
*/
|
*/
|
||||||
add(parent, childId) {
|
add(parent, childId) {
|
||||||
if (!this.includes(parent, childId)) {
|
if (!this.includes(parent, childId)) {
|
||||||
const composition = structuredClone(parent.composition);
|
const composition = structuredClone(toRaw(parent.composition));
|
||||||
composition.push(childId);
|
composition.push(childId);
|
||||||
this.publicAPI.objects.mutate(parent, 'composition', composition);
|
this.publicAPI.objects.mutate(parent, 'composition', composition);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ import TextAreaField from './components/controls/TextAreaField.vue';
|
|||||||
import TextField from './components/controls/TextField.vue';
|
import TextField from './components/controls/TextField.vue';
|
||||||
import ToggleSwitchField from './components/controls/ToggleSwitchField.vue';
|
import ToggleSwitchField from './components/controls/ToggleSwitchField.vue';
|
||||||
|
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export const DEFAULT_CONTROLS_MAP = {
|
export const DEFAULT_CONTROLS_MAP = {
|
||||||
autocomplete: AutoCompleteField,
|
autocomplete: AutoCompleteField,
|
||||||
checkbox: CheckBoxField,
|
checkbox: CheckBoxField,
|
||||||
@@ -69,31 +68,40 @@ export default class FormControl {
|
|||||||
*/
|
*/
|
||||||
_getControlViewProvider(control) {
|
_getControlViewProvider(control) {
|
||||||
const self = this;
|
const self = this;
|
||||||
let rowComponent;
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show(element, model, onChange) {
|
show(element, model, onChange) {
|
||||||
rowComponent = new Vue({
|
const { vNode, destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
FormControlComponent: DEFAULT_CONTROLS_MAP[control]
|
components: {
|
||||||
|
FormControlComponent: DEFAULT_CONTROLS_MAP[control]
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct: self.openmct
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
model,
|
||||||
|
onChange
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template: `<FormControlComponent :model="model" @onChange="onChange"></FormControlComponent>`
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct: self.openmct
|
element,
|
||||||
},
|
app: self.openmct.app
|
||||||
data() {
|
}
|
||||||
return {
|
);
|
||||||
model,
|
_destroy = destroy;
|
||||||
onChange
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template: `<FormControlComponent :model="model" @onChange="onChange"></FormControlComponent>`
|
|
||||||
});
|
|
||||||
|
|
||||||
return rowComponent;
|
return vNode;
|
||||||
},
|
},
|
||||||
destroy() {
|
destroy() {
|
||||||
rowComponent.$destroy();
|
if (_destroy) {
|
||||||
|
_destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
import FormController from './FormController';
|
import FormController from './FormController';
|
||||||
import FormProperties from './components/FormProperties.vue';
|
import FormProperties from './components/FormProperties.vue';
|
||||||
|
|
||||||
import Vue from 'vue';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default class FormsAPI {
|
export default class FormsAPI {
|
||||||
constructor(openmct) {
|
constructor(openmct) {
|
||||||
@@ -156,25 +156,28 @@ export default class FormsAPI {
|
|||||||
formCancel = onFormAction(reject);
|
formCancel = onFormAction(reject);
|
||||||
});
|
});
|
||||||
|
|
||||||
const vm = new Vue({
|
const { destroy } = mount(
|
||||||
components: { FormProperties },
|
{
|
||||||
provide: {
|
components: { FormProperties },
|
||||||
openmct: self.openmct
|
provide: {
|
||||||
|
openmct: self.openmct
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formStructure,
|
||||||
|
onChange: onFormPropertyChange,
|
||||||
|
onCancel: formCancel,
|
||||||
|
onSave: formSave
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template:
|
||||||
|
'<FormProperties :model="formStructure" @onChange="onChange" @onCancel="onCancel" @onSave="onSave"></FormProperties>'
|
||||||
},
|
},
|
||||||
data() {
|
{
|
||||||
return {
|
element,
|
||||||
formStructure,
|
app: self.openmct.app
|
||||||
onChange: onFormPropertyChange,
|
}
|
||||||
onCancel: formCancel,
|
);
|
||||||
onSave: formSave
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template:
|
|
||||||
'<FormProperties :model="formStructure" @onChange="onChange" @onCancel="onCancel" @onSave="onSave"></FormProperties>'
|
|
||||||
}).$mount();
|
|
||||||
|
|
||||||
const formElement = vm.$el;
|
|
||||||
element.append(formElement);
|
|
||||||
|
|
||||||
function onFormPropertyChange(data) {
|
function onFormPropertyChange(data) {
|
||||||
if (onChange) {
|
if (onChange) {
|
||||||
@@ -195,8 +198,7 @@ export default class FormsAPI {
|
|||||||
|
|
||||||
function onFormAction(callback) {
|
function onFormAction(callback) {
|
||||||
return () => {
|
return () => {
|
||||||
formElement.remove();
|
destroy();
|
||||||
vm.$destroy();
|
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(changes);
|
callback(changes);
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onChange(data) {
|
onChange(data) {
|
||||||
this.$set(this.invalidProperties, data.model.key, data.invalid);
|
this.invalidProperties[data.model.key] = data.invalid;
|
||||||
|
|
||||||
this.$emit('onChange', data);
|
this.$emit('onChange', data);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,9 +26,7 @@
|
|||||||
{{ row.name }}
|
{{ row.name }}
|
||||||
</div>
|
</div>
|
||||||
<div class="c-form-row__state-indicator" :class="reqClass"></div>
|
<div class="c-form-row__state-indicator" :class="reqClass"></div>
|
||||||
<div v-if="row.control" class="c-form-row__controls">
|
<div v-if="row.control" ref="rowElement" class="c-form-row__controls"></div>
|
||||||
<div ref="rowElement"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -91,7 +89,7 @@ export default {
|
|||||||
|
|
||||||
this.formControl.show(this.$refs.rowElement, this.row, this.onChange);
|
this.formControl.show(this.$refs.rowElement, this.row, this.onChange);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
const destroy = this.formControl.destroy;
|
const destroy = this.formControl.destroy;
|
||||||
if (destroy) {
|
if (destroy) {
|
||||||
destroy();
|
destroy();
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ export default {
|
|||||||
this.options = this.model.options;
|
this.options = this.model.options;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
document.body.removeEventListener('click', this.handleOutsideClick);
|
document.body.removeEventListener('click', this.handleOutsideClick);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -20,17 +20,17 @@
|
|||||||
at runtime from the About dialog for additional information.
|
at runtime from the About dialog for additional information.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="c-menu" :class="options.menuClass">
|
<div class="c-menu" :class="options.menuClass" :style="styleObject">
|
||||||
<ul v-if="options.actions.length && options.actions[0].length" role="menu">
|
<ul v-if="options.actions.length && options.actions[0].length" role="menu">
|
||||||
<template v-for="(actionGroups, index) in options.actions">
|
<template v-for="(actionGroups, index) in options.actions" :key="index">
|
||||||
<div :key="index" role="group">
|
<div role="group">
|
||||||
<li
|
<li
|
||||||
v-for="action in actionGroups"
|
v-for="action in actionGroups"
|
||||||
:key="action.name"
|
:key="action.name"
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
:class="[action.cssClass, action.isDisabled ? 'disabled' : '']"
|
:class="[action.cssClass, action.isDisabled ? 'disabled' : '']"
|
||||||
:title="action.description"
|
:title="action.description"
|
||||||
:data-testid="action.testId || false"
|
:data-testid="action.testId || null"
|
||||||
@click="action.onItemClicked"
|
@click="action.onItemClicked"
|
||||||
>
|
>
|
||||||
{{ action.name }}
|
{{ action.name }}
|
||||||
@@ -42,8 +42,8 @@
|
|||||||
class="c-menu__section-separator"
|
class="c-menu__section-separator"
|
||||||
></div>
|
></div>
|
||||||
<li v-if="actionGroups.length === 0" :key="index">No actions defined.</li>
|
<li v-if="actionGroups.length === 0" :key="index">No actions defined.</li>
|
||||||
</div></template
|
</div>
|
||||||
>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul v-else role="menu">
|
<ul v-else role="menu">
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
role="menuitem"
|
role="menuitem"
|
||||||
:class="[action.cssClass, action.isDisabled ? 'disabled' : '']"
|
:class="[action.cssClass, action.isDisabled ? 'disabled' : '']"
|
||||||
:title="action.description"
|
:title="action.description"
|
||||||
:data-testid="action.testId || false"
|
:data-testid="action.testId || null"
|
||||||
@click="action.onItemClicked"
|
@click="action.onItemClicked"
|
||||||
>
|
>
|
||||||
{{ action.name }}
|
{{ action.name }}
|
||||||
@@ -64,7 +64,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import popupMenuMixin from '../mixins/popupMenuMixin';
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [popupMenuMixin],
|
||||||
inject: ['options']
|
inject: ['options']
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -20,21 +20,21 @@
|
|||||||
at runtime from the About dialog for additional information.
|
at runtime from the About dialog for additional information.
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="c-menu" :class="[options.menuClass, 'c-super-menu']">
|
<div class="c-menu" :class="[options.menuClass, 'c-super-menu']" :style="styleObject">
|
||||||
<ul
|
<ul
|
||||||
v-if="options.actions.length && options.actions[0].length"
|
v-if="options.actions.length && options.actions[0].length"
|
||||||
role="menu"
|
role="menu"
|
||||||
class="c-super-menu__menu"
|
class="c-super-menu__menu"
|
||||||
>
|
>
|
||||||
<template v-for="(actionGroups, index) in options.actions">
|
<template v-for="(actionGroups, index) in options.actions" :key="index">
|
||||||
<div :key="index" role="group">
|
<div role="group">
|
||||||
<li
|
<li
|
||||||
v-for="action in actionGroups"
|
v-for="action in actionGroups"
|
||||||
:key="action.name"
|
:key="action.name"
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
:class="[action.cssClass, action.isDisabled ? 'disabled' : '']"
|
:class="[action.cssClass, action.isDisabled ? 'disabled' : '']"
|
||||||
:title="action.description"
|
:title="action.description"
|
||||||
:data-testid="action.testId || false"
|
:data-testid="action.testId || null"
|
||||||
@click="action.onItemClicked"
|
@click="action.onItemClicked"
|
||||||
@mouseover="toggleItemDescription(action)"
|
@mouseover="toggleItemDescription(action)"
|
||||||
@mouseleave="toggleItemDescription()"
|
@mouseleave="toggleItemDescription()"
|
||||||
@@ -58,7 +58,8 @@
|
|||||||
:key="action.name"
|
:key="action.name"
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
:class="action.cssClass"
|
:class="action.cssClass"
|
||||||
:data-testid="action.testId || false"
|
:title="action.description"
|
||||||
|
:data-testid="action.testId || null"
|
||||||
@click="action.onItemClicked"
|
@click="action.onItemClicked"
|
||||||
@mouseover="toggleItemDescription(action)"
|
@mouseover="toggleItemDescription(action)"
|
||||||
@mouseleave="toggleItemDescription()"
|
@mouseleave="toggleItemDescription()"
|
||||||
@@ -79,9 +80,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import popupMenuMixin from '../mixins/popupMenuMixin';
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [popupMenuMixin],
|
||||||
inject: ['options'],
|
inject: ['options'],
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
import EventEmitter from 'EventEmitter';
|
import EventEmitter from 'EventEmitter';
|
||||||
import MenuComponent from './components/Menu.vue';
|
import MenuComponent from './components/Menu.vue';
|
||||||
import SuperMenuComponent from './components/SuperMenu.vue';
|
import SuperMenuComponent from './components/SuperMenu.vue';
|
||||||
import Vue from 'vue';
|
import { h } from 'vue';
|
||||||
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export const MENU_PLACEMENT = {
|
export const MENU_PLACEMENT = {
|
||||||
TOP: 'top',
|
TOP: 'top',
|
||||||
@@ -52,137 +53,67 @@ class Menu extends EventEmitter {
|
|||||||
|
|
||||||
dismiss() {
|
dismiss() {
|
||||||
this.emit('destroy');
|
this.emit('destroy');
|
||||||
document.body.removeChild(this.component.$el);
|
if (this.destroy) {
|
||||||
|
this.destroy();
|
||||||
|
this.destroy = null;
|
||||||
|
}
|
||||||
document.removeEventListener('click', this.dismiss);
|
document.removeEventListener('click', this.dismiss);
|
||||||
this.component.$destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
show() {
|
|
||||||
this.component.$mount();
|
|
||||||
document.body.appendChild(this.component.$el);
|
|
||||||
|
|
||||||
let position = this._calculatePopupPosition(this.component.$el);
|
|
||||||
|
|
||||||
this.component.$el.style.left = `${position.x}px`;
|
|
||||||
this.component.$el.style.top = `${position.y}px`;
|
|
||||||
|
|
||||||
document.addEventListener('click', this.dismiss);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showMenu() {
|
showMenu() {
|
||||||
this.component = new Vue({
|
if (this.destroy) {
|
||||||
components: {
|
return;
|
||||||
MenuComponent
|
}
|
||||||
|
const { vNode, destroy } = mount({
|
||||||
|
render() {
|
||||||
|
return h(MenuComponent);
|
||||||
},
|
},
|
||||||
provide: {
|
provide: {
|
||||||
options: this.options
|
options: this.options
|
||||||
},
|
},
|
||||||
template: '<menu-component />'
|
// TODO: Remove this exception upon full migration to Vue 3
|
||||||
|
// https://v3-migration.vuejs.org/breaking-changes/render-function-api.html#render-function-argument
|
||||||
|
compatConfig: {
|
||||||
|
RENDER_FUNCTION: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.el = vNode.el;
|
||||||
|
this.destroy = destroy;
|
||||||
|
|
||||||
this.show();
|
this.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
showSuperMenu() {
|
showSuperMenu() {
|
||||||
this.component = new Vue({
|
const { vNode, destroy } = mount({
|
||||||
components: {
|
data() {
|
||||||
SuperMenuComponent
|
return {
|
||||||
|
top: '0px',
|
||||||
|
left: '0px'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
render() {
|
||||||
|
return h(SuperMenuComponent);
|
||||||
},
|
},
|
||||||
provide: {
|
provide: {
|
||||||
options: this.options
|
options: this.options
|
||||||
},
|
},
|
||||||
template: '<super-menu-component />'
|
// TODO: Remove this exception upon full migration to Vue 3
|
||||||
|
// https://v3-migration.vuejs.org/breaking-changes/render-function-api.html#render-function-argument
|
||||||
|
compatConfig: {
|
||||||
|
RENDER_FUNCTION: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.el = vNode.el;
|
||||||
|
this.destroy = destroy;
|
||||||
|
|
||||||
this.show();
|
this.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
show() {
|
||||||
* @private
|
document.body.appendChild(this.el);
|
||||||
*/
|
document.addEventListener('click', this.dismiss);
|
||||||
_calculatePopupPosition(menuElement) {
|
|
||||||
let menuDimensions = menuElement.getBoundingClientRect();
|
|
||||||
|
|
||||||
if (!this.options.placement) {
|
|
||||||
this.options.placement = MENU_PLACEMENT.BOTTOM_RIGHT;
|
|
||||||
}
|
|
||||||
|
|
||||||
const menuPosition = this._getMenuPositionBasedOnPlacement(menuDimensions);
|
|
||||||
|
|
||||||
return this._preventMenuOverflow(menuPosition, menuDimensions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
_getMenuPositionBasedOnPlacement(menuDimensions) {
|
|
||||||
let eventPosX = this.options.x;
|
|
||||||
let eventPosY = this.options.y;
|
|
||||||
|
|
||||||
// Adjust popup menu based on placement
|
|
||||||
switch (this.options.placement) {
|
|
||||||
case MENU_PLACEMENT.TOP:
|
|
||||||
eventPosX = this.options.x - Math.floor(menuDimensions.width / 2);
|
|
||||||
eventPosY = this.options.y - menuDimensions.height;
|
|
||||||
break;
|
|
||||||
case MENU_PLACEMENT.BOTTOM:
|
|
||||||
eventPosX = this.options.x - Math.floor(menuDimensions.width / 2);
|
|
||||||
break;
|
|
||||||
case MENU_PLACEMENT.LEFT:
|
|
||||||
eventPosX = this.options.x - menuDimensions.width;
|
|
||||||
eventPosY = this.options.y - Math.floor(menuDimensions.height / 2);
|
|
||||||
break;
|
|
||||||
case MENU_PLACEMENT.RIGHT:
|
|
||||||
eventPosY = this.options.y - Math.floor(menuDimensions.height / 2);
|
|
||||||
break;
|
|
||||||
case MENU_PLACEMENT.TOP_LEFT:
|
|
||||||
eventPosX = this.options.x - menuDimensions.width;
|
|
||||||
eventPosY = this.options.y - menuDimensions.height;
|
|
||||||
break;
|
|
||||||
case MENU_PLACEMENT.TOP_RIGHT:
|
|
||||||
eventPosY = this.options.y - menuDimensions.height;
|
|
||||||
break;
|
|
||||||
case MENU_PLACEMENT.BOTTOM_LEFT:
|
|
||||||
eventPosX = this.options.x - menuDimensions.width;
|
|
||||||
break;
|
|
||||||
case MENU_PLACEMENT.BOTTOM_RIGHT:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
x: eventPosX,
|
|
||||||
y: eventPosY
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
_preventMenuOverflow(menuPosition, menuDimensions) {
|
|
||||||
let { x: eventPosX, y: eventPosY } = menuPosition;
|
|
||||||
let overflowX = eventPosX + menuDimensions.width - document.body.clientWidth;
|
|
||||||
let overflowY = eventPosY + menuDimensions.height - document.body.clientHeight;
|
|
||||||
|
|
||||||
if (overflowX > 0) {
|
|
||||||
eventPosX = eventPosX - overflowX;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (overflowY > 0) {
|
|
||||||
eventPosY = eventPosY - overflowY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (eventPosX < 0) {
|
|
||||||
eventPosX = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (eventPosY < 0) {
|
|
||||||
eventPosY = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
x: eventPosX,
|
|
||||||
y: eventPosY
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
111
src/api/menu/mixins/popupMenuMixin.js
Normal file
111
src/api/menu/mixins/popupMenuMixin.js
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
import { MENU_PLACEMENT } from '../menu';
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_calculatePopupPosition(menuElement) {
|
||||||
|
let menuDimensions = menuElement.getBoundingClientRect();
|
||||||
|
|
||||||
|
if (!this.options.placement) {
|
||||||
|
this.options.placement = MENU_PLACEMENT.BOTTOM_RIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
const menuPosition = this._getMenuPositionBasedOnPlacement(menuDimensions);
|
||||||
|
|
||||||
|
return this._preventMenuOverflow(menuPosition, menuDimensions);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_getMenuPositionBasedOnPlacement(menuDimensions) {
|
||||||
|
let eventPosX = this.options.x;
|
||||||
|
let eventPosY = this.options.y;
|
||||||
|
|
||||||
|
// Adjust popup menu based on placement
|
||||||
|
switch (this.options.placement) {
|
||||||
|
case MENU_PLACEMENT.TOP:
|
||||||
|
eventPosX = this.options.x - Math.floor(menuDimensions.width / 2);
|
||||||
|
eventPosY = this.options.y - menuDimensions.height;
|
||||||
|
break;
|
||||||
|
case MENU_PLACEMENT.BOTTOM:
|
||||||
|
eventPosX = this.options.x - Math.floor(menuDimensions.width / 2);
|
||||||
|
break;
|
||||||
|
case MENU_PLACEMENT.LEFT:
|
||||||
|
eventPosX = this.options.x - menuDimensions.width;
|
||||||
|
eventPosY = this.options.y - Math.floor(menuDimensions.height / 2);
|
||||||
|
break;
|
||||||
|
case MENU_PLACEMENT.RIGHT:
|
||||||
|
eventPosY = this.options.y - Math.floor(menuDimensions.height / 2);
|
||||||
|
break;
|
||||||
|
case MENU_PLACEMENT.TOP_LEFT:
|
||||||
|
eventPosX = this.options.x - menuDimensions.width;
|
||||||
|
eventPosY = this.options.y - menuDimensions.height;
|
||||||
|
break;
|
||||||
|
case MENU_PLACEMENT.TOP_RIGHT:
|
||||||
|
eventPosY = this.options.y - menuDimensions.height;
|
||||||
|
break;
|
||||||
|
case MENU_PLACEMENT.BOTTOM_LEFT:
|
||||||
|
eventPosX = this.options.x - menuDimensions.width;
|
||||||
|
break;
|
||||||
|
case MENU_PLACEMENT.BOTTOM_RIGHT:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
x: eventPosX,
|
||||||
|
y: eventPosY
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_preventMenuOverflow(menuPosition, menuDimensions) {
|
||||||
|
let { x: eventPosX, y: eventPosY } = menuPosition;
|
||||||
|
let overflowX = eventPosX + menuDimensions.width - document.body.clientWidth;
|
||||||
|
let overflowY = eventPosY + menuDimensions.height - document.body.clientHeight;
|
||||||
|
|
||||||
|
if (overflowX > 0) {
|
||||||
|
eventPosX = eventPosX - overflowX;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (overflowY > 0) {
|
||||||
|
eventPosY = eventPosY - overflowY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eventPosX < 0) {
|
||||||
|
eventPosX = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eventPosY < 0) {
|
||||||
|
eventPosY = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
x: eventPosX,
|
||||||
|
y: eventPosY
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const position = this._calculatePopupPosition(this.$el);
|
||||||
|
this.top = position.y;
|
||||||
|
this.left = position.x;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
top: '0px',
|
||||||
|
left: '0px'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
styleObject() {
|
||||||
|
return {
|
||||||
|
top: `${this.top}px`,
|
||||||
|
left: `${this.left}px`
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -159,6 +159,9 @@ class InMemorySearchProvider {
|
|||||||
return pendingQuery.promise;
|
return pendingQuery.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
#localQueryFallBack({ queryId, searchType, query, maxResults }) {
|
#localQueryFallBack({ queryId, searchType, query, maxResults }) {
|
||||||
if (searchType === this.searchTypes.OBJECTS) {
|
if (searchType === this.searchTypes.OBJECTS) {
|
||||||
return this.localSearchForObjects(queryId, query, maxResults);
|
return this.localSearchForObjects(queryId, query, maxResults);
|
||||||
|
|||||||
@@ -96,12 +96,26 @@ class MutableDomainObject {
|
|||||||
//Emit events specific to properties affected
|
//Emit events specific to properties affected
|
||||||
let parentPropertiesList = path.split('.');
|
let parentPropertiesList = path.split('.');
|
||||||
for (let index = parentPropertiesList.length; index > 0; index--) {
|
for (let index = parentPropertiesList.length; index > 0; index--) {
|
||||||
|
let pathToThisProperty = parentPropertiesList.slice(0, index);
|
||||||
let parentPropertyPath = parentPropertiesList.slice(0, index).join('.');
|
let parentPropertyPath = parentPropertiesList.slice(0, index).join('.');
|
||||||
this._globalEventEmitter.emit(
|
this._globalEventEmitter.emit(
|
||||||
qualifiedEventName(this, parentPropertyPath),
|
qualifiedEventName(this, parentPropertyPath),
|
||||||
_.get(this, parentPropertyPath),
|
_.get(this, parentPropertyPath),
|
||||||
_.get(oldModel, parentPropertyPath)
|
_.get(oldModel, parentPropertyPath)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const lastPathElement = parentPropertiesList[index - 1];
|
||||||
|
// Also emit an event for the array whose element has changed so developers do not need to listen to every element of the array.
|
||||||
|
if (lastPathElement.endsWith(']')) {
|
||||||
|
const arrayPathElement = lastPathElement.substring(0, lastPathElement.lastIndexOf('['));
|
||||||
|
pathToThisProperty[index - 1] = arrayPathElement;
|
||||||
|
const pathToArrayString = pathToThisProperty.join('.');
|
||||||
|
this._globalEventEmitter.emit(
|
||||||
|
qualifiedEventName(this, pathToArrayString),
|
||||||
|
_.get(this, pathToArrayString),
|
||||||
|
_.get(oldModel, pathToArrayString)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Emit events for listeners of child properties when parent changes.
|
//TODO: Emit events for listeners of child properties when parent changes.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import DialogComponent from './components/DialogComponent.vue';
|
import DialogComponent from './components/DialogComponent.vue';
|
||||||
import Overlay from './Overlay';
|
import Overlay from './Overlay';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
class Dialog extends Overlay {
|
class Dialog extends Overlay {
|
||||||
constructor({ iconClass, message, title, hint, timestamp, ...options }) {
|
constructor({ iconClass, message, title, hint, timestamp, ...options }) {
|
||||||
let component = new Vue({
|
const { vNode, destroy } = mount({
|
||||||
components: {
|
components: {
|
||||||
DialogComponent: DialogComponent
|
DialogComponent: DialogComponent
|
||||||
},
|
},
|
||||||
@@ -16,17 +16,17 @@ class Dialog extends Overlay {
|
|||||||
timestamp
|
timestamp
|
||||||
},
|
},
|
||||||
template: '<dialog-component></dialog-component>'
|
template: '<dialog-component></dialog-component>'
|
||||||
}).$mount();
|
});
|
||||||
|
|
||||||
super({
|
super({
|
||||||
element: component.$el,
|
element: vNode.el,
|
||||||
size: 'fit',
|
size: 'fit',
|
||||||
dismissable: false,
|
dismissable: false,
|
||||||
...options
|
...options
|
||||||
});
|
});
|
||||||
|
|
||||||
this.once('destroy', () => {
|
this.once('destroy', () => {
|
||||||
component.$destroy();
|
destroy();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import OverlayComponent from './components/OverlayComponent.vue';
|
import OverlayComponent from './components/OverlayComponent.vue';
|
||||||
import EventEmitter from 'EventEmitter';
|
import EventEmitter from 'EventEmitter';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
const cssClasses = {
|
const cssClasses = {
|
||||||
large: 'l-overlay-large',
|
large: 'l-overlay-large',
|
||||||
@@ -28,18 +28,25 @@ class Overlay extends EventEmitter {
|
|||||||
this.autoHide = autoHide;
|
this.autoHide = autoHide;
|
||||||
this.dismissable = dismissable !== false;
|
this.dismissable = dismissable !== false;
|
||||||
|
|
||||||
this.component = new Vue({
|
const { destroy } = mount(
|
||||||
components: {
|
{
|
||||||
OverlayComponent: OverlayComponent
|
components: {
|
||||||
|
OverlayComponent: OverlayComponent
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
dismiss: this.notifyAndDismiss.bind(this),
|
||||||
|
element,
|
||||||
|
buttons,
|
||||||
|
dismissable: this.dismissable
|
||||||
|
},
|
||||||
|
template: '<overlay-component></overlay-component>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
dismiss: this.notifyAndDismiss.bind(this),
|
element: this.container
|
||||||
element,
|
}
|
||||||
buttons,
|
);
|
||||||
dismissable: this.dismissable
|
|
||||||
},
|
this.destroy = destroy;
|
||||||
template: '<overlay-component></overlay-component>'
|
|
||||||
});
|
|
||||||
|
|
||||||
if (onDestroy) {
|
if (onDestroy) {
|
||||||
this.once('destroy', onDestroy);
|
this.once('destroy', onDestroy);
|
||||||
@@ -53,7 +60,7 @@ class Overlay extends EventEmitter {
|
|||||||
dismiss() {
|
dismiss() {
|
||||||
this.emit('destroy');
|
this.emit('destroy');
|
||||||
document.body.removeChild(this.container);
|
document.body.removeChild(this.container);
|
||||||
this.component.$destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ensures that any callers are notified that the overlay is dismissed
|
//Ensures that any callers are notified that the overlay is dismissed
|
||||||
@@ -67,7 +74,6 @@ class Overlay extends EventEmitter {
|
|||||||
**/
|
**/
|
||||||
show() {
|
show() {
|
||||||
document.body.appendChild(this.container);
|
document.body.appendChild(this.container);
|
||||||
this.container.appendChild(this.component.$mount().$el);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import ProgressDialogComponent from './components/ProgressDialogComponent.vue';
|
import ProgressDialogComponent from './components/ProgressDialogComponent.vue';
|
||||||
import Overlay from './Overlay';
|
import Overlay from './Overlay';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
let component;
|
let component;
|
||||||
|
|
||||||
class ProgressDialog extends Overlay {
|
class ProgressDialog extends Overlay {
|
||||||
constructor({
|
constructor({
|
||||||
progressPerc,
|
progressPerc,
|
||||||
@@ -15,7 +14,7 @@ class ProgressDialog extends Overlay {
|
|||||||
timestamp,
|
timestamp,
|
||||||
...options
|
...options
|
||||||
}) {
|
}) {
|
||||||
component = new Vue({
|
const { vNode, destroy } = mount({
|
||||||
components: {
|
components: {
|
||||||
ProgressDialogComponent: ProgressDialogComponent
|
ProgressDialogComponent: ProgressDialogComponent
|
||||||
},
|
},
|
||||||
@@ -35,17 +34,18 @@ class ProgressDialog extends Overlay {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
template: '<progress-dialog-component :model="model"></progress-dialog-component>'
|
template: '<progress-dialog-component :model="model"></progress-dialog-component>'
|
||||||
}).$mount();
|
});
|
||||||
|
component = vNode.componentInstance;
|
||||||
|
|
||||||
super({
|
super({
|
||||||
element: component.$el,
|
element: vNode.el,
|
||||||
size: 'fit',
|
size: 'fit',
|
||||||
dismissable: false,
|
dismissable: false,
|
||||||
...options
|
...options
|
||||||
});
|
});
|
||||||
|
|
||||||
this.once('destroy', () => {
|
this.once('destroy', () => {
|
||||||
component.$destroy();
|
destroy();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import SelectionComponent from './components/SelectionComponent.vue';
|
import SelectionComponent from './components/SelectionComponent.vue';
|
||||||
import Overlay from './Overlay';
|
import Overlay from './Overlay';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
class Selection extends Overlay {
|
class Selection extends Overlay {
|
||||||
constructor({
|
constructor({
|
||||||
@@ -34,7 +34,7 @@ class Selection extends Overlay {
|
|||||||
currentSelection,
|
currentSelection,
|
||||||
...options
|
...options
|
||||||
}) {
|
}) {
|
||||||
let component = new Vue({
|
const { vNode, destroy } = mount({
|
||||||
components: {
|
components: {
|
||||||
SelectionComponent: SelectionComponent
|
SelectionComponent: SelectionComponent
|
||||||
},
|
},
|
||||||
@@ -47,7 +47,9 @@ class Selection extends Overlay {
|
|||||||
currentSelection
|
currentSelection
|
||||||
},
|
},
|
||||||
template: '<selection-component></selection-component>'
|
template: '<selection-component></selection-component>'
|
||||||
}).$mount();
|
});
|
||||||
|
|
||||||
|
const component = vNode.componentInstance;
|
||||||
|
|
||||||
super({
|
super({
|
||||||
element: component.$el,
|
element: component.$el,
|
||||||
@@ -59,7 +61,7 @@ class Selection extends Overlay {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.once('destroy', () => {
|
this.once('destroy', () => {
|
||||||
component.$destroy();
|
destroy();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import TooltipComponent from './components/TooltipComponent.vue';
|
import TooltipComponent from './components/TooltipComponent.vue';
|
||||||
import EventEmitter from 'EventEmitter';
|
import EventEmitter from 'EventEmitter';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
class Tooltip extends EventEmitter {
|
class Tooltip extends EventEmitter {
|
||||||
constructor(
|
constructor(
|
||||||
@@ -34,9 +34,7 @@ class Tooltip extends EventEmitter {
|
|||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.container = document.createElement('div');
|
const { vNode, destroy } = mount({
|
||||||
|
|
||||||
this.component = new Vue({
|
|
||||||
components: {
|
components: {
|
||||||
TooltipComponent: TooltipComponent
|
TooltipComponent: TooltipComponent
|
||||||
},
|
},
|
||||||
@@ -48,6 +46,9 @@ class Tooltip extends EventEmitter {
|
|||||||
template: '<tooltip-component toolTipText="toolTipText"></tooltip-component>'
|
template: '<tooltip-component toolTipText="toolTipText"></tooltip-component>'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.component = vNode.componentInstance;
|
||||||
|
this._destroy = destroy;
|
||||||
|
|
||||||
this.isActive = null;
|
this.isActive = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,8 +56,7 @@ class Tooltip extends EventEmitter {
|
|||||||
if (!this.isActive) {
|
if (!this.isActive) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
document.body.removeChild(this.container);
|
this._destroy();
|
||||||
this.component.$destroy();
|
|
||||||
this.isActive = false;
|
this.isActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +64,7 @@ class Tooltip extends EventEmitter {
|
|||||||
* @private
|
* @private
|
||||||
**/
|
**/
|
||||||
show() {
|
show() {
|
||||||
document.body.appendChild(this.container);
|
document.body.appendChild(this.component.$el);
|
||||||
this.container.appendChild(this.component.$mount().$el);
|
|
||||||
this.isActive = true;
|
this.isActive = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
.c-tooltip-wrapper {
|
.c-tooltip-wrapper {
|
||||||
max-width: 200px;
|
max-width: 200px;
|
||||||
|
height: auto;
|
||||||
|
width: auto;
|
||||||
padding: $interiorMargin;
|
padding: $interiorMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,13 +21,16 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
import EventEmitter from 'EventEmitter';
|
import EventEmitter from 'EventEmitter';
|
||||||
|
import { markRaw } from 'vue';
|
||||||
export default class LADTableConfiguration extends EventEmitter {
|
export default class LADTableConfiguration extends EventEmitter {
|
||||||
constructor(domainObject, openmct) {
|
constructor(domainObject, openmct) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
this.openmct = openmct;
|
|
||||||
|
// Prevent Vue from making this a Proxy, otherwise
|
||||||
|
// it cannot access any private methods (like #mutate()).
|
||||||
|
this.openmct = markRaw(openmct);
|
||||||
|
|
||||||
this.objectMutated = this.objectMutated.bind(this);
|
this.objectMutated = this.objectMutated.bind(this);
|
||||||
this.unlistenFromMutation = openmct.objects.observe(
|
this.unlistenFromMutation = openmct.objects.observe(
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
import LADTableConfigurationComponent from './components/LADTableConfiguration.vue';
|
import LADTableConfigurationComponent from './components/LADTableConfiguration.vue';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default function LADTableConfigurationViewProvider(openmct) {
|
export default function LADTableConfigurationViewProvider(openmct) {
|
||||||
return {
|
return {
|
||||||
@@ -37,28 +37,34 @@ export default function LADTableConfigurationViewProvider(openmct) {
|
|||||||
return object?.type === 'LadTable' || object?.type === 'LadTableSet';
|
return object?.type === 'LadTable' || object?.type === 'LadTableSet';
|
||||||
},
|
},
|
||||||
view(selection) {
|
view(selection) {
|
||||||
let component;
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show(element) {
|
show(element) {
|
||||||
component = new Vue({
|
const { destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
LADTableConfiguration: LADTableConfigurationComponent
|
components: {
|
||||||
|
LADTableConfiguration: LADTableConfigurationComponent
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct
|
||||||
|
},
|
||||||
|
template: '<LADTableConfiguration />'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct
|
app: openmct.app,
|
||||||
},
|
element
|
||||||
template: '<LADTableConfiguration />'
|
}
|
||||||
});
|
);
|
||||||
|
_destroy = destroy;
|
||||||
},
|
},
|
||||||
priority() {
|
priority() {
|
||||||
return 1;
|
return 1;
|
||||||
},
|
},
|
||||||
destroy() {
|
destroy() {
|
||||||
if (component) {
|
if (_destroy) {
|
||||||
component.$destroy();
|
_destroy();
|
||||||
component = undefined;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,38 +22,47 @@
|
|||||||
|
|
||||||
import LadTable from './components/LADTable.vue';
|
import LadTable from './components/LADTable.vue';
|
||||||
import LADTableConfiguration from './LADTableConfiguration';
|
import LADTableConfiguration from './LADTableConfiguration';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default class LADTableView {
|
export default class LADTableView {
|
||||||
constructor(openmct, domainObject, objectPath) {
|
constructor(openmct, domainObject, objectPath) {
|
||||||
this.openmct = openmct;
|
this.openmct = openmct;
|
||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
this.objectPath = objectPath;
|
this.objectPath = objectPath;
|
||||||
this.component = undefined;
|
this.component = null;
|
||||||
|
this._destroy = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
show(element) {
|
show(element) {
|
||||||
let ladTableConfiguration = new LADTableConfiguration(this.domainObject, this.openmct);
|
let ladTableConfiguration = new LADTableConfiguration(this.domainObject, this.openmct);
|
||||||
|
|
||||||
this.component = new Vue({
|
const { vNode, destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
LadTable
|
components: {
|
||||||
|
LadTable
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct: this.openmct,
|
||||||
|
currentView: this,
|
||||||
|
ladTableConfiguration
|
||||||
|
},
|
||||||
|
data: () => {
|
||||||
|
return {
|
||||||
|
domainObject: this.domainObject,
|
||||||
|
objectPath: this.objectPath
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template:
|
||||||
|
'<lad-table ref="ladTable" :domain-object="domainObject" :object-path="objectPath"></lad-table>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct: this.openmct,
|
app: this.openmct.app,
|
||||||
currentView: this,
|
element
|
||||||
ladTableConfiguration
|
}
|
||||||
},
|
);
|
||||||
data: () => {
|
this.component = vNode.componentInstance;
|
||||||
return {
|
this._destroy = destroy;
|
||||||
domainObject: this.domainObject,
|
|
||||||
objectPath: this.objectPath
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template:
|
|
||||||
'<lad-table ref="ladTable" :domain-object="domainObject" :object-path="objectPath"></lad-table>'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getViewContext() {
|
getViewContext() {
|
||||||
@@ -64,8 +73,9 @@ export default class LADTableView {
|
|||||||
return this.component.$refs.ladTable.getViewContext();
|
return this.component.$refs.ladTable.getViewContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy(element) {
|
destroy() {
|
||||||
this.component.$destroy();
|
if (this._destroy) {
|
||||||
this.component = undefined;
|
this._destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,37 +22,46 @@
|
|||||||
|
|
||||||
import LadTableSet from './components/LadTableSet.vue';
|
import LadTableSet from './components/LadTableSet.vue';
|
||||||
import LADTableConfiguration from './LADTableConfiguration';
|
import LADTableConfiguration from './LADTableConfiguration';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default class LadTableSetView {
|
export default class LadTableSetView {
|
||||||
constructor(openmct, domainObject, objectPath) {
|
constructor(openmct, domainObject, objectPath) {
|
||||||
this.openmct = openmct;
|
this.openmct = openmct;
|
||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
this.objectPath = objectPath;
|
this.objectPath = objectPath;
|
||||||
this.component = undefined;
|
this._destroy = null;
|
||||||
|
this.component = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
show(element) {
|
show(element) {
|
||||||
let ladTableConfiguration = new LADTableConfiguration(this.domainObject, this.openmct);
|
let ladTableConfiguration = new LADTableConfiguration(this.domainObject, this.openmct);
|
||||||
|
|
||||||
this.component = new Vue({
|
const { vNode, destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
LadTableSet
|
components: {
|
||||||
|
LadTableSet
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct: this.openmct,
|
||||||
|
objectPath: this.objectPath,
|
||||||
|
currentView: this,
|
||||||
|
ladTableConfiguration
|
||||||
|
},
|
||||||
|
data: () => {
|
||||||
|
return {
|
||||||
|
domainObject: this.domainObject
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template: '<lad-table-set ref="ladTableSet" :domain-object="domainObject"></lad-table-set>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct: this.openmct,
|
app: this.openmct.app,
|
||||||
objectPath: this.objectPath,
|
element
|
||||||
currentView: this,
|
}
|
||||||
ladTableConfiguration
|
);
|
||||||
},
|
this._destroy = destroy;
|
||||||
data: () => {
|
this.component = vNode.componentInstance;
|
||||||
return {
|
|
||||||
domainObject: this.domainObject
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template: '<lad-table-set ref="ladTableSet" :domain-object="domainObject"></lad-table-set>'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getViewContext() {
|
getViewContext() {
|
||||||
@@ -63,8 +72,9 @@ export default class LadTableSetView {
|
|||||||
return this.component.$refs.ladTableSet.getViewContext();
|
return this.component.$refs.ladTableSet.getViewContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy(element) {
|
destroy() {
|
||||||
this.component.$destroy();
|
if (this._destroy) {
|
||||||
this.component = undefined;
|
this._destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ export default {
|
|||||||
this.previewAction = new PreviewAction(this.openmct);
|
this.previewAction = new PreviewAction(this.openmct);
|
||||||
this.previewAction.on('isVisible', this.togglePreviewState);
|
this.previewAction.on('isVisible', this.togglePreviewState);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.openmct.time.off('timeSystem', this.updateTimeSystem);
|
this.openmct.time.off('timeSystem', this.updateTimeSystem);
|
||||||
this.telemetryCollection.off('add', this.setLatestValues);
|
this.telemetryCollection.off('add', this.setLatestValues);
|
||||||
this.telemetryCollection.off('clear', this.resetValues);
|
this.telemetryCollection.off('clear', this.resetValues);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue';
|
import Vue, { toRaw } from 'vue';
|
||||||
import LadRow from './LADRow.vue';
|
import LadRow from './LADRow.vue';
|
||||||
import StalenessUtils from '@/utils/staleness';
|
import StalenessUtils from '@/utils/staleness';
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ export default {
|
|||||||
);
|
);
|
||||||
this.initializeViewActions();
|
this.initializeViewActions();
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.ladTableConfiguration.off('change', this.handleConfigurationChange);
|
this.ladTableConfiguration.off('change', this.handleConfigurationChange);
|
||||||
|
|
||||||
this.composition.off('add', this.addItem);
|
this.composition.off('add', this.addItem);
|
||||||
@@ -191,7 +191,7 @@ export default {
|
|||||||
reorder(reorderPlan) {
|
reorder(reorderPlan) {
|
||||||
const oldItems = this.items.slice();
|
const oldItems = this.items.slice();
|
||||||
reorderPlan.forEach((reorderEvent) => {
|
reorderPlan.forEach((reorderEvent) => {
|
||||||
this.$set(this.items, reorderEvent.newIndex, oldItems[reorderEvent.oldIndex]);
|
this.items[reorderEvent.newIndex] = oldItems[reorderEvent.oldIndex];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
metadataHasUnits(valueMetadatas) {
|
metadataHasUnits(valueMetadatas) {
|
||||||
@@ -230,7 +230,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
toggleFixedLayout() {
|
toggleFixedLayout() {
|
||||||
const config = structuredClone(this.configuration);
|
const config = structuredClone(toRaw(this.configuration));
|
||||||
|
|
||||||
config.isFixedLayout = !this.configuration.isFixedLayout;
|
config.isFixedLayout = !this.configuration.isFixedLayout;
|
||||||
this.ladTableConfiguration.updateConfiguration(config);
|
this.ladTableConfiguration.updateConfiguration(config);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default {
|
|||||||
|
|
||||||
this.composition.load();
|
this.composition.load();
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.ladTableConfiguration.destroy();
|
this.ladTableConfiguration.destroy();
|
||||||
this.openmct.editor.off('isEditing', this.toggleEdit);
|
this.openmct.editor.off('isEditing', this.toggleEdit);
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ export default {
|
|||||||
ladTable.domainObject = domainObject;
|
ladTable.domainObject = domainObject;
|
||||||
ladTable.key = this.openmct.objects.makeKeyString(domainObject.identifier);
|
ladTable.key = this.openmct.objects.makeKeyString(domainObject.identifier);
|
||||||
|
|
||||||
this.$set(this.ladTelemetryObjects, ladTable.key, []);
|
this.ladTelemetryObjects[ladTable.key] = [];
|
||||||
this.ladTableObjects.push(ladTable);
|
this.ladTableObjects.push(ladTable);
|
||||||
|
|
||||||
const composition = this.openmct.composition.get(ladTable.domainObject);
|
const composition = this.openmct.composition.get(ladTable.domainObject);
|
||||||
@@ -165,7 +165,7 @@ export default {
|
|||||||
const telemetryObjects = this.ladTelemetryObjects[ladTable.key];
|
const telemetryObjects = this.ladTelemetryObjects[ladTable.key];
|
||||||
telemetryObjects.push(telemetryObject);
|
telemetryObjects.push(telemetryObject);
|
||||||
|
|
||||||
this.$set(this.ladTelemetryObjects, ladTable.key, telemetryObjects);
|
this.ladTelemetryObjects[ladTable.key] = telemetryObjects;
|
||||||
|
|
||||||
this.shouldShowUnitsCheckbox();
|
this.shouldShowUnitsCheckbox();
|
||||||
};
|
};
|
||||||
@@ -179,7 +179,7 @@ export default {
|
|||||||
);
|
);
|
||||||
|
|
||||||
telemetryObjects.splice(index, 1);
|
telemetryObjects.splice(index, 1);
|
||||||
this.$set(this.ladTelemetryObjects, ladTable.key, telemetryObjects);
|
this.ladTelemetryObjects[ladTable.key] = telemetryObjects;
|
||||||
|
|
||||||
this.shouldShowUnitsCheckbox();
|
this.shouldShowUnitsCheckbox();
|
||||||
};
|
};
|
||||||
@@ -220,7 +220,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (showUnitsCheckbox && this.headers.units === undefined) {
|
if (showUnitsCheckbox && this.headers.units === undefined) {
|
||||||
this.$set(this.headers, 'units', 'Units');
|
this.headers.units = 'Units';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!showUnitsCheckbox && this.headers?.units) {
|
if (!showUnitsCheckbox && this.headers?.units) {
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<template v-for="ladTable in ladTableObjects">
|
<template v-for="ladTable in ladTableObjects" :key="ladTable.key">
|
||||||
<tr :key="ladTable.key" class="c-table__group-header js-lad-table-set__table-headers">
|
<tr class="c-table__group-header js-lad-table-set__table-headers">
|
||||||
<td colspan="10">
|
<td colspan="10">
|
||||||
{{ ladTable.domainObject.name }}
|
{{ ladTable.domainObject.name }}
|
||||||
</td>
|
</td>
|
||||||
@@ -125,7 +125,7 @@ export default {
|
|||||||
|
|
||||||
this.stalenessSubscription = {};
|
this.stalenessSubscription = {};
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.ladTableConfiguration.off('change', this.handleConfigurationChange);
|
this.ladTableConfiguration.off('change', this.handleConfigurationChange);
|
||||||
this.composition.off('add', this.addLadTable);
|
this.composition.off('add', this.addLadTable);
|
||||||
this.composition.off('remove', this.removeLadTable);
|
this.composition.off('remove', this.removeLadTable);
|
||||||
@@ -147,7 +147,7 @@ export default {
|
|||||||
ladTable.key = this.openmct.objects.makeKeyString(domainObject.identifier);
|
ladTable.key = this.openmct.objects.makeKeyString(domainObject.identifier);
|
||||||
ladTable.objectPath = [domainObject, ...this.objectPath];
|
ladTable.objectPath = [domainObject, ...this.objectPath];
|
||||||
|
|
||||||
this.$set(this.ladTelemetryObjects, ladTable.key, []);
|
this.ladTelemetryObjects[ladTable.key] = [];
|
||||||
this.ladTableObjects.push(ladTable);
|
this.ladTableObjects.push(ladTable);
|
||||||
|
|
||||||
let composition = this.openmct.composition.get(ladTable.domainObject);
|
let composition = this.openmct.composition.get(ladTable.domainObject);
|
||||||
@@ -201,7 +201,7 @@ export default {
|
|||||||
const telemetryObjects = this.ladTelemetryObjects[ladTable.key];
|
const telemetryObjects = this.ladTelemetryObjects[ladTable.key];
|
||||||
telemetryObjects.push(telemetryObject);
|
telemetryObjects.push(telemetryObject);
|
||||||
|
|
||||||
this.$set(this.ladTelemetryObjects, ladTable.key, telemetryObjects);
|
this.ladTelemetryObjects[ladTable.key] = telemetryObjects;
|
||||||
|
|
||||||
this.stalenessSubscription[combinedKey] = {};
|
this.stalenessSubscription[combinedKey] = {};
|
||||||
this.stalenessSubscription[combinedKey].stalenessUtils = new StalenessUtils(
|
this.stalenessSubscription[combinedKey].stalenessUtils = new StalenessUtils(
|
||||||
@@ -236,7 +236,7 @@ export default {
|
|||||||
this.unwatchStaleness(combinedKey);
|
this.unwatchStaleness(combinedKey);
|
||||||
|
|
||||||
telemetryObjects.splice(index, 1);
|
telemetryObjects.splice(index, 1);
|
||||||
this.$set(this.ladTelemetryObjects, ladTable.key, telemetryObjects);
|
this.ladTelemetryObjects[ladTable.key] = telemetryObjects;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
unwatchStaleness(combinedKey) {
|
unwatchStaleness(combinedKey) {
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ define([
|
|||||||
rowCount: 'reflow'
|
rowCount: 'reflow'
|
||||||
},
|
},
|
||||||
template: autoflowTemplate,
|
template: autoflowTemplate,
|
||||||
destroyed: function () {
|
unmounted: function () {
|
||||||
controller.destroy();
|
controller.destroy();
|
||||||
|
|
||||||
if (interval) {
|
if (interval) {
|
||||||
@@ -109,7 +109,7 @@ define([
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoflowTabularView.prototype = Object.create(VueView.prototype);
|
AutoflowTabularView.prototype = Object.create(VueView.default.prototype);
|
||||||
|
|
||||||
return AutoflowTabularView;
|
return AutoflowTabularView;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,15 +20,15 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define(['vue'], function (Vue) {
|
import mount from 'utils/mount';
|
||||||
function VueView(options) {
|
export default function () {
|
||||||
const vm = new Vue(options);
|
return function VueView(options) {
|
||||||
|
const { vNode, destroy } = mount(options);
|
||||||
|
|
||||||
this.show = function (container) {
|
this.show = function (container) {
|
||||||
container.appendChild(vm.$mount().$el);
|
container.appendChild(vNode.el);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = vm.$destroy.bind(vm);
|
this.destroy = destroy;
|
||||||
}
|
};
|
||||||
|
}
|
||||||
return VueView;
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.registerListeners();
|
this.registerListeners();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.plotResizeObserver) {
|
if (this.plotResizeObserver) {
|
||||||
this.plotResizeObserver.unobserve(this.$refs.plotWrapper);
|
this.plotResizeObserver.unobserve(this.$refs.plotWrapper);
|
||||||
clearTimeout(this.resizeTimer);
|
clearTimeout(this.resizeTimer);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export default {
|
|||||||
this.refreshData
|
this.refreshData
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.stopFollowingTimeContext();
|
this.stopFollowingTimeContext();
|
||||||
|
|
||||||
this.removeAllSubscriptions();
|
this.removeAllSubscriptions();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import BarGraphView from './BarGraphView.vue';
|
import BarGraphView from './BarGraphView.vue';
|
||||||
import { BAR_GRAPH_KEY, BAR_GRAPH_VIEW } from './BarGraphConstants';
|
import { BAR_GRAPH_KEY, BAR_GRAPH_VIEW } from './BarGraphConstants';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default function BarGraphViewProvider(openmct) {
|
export default function BarGraphViewProvider(openmct) {
|
||||||
function isCompactView(objectPath) {
|
function isCompactView(objectPath) {
|
||||||
@@ -44,34 +44,43 @@ export default function BarGraphViewProvider(openmct) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
view: function (domainObject, objectPath) {
|
view: function (domainObject, objectPath) {
|
||||||
let component;
|
let _destroy = null;
|
||||||
|
let component = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: function (element) {
|
show: function (element) {
|
||||||
let isCompact = isCompactView(objectPath);
|
let isCompact = isCompactView(objectPath);
|
||||||
component = new Vue({
|
|
||||||
el: element,
|
const { vNode, destroy } = mount(
|
||||||
components: {
|
{
|
||||||
BarGraphView
|
el: element,
|
||||||
|
components: {
|
||||||
|
BarGraphView
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct,
|
||||||
|
domainObject,
|
||||||
|
path: objectPath
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
options: {
|
||||||
|
compact: isCompact
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template: '<bar-graph-view ref="graphComponent" :options="options"></bar-graph-view>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct,
|
app: openmct.app,
|
||||||
domainObject,
|
element
|
||||||
path: objectPath
|
}
|
||||||
},
|
);
|
||||||
data() {
|
_destroy = destroy;
|
||||||
return {
|
component = vNode.componentInstance;
|
||||||
options: {
|
|
||||||
compact: isCompact
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template: '<bar-graph-view ref="graphComponent" :options="options"></bar-graph-view>'
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
component.$destroy();
|
_destroy();
|
||||||
component = undefined;
|
|
||||||
},
|
},
|
||||||
onClearData() {
|
onClearData() {
|
||||||
component.$refs.graphComponent.refreshData();
|
component.$refs.graphComponent.refreshData();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { BAR_GRAPH_INSPECTOR_KEY, BAR_GRAPH_KEY } from '../BarGraphConstants';
|
import { BAR_GRAPH_INSPECTOR_KEY, BAR_GRAPH_KEY } from '../BarGraphConstants';
|
||||||
import Vue from 'vue';
|
|
||||||
import BarGraphOptions from './BarGraphOptions.vue';
|
import BarGraphOptions from './BarGraphOptions.vue';
|
||||||
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default function BarGraphInspectorViewProvider(openmct) {
|
export default function BarGraphInspectorViewProvider(openmct) {
|
||||||
return {
|
return {
|
||||||
@@ -16,29 +16,35 @@ export default function BarGraphInspectorViewProvider(openmct) {
|
|||||||
return object && object.type === BAR_GRAPH_KEY;
|
return object && object.type === BAR_GRAPH_KEY;
|
||||||
},
|
},
|
||||||
view: function (selection) {
|
view: function (selection) {
|
||||||
let component;
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: function (element) {
|
show: function (element) {
|
||||||
component = new Vue({
|
const { destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
BarGraphOptions
|
components: {
|
||||||
|
BarGraphOptions
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct,
|
||||||
|
domainObject: selection[0][0].context.item
|
||||||
|
},
|
||||||
|
template: '<bar-graph-options></bar-graph-options>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct,
|
app: openmct.app,
|
||||||
domainObject: selection[0][0].context.item
|
element
|
||||||
},
|
}
|
||||||
template: '<bar-graph-options></bar-graph-options>'
|
);
|
||||||
});
|
_destroy = destroy;
|
||||||
},
|
},
|
||||||
priority: function () {
|
priority: function () {
|
||||||
return openmct.priority.HIGH + 1;
|
return openmct.priority.HIGH + 1;
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
if (component) {
|
if (_destroy) {
|
||||||
component.$destroy();
|
_destroy();
|
||||||
component = undefined;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ export default {
|
|||||||
this.registerListeners();
|
this.registerListeners();
|
||||||
this.composition.load();
|
this.composition.load();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.openmct.editor.off('isEditing', this.setEditState);
|
this.openmct.editor.off('isEditing', this.setEditState);
|
||||||
this.stopListening();
|
this.stopListening();
|
||||||
},
|
},
|
||||||
@@ -192,7 +192,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
addSeries(series, index) {
|
addSeries(series, index) {
|
||||||
this.$set(this.plotSeries, this.plotSeries.length, series);
|
this.plotSeries.push(series);
|
||||||
this.setupOptions();
|
this.setupOptions();
|
||||||
},
|
},
|
||||||
removeSeries(seriesIdentifier) {
|
removeSeries(seriesIdentifier) {
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export default {
|
|||||||
this.initColorAndName
|
this.initColorAndName
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.removeBarStylesListener) {
|
if (this.removeBarStylesListener) {
|
||||||
this.removeBarStylesListener();
|
this.removeBarStylesListener();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default {
|
|||||||
this.reloadTelemetry
|
this.reloadTelemetry
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.stopFollowingTimeContext();
|
this.stopFollowingTimeContext();
|
||||||
|
|
||||||
if (!this.composition) {
|
if (!this.composition) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import ScatterPlotView from './ScatterPlotView.vue';
|
import ScatterPlotView from './ScatterPlotView.vue';
|
||||||
import { SCATTER_PLOT_KEY, SCATTER_PLOT_VIEW, TIME_STRIP_KEY } from './scatterPlotConstants.js';
|
import { SCATTER_PLOT_KEY, SCATTER_PLOT_VIEW, TIME_STRIP_KEY } from './scatterPlotConstants.js';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default function ScatterPlotViewProvider(openmct) {
|
export default function ScatterPlotViewProvider(openmct) {
|
||||||
function isCompactView(objectPath) {
|
function isCompactView(objectPath) {
|
||||||
@@ -44,34 +44,42 @@ export default function ScatterPlotViewProvider(openmct) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
view: function (domainObject, objectPath) {
|
view: function (domainObject, objectPath) {
|
||||||
let component;
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: function (element) {
|
show: function (element) {
|
||||||
let isCompact = isCompactView(objectPath);
|
const isCompact = isCompactView(objectPath);
|
||||||
component = new Vue({
|
const { destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
ScatterPlotView
|
components: {
|
||||||
|
ScatterPlotView
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct,
|
||||||
|
domainObject,
|
||||||
|
path: objectPath
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
options: {
|
||||||
|
compact: isCompact
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template: '<scatter-plot-view :options="options"></scatter-plot-view>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct,
|
app: openmct.app,
|
||||||
domainObject,
|
element
|
||||||
path: objectPath
|
}
|
||||||
},
|
);
|
||||||
data() {
|
_destroy = destroy;
|
||||||
return {
|
|
||||||
options: {
|
|
||||||
compact: isCompact
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template: '<scatter-plot-view :options="options"></scatter-plot-view>'
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
component.$destroy();
|
if (_destroy) {
|
||||||
component = undefined;
|
_destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,10 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
data: {
|
data: {
|
||||||
immediate: false,
|
immediate: false,
|
||||||
handler: 'updateData'
|
handler() {
|
||||||
|
this.updateData();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -106,7 +109,7 @@ export default {
|
|||||||
|
|
||||||
this.$refs.plot.on('plotly_relayout', this.zoom);
|
this.$refs.plot.on('plotly_relayout', this.zoom);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.$refs.plot && this.$refs.plot.off) {
|
if (this.$refs.plot && this.$refs.plot.off) {
|
||||||
this.$refs.plot.off('plotly_relayout', this.zoom);
|
this.$refs.plot.off('plotly_relayout', this.zoom);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.openmct.editor.on('isEditing', this.setEditState);
|
this.openmct.editor.on('isEditing', this.setEditState);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.openmct.editor.off('isEditing', this.setEditState);
|
this.openmct.editor.off('isEditing', this.setEditState);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export default {
|
|||||||
this.registerListeners();
|
this.registerListeners();
|
||||||
this.composition.load();
|
this.composition.load();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.stopListening();
|
this.stopListening();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -102,7 +102,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
addSeries(series, index) {
|
addSeries(series, index) {
|
||||||
this.$set(this.plotSeries, this.plotSeries.length, series);
|
this.plotSeries.push(series);
|
||||||
this.setAxesLabels();
|
this.setAxesLabels();
|
||||||
},
|
},
|
||||||
removeSeries(seriesKey) {
|
removeSeries(seriesKey) {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export default {
|
|||||||
this.registerListeners();
|
this.registerListeners();
|
||||||
this.composition.load();
|
this.composition.load();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.stopListening();
|
this.stopListening();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -135,7 +135,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
addSeries(series, index) {
|
addSeries(series, index) {
|
||||||
this.$set(this.plotSeries, this.plotSeries.length, series);
|
this.plotSeries.push(series);
|
||||||
this.setupOptions();
|
this.setupOptions();
|
||||||
},
|
},
|
||||||
removeSeries(seriesIdentifier) {
|
removeSeries(seriesIdentifier) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { SCATTER_PLOT_INSPECTOR_KEY, SCATTER_PLOT_KEY } from '../scatterPlotConstants';
|
import { SCATTER_PLOT_INSPECTOR_KEY, SCATTER_PLOT_KEY } from '../scatterPlotConstants';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
import PlotOptions from './PlotOptions.vue';
|
import PlotOptions from './PlotOptions.vue';
|
||||||
|
|
||||||
export default function ScatterPlotInspectorViewProvider(openmct) {
|
export default function ScatterPlotInspectorViewProvider(openmct) {
|
||||||
@@ -16,29 +16,34 @@ export default function ScatterPlotInspectorViewProvider(openmct) {
|
|||||||
return object && object.type === SCATTER_PLOT_KEY;
|
return object && object.type === SCATTER_PLOT_KEY;
|
||||||
},
|
},
|
||||||
view: function (selection) {
|
view: function (selection) {
|
||||||
let component;
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: function (element) {
|
show: function (element) {
|
||||||
component = new Vue({
|
const { destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
PlotOptions
|
components: {
|
||||||
|
PlotOptions
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct,
|
||||||
|
domainObject: selection[0][0].context.item
|
||||||
|
},
|
||||||
|
template: '<plot-options></plot-options>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct,
|
app: openmct.app,
|
||||||
domainObject: selection[0][0].context.item
|
element
|
||||||
},
|
}
|
||||||
template: '<plot-options></plot-options>'
|
);
|
||||||
});
|
_destroy = destroy;
|
||||||
},
|
},
|
||||||
priority: function () {
|
priority: function () {
|
||||||
return openmct.priority.HIGH + 1;
|
return openmct.priority.HIGH + 1;
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
if (component) {
|
if (_destroy) {
|
||||||
component.$destroy();
|
_destroy();
|
||||||
component = undefined;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ import { SCATTER_PLOT_KEY } from './scatterPlotConstants.js';
|
|||||||
import ScatterPlotViewProvider from './ScatterPlotViewProvider';
|
import ScatterPlotViewProvider from './ScatterPlotViewProvider';
|
||||||
import ScatterPlotInspectorViewProvider from './inspector/ScatterPlotInspectorViewProvider';
|
import ScatterPlotInspectorViewProvider from './inspector/ScatterPlotInspectorViewProvider';
|
||||||
import ScatterPlotCompositionPolicy from './ScatterPlotCompositionPolicy';
|
import ScatterPlotCompositionPolicy from './ScatterPlotCompositionPolicy';
|
||||||
import Vue from 'vue';
|
|
||||||
import ScatterPlotForm from './ScatterPlotForm.vue';
|
import ScatterPlotForm from './ScatterPlotForm.vue';
|
||||||
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
@@ -100,24 +100,30 @@ export default function () {
|
|||||||
function getScatterPlotFormControl(openmct) {
|
function getScatterPlotFormControl(openmct) {
|
||||||
return {
|
return {
|
||||||
show(element, model, onChange) {
|
show(element, model, onChange) {
|
||||||
const rowComponent = new Vue({
|
const { vNode } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
ScatterPlotForm
|
components: {
|
||||||
|
ScatterPlotForm
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
model,
|
||||||
|
onChange
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template: `<scatter-plot-form :model="model" @onChange="onChange"></scatter-plot-form>`
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct
|
app: openmct.app,
|
||||||
},
|
element
|
||||||
data() {
|
}
|
||||||
return {
|
);
|
||||||
model,
|
|
||||||
onChange
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template: `<scatter-plot-form :model="model" @onChange="onChange"></scatter-plot-form>`
|
|
||||||
});
|
|
||||||
|
|
||||||
return rowComponent;
|
return vNode;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,39 +19,42 @@
|
|||||||
* 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 ClearDataAction from './ClearDataAction';
|
||||||
|
import GlobalClearIndicator from './components/globalClearIndicator.vue';
|
||||||
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
define(['./components/globalClearIndicator.vue', './ClearDataAction', 'vue'], function (
|
export default function plugin(appliesToObjects, options = { indicator: true }) {
|
||||||
GlobaClearIndicator,
|
let installIndicator = options.indicator;
|
||||||
ClearDataAction,
|
|
||||||
Vue
|
|
||||||
) {
|
|
||||||
return function plugin(appliesToObjects, options = { indicator: true }) {
|
|
||||||
let installIndicator = options.indicator;
|
|
||||||
|
|
||||||
appliesToObjects = appliesToObjects || [];
|
appliesToObjects = appliesToObjects || [];
|
||||||
|
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
if (installIndicator) {
|
if (installIndicator) {
|
||||||
let component = new Vue({
|
const { vNode } = mount(
|
||||||
|
{
|
||||||
components: {
|
components: {
|
||||||
GlobalClearIndicator: GlobaClearIndicator.default
|
GlobalClearIndicator
|
||||||
},
|
},
|
||||||
provide: {
|
provide: {
|
||||||
openmct
|
openmct
|
||||||
},
|
},
|
||||||
template: '<GlobalClearIndicator></GlobalClearIndicator>'
|
template: '<GlobalClearIndicator></GlobalClearIndicator>'
|
||||||
});
|
},
|
||||||
|
{
|
||||||
|
app: openmct.app,
|
||||||
|
element: document.createElement('div')
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let indicator = {
|
let indicator = {
|
||||||
element: component.$mount().$el,
|
element: vNode.el,
|
||||||
key: 'global-clear-indicator',
|
key: 'global-clear-indicator',
|
||||||
priority: openmct.priority.DEFAULT
|
priority: openmct.priority.DEFAULT
|
||||||
};
|
};
|
||||||
|
|
||||||
openmct.indicators.add(indicator);
|
openmct.indicators.add(indicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
openmct.actions.register(new ClearDataAction.default(openmct, appliesToObjects));
|
openmct.actions.register(new ClearDataAction(openmct, appliesToObjects));
|
||||||
};
|
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
import Clock from './components/Clock.vue';
|
import Clock from './components/Clock.vue';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default function ClockViewProvider(openmct) {
|
export default function ClockViewProvider(openmct) {
|
||||||
return {
|
return {
|
||||||
@@ -33,25 +33,33 @@ export default function ClockViewProvider(openmct) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
view: function (domainObject) {
|
view: function (domainObject) {
|
||||||
let component;
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: function (element) {
|
show: function (element) {
|
||||||
component = new Vue({
|
const { destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
Clock
|
components: {
|
||||||
|
Clock
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct,
|
||||||
|
domainObject
|
||||||
|
},
|
||||||
|
template: '<clock />'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct,
|
app: openmct.app,
|
||||||
domainObject
|
element
|
||||||
},
|
}
|
||||||
template: '<clock />'
|
);
|
||||||
});
|
_destroy = destroy;
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
component.$destroy();
|
if (_destroy) {
|
||||||
component = undefined;
|
_destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,18 +21,16 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="l-angular-ov-wrapper">
|
<div class="u-contents">
|
||||||
<div class="u-contents">
|
<div class="c-clock l-time-display u-style-receiver js-style-receiver">
|
||||||
<div class="c-clock l-time-display u-style-receiver js-style-receiver">
|
<div class="c-clock__timezone">
|
||||||
<div class="c-clock__timezone">
|
{{ timeZoneAbbr }}
|
||||||
{{ timeZoneAbbr }}
|
</div>
|
||||||
</div>
|
<div class="c-clock__value">
|
||||||
<div class="c-clock__value">
|
{{ timeTextValue }}
|
||||||
{{ timeTextValue }}
|
</div>
|
||||||
</div>
|
<div class="c-clock__ampm">
|
||||||
<div class="c-clock__ampm">
|
{{ timeAmPm }}
|
||||||
{{ timeAmPm }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,13 +45,11 @@ export default {
|
|||||||
inject: ['openmct', 'domainObject'],
|
inject: ['openmct', 'domainObject'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configuration: this.domainObject.configuration,
|
||||||
lastTimestamp: this.openmct.time.now()
|
lastTimestamp: this.openmct.time.now()
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
configuration() {
|
|
||||||
return this.domainObject.configuration;
|
|
||||||
},
|
|
||||||
baseFormat() {
|
baseFormat() {
|
||||||
return this.configuration.baseFormat;
|
return this.configuration.baseFormat;
|
||||||
},
|
},
|
||||||
@@ -85,10 +81,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.unobserve = this.openmct.objects.observe(
|
||||||
|
this.domainObject,
|
||||||
|
'configuration',
|
||||||
|
(configuration) => {
|
||||||
|
this.configuration = configuration;
|
||||||
|
}
|
||||||
|
);
|
||||||
this.tick = raf(this.tick);
|
this.tick = raf(this.tick);
|
||||||
this.openmct.time.on('tick', this.tick);
|
this.openmct.time.on('tick', this.tick);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
|
if (this.unobserve) {
|
||||||
|
this.unobserve();
|
||||||
|
}
|
||||||
|
|
||||||
this.openmct.time.off('tick', this.tick);
|
this.openmct.time.off('tick', this.tick);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export default {
|
|||||||
this.openmct.time.on('tick', this.tick);
|
this.openmct.time.on('tick', this.tick);
|
||||||
this.tick(this.timeTextValue);
|
this.tick(this.timeTextValue);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.openmct.time.off('tick', this.tick);
|
this.openmct.time.off('tick', this.tick);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import ClockViewProvider from './ClockViewProvider';
|
|||||||
import ClockIndicator from './components/ClockIndicator.vue';
|
import ClockIndicator from './components/ClockIndicator.vue';
|
||||||
|
|
||||||
import momentTimezone from 'moment-timezone';
|
import momentTimezone from 'moment-timezone';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default function ClockPlugin(options) {
|
export default function ClockPlugin(options) {
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
@@ -93,26 +93,33 @@ export default function ClockPlugin(options) {
|
|||||||
openmct.objectViews.addProvider(new ClockViewProvider(openmct));
|
openmct.objectViews.addProvider(new ClockViewProvider(openmct));
|
||||||
|
|
||||||
if (options && options.enableClockIndicator === true) {
|
if (options && options.enableClockIndicator === true) {
|
||||||
const clockIndicator = new Vue({
|
const element = document.createElement('div');
|
||||||
components: {
|
|
||||||
ClockIndicator
|
const { vNode } = mount(
|
||||||
|
{
|
||||||
|
components: {
|
||||||
|
ClockIndicator
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
indicatorFormat: CLOCK_INDICATOR_FORMAT
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template: '<ClockIndicator :indicator-format="indicatorFormat" />'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct
|
app: openmct.app,
|
||||||
},
|
element
|
||||||
data() {
|
}
|
||||||
return {
|
);
|
||||||
indicatorFormat: CLOCK_INDICATOR_FORMAT
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template: '<ClockIndicator :indicator-format="indicatorFormat" />'
|
|
||||||
});
|
|
||||||
const indicator = {
|
const indicator = {
|
||||||
element: clockIndicator.$mount().$el,
|
element: vNode.el,
|
||||||
key: 'clock-indicator',
|
key: 'clock-indicator',
|
||||||
priority: openmct.priority.LOW
|
priority: openmct.priority.LOW
|
||||||
};
|
};
|
||||||
|
|
||||||
openmct.indicators.add(indicator);
|
openmct.indicators.add(indicator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
import ConditionSet from './components/ConditionSet.vue';
|
import ConditionSet from './components/ConditionSet.vue';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
const DEFAULT_VIEW_PRIORITY = 100;
|
const DEFAULT_VIEW_PRIORITY = 100;
|
||||||
|
|
||||||
@@ -46,35 +46,44 @@ export default class ConditionSetViewProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
view(domainObject, objectPath) {
|
view(domainObject, objectPath) {
|
||||||
let component;
|
let _destroy = null;
|
||||||
const openmct = this.openmct;
|
let component = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: (container, isEditing) => {
|
show: (container, isEditing) => {
|
||||||
component = new Vue({
|
const { vNode, destroy } = mount(
|
||||||
el: container,
|
{
|
||||||
components: {
|
el: container,
|
||||||
ConditionSet
|
components: {
|
||||||
|
ConditionSet
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct: this.openmct,
|
||||||
|
domainObject,
|
||||||
|
objectPath
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isEditing
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template: '<condition-set :isEditing="isEditing"></condition-set>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct,
|
app: this.openmct.app,
|
||||||
domainObject,
|
element: container
|
||||||
objectPath
|
}
|
||||||
},
|
);
|
||||||
data() {
|
_destroy = destroy;
|
||||||
return {
|
component = vNode.componentInstance;
|
||||||
isEditing
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template: '<condition-set :isEditing="isEditing"></condition-set>'
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
onEditModeChange: (isEditing) => {
|
onEditModeChange: (isEditing) => {
|
||||||
component.isEditing = isEditing;
|
component.isEditing = isEditing;
|
||||||
},
|
},
|
||||||
destroy: () => {
|
destroy: () => {
|
||||||
component.$destroy();
|
if (_destroy) {
|
||||||
component = undefined;
|
_destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export default {
|
|||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.composition.off('add', this.addTelemetryObject);
|
this.composition.off('add', this.addTelemetryObject);
|
||||||
this.composition.off('remove', this.removeTelemetryObject);
|
this.composition.off('remove', this.removeTelemetryObject);
|
||||||
if (this.conditionManager) {
|
if (this.conditionManager) {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ export default {
|
|||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.resetApplied();
|
this.resetApplied();
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ export default {
|
|||||||
return this.styleableFontItems.length && this.allowEditing;
|
return this.styleableFontItems.length && this.allowEditing;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.removeListeners();
|
this.removeListeners();
|
||||||
this.openmct.editor.off('isEditing', this.setEditState);
|
this.openmct.editor.off('isEditing', this.setEditState);
|
||||||
this.stylesManager.off('styleSelected', this.applyStyleToSelection);
|
this.stylesManager.off('styleSelected', this.applyStyleToSelection);
|
||||||
@@ -878,8 +878,8 @@ export default {
|
|||||||
const fontSize = hasConsolidatedFontSize ? styles[0].fontSize : NON_SPECIFIC;
|
const fontSize = hasConsolidatedFontSize ? styles[0].fontSize : NON_SPECIFIC;
|
||||||
const font = hasConsolidatedFont ? styles[0].font : NON_SPECIFIC;
|
const font = hasConsolidatedFont ? styles[0].font : NON_SPECIFIC;
|
||||||
|
|
||||||
this.$set(this.consolidatedFontStyle, 'fontSize', fontSize);
|
this.consolidatedFontStyle.fontSize = fontSize;
|
||||||
this.$set(this.consolidatedFontStyle, 'font', font);
|
this.consolidatedFontStyle.font = font;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getFontStyle(selectionPath) {
|
getFontStyle(selectionPath) {
|
||||||
@@ -934,7 +934,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sync vue component on font update
|
// sync vue component on font update
|
||||||
this.$set(this.consolidatedFontStyle, property, value);
|
this.consolidatedFontStyle[property] = value;
|
||||||
},
|
},
|
||||||
isLayoutObject(selectionPath) {
|
isLayoutObject(selectionPath) {
|
||||||
const layoutItemType =
|
const layoutItemType =
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
import ConditionWidgetComponent from './components/ConditionWidget.vue';
|
import ConditionWidgetComponent from './components/ConditionWidget.vue';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default function ConditionWidget(openmct) {
|
export default function ConditionWidget(openmct) {
|
||||||
return {
|
return {
|
||||||
@@ -35,25 +35,33 @@ export default function ConditionWidget(openmct) {
|
|||||||
return domainObject.type === 'conditionWidget';
|
return domainObject.type === 'conditionWidget';
|
||||||
},
|
},
|
||||||
view: function (domainObject) {
|
view: function (domainObject) {
|
||||||
let component;
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: function (element) {
|
show: function (element) {
|
||||||
component = new Vue({
|
const { destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
ConditionWidgetComponent: ConditionWidgetComponent
|
components: {
|
||||||
|
ConditionWidgetComponent: ConditionWidgetComponent
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct,
|
||||||
|
domainObject
|
||||||
|
},
|
||||||
|
template: '<condition-widget-component></condition-widget-component>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct,
|
app: openmct.app,
|
||||||
domainObject
|
element
|
||||||
},
|
}
|
||||||
template: '<condition-widget-component></condition-widget-component>'
|
);
|
||||||
});
|
_destroy = destroy;
|
||||||
},
|
},
|
||||||
destroy: function (element) {
|
destroy: function () {
|
||||||
component.$destroy();
|
if (_destroy) {
|
||||||
component = undefined;
|
_destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export default {
|
|||||||
this.listenToConditionSetChanges();
|
this.listenToConditionSetChanges();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.stopListeningToConditionSetChanges();
|
this.stopListeningToConditionSetChanges();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -22,30 +22,38 @@
|
|||||||
|
|
||||||
import AlphanumericFormat from './components/AlphanumericFormat.vue';
|
import AlphanumericFormat from './components/AlphanumericFormat.vue';
|
||||||
|
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
class AlphanumericFormatView {
|
class AlphanumericFormatView {
|
||||||
constructor(openmct, domainObject, objectPath) {
|
constructor(openmct, domainObject, objectPath) {
|
||||||
this.openmct = openmct;
|
this.openmct = openmct;
|
||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
this.objectPath = objectPath;
|
this.objectPath = objectPath;
|
||||||
this.component = undefined;
|
this._destroy = null;
|
||||||
|
this.component = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
show(element) {
|
show(element) {
|
||||||
this.component = new Vue({
|
const { vNode, destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
name: 'AlphanumericFormat',
|
el: element,
|
||||||
components: {
|
components: {
|
||||||
AlphanumericFormat
|
AlphanumericFormat
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct: this.openmct,
|
||||||
|
objectPath: this.objectPath,
|
||||||
|
currentView: this
|
||||||
|
},
|
||||||
|
template: '<AlphanumericFormat ref="alphanumericFormat" />'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct: this.openmct,
|
app: this.openmct.app,
|
||||||
objectPath: this.objectPath,
|
element
|
||||||
currentView: this
|
}
|
||||||
},
|
);
|
||||||
template: '<alphanumeric-format ref="alphanumericFormat"></alphanumeric-format>'
|
this.component = vNode.componentInstance;
|
||||||
});
|
this._destroy = destroy;
|
||||||
}
|
}
|
||||||
|
|
||||||
getViewContext() {
|
getViewContext() {
|
||||||
@@ -61,8 +69,9 @@ class AlphanumericFormatView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.component.$destroy();
|
if (this._destroy) {
|
||||||
this.component = undefined;
|
this._destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export default {
|
|||||||
this.openmct.selection.on('change', this.handleSelection);
|
this.openmct.selection.on('change', this.handleSelection);
|
||||||
this.handleSelection(this.openmct.selection.get());
|
this.handleSelection(this.openmct.selection.get());
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.openmct.editor.off('isEditing', this.toggleEdit);
|
this.openmct.editor.off('isEditing', this.toggleEdit);
|
||||||
this.openmct.selection.off('change', this.handleSelection);
|
this.openmct.selection.off('change', this.handleSelection);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export default {
|
|||||||
this.initSelect
|
this.initSelect
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
if (this.removeSelectable) {
|
if (this.removeSelectable) {
|
||||||
this.removeSelectable();
|
this.removeSelectable();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
:grid-size="gridSize"
|
:grid-size="gridSize"
|
||||||
:init-select="initSelectIndex === index"
|
:init-select="initSelectIndex === index"
|
||||||
:index="index"
|
:index="index"
|
||||||
:multi-select="selectedLayoutItems.length > 1"
|
:multi-select="selectedLayoutItems.length > 1 || null"
|
||||||
:is-editing="isEditing"
|
:is-editing="isEditing"
|
||||||
@contextClick="updateViewContext"
|
@contextClick="updateViewContext"
|
||||||
@move="move"
|
@move="move"
|
||||||
@@ -161,16 +161,14 @@ export default {
|
|||||||
selection: [],
|
selection: [],
|
||||||
showGrid: true,
|
showGrid: true,
|
||||||
viewContext: {},
|
viewContext: {},
|
||||||
gridDimensions: [0, 0]
|
gridDimensions: [0, 0],
|
||||||
|
layoutItems: this.domainObject.configuration.items
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
gridSize() {
|
gridSize() {
|
||||||
return this.domainObject.configuration.layoutGrid.map(Number);
|
return this.domainObject.configuration.layoutGrid.map(Number);
|
||||||
},
|
},
|
||||||
layoutItems() {
|
|
||||||
return this.domainObject.configuration.items;
|
|
||||||
},
|
|
||||||
selectedLayoutItems() {
|
selectedLayoutItems() {
|
||||||
return this.layoutItems.filter((item) => {
|
return this.layoutItems.filter((item) => {
|
||||||
return this.itemIsInCurrentSelection(item);
|
return this.itemIsInCurrentSelection(item);
|
||||||
@@ -223,9 +221,13 @@ export default {
|
|||||||
this.composition.load();
|
this.composition.load();
|
||||||
this.gridDimensions = [this.$el.offsetWidth, this.$el.scrollHeight];
|
this.gridDimensions = [this.$el.offsetWidth, this.$el.scrollHeight];
|
||||||
|
|
||||||
|
this.openmct.objects.observe(this.domainObject, 'configuration.items', (items) => {
|
||||||
|
this.layoutItems = items;
|
||||||
|
});
|
||||||
|
|
||||||
this.watchDisplayResize();
|
this.watchDisplayResize();
|
||||||
},
|
},
|
||||||
destroyed: function () {
|
unmounted: function () {
|
||||||
this.openmct.selection.off('change', this.setSelection);
|
this.openmct.selection.off('change', this.setSelection);
|
||||||
this.composition.off('add', this.addChild);
|
this.composition.off('add', this.addChild);
|
||||||
this.composition.off('remove', this.removeChild);
|
this.composition.off('remove', this.removeChild);
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export default {
|
|||||||
this.initSelect
|
this.initSelect
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
if (this.removeSelectable) {
|
if (this.removeSelectable) {
|
||||||
this.removeSelectable();
|
this.removeSelectable();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ export default {
|
|||||||
this.initSelect
|
this.initSelect
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
if (this.removeSelectable) {
|
if (this.removeSelectable) {
|
||||||
this.removeSelectable();
|
this.removeSelectable();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,13 @@
|
|||||||
<div class="l-layout__frame c-frame no-frame c-line-view" :class="[styleClass]" :style="style">
|
<div class="l-layout__frame c-frame no-frame c-line-view" :class="[styleClass]" :style="style">
|
||||||
<svg width="100%" height="100%">
|
<svg width="100%" height="100%">
|
||||||
<line
|
<line
|
||||||
class="c-line-view__hover-indicator"
|
|
||||||
v-bind="linePosition"
|
v-bind="linePosition"
|
||||||
|
class="c-line-view__hover-indicator"
|
||||||
vector-effect="non-scaling-stroke"
|
vector-effect="non-scaling-stroke"
|
||||||
/>
|
/>
|
||||||
<line
|
<line
|
||||||
class="c-line-view__line"
|
|
||||||
v-bind="linePosition"
|
v-bind="linePosition"
|
||||||
|
class="c-line-view__line"
|
||||||
:stroke="stroke"
|
:stroke="stroke"
|
||||||
vector-effect="non-scaling-stroke"
|
vector-effect="non-scaling-stroke"
|
||||||
/>
|
/>
|
||||||
@@ -257,7 +257,7 @@ export default {
|
|||||||
this.initSelect
|
this.initSelect
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
if (this.removeSelectable) {
|
if (this.removeSelectable) {
|
||||||
this.removeSelectable();
|
this.removeSelectable();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ export default {
|
|||||||
this.openmct.objects.get(this.item.identifier).then(this.setObject);
|
this.openmct.objects.get(this.item.identifier).then(this.setObject);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.removeSelectable) {
|
if (this.removeSelectable) {
|
||||||
this.removeSelectable();
|
this.removeSelectable();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ export default {
|
|||||||
this.status = this.openmct.status.get(this.item.identifier);
|
this.status = this.openmct.status.get(this.item.identifier);
|
||||||
this.removeStatusListener = this.openmct.status.observe(this.item.identifier, this.setStatus);
|
this.removeStatusListener = this.openmct.status.observe(this.item.identifier, this.setStatus);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.removeStatusListener();
|
this.removeStatusListener();
|
||||||
|
|
||||||
if (this.removeSelectable) {
|
if (this.removeSelectable) {
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ export default {
|
|||||||
this.initSelect
|
this.initSelect
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
if (this.removeSelectable) {
|
if (this.removeSelectable) {
|
||||||
this.removeSelectable();
|
this.removeSelectable();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
&__grid-holder,
|
|
||||||
&__dimensions {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__dimensions {
|
&__dimensions {
|
||||||
$b: 1px dashed $editDimensionsColor;
|
$b: 1px dashed $editDimensionsColor;
|
||||||
border-right: $b;
|
border-right: $b;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
.c-frame-edit {
|
.c-frame-edit {
|
||||||
// In Layouts, this is the editing rect and handles
|
// In Layouts, this is the editing rect and handles
|
||||||
display: none; // Set to display: block in DisplayLayout.vue
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@include abs();
|
@include abs();
|
||||||
border: $editMarqueeBorder;
|
border: $editMarqueeBorder;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default {
|
|||||||
);
|
);
|
||||||
this.initObjectStyles();
|
this.initObjectStyles();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.stopListeningObjectStyles) {
|
if (this.stopListeningObjectStyles) {
|
||||||
this.stopListeningObjectStyles();
|
this.stopListeningObjectStyles();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,10 +26,8 @@ import DisplayLayout from './components/DisplayLayout.vue';
|
|||||||
import DisplayLayoutToolbar from './DisplayLayoutToolbar.js';
|
import DisplayLayoutToolbar from './DisplayLayoutToolbar.js';
|
||||||
import DisplayLayoutType from './DisplayLayoutType.js';
|
import DisplayLayoutType from './DisplayLayoutType.js';
|
||||||
import DisplayLayoutDrawingObjectTypes from './DrawingObjectTypes.js';
|
import DisplayLayoutDrawingObjectTypes from './DrawingObjectTypes.js';
|
||||||
|
|
||||||
import objectUtils from 'objectUtils';
|
import objectUtils from 'objectUtils';
|
||||||
|
import mount from 'utils/mount';
|
||||||
import Vue from 'vue';
|
|
||||||
|
|
||||||
class DisplayLayoutView {
|
class DisplayLayoutView {
|
||||||
constructor(openmct, domainObject, objectPath, options) {
|
constructor(openmct, domainObject, objectPath, options) {
|
||||||
@@ -38,31 +36,40 @@ class DisplayLayoutView {
|
|||||||
this.objectPath = objectPath;
|
this.objectPath = objectPath;
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|
||||||
this.component = undefined;
|
this.component = null;
|
||||||
|
this.app = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
show(container, isEditing) {
|
show(container, isEditing) {
|
||||||
this.component = new Vue({
|
const { vNode, destroy } = mount(
|
||||||
el: container,
|
{
|
||||||
components: {
|
el: container,
|
||||||
DisplayLayout
|
components: {
|
||||||
|
DisplayLayout
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct: this.openmct,
|
||||||
|
objectPath: this.objectPath,
|
||||||
|
options: this.options,
|
||||||
|
objectUtils,
|
||||||
|
currentView: this
|
||||||
|
},
|
||||||
|
data: () => {
|
||||||
|
return {
|
||||||
|
domainObject: this.domainObject,
|
||||||
|
isEditing
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template:
|
||||||
|
'<display-layout ref="displayLayout" :domain-object="domainObject" :is-editing="isEditing"></display-layout>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct: this.openmct,
|
app: this.openmct.app,
|
||||||
objectPath: this.objectPath,
|
element: container
|
||||||
options: this.options,
|
}
|
||||||
objectUtils,
|
);
|
||||||
currentView: this
|
this._destroy = destroy;
|
||||||
},
|
this.component = vNode.componentInstance;
|
||||||
data: () => {
|
|
||||||
return {
|
|
||||||
domainObject: this.domainObject,
|
|
||||||
isEditing
|
|
||||||
};
|
|
||||||
},
|
|
||||||
template:
|
|
||||||
'<display-layout ref="displayLayout" :domain-object="domainObject" :is-editing="isEditing"></display-layout>'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getViewContext() {
|
getViewContext() {
|
||||||
@@ -95,8 +102,9 @@ class DisplayLayoutView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.component.$destroy();
|
if (this._destroy) {
|
||||||
this.component = undefined;
|
this._destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import FaultManagementInspector from './FaultManagementInspector.vue';
|
import FaultManagementInspector from './FaultManagementInspector.vue';
|
||||||
|
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
import { FAULT_MANAGEMENT_INSPECTOR, FAULT_MANAGEMENT_TYPE } from './constants';
|
import { FAULT_MANAGEMENT_INSPECTOR, FAULT_MANAGEMENT_TYPE } from './constants';
|
||||||
|
|
||||||
@@ -41,28 +41,34 @@ export default function FaultManagementInspectorViewProvider(openmct) {
|
|||||||
return object && object.type === FAULT_MANAGEMENT_TYPE;
|
return object && object.type === FAULT_MANAGEMENT_TYPE;
|
||||||
},
|
},
|
||||||
view: (selection) => {
|
view: (selection) => {
|
||||||
let component;
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: function (element) {
|
show: function (element) {
|
||||||
component = new Vue({
|
const { destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
FaultManagementInspector
|
components: {
|
||||||
|
FaultManagementInspector
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct
|
||||||
|
},
|
||||||
|
template: '<FaultManagementInspector></FaultManagementInspector>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct
|
app: openmct.app,
|
||||||
},
|
element
|
||||||
template: '<FaultManagementInspector></FaultManagementInspector>'
|
}
|
||||||
});
|
);
|
||||||
|
_destroy = destroy;
|
||||||
},
|
},
|
||||||
priority: function () {
|
priority: function () {
|
||||||
return openmct.priority.HIGH + 1;
|
return openmct.priority.HIGH + 1;
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
if (component) {
|
if (_destroy) {
|
||||||
component.$destroy();
|
_destroy();
|
||||||
component = undefined;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ export default {
|
|||||||
},
|
},
|
||||||
toggleSelected({ fault, selected = false }) {
|
toggleSelected({ fault, selected = false }) {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
this.$set(this.selectedFaults, fault.id, fault);
|
this.selectedFaults[fault.id] = fault;
|
||||||
} else {
|
} else {
|
||||||
this.$delete(this.selectedFaults, fault.id);
|
this.$delete(this.selectedFaults, fault.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.unsubscribe = this.openmct.faults.subscribe(this.domainObject, this.updateFault);
|
this.unsubscribe = this.openmct.faults.subscribe(this.domainObject, this.updateFault);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.unsubscribe) {
|
if (this.unsubscribe) {
|
||||||
this.unsubscribe();
|
this.unsubscribe();
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ export default {
|
|||||||
} else if (type === FAULT_MANAGEMENT_ALARMS) {
|
} else if (type === FAULT_MANAGEMENT_ALARMS) {
|
||||||
this.faultsList.forEach((faultValue, i) => {
|
this.faultsList.forEach((faultValue, i) => {
|
||||||
if (fault.id === faultValue.id) {
|
if (fault.id === faultValue.id) {
|
||||||
this.$set(this.faultsList, i, fault);
|
this.faultsList[i] = fault;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import FaultManagementView from './FaultManagementView.vue';
|
import FaultManagementView from './FaultManagementView.vue';
|
||||||
import { FAULT_MANAGEMENT_TYPE, FAULT_MANAGEMENT_VIEW } from './constants';
|
import { FAULT_MANAGEMENT_TYPE, FAULT_MANAGEMENT_VIEW } from './constants';
|
||||||
import Vue from 'vue';
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
export default class FaultManagementViewProvider {
|
export default class FaultManagementViewProvider {
|
||||||
constructor(openmct) {
|
constructor(openmct) {
|
||||||
@@ -39,30 +39,34 @@ export default class FaultManagementViewProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
view(domainObject) {
|
view(domainObject) {
|
||||||
let component;
|
|
||||||
const openmct = this.openmct;
|
const openmct = this.openmct;
|
||||||
|
let _destroy = null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: (element) => {
|
show: (element) => {
|
||||||
component = new Vue({
|
const { destroy } = mount(
|
||||||
el: element,
|
{
|
||||||
components: {
|
el: element,
|
||||||
FaultManagementView
|
components: {
|
||||||
|
FaultManagementView
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct,
|
||||||
|
domainObject
|
||||||
|
},
|
||||||
|
template: '<FaultManagementView></FaultManagementView>'
|
||||||
},
|
},
|
||||||
provide: {
|
{
|
||||||
openmct,
|
app: openmct.app,
|
||||||
domainObject
|
element
|
||||||
},
|
}
|
||||||
template: '<FaultManagementView></FaultManagementView>'
|
);
|
||||||
});
|
_destroy = destroy;
|
||||||
},
|
},
|
||||||
destroy: () => {
|
destroy: () => {
|
||||||
if (!component) {
|
if (_destroy) {
|
||||||
return;
|
_destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
component.$destroy();
|
|
||||||
component = undefined;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,59 +20,70 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define(['./components/FiltersView.vue', 'vue'], function (FiltersView, Vue) {
|
import mount from 'utils/mount';
|
||||||
function FiltersInspectorViewProvider(openmct, supportedObjectTypesArray) {
|
import FiltersView from './components/FiltersView.vue';
|
||||||
|
|
||||||
|
const FILTERS_INSPECTOR_KEY = 'filters-inspector';
|
||||||
|
export default class FiltersInspectorViewProvider {
|
||||||
|
constructor(openmct, supportedObjectTypesArray) {
|
||||||
|
this.openmct = openmct;
|
||||||
|
this.supportedObjectTypesArray = supportedObjectTypesArray;
|
||||||
|
this.key = FILTERS_INSPECTOR_KEY;
|
||||||
|
this.name = 'Filters';
|
||||||
|
}
|
||||||
|
canView(selection) {
|
||||||
|
const domainObject = selection?.[0]?.[0]?.context?.item;
|
||||||
|
|
||||||
|
return (
|
||||||
|
domainObject && this.supportedObjectTypesArray.some((type) => domainObject.type === type)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
view(selection) {
|
||||||
|
let openmct = this.openmct;
|
||||||
|
let _destroy = null;
|
||||||
|
|
||||||
|
const domainObject = selection?.[0]?.[0]?.context?.item;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
key: 'filters-inspector',
|
show: function (element) {
|
||||||
name: 'Filters',
|
const { destroy } = mount(
|
||||||
canView: function (selection) {
|
{
|
||||||
const domainObject = selection?.[0]?.[0]?.context?.item;
|
el: element,
|
||||||
|
components: {
|
||||||
return domainObject && supportedObjectTypesArray.some((type) => domainObject.type === type);
|
FiltersView
|
||||||
},
|
},
|
||||||
view: function (selection) {
|
provide: {
|
||||||
let component;
|
openmct: openmct
|
||||||
|
},
|
||||||
const domainObject = selection?.[0]?.[0]?.context?.item;
|
template: '<filters-view></filters-view>'
|
||||||
|
|
||||||
return {
|
|
||||||
show: function (element) {
|
|
||||||
component = new Vue({
|
|
||||||
el: element,
|
|
||||||
components: {
|
|
||||||
FiltersView: FiltersView.default
|
|
||||||
},
|
|
||||||
provide: {
|
|
||||||
openmct
|
|
||||||
},
|
|
||||||
template: '<filters-view></filters-view>'
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
showTab: function (isEditing) {
|
{
|
||||||
if (isEditing) {
|
app: openmct.app,
|
||||||
return true;
|
element
|
||||||
}
|
|
||||||
|
|
||||||
const metadata = openmct.telemetry.getMetadata(domainObject);
|
|
||||||
const metadataWithFilters = metadata
|
|
||||||
? metadata.valueMetadatas.filter((value) => value.filters)
|
|
||||||
: [];
|
|
||||||
|
|
||||||
return metadataWithFilters.length;
|
|
||||||
},
|
|
||||||
priority: function () {
|
|
||||||
return openmct.priority.DEFAULT;
|
|
||||||
},
|
|
||||||
destroy: function () {
|
|
||||||
if (component) {
|
|
||||||
component.$destroy();
|
|
||||||
component = undefined;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
);
|
||||||
|
_destroy = destroy;
|
||||||
|
},
|
||||||
|
showTab: function (isEditing) {
|
||||||
|
if (isEditing) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const metadata = openmct.telemetry.getMetadata(domainObject);
|
||||||
|
const metadataWithFilters = metadata
|
||||||
|
? metadata.valueMetadatas.filter((value) => value.filters)
|
||||||
|
: [];
|
||||||
|
|
||||||
|
return metadataWithFilters.length;
|
||||||
|
},
|
||||||
|
priority: function () {
|
||||||
|
return openmct.priority.DEFAULT;
|
||||||
|
},
|
||||||
|
destroy: function () {
|
||||||
|
if (_destroy) {
|
||||||
|
_destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return FiltersInspectorViewProvider;
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.openmct.editor.on('isEditing', this.toggleIsEditing);
|
this.openmct.editor.on('isEditing', this.toggleIsEditing);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.openmct.editor.off('isEditing', this.toggleIsEditing);
|
this.openmct.editor.off('isEditing', this.toggleIsEditing);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export default {
|
|||||||
this.objectCssClass = type.definition.cssClass;
|
this.objectCssClass = type.definition.cssClass;
|
||||||
this.openmct.editor.on('isEditing', this.toggleIsEditing);
|
this.openmct.editor.on('isEditing', this.toggleIsEditing);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.openmct.editor.off('isEditing', this.toggleIsEditing);
|
this.openmct.editor.off('isEditing', this.toggleIsEditing);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -151,32 +151,32 @@ export default {
|
|||||||
filterValue[comparator].push(valueName);
|
filterValue[comparator].push(valueName);
|
||||||
} else {
|
} else {
|
||||||
if (filterValue[comparator].length === 1) {
|
if (filterValue[comparator].length === 1) {
|
||||||
this.$set(this.updatedFilters, key, {});
|
this.updatedFilters[key] = {};
|
||||||
} else {
|
} else {
|
||||||
filterValue[comparator] = filterValue[comparator].filter((v) => v !== valueName);
|
filterValue[comparator] = filterValue[comparator].filter((v) => v !== valueName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.updatedFilters[key], comparator, [valueName]);
|
this.updatedFilters[key][comparator] = [valueName];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit('updateFilters', this.keyString, this.updatedFilters);
|
this.$emit('updateFilters', this.keyString, this.updatedFilters);
|
||||||
},
|
},
|
||||||
clearFilters(key) {
|
clearFilters(key) {
|
||||||
this.$set(this.updatedFilters, key, {});
|
this.updatedFilters[key] = {};
|
||||||
this.$emit('updateFilters', this.keyString, this.updatedFilters);
|
this.$emit('updateFilters', this.keyString, this.updatedFilters);
|
||||||
},
|
},
|
||||||
updateFiltersWithTextValue(key, comparator, value) {
|
updateFiltersWithTextValue(key, comparator, value) {
|
||||||
if (value.trim() === '') {
|
if (value.trim() === '') {
|
||||||
this.$set(this.updatedFilters, key, {});
|
this.updatedFilters[key] = {};
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.updatedFilters[key], comparator, value);
|
this.updatedFilters[key][comparator] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit('updateFilters', this.keyString, this.updatedFilters);
|
this.$emit('updateFilters', this.keyString, this.updatedFilters);
|
||||||
},
|
},
|
||||||
updateSingleSelection(key, comparator, value) {
|
updateSingleSelection(key, comparator, value) {
|
||||||
this.$set(this.updatedFilters[key], comparator, [value]);
|
this.updatedFilters[key][comparator] = [value];
|
||||||
this.$emit('updateFilters', this.keyString, this.updatedFilters);
|
this.$emit('updateFilters', this.keyString, this.updatedFilters);
|
||||||
},
|
},
|
||||||
useGlobalFilter(checked) {
|
useGlobalFilter(checked) {
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export default {
|
|||||||
this.updateGlobalFilters
|
this.updateGlobalFilters
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.composition.off('add', this.addChildren);
|
this.composition.off('add', this.addChildren);
|
||||||
this.composition.off('remove', this.removeChildren);
|
this.composition.off('remove', this.removeChildren);
|
||||||
this.unobserve();
|
this.unobserve();
|
||||||
@@ -136,21 +136,21 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (metadataWithFilters.length) {
|
if (metadataWithFilters.length) {
|
||||||
this.$set(this.children, keyString, childObject);
|
this.children[keyString] = childObject;
|
||||||
|
|
||||||
metadataWithFilters.forEach((metadatum) => {
|
metadataWithFilters.forEach((metadatum) => {
|
||||||
if (!this.globalFilters[metadatum.key]) {
|
if (!this.globalFilters[metadatum.key]) {
|
||||||
this.$set(this.globalFilters, metadatum.key, {});
|
this.globalFilters[metadatum.key] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.globalMetadata[metadatum.key]) {
|
if (!this.globalMetadata[metadatum.key]) {
|
||||||
this.$set(this.globalMetadata, metadatum.key, metadatum);
|
this.globalMetadata[metadatum.key] = metadatum;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasFiltersWithKeyString) {
|
if (!hasFiltersWithKeyString) {
|
||||||
if (!this.persistedFilters[keyString]) {
|
if (!this.persistedFilters[keyString]) {
|
||||||
this.$set(this.persistedFilters, keyString, {});
|
this.persistedFilters[keyString] = {};
|
||||||
this.$set(this.persistedFilters[keyString], 'useGlobal', true);
|
this.persistedFilters[keyString].useGlobal = true;
|
||||||
mutateFilters = true;
|
mutateFilters = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,10 +239,10 @@ export default {
|
|||||||
this.containsField(keyString, key)
|
this.containsField(keyString, key)
|
||||||
) {
|
) {
|
||||||
if (!this.persistedFilters[keyString][key]) {
|
if (!this.persistedFilters[keyString][key]) {
|
||||||
this.$set(this.persistedFilters[keyString], key, {});
|
this.persistedFilters[keyString][key] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$set(this.persistedFilters[keyString], key, filters[key]);
|
this.persistedFilters[keyString][key] = filters[key];
|
||||||
mutateFilters = true;
|
mutateFilters = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export default {
|
|||||||
this.expanded = !this.expanded;
|
this.expanded = !this.expanded;
|
||||||
},
|
},
|
||||||
clearFilters(key) {
|
clearFilters(key) {
|
||||||
this.$set(this.updatedFilters, key, {});
|
this.updatedFilters[key] = {};
|
||||||
this.$emit('persistGlobalFilters', key, this.updatedFilters);
|
this.$emit('persistGlobalFilters', key, this.updatedFilters);
|
||||||
},
|
},
|
||||||
updateFiltersWithSelectedValue(key, comparator, valueName, value) {
|
updateFiltersWithSelectedValue(key, comparator, valueName, value) {
|
||||||
@@ -112,26 +112,26 @@ export default {
|
|||||||
filterValue[comparator].push(valueName);
|
filterValue[comparator].push(valueName);
|
||||||
} else {
|
} else {
|
||||||
if (filterValue[comparator].length === 1) {
|
if (filterValue[comparator].length === 1) {
|
||||||
this.$set(this.updatedFilters, key, {});
|
this.updatedFilters[key] = {};
|
||||||
} else {
|
} else {
|
||||||
filterValue[comparator] = filterValue[comparator].filter((v) => v !== valueName);
|
filterValue[comparator] = filterValue[comparator].filter((v) => v !== valueName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.updatedFilters[key], comparator, [valueName]);
|
this.updatedFilters[key][comparator] = [valueName];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit('persistGlobalFilters', key, this.updatedFilters);
|
this.$emit('persistGlobalFilters', key, this.updatedFilters);
|
||||||
},
|
},
|
||||||
updateSingleSelection(key, comparator, value) {
|
updateSingleSelection(key, comparator, value) {
|
||||||
this.$set(this.updatedFilters[key], comparator, [value]);
|
this.updatedFilters[key][comparator] = [value];
|
||||||
this.$emit('persistGlobalFilters', key, this.updatedFilters);
|
this.$emit('persistGlobalFilters', key, this.updatedFilters);
|
||||||
},
|
},
|
||||||
updateFiltersWithTextValue(key, comparator, value) {
|
updateFiltersWithTextValue(key, comparator, value) {
|
||||||
if (value.trim() === '') {
|
if (value.trim() === '') {
|
||||||
this.$set(this.updatedFilters, key, {});
|
this.updatedFilters[key] = {};
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.updatedFilters[key], comparator, value);
|
this.updatedFilters[key][comparator] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit('persistGlobalFilters', key, this.updatedFilters);
|
this.$emit('persistGlobalFilters', key, this.updatedFilters);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ define(['./FiltersInspectorViewProvider'], function (FiltersInspectorViewProvide
|
|||||||
return function plugin(supportedObjectTypesArray) {
|
return function plugin(supportedObjectTypesArray) {
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
openmct.inspectorViews.addProvider(
|
openmct.inspectorViews.addProvider(
|
||||||
new FiltersInspectorViewProvider(openmct, supportedObjectTypesArray)
|
new FiltersInspectorViewProvider.default(openmct, supportedObjectTypesArray)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,9 +43,8 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="c-fl-container__frames-holder">
|
<div class="c-fl-container__frames-holder">
|
||||||
<template v-for="(frame, i) in frames">
|
<template v-for="(frame, i) in frames" :key="frame.id">
|
||||||
<frame-component
|
<frame-component
|
||||||
:key="frame.id"
|
|
||||||
class="c-fl-container__frame"
|
class="c-fl-container__frame"
|
||||||
:frame="frame"
|
:frame="frame"
|
||||||
:index="i"
|
:index="i"
|
||||||
@@ -55,7 +54,6 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<drop-hint
|
<drop-hint
|
||||||
:key="'hint-' + i"
|
|
||||||
class="c-fl-frame__drop-hint"
|
class="c-fl-frame__drop-hint"
|
||||||
:index="i"
|
:index="i"
|
||||||
:allow-drop="allowDrop"
|
:allow-drop="allowDrop"
|
||||||
@@ -64,7 +62,6 @@
|
|||||||
|
|
||||||
<resize-handle
|
<resize-handle
|
||||||
v-if="i !== frames.length - 1"
|
v-if="i !== frames.length - 1"
|
||||||
:key="'handle-' + i"
|
|
||||||
:index="i"
|
:index="i"
|
||||||
:orientation="rowsLayout ? 'horizontal' : 'vertical'"
|
:orientation="rowsLayout ? 'horizontal' : 'vertical'"
|
||||||
:is-editing="isEditing"
|
:is-editing="isEditing"
|
||||||
@@ -132,7 +129,7 @@ export default {
|
|||||||
|
|
||||||
this.unsubscribeSelection = this.openmct.selection.selectable(this.$el, context, false);
|
this.unsubscribeSelection = this.openmct.selection.selectable(this.$el, context, false);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.unsubscribeSelection();
|
this.unsubscribeSelection();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export default {
|
|||||||
document.addEventListener('dragend', this.dragend);
|
document.addEventListener('dragend', this.dragend);
|
||||||
document.addEventListener('drop', this.dragend);
|
document.addEventListener('drop', this.dragend);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
document.removeEventListener('dragstart', this.dragstart);
|
document.removeEventListener('dragstart', this.dragstart);
|
||||||
document.removeEventListener('dragend', this.dragend);
|
document.removeEventListener('dragend', this.dragend);
|
||||||
document.removeEventListener('drop', this.dragend);
|
document.removeEventListener('drop', this.dragend);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
'c-fl--rows': rowsLayout === true
|
'c-fl--rows': rowsLayout === true
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template v-for="(container, index) in containers">
|
<template v-for="(container, index) in containers" :key="`component-${container.id}`">
|
||||||
<drop-hint
|
<drop-hint
|
||||||
v-if="index === 0 && containers.length > 1"
|
v-if="index === 0 && containers.length > 1"
|
||||||
:key="`hint-top-${container.id}`"
|
:key="`hint-top-${container.id}`"
|
||||||
@@ -45,7 +45,6 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<container-component
|
<container-component
|
||||||
:key="`component-${container.id}`"
|
|
||||||
class="c-fl__container"
|
class="c-fl__container"
|
||||||
:index="index"
|
:index="index"
|
||||||
:container="container"
|
:container="container"
|
||||||
@@ -174,7 +173,7 @@ export default {
|
|||||||
this.composition.on('add', this.addFrame);
|
this.composition.on('add', this.addFrame);
|
||||||
this.composition.load();
|
this.composition.load();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
this.composition.off('remove', this.removeChildObject);
|
this.composition.off('remove', this.removeChildObject);
|
||||||
this.composition.off('add', this.addFrame);
|
this.composition.off('add', this.addFrame);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export default {
|
|||||||
|
|
||||||
this.dragGhost = document.getElementById('js-fl-drag-ghost');
|
this.dragGhost = document.getElementById('js-fl-drag-ghost');
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeUnmount() {
|
||||||
if (this.domainObjectPromise) {
|
if (this.domainObjectPromise) {
|
||||||
this.domainObjectPromise.then(() => {
|
this.domainObjectPromise.then(() => {
|
||||||
if (this?.domainObject?.isMutable) {
|
if (this?.domainObject?.isMutable) {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export default {
|
|||||||
document.addEventListener('dragend', this.unsetDragging);
|
document.addEventListener('dragend', this.unsetDragging);
|
||||||
document.addEventListener('drop', this.unsetDragging);
|
document.addEventListener('drop', this.unsetDragging);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
document.removeEventListener('dragstart', this.setDragging);
|
document.removeEventListener('dragstart', this.setDragging);
|
||||||
document.removeEventListener('dragend', this.unsetDragging);
|
document.removeEventListener('dragend', this.unsetDragging);
|
||||||
document.removeEventListener('drop', this.unsetDragging);
|
document.removeEventListener('drop', this.unsetDragging);
|
||||||
|
|||||||
@@ -20,65 +20,82 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define(['./components/flexibleLayout.vue', 'vue'], function (FlexibleLayoutComponent, Vue) {
|
import mount from 'utils/mount';
|
||||||
function FlexibleLayoutViewProvider(openmct) {
|
import FlexibleLayoutComponent from './components/flexibleLayout.vue';
|
||||||
return {
|
|
||||||
key: 'flexible-layout',
|
|
||||||
name: 'FlexibleLayout',
|
|
||||||
cssClass: 'icon-layout-view',
|
|
||||||
canView: function (domainObject) {
|
|
||||||
return domainObject.type === 'flexible-layout';
|
|
||||||
},
|
|
||||||
canEdit: function (domainObject) {
|
|
||||||
return domainObject.type === 'flexible-layout';
|
|
||||||
},
|
|
||||||
view: function (domainObject, objectPath) {
|
|
||||||
let component;
|
|
||||||
|
|
||||||
return {
|
const FLEXIBLE_LAYOUT_KEY = 'flexible-layout';
|
||||||
show: function (element, isEditing) {
|
export default class FlexibleLayoutViewProvider {
|
||||||
component = new Vue({
|
constructor(openmct) {
|
||||||
el: element,
|
this.openmct = openmct;
|
||||||
components: {
|
this.key = FLEXIBLE_LAYOUT_KEY;
|
||||||
FlexibleLayoutComponent: FlexibleLayoutComponent.default
|
this.name = 'Flexible Layout';
|
||||||
},
|
this.cssClass = 'icon-layout-view';
|
||||||
provide: {
|
this.destroy = null;
|
||||||
openmct,
|
}
|
||||||
objectPath,
|
|
||||||
layoutObject: domainObject
|
canView(domainObject) {
|
||||||
},
|
return domainObject.type === FLEXIBLE_LAYOUT_KEY;
|
||||||
data() {
|
}
|
||||||
return {
|
|
||||||
isEditing: isEditing
|
canEdit(domainObject) {
|
||||||
};
|
return domainObject.type === FLEXIBLE_LAYOUT_KEY;
|
||||||
},
|
}
|
||||||
template:
|
|
||||||
'<flexible-layout-component ref="flexibleLayout" :isEditing="isEditing"></flexible-layout-component>'
|
view(domainObject, objectPath) {
|
||||||
});
|
let openmct = this.openmct;
|
||||||
|
let _destroy = null;
|
||||||
|
let component = null;
|
||||||
|
|
||||||
|
return {
|
||||||
|
show: function (element, isEditing) {
|
||||||
|
const { vNode, destroy } = mount(
|
||||||
|
{
|
||||||
|
el: element,
|
||||||
|
components: {
|
||||||
|
FlexibleLayoutComponent
|
||||||
|
},
|
||||||
|
provide: {
|
||||||
|
openmct: openmct,
|
||||||
|
objectPath,
|
||||||
|
layoutObject: domainObject
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isEditing: isEditing
|
||||||
|
};
|
||||||
|
},
|
||||||
|
template:
|
||||||
|
'<flexible-layout-component ref="flexibleLayout" :isEditing="isEditing"></flexible-layout-component>'
|
||||||
},
|
},
|
||||||
getSelectionContext: function () {
|
{
|
||||||
return {
|
app: openmct.app,
|
||||||
item: domainObject,
|
element
|
||||||
addContainer: component.$refs.flexibleLayout.addContainer,
|
|
||||||
deleteContainer: component.$refs.flexibleLayout.deleteContainer,
|
|
||||||
deleteFrame: component.$refs.flexibleLayout.deleteFrame,
|
|
||||||
type: 'flexible-layout'
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onEditModeChange: function (isEditing) {
|
|
||||||
component.isEditing = isEditing;
|
|
||||||
},
|
|
||||||
destroy: function (element) {
|
|
||||||
component.$destroy();
|
|
||||||
component = undefined;
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
component = vNode.componentInstance;
|
||||||
|
_destroy = destroy;
|
||||||
|
},
|
||||||
|
getSelectionContext: function () {
|
||||||
|
return {
|
||||||
|
item: domainObject,
|
||||||
|
addContainer: component.$refs.flexibleLayout.addContainer,
|
||||||
|
deleteContainer: component.$refs.flexibleLayout.deleteContainer,
|
||||||
|
deleteFrame: component.$refs.flexibleLayout.deleteFrame,
|
||||||
|
type: 'flexible-layout'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
priority: function () {
|
onEditModeChange: function (isEditing) {
|
||||||
return 1;
|
component.isEditing = isEditing;
|
||||||
|
},
|
||||||
|
destroy: function (element) {
|
||||||
|
if (_destroy) {
|
||||||
|
_destroy();
|
||||||
|
component = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
priority() {
|
||||||
return FlexibleLayoutViewProvider;
|
return 1;
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ define(['./flexibleLayoutViewProvider', './utils/container', './toolbarProvider'
|
|||||||
) {
|
) {
|
||||||
return function plugin() {
|
return function plugin() {
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
openmct.objectViews.addProvider(new FlexibleLayoutViewProvider(openmct));
|
openmct.objectViews.addProvider(new FlexibleLayoutViewProvider.default(openmct));
|
||||||
|
|
||||||
openmct.types.addType('flexible-layout', {
|
openmct.types.addType('flexible-layout', {
|
||||||
name: 'Flexible Layout',
|
name: 'Flexible Layout',
|
||||||
|
|||||||
@@ -19,50 +19,51 @@
|
|||||||
* 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 GridViewComponent from './components/GridView.vue';
|
||||||
|
import { ALLOWED_FOLDER_TYPES } from './constants.js';
|
||||||
|
import mount from 'utils/mount';
|
||||||
|
|
||||||
define(['./components/GridView.vue', './constants.js', 'vue'], function (
|
export default class FolderGridView {
|
||||||
GridViewComponent,
|
constructor(openmct) {
|
||||||
constants,
|
this.openmct = openmct;
|
||||||
Vue
|
this.key = 'grid';
|
||||||
) {
|
this.name = 'Grid View';
|
||||||
function FolderGridView(openmct) {
|
this.cssClass = 'icon-thumbs-strip';
|
||||||
const ALLOWED_FOLDER_TYPES = constants.ALLOWED_FOLDER_TYPES;
|
}
|
||||||
|
canView(domainObject) {
|
||||||
|
return ALLOWED_FOLDER_TYPES.includes(domainObject.type);
|
||||||
|
}
|
||||||
|
|
||||||
|
view(domainObject) {
|
||||||
return {
|
return {
|
||||||
key: 'grid',
|
show: (element) => {
|
||||||
name: 'Grid View',
|
const { destroy } = mount(
|
||||||
cssClass: 'icon-thumbs-strip',
|
{
|
||||||
canView: function (domainObject) {
|
components: {
|
||||||
return ALLOWED_FOLDER_TYPES.includes(domainObject.type);
|
GridViewComponent
|
||||||
},
|
},
|
||||||
view: function (domainObject) {
|
provide: {
|
||||||
let component;
|
openmct: this.openmct,
|
||||||
|
domainObject
|
||||||
return {
|
},
|
||||||
show: function (element) {
|
template: '<GridViewComponent></GridViewComponent>'
|
||||||
component = new Vue({
|
|
||||||
el: element,
|
|
||||||
components: {
|
|
||||||
gridViewComponent: GridViewComponent.default
|
|
||||||
},
|
|
||||||
provide: {
|
|
||||||
openmct,
|
|
||||||
domainObject
|
|
||||||
},
|
|
||||||
template: '<grid-view-component></grid-view-component>'
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
destroy: function (element) {
|
{
|
||||||
component.$destroy();
|
app: this.openmct.app,
|
||||||
component = undefined;
|
element
|
||||||
}
|
}
|
||||||
};
|
);
|
||||||
|
this._destroy = destroy;
|
||||||
},
|
},
|
||||||
priority: function () {
|
destroy: () => {
|
||||||
return 1;
|
if (this._destroy) {
|
||||||
|
this._destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return FolderGridView;
|
priority() {
|
||||||
});
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,52 +19,54 @@
|
|||||||
* 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 mount from 'utils/mount';
|
||||||
|
import ListViewComponent from './components/ListView.vue';
|
||||||
|
import Moment from 'moment';
|
||||||
|
import { ALLOWED_FOLDER_TYPES } from './constants.js';
|
||||||
|
|
||||||
define(['./components/ListView.vue', './constants.js', 'vue', 'moment'], function (
|
export default class FolderListView {
|
||||||
ListViewComponent,
|
constructor(openmct) {
|
||||||
constants,
|
this.openmct = openmct;
|
||||||
Vue,
|
this.key = 'list-view';
|
||||||
Moment
|
this.name = 'List View';
|
||||||
) {
|
this.cssClass = 'icon-list-view';
|
||||||
function FolderListView(openmct) {
|
}
|
||||||
const ALLOWED_FOLDER_TYPES = constants.ALLOWED_FOLDER_TYPES;
|
|
||||||
|
|
||||||
|
canView(domainObject) {
|
||||||
|
return ALLOWED_FOLDER_TYPES.includes(domainObject.type);
|
||||||
|
}
|
||||||
|
|
||||||
|
view(domainObject) {
|
||||||
return {
|
return {
|
||||||
key: 'list-view',
|
show: (element) => {
|
||||||
name: 'List View',
|
const { destroy } = mount(
|
||||||
cssClass: 'icon-list-view',
|
{
|
||||||
canView: function (domainObject) {
|
el: element,
|
||||||
return ALLOWED_FOLDER_TYPES.includes(domainObject.type);
|
components: {
|
||||||
},
|
ListViewComponent
|
||||||
view: function (domainObject) {
|
},
|
||||||
let component;
|
provide: {
|
||||||
|
openmct: this.openmct,
|
||||||
return {
|
domainObject,
|
||||||
show: function (element) {
|
Moment
|
||||||
component = new Vue({
|
},
|
||||||
el: element,
|
template: '<ListViewComponent></ListViewComponent>'
|
||||||
components: {
|
|
||||||
listViewComponent: ListViewComponent.default
|
|
||||||
},
|
|
||||||
provide: {
|
|
||||||
openmct,
|
|
||||||
domainObject,
|
|
||||||
Moment
|
|
||||||
},
|
|
||||||
template: '<list-view-component></list-view-component>'
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
destroy: function (element) {
|
{
|
||||||
component.$destroy();
|
app: this.openmct.app,
|
||||||
component = undefined;
|
element
|
||||||
}
|
}
|
||||||
};
|
);
|
||||||
|
this._destroy = destroy;
|
||||||
},
|
},
|
||||||
priority: function () {
|
destroy: () => {
|
||||||
return 1;
|
if (this._destroy) {
|
||||||
|
this._destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
priority() {
|
||||||
return FolderListView;
|
return 1;
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<a
|
<a
|
||||||
|
ref="root"
|
||||||
class="l-grid-view__item c-grid-item js-folder-child"
|
class="l-grid-view__item c-grid-item js-folder-child"
|
||||||
:class="[
|
:class="[
|
||||||
{
|
{
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
},
|
},
|
||||||
statusClass
|
statusClass
|
||||||
]"
|
]"
|
||||||
@click="navigate"
|
@click="navigate($event)"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="c-grid-item__type-icon"
|
class="c-grid-item__type-icon"
|
||||||
@@ -69,7 +70,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navigate() {
|
navigate(_event) {
|
||||||
this.openmct.router.navigate(this.objectLink);
|
this.openmct.router.navigate(this.objectLink);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<tr
|
<tr
|
||||||
|
ref="root"
|
||||||
class="c-list-item js-folder-child"
|
class="c-list-item js-folder-child"
|
||||||
:class="{
|
:class="{
|
||||||
'is-alias': item.isAlias === true
|
'is-alias': item.isAlias === true
|
||||||
|
|||||||
@@ -23,11 +23,10 @@ export default {
|
|||||||
this.composition.on('remove', this.remove);
|
this.composition.on('remove', this.remove);
|
||||||
this.composition.load();
|
this.composition.load();
|
||||||
},
|
},
|
||||||
destroyed() {
|
beforeUnmount() {
|
||||||
if (!this.composition) {
|
if (!this.composition) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.composition.off('add', this.add);
|
this.composition.off('add', this.add);
|
||||||
this.composition.off('remove', this.remove);
|
this.composition.off('remove', this.remove);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default {
|
|||||||
this.status = this.openmct.status.get(identifier);
|
this.status = this.openmct.status.get(identifier);
|
||||||
this.removeStatusListener = this.openmct.status.observe(identifier, this.setStatus);
|
this.removeStatusListener = this.openmct.status.observe(identifier, this.setStatus);
|
||||||
},
|
},
|
||||||
destroyed() {
|
unmounted() {
|
||||||
this.removeStatusListener();
|
this.removeStatusListener();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user