Compare commits

..

2 Commits

Author SHA1 Message Date
charlesh88
6d0294261d UI Various 2
- Change Status area Indicators to right-justify;
- Adjust Status area collapse toggle button margin;
2019-09-11 22:44:15 -07:00
charlesh88
e04b916988 UI Various 2
- Fixes icon-gear margin for #2477;
- Now applies mixed visual style to toggle frame visibility button in
Layout toolbar for #2460;
2019-09-11 16:42:51 -07:00
13 changed files with 25 additions and 78 deletions

View File

@@ -19,7 +19,8 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, objectUtils) {
define(['zepto'], function ($) {
/**
* The ImportAsJSONAction is available from context menus and allows a user
@@ -60,9 +61,7 @@ define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, ob
ImportAsJSONAction.prototype.importObjectTree = function (objTree) {
var parent = this.context.domainObject;
var namespace = parent.useCapability('adapter').identifier.namespace;
var tree = this.generateNewIdentifiers(objTree, namespace);
var tree = this.generateNewIdentifiers(objTree);
var rootId = tree.rootId;
var rootObj = this.instantiate(tree.openmct[rootId], rootId);
var newStyleParent = parent.useCapability('adapter');
@@ -106,6 +105,7 @@ define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, ob
if (!tree[keystring] || seen.includes(keystring)) {
return;
}
newObj = this.instantiate(tree[keystring], keystring);
newObj.getCapability("location")
.setPrimaryLocation(tree[keystring].location);
@@ -114,17 +114,11 @@ define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, ob
}
};
ImportAsJSONAction.prototype.generateNewIdentifiers = function (tree, namespace) {
ImportAsJSONAction.prototype.generateNewIdentifiers = function (tree) {
// For each domain object in the file, generate new ID, replace in tree
Object.keys(tree.openmct).forEach(function (domainObjectId) {
let newId = {
namespace: namespace,
key: this.identifierService.generate()
};
let oldId = objectUtils.parseKeyString(domainObjectId);
tree = this.rewriteId(oldId, newId, tree);
var newId = this.identifierService.generate();
tree = this.rewriteId(domainObjectId, newId, tree);
}, this);
return tree;
};
@@ -135,21 +129,9 @@ define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, ob
*
* @private
*/
ImportAsJSONAction.prototype.rewriteId = function (oldId, newId, tree) {
let newIdKeyString = this.openmct.objects.makeKeyString(newId);
let oldIdKeyString = this.openmct.objects.makeKeyString(oldId);
tree = JSON.stringify(tree).replace(new RegExp(oldIdKeyString, 'g'), newIdKeyString);
return JSON.parse(tree, (key, value) => {
if (Object.prototype.hasOwnProperty.call(value, 'key') &&
Object.prototype.hasOwnProperty.call(value, 'namespace') &&
value.key === oldId.key &&
value.namespace === oldId.namespace) {
return newId
} else {
return value;
}
});
ImportAsJSONAction.prototype.rewriteId = function (oldID, newID, tree) {
tree = JSON.stringify(tree).replace(new RegExp(oldID, 'g'), newID);
return JSON.parse(tree);
};
ImportAsJSONAction.prototype.getFormModel = function () {

View File

@@ -53,7 +53,6 @@
&__filter-indicator {
color: $colorFilter;
width: 1.2em; // Set width explicitly for layout reasons: will either have class icon-filter, or none.
flex: 0 0 auto;
}
}
</style>
@@ -132,4 +131,4 @@
}
}
}
</script>
</script>

View File

@@ -117,7 +117,7 @@
<div class="gl-plot-label gl-plot-y-label"
ng-class="{'icon-gear': (yKeyOptions.length > 1 && series.length === 1)}"
>{{yAxis.get('label')}}
ng-bind="yAxisLabel">
</div>
<select class="gl-plot-y-label__select local-controls--hidden"

View File

@@ -526,7 +526,6 @@ define([
if (yAxisObject) {
series.emit('change:yKey', yAxisObject.key);
this.config.yAxis.set('label', label);
this.$scope.yAxisLabel = label;
}
};

View File

@@ -73,8 +73,7 @@ define([
) {
var bundleMap = {
LocalStorage: 'platform/persistence/local',
MyItems: 'platform/features/my-items',
CouchDB: 'platform/persistence/couch'
MyItems: 'platform/features/my-items'
};
var plugins = _.mapValues(bundleMap, function (bundleName, pluginName) {

View File

@@ -180,7 +180,7 @@ define([
inputArea.html('');
this.valueInputs = [];
this.config.values = this.config.values || [];
this.config.values = [];
if (evaluator.getInputCount(operation)) {
inputCount = evaluator.getInputCount(operation);
@@ -191,10 +191,8 @@ define([
newInput = $('<select>' + this.generateSelectOptions() + '</select>');
emitChange = true;
} else {
const defaultValue = inputType === 'number' ? 0 : '';
const value = this.config.values[index] || defaultValue;
this.config.values[index] = value;
newInput = $('<input type = "' + inputType + '" value = "' + value + '"></input>');
this.config.values[index] = inputType === 'number' ? 0 : '';
newInput = $('<input type = "' + inputType + '" value = "' + this.config.values[index] + '"> </input>');
}
this.valueInputs.push(newInput.get(0));

View File

@@ -252,8 +252,8 @@ define([
ruleOrder.push(ruleId);
this.domainObject.configuration.ruleOrder = ruleOrder;
this.initRule(ruleId, 'Rule');
this.updateDomainObject();
this.initRule(ruleId, 'Rule');
this.refreshRules();
};
@@ -281,8 +281,8 @@ define([
ruleOrder.splice(ruleOrder.indexOf(sourceRuleId) + 1, 0, ruleId);
this.domainObject.configuration.ruleOrder = ruleOrder;
this.domainObject.configuration.ruleConfigById[ruleId] = sourceConfig;
this.initRule(ruleId, sourceConfig.name);
this.updateDomainObject();
this.initRule(ruleId, sourceConfig.name);
this.refreshRules();
};

View File

@@ -59,14 +59,13 @@ define([
this.requestDataFor = this.requestDataFor.bind(this);
this.updateFilters = this.updateFilters.bind(this);
this.buildOptionsFromConfiguration = this.buildOptionsFromConfiguration.bind(this);
this.sortBoundedRowsByTimeSystem = this.sortBoundedRowsByTimeSystem.bind(this);
this.filterObserver = undefined;
this.createTableRowCollections();
openmct.time.on('bounds', this.refreshData);
openmct.time.on('timeSystem', this.sortBoundedRowsByTimeSystem);
openmct.time.on('timeSystem', this.refreshData);
}
initialize() {
@@ -183,18 +182,14 @@ define([
if (!isTick) {
this.filteredRows.clear();
this.boundedRows.clear();
this.boundedRows.sortByTimeSystem(this.openmct.time.timeSystem());
this.telemetryObjects.forEach(this.requestDataFor);
}
}
sortBoundedRowsByTimeSystem(timeSystem) {
this.boundedRows.sortByTimeSystem(timeSystem);
}
clearData() {
this.filteredRows.clear();
this.boundedRows.clear();
this.emit('refresh');
}
getColumnMapForObject(objectKeyString) {

View File

@@ -261,12 +261,7 @@
height: 18px; // Needed when a row has empty values in its cells
&.is-selected {
background-color: $colorSelectedBg !important;
color: $colorSelectedFg !important;
td {
background: none !important;
color: inherit !important;
}
background-color: $colorSelectedBg;
}
}

View File

@@ -271,15 +271,6 @@ input[type=number]::-webkit-outer-spin-button {
}
}
input[type=number].c-input-number--no-spinners {
&::-webkit-inner-spin-button,
&::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
-moz-appearance: textfield;
}
.c-labeled-input {
// An input used in the Toolbar
// Assumes label is before the input

View File

@@ -483,7 +483,6 @@ body.mobile.phone {
.widget-edit-holder {
display: flex; // Overrides `display: none` during Browse mode
flex: 1 1 auto;
overflow: hidden;
.flex-accordion-holder {
// Needed because otherwise accordion elements "creep" when contents expand and contract
@@ -631,8 +630,6 @@ body.mobile.phone {
.c-sw-rule {
&__grippy-wrapper {
$d: 8px;
flex: 0 0 auto;
cursor: move;
width: $d; height: $d;
transform: translateY(-1px);
}

View File

@@ -127,16 +127,9 @@ const PLACEHOLDER_OBJECT = {};
}
},
saveAndFinishEditing() {
let dialog = this.openmct.overlays.progressDialog({
progressPerc: 'unknown',
progressText: 'Saving...',
});
return this.openmct.editor.save().then(()=> {
dialog.dismiss();
this.openmct.notifications.info('Save successful');
}).catch((error) => {
dialog.dismiss();
this.openmct.notifications.error('Error saving objects');
console.error(error);
});

View File

@@ -107,19 +107,19 @@
.c-indicator__label {
box-shadow: $colorIndicatorMenuBgShdw;
transform: scale(1.0);
transition: all 100ms ease-out 100ms;
transition: transform 100ms ease-out 100ms;
}
}
.c-indicator__label {
transition: all 250ms ease-in 200ms;
transition: transform 250ms ease-in 200ms;
background: $colorIndicatorMenuBg;
color: $colorIndicatorMenuFg;
border-radius: $controlCr;
right: 0;
left: 0;
top: 130%;
padding: $interiorMargin $interiorMargin;
position: absolute;
transform-origin: 90% 0;
transform-origin: 10px 0;
transform: scale(0.0);
overflow: visible;
z-index: 50;
@@ -130,7 +130,6 @@
display: block;
position: absolute;
bottom: 100%;
right: 8px;
@include triangle('up', $size: 4px, $ratio: 1, $color: $colorIndicatorMenuBg);
}
}