mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +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:
parent
9e5eddec9b
commit
8e54b8a819
@ -20,20 +20,13 @@
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
export default class LADTableCompositionPolicy {
|
||||
|
||||
constructor(openmct) {
|
||||
this.openmct = openmct;
|
||||
return this.allow.bind(this);
|
||||
}
|
||||
|
||||
allow(parent, child) {
|
||||
export default function ladTableCompositionPolicy(openmct) {
|
||||
return function (parent, child) {
|
||||
if(parent.type === 'LadTable') {
|
||||
return this.openmct.telemetry.isTelemetryObject(child);
|
||||
return openmct.telemetry.isTelemetryObject(child);
|
||||
} else if(parent.type === 'LadTableSet') {
|
||||
return child.type === 'LadTable';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
*****************************************************************************/
|
||||
import LADTableViewProvider from './LADTableViewProvider';
|
||||
import LADTableSetViewProvider from './LADTableSetViewProvider';
|
||||
import LADTableCompositionPolicy from './LADTableCompositionPolicy';
|
||||
import ladTableCompositionPolicy from './LADTableCompositionPolicy';
|
||||
|
||||
export default function plugin() {
|
||||
return function install(openmct) {
|
||||
@ -49,6 +49,6 @@ export default function plugin() {
|
||||
}
|
||||
});
|
||||
|
||||
openmct.composition.addPolicy(new LADTableCompositionPolicy(openmct));
|
||||
openmct.composition.addPolicy(ladTableCompositionPolicy(openmct));
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user