Compare commits

...

3 Commits

Author SHA1 Message Date
David Tsay
488beb5b3f new colors show better on espresso and snow themes 2022-01-06 11:25:33 -08:00
David Tsay
2f63718385 use relative path (#4683) 2022-01-06 11:14:21 -08:00
Shefali Joshi
433f1bf28e Fix object creation (#4675)
* Save the object before adding it to the parent so that transaction committing works properly
* Fix object creation - composition policy changes
2022-01-05 11:05:02 -08:00
6 changed files with 30 additions and 19 deletions

View File

@@ -39,8 +39,10 @@ export default class ConditionSetViewProvider {
return isConditionSet && this.openmct.router.isNavigatedObject(objectPath);
}
canEdit(domainObject) {
return domainObject.type === 'conditionSet';
canEdit(domainObject, objectPath) {
const isConditionSet = domainObject.type === 'conditionSet';
return isConditionSet && this.openmct.router.isNavigatedObject(objectPath);
}
view(domainObject, objectPath) {

View File

@@ -99,6 +99,7 @@ export default class CreateAction extends PropertiesAction {
*/
async _navigateAndEdit(domainObject, parentDomainObjectpath) {
let objectPath;
let self = this;
if (parentDomainObjectpath) {
objectPath = parentDomainObjectpath && [domainObject].concat(parentDomainObjectpath);
} else {
@@ -110,15 +111,20 @@ export default class CreateAction extends PropertiesAction {
.reverse()
.join('/');
this.openmct.router.navigate(url);
const objectView = this.openmct.objectViews.get(domainObject, objectPath)[0];
function editObject() {
const objectView = self.openmct.objectViews.get(domainObject, objectPath)[0];
const canEdit = objectView && objectView.canEdit && objectView.canEdit(domainObject, objectPath);
if (canEdit) {
this.openmct.editor.edit();
self.openmct.editor.edit();
}
}
this.openmct.router.once('afterNavigation', editObject);
this.openmct.router.navigate(url);
}
/**
* @private
*/

View File

@@ -29,10 +29,9 @@ define(
}
SummaryWidgetsCompositionPolicy.prototype.allow = function (parent, child) {
const parentType = parent.getCapability('type');
const newStyleChild = child.useCapability('adapter');
const parentType = parent.type;
if (parentType.instanceOf('summary-widget') && !this.openmct.telemetry.isTelemetryObject(newStyleChild)) {
if (parentType === 'summary-widget' && !this.openmct.telemetry.isTelemetryObject(child)) {
return false;
}

View File

@@ -21,7 +21,7 @@
*****************************************************************************/
export const COLOR_PALETTE = [
[0x00, 0x37, 0xFF],
[0x43, 0xB0, 0xFF],
[0xF0, 0x60, 0x00],
[0x00, 0x70, 0x40],
[0xFB, 0x49, 0x49],
@@ -30,25 +30,25 @@ export const COLOR_PALETTE = [
[0xFF, 0xA6, 0x3D],
[0x05, 0xA3, 0x00],
[0xF0, 0x00, 0x6C],
[0x77, 0x17, 0x7A],
[0xAC, 0x54, 0xAE],
[0x23, 0xA9, 0xDB],
[0xFA, 0xF0, 0x6F],
[0x4E, 0xF0, 0x48],
[0xC7, 0xBE, 0x52],
[0x5A, 0xBD, 0x56],
[0xAD, 0x50, 0x72],
[0x94, 0x25, 0xEA],
[0x21, 0x87, 0x82],
[0x8F, 0x6E, 0x47],
[0xf0, 0x59, 0xcb],
[0x34, 0xB6, 0x7D],
[0x6A, 0x36, 0xFF],
[0x56, 0xF0, 0xE8],
[0x7F, 0x52, 0xFF],
[0x46, 0xC7, 0xC0],
[0xA1, 0x8C, 0x1C],
[0xCB, 0xE1, 0x44],
[0x95, 0xB1, 0x26],
[0xFF, 0x84, 0x9E],
[0xB7, 0x79, 0xE7],
[0x8C, 0xC9, 0xFD],
[0xDB, 0xAA, 0x6E],
[0xB8, 0xDF, 0x97],
[0x93, 0xB5, 0x77],
[0xFF, 0xBC, 0xDA],
[0xD3, 0xB6, 0xDE]
];

View File

@@ -445,6 +445,10 @@ export default {
}
// sorting composition items
if (!a.name || !b.name) {
return 0;
}
if (a.name.toLowerCase()
> b.name.toLowerCase()) {
return 1;

View File

@@ -1,4 +1,4 @@
import objectPathToUrl from '/src/tools/url';
import objectPathToUrl from '../../tools/url';
export default {
inject: ['openmct'],