diff --git a/client/App.vue b/client/App.vue index 18eebe7cf..cd4a074df 100644 --- a/client/App.vue +++ b/client/App.vue @@ -28,6 +28,8 @@ import { getEnvironmentList, getEnvironmentLocation, getLatestNewsItems, + parseStringToBoolean, + workflowHistoryEventHighlightListAddOrUpdate, } from '~helpers'; export default { @@ -77,6 +79,18 @@ export default { localStorage.getItem(LOCAL_STORAGE_SETTINGS.timezone) || TIMEZONE_LOCAL, timezoneOptions: TIMEZONE_OPTIONS, + workflowHistoryEventHighlightList: + JSON.parse( + localStorage.getItem( + LOCAL_STORAGE_SETTINGS.workflowHistoryEventHighlightList + ) + ) || [], + workflowHistoryEventHighlightListEnabled: parseStringToBoolean( + localStorage.getItem( + LOCAL_STORAGE_SETTINGS.workflowHistoryEventHighlightListEnabled + ), + true + ), }, }; }, @@ -144,14 +158,39 @@ export default { onSettingsChange(values) { for (const key in values) { const value = values[key]; + const storeValue = + typeof value === 'object' ? JSON.stringify(value) : value; + + localStorage.setItem(LOCAL_STORAGE_SETTINGS[key], storeValue); - localStorage.setItem(LOCAL_STORAGE_SETTINGS[key], value); this.settings[key] = value; } }, onSettingsClick() { this.$modal.show('settings-modal'); }, + onWorkflowHistoryEventParamToggle({ + eventParam: { key: eventParamName, isHighlighted }, + eventType, + }) { + const { + settings: { workflowHistoryEventHighlightList }, + } = this; + + this.settings.workflowHistoryEventHighlightList = workflowHistoryEventHighlightListAddOrUpdate( + { + eventParamName, + eventType, + isEnabled: !isHighlighted, + workflowHistoryEventHighlightList, + } + ); + + localStorage.setItem( + LOCAL_STORAGE_SETTINGS.workflowHistoryEventHighlightList, + JSON.stringify(this.settings.workflowHistoryEventHighlightList) + ); + }, }, watch: { 'notification.show'(value) { @@ -239,6 +278,13 @@ export default { :date-format="settings.dateFormat" :time-format="settings.timeFormat" :timezone="settings.timezone" + :workflow-history-event-highlight-list=" + settings.workflowHistoryEventHighlightList + " + :workflow-history-event-highlight-list-enabled=" + settings.workflowHistoryEventHighlightListEnabled + " + @onWorkflowHistoryEventParamToggle="onWorkflowHistoryEventParamToggle" @onNotification="onNotification" > @@ -251,7 +297,13 @@ export default { :time-format-options="settings.timeFormatOptions" :timezone="settings.timezone" :timezone-options="settings.timezoneOptions" - @onChange="onSettingsChange" + :workflow-history-event-highlight-list=" + settings.workflowHistoryEventHighlightList + " + :workflow-history-event-highlight-list-enabled=" + settings.workflowHistoryEventHighlightListEnabled + " + @change="onSettingsChange" /> diff --git a/client/components/button-icon.vue b/client/components/button-icon.vue index aacc16e1a..911ca3ac0 100644 --- a/client/components/button-icon.vue +++ b/client/components/button-icon.vue @@ -1,6 +1,9 @@ @@ -23,6 +28,9 @@ export default { type: String, validator: value => ['primary', 'secondary'].includes(value), }, + disabled: { + type: Boolean, + }, href: { type: String, }, @@ -46,7 +54,9 @@ export default { }, methods: { onClick(...args) { - this.$emit('click', ...args); + if (!this.disabled) { + this.$emit('click', ...args); + } }, }, }; @@ -64,6 +74,11 @@ export default { transition: all 400ms ease; white-space: nowrap; + &.disabled { + opacity: 0.5; + cursor: not-allowed; + } + .icon { vertical-align: middle; } diff --git a/client/components/data-viewer.vue b/client/components/data-viewer.vue index c5bc78b8e..4335a9106 100644 --- a/client/components/data-viewer.vue +++ b/client/components/data-viewer.vue @@ -5,12 +5,7 @@ class="view-full-screen" @click.stop.prevent="viewFullScreen" > - {{ - item.jsonStringDisplay - }} -
{{
-      item.jsonStringDisplay
-    }}
+ {{ item.jsonStringDisplay }} @@ -21,7 +16,7 @@ import Prism from 'vue-prism-component'; export default { name: 'data-viewer', - props: ['compact', 'highlight', 'item', 'title'], + props: ['compact', 'item', 'title'], data() { return {}; }, @@ -42,9 +37,7 @@ export default { this.$el.classList[action]('overflow'); }; window.addEventListener('resize', this.checkOverflow); - ['item', 'highlight', 'compact'].forEach(e => - this.$watch(e, this.checkOverflow) - ); + ['item', 'compact'].forEach(e => this.$watch(e, this.checkOverflow)); this.$watch(() => this.$route, this.checkOverflow); }, mounted() { diff --git a/client/components/detail-list.vue b/client/components/detail-list.vue index 2a5912c7c..22254b75b 100644 --- a/client/components/detail-list.vue +++ b/client/components/detail-list.vue @@ -1,12 +1,14 @@ diff --git a/client/components/flex-grid.vue b/client/components/flex-grid.vue index a3eecffd5..c5bba313b 100644 --- a/client/components/flex-grid.vue +++ b/client/components/flex-grid.vue @@ -3,6 +3,7 @@ class="flex-grid" :style="{ 'align-items': alignItems, + 'flex-direction': flexDirection, 'justify-content': justifyContent, width: width, }" @@ -13,14 +14,27 @@ diff --git a/client/components/highlight-toggle.vue b/client/components/highlight-toggle.vue new file mode 100644 index 000000000..985fcd058 --- /dev/null +++ b/client/components/highlight-toggle.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/client/components/index.js b/client/components/index.js index cb0a9d080..c97b4aaf4 100644 --- a/client/components/index.js +++ b/client/components/index.js @@ -10,6 +10,7 @@ export { default as ErrorMessage } from './error-message'; export { default as FeatureFlag } from './feature-flag'; export { default as FlexGrid } from './flex-grid'; export { default as FlexGridItem } from './flex-grid-item'; +export { default as HighlightToggle } from './highlight-toggle'; export { default as LoadingMessage } from './loading-message'; export { default as LoadingSpinner } from './loading-spinner'; export { default as NavigationBar } from './navigation-bar'; diff --git a/client/components/settings-modal.vue b/client/components/settings-modal.vue deleted file mode 100644 index 17ed5648d..000000000 --- a/client/components/settings-modal.vue +++ /dev/null @@ -1,258 +0,0 @@ - - - - - diff --git a/client/components/settings-modal/components/settings-date-format.vue b/client/components/settings-modal/components/settings-date-format.vue new file mode 100644 index 000000000..837c61dc6 --- /dev/null +++ b/client/components/settings-modal/components/settings-date-format.vue @@ -0,0 +1,184 @@ + + + diff --git a/client/components/settings-modal/components/settings-footer.vue b/client/components/settings-modal/components/settings-footer.vue new file mode 100644 index 000000000..4bb0086aa --- /dev/null +++ b/client/components/settings-modal/components/settings-footer.vue @@ -0,0 +1,42 @@ + + + diff --git a/client/components/settings-modal/components/settings-header.vue b/client/components/settings-modal/components/settings-header.vue new file mode 100644 index 000000000..ffc5378c8 --- /dev/null +++ b/client/components/settings-modal/components/settings-header.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/client/components/settings-modal/components/settings-list.vue b/client/components/settings-modal/components/settings-list.vue new file mode 100644 index 000000000..06baac0a0 --- /dev/null +++ b/client/components/settings-modal/components/settings-list.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/client/components/settings-modal/components/settings-toggle.vue b/client/components/settings-modal/components/settings-toggle.vue new file mode 100644 index 000000000..0fd8b2b46 --- /dev/null +++ b/client/components/settings-modal/components/settings-toggle.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/client/components/settings-modal/components/settings-workflow-history.vue b/client/components/settings-modal/components/settings-workflow-history.vue new file mode 100644 index 000000000..f00bbfc05 --- /dev/null +++ b/client/components/settings-modal/components/settings-workflow-history.vue @@ -0,0 +1,248 @@ + + + + + diff --git a/client/components/settings-modal/constants.js b/client/components/settings-modal/constants.js new file mode 100644 index 000000000..fb76b57cf --- /dev/null +++ b/client/components/settings-modal/constants.js @@ -0,0 +1,10 @@ +export const SETTINGS_VIEW_LIST = [ + { + displayName: 'DateTime', + name: 'settings-date-format', + }, + { + displayName: 'Workflow History', + name: 'settings-workflow-history', + }, +]; diff --git a/client/components/settings-modal/index.vue b/client/components/settings-modal/index.vue new file mode 100644 index 000000000..06a6c6151 --- /dev/null +++ b/client/components/settings-modal/index.vue @@ -0,0 +1,153 @@ + + + + + diff --git a/client/components/text-input.vue b/client/components/text-input.vue index bc8f29b2c..2d0a01122 100644 --- a/client/components/text-input.vue +++ b/client/components/text-input.vue @@ -1,6 +1,7 @@