mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 16:49:42 +00:00
LAD Table (Set) Composition Policy (#2962)
* added LAD Table composition policy, with a check for lad table sets, child can only be lad table Co-authored-by: Andrew Henry <akhenry@gmail.com> Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
This commit is contained in:
@ -20,20 +20,13 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
export default class LADTableCompositionPolicy {
|
export default function ladTableCompositionPolicy(openmct) {
|
||||||
|
return function (parent, child) {
|
||||||
constructor(openmct) {
|
|
||||||
this.openmct = openmct;
|
|
||||||
return this.allow.bind(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
allow(parent, child) {
|
|
||||||
if(parent.type === 'LadTable') {
|
if(parent.type === 'LadTable') {
|
||||||
return this.openmct.telemetry.isTelemetryObject(child);
|
return openmct.telemetry.isTelemetryObject(child);
|
||||||
} else if(parent.type === 'LadTableSet') {
|
} else if(parent.type === 'LadTableSet') {
|
||||||
return child.type === 'LadTable';
|
return child.type === 'LadTable';
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
import LADTableViewProvider from './LADTableViewProvider';
|
import LADTableViewProvider from './LADTableViewProvider';
|
||||||
import LADTableSetViewProvider from './LADTableSetViewProvider';
|
import LADTableSetViewProvider from './LADTableSetViewProvider';
|
||||||
import LADTableCompositionPolicy from './LADTableCompositionPolicy';
|
import ladTableCompositionPolicy from './LADTableCompositionPolicy';
|
||||||
|
|
||||||
export default function plugin() {
|
export default function plugin() {
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
@ -49,6 +49,6 @@ export default function plugin() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
openmct.composition.addPolicy(new LADTableCompositionPolicy(openmct));
|
openmct.composition.addPolicy(ladTableCompositionPolicy(openmct));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user