Compare commits

..

6 Commits

6 changed files with 74 additions and 62 deletions

View File

@ -288,8 +288,6 @@ define([
this.install(this.plugins.ObjectInterceptors()); this.install(this.plugins.ObjectInterceptors());
this.install(this.plugins.NonEditableFolder()); this.install(this.plugins.NonEditableFolder());
this.install(this.plugins.DeviceClassifier()); this.install(this.plugins.DeviceClassifier());
this._isVue = true;
} }
MCT.prototype = Object.create(EventEmitter.prototype); MCT.prototype = Object.create(EventEmitter.prototype);

View File

@ -180,13 +180,9 @@ export default {
this.openmct.notifications.alert(message); this.openmct.notifications.alert(message);
} }
if (this.openmct.editor.isEditing()) { const relativeHash = hash.slice(hash.indexOf('#'));
this.previewEmbed(); const url = new URL(relativeHash, `${location.protocol}//${location.host}${location.pathname}`);
} else { this.openmct.router.navigate(url.hash);
const relativeHash = hash.slice(hash.indexOf('#'));
const url = new URL(relativeHash, `${location.protocol}//${location.host}${location.pathname}`);
this.openmct.router.navigate(url.hash);
}
}, },
formatTime(unixTime, timeFormat) { formatTime(unixTime, timeFormat) {
return Moment.utc(unixTime).format(timeFormat); return Moment.utc(unixTime).format(timeFormat);

View File

@ -21,57 +21,67 @@
--> -->
<template> <template>
<div class="u-contents"> <div class="u-contents">
<div v-if="canEdit" <ul v-if="canEdit"
class="grid-row" class="l-inspector-part"
> >
<div class="grid-cell label" <h2 v-if="heading"
:title="editTitle" :title="heading"
>{{ shortLabel }}</div> >{{ heading }}</h2>
<div class="grid-cell value"> <li class="grid-row">
<div class="c-click-swatch c-click-swatch--menu" <div class="grid-cell label"
@click="toggleSwatch()" :title="editTitle"
> >{{ shortLabel }}</div>
<span class="c-color-swatch" <div class="grid-cell value">
:style="{ background: currentColor }" <div class="c-click-swatch c-click-swatch--menu"
@click="toggleSwatch()"
> >
</span> <span class="c-color-swatch"
</div> :style="{ background: currentColor }"
<div class="c-palette c-palette--color">
<div v-show="swatchActive"
class="c-palette__items"
>
<div v-for="group in colorPaletteGroups"
:key="group.id"
class="u-contents"
> >
<div v-for="color in group" </span>
:key="color.id" </div>
class="c-palette__item" <div class="c-palette c-palette--color">
:class="{ 'selected': currentColor === color.hexString }" <div v-show="swatchActive"
:style="{ background: color.hexString }" class="c-palette__items"
@click="setColor(color)" >
<div v-for="group in colorPaletteGroups"
:key="group.id"
class="u-contents"
> >
<div v-for="color in group"
:key="color.id"
class="c-palette__item"
:class="{ 'selected': currentColor === color.hexString }"
:style="{ background: color.hexString }"
@click="setColor(color)"
>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </li>
</div> </ul>
<div v-else <ul v-else
class="grid-row" class="l-inspector-part"
> >
<div class="grid-cell label" <h2 v-if="heading"
:title="viewTitle" :title="heading"
>{{ shortLabel }}</div> >{{ heading }}</h2>
<div class="grid-cell value"> <li class="grid-row">
<span class="c-color-swatch" <div class="grid-cell label"
:style="{ :title="viewTitle"
'background': currentColor >{{ shortLabel }}</div>
}" <div class="grid-cell value">
> <span class="c-color-swatch"
</span> :style="{
</div> 'background': currentColor
</div> }"
>
</span>
</div>
</li>
</ul>
</div> </div>
</template> </template>
@ -104,6 +114,12 @@ export default {
default() { default() {
return 'Color'; return 'Color';
} }
},
heading: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {

View File

@ -107,7 +107,7 @@ export default {
}; };
this.openmct.objects.mutate( this.openmct.objects.mutate(
this.domainObject, this.domainObject,
`configuration.barStyles[${key}]`, `configuration.barStyles[${this.key}]`,
this.domainObject.configuration.barStyles[key] this.domainObject.configuration.barStyles[key]
); );
} else { } else {

View File

@ -33,9 +33,9 @@
</li> </li>
<ColorSwatch v-if="expanded" <ColorSwatch v-if="expanded"
:current-color="currentColor" :current-color="currentColor"
title="Manually set the color for this bar graph series." title="Manually set the color for this bar graph."
edit-title="Manually set the color for this bar graph series" edit-title="Manually set the color for this bar graph"
view-title="The color for this bar graph series." view-title="The color for this bar graph."
short-label="Color" short-label="Color"
class="grid-properties" class="grid-properties"
@colorSet="setColor" @colorSet="setColor"

View File

@ -20,13 +20,15 @@
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<template> <template>
<ul class="c-tree"> <div>
<h2 title="Display properties for this object">Bar Graph Series</h2> <ul class="c-tree">
<bar-graph-options v-for="series in domainObject.composition" <li v-for="series in domainObject.composition"
:key="series.key" :key="series.key"
:item="series" >
/> <bar-graph-options :item="series" />
</ul> </li>
</ul>
</div>
</template> </template>
<script> <script>