Skip to content

Commit 02cb9ff

Browse files
authored
Release/3.19.0 (#181)
* fixing eslint (#175) * Feature/global component changes (#176) * component changes for event history highlight * adding reference to where highlight is used in the code * changes to move settings-modal into a folder. breaking into smaller reusable components. (#177) * Adding workflow event type to helpers and add constant type. (#178) * New helpers which manage workflowHistoryEventHighlightList. (#179) * Helper changes for highlight toggle (#180) * Feature/workflow history highlight toggle (#182) * New helpers which manage workflowHistoryEventHighlightList. * Helper changes for highlight toggle * adding highlight-toggle to workflow history * Feature/workflow history settings modal (#183) * New helpers which manage workflowHistoryEventHighlightList. * Helper changes for highlight toggle * adding highlight-toggle to workflow history * Add workflow history screen to settings modal * 3.19.0-beta.0 * fix/spec eslint fixes (#185) * New helpers which manage workflowHistoryEventHighlightList. * Helper changes for highlight toggle * adding highlight-toggle to workflow history * Add workflow history screen to settings modal * 3.19.0-beta.0 * fixing eslint on spec files. * fixing previous dates and adding 3.19.0 release notes (#184) * 3.19.0-beta.1 * 3.19.0
1 parent 25e8055 commit 02cb9ff

File tree

55 files changed

+1815
-375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1815
-375
lines changed

client/App.vue

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import {
2828
getEnvironmentList,
2929
getEnvironmentLocation,
3030
getLatestNewsItems,
31+
parseStringToBoolean,
32+
workflowHistoryEventHighlightListAddOrUpdate,
3133
} from '~helpers';
3234
3335
export default {
@@ -77,6 +79,18 @@ export default {
7779
localStorage.getItem(LOCAL_STORAGE_SETTINGS.timezone) ||
7880
TIMEZONE_LOCAL,
7981
timezoneOptions: TIMEZONE_OPTIONS,
82+
workflowHistoryEventHighlightList:
83+
JSON.parse(
84+
localStorage.getItem(
85+
LOCAL_STORAGE_SETTINGS.workflowHistoryEventHighlightList
86+
)
87+
) || [],
88+
workflowHistoryEventHighlightListEnabled: parseStringToBoolean(
89+
localStorage.getItem(
90+
LOCAL_STORAGE_SETTINGS.workflowHistoryEventHighlightListEnabled
91+
),
92+
true
93+
),
8094
},
8195
};
8296
},
@@ -144,14 +158,39 @@ export default {
144158
onSettingsChange(values) {
145159
for (const key in values) {
146160
const value = values[key];
161+
const storeValue =
162+
typeof value === 'object' ? JSON.stringify(value) : value;
163+
164+
localStorage.setItem(LOCAL_STORAGE_SETTINGS[key], storeValue);
147165
148-
localStorage.setItem(LOCAL_STORAGE_SETTINGS[key], value);
149166
this.settings[key] = value;
150167
}
151168
},
152169
onSettingsClick() {
153170
this.$modal.show('settings-modal');
154171
},
172+
onWorkflowHistoryEventParamToggle({
173+
eventParam: { key: eventParamName, isHighlighted },
174+
eventType,
175+
}) {
176+
const {
177+
settings: { workflowHistoryEventHighlightList },
178+
} = this;
179+
180+
this.settings.workflowHistoryEventHighlightList = workflowHistoryEventHighlightListAddOrUpdate(
181+
{
182+
eventParamName,
183+
eventType,
184+
isEnabled: !isHighlighted,
185+
workflowHistoryEventHighlightList,
186+
}
187+
);
188+
189+
localStorage.setItem(
190+
LOCAL_STORAGE_SETTINGS.workflowHistoryEventHighlightList,
191+
JSON.stringify(this.settings.workflowHistoryEventHighlightList)
192+
);
193+
},
155194
},
156195
watch: {
157196
'notification.show'(value) {
@@ -239,6 +278,13 @@ export default {
239278
:date-format="settings.dateFormat"
240279
:time-format="settings.timeFormat"
241280
:timezone="settings.timezone"
281+
:workflow-history-event-highlight-list="
282+
settings.workflowHistoryEventHighlightList
283+
"
284+
:workflow-history-event-highlight-list-enabled="
285+
settings.workflowHistoryEventHighlightListEnabled
286+
"
287+
@onWorkflowHistoryEventParamToggle="onWorkflowHistoryEventParamToggle"
242288
@onNotification="onNotification"
243289
></router-view>
244290
<modals-container />
@@ -251,7 +297,13 @@ export default {
251297
:time-format-options="settings.timeFormatOptions"
252298
:timezone="settings.timezone"
253299
:timezone-options="settings.timezoneOptions"
254-
@onChange="onSettingsChange"
300+
:workflow-history-event-highlight-list="
301+
settings.workflowHistoryEventHighlightList
302+
"
303+
:workflow-history-event-highlight-list-enabled="
304+
settings.workflowHistoryEventHighlightListEnabled
305+
"
306+
@change="onSettingsChange"
255307
/>
256308
</main>
257309
</template>

client/components/button-icon.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<template>
22
<component
3+
:aria-disabled="disabled"
34
class="button-icon"
5+
:class="{ disabled: disabled }"
6+
:disabled="disabled"
47
:href="href"
58
:is="tag"
69
:to="to"
@@ -11,7 +14,9 @@
1114
:class="{ [icon]: icon, [color]: color }"
1215
:style="{ 'font-size': size }"
1316
/>
14-
<span class="label" :class="{ [color]: color }">{{ label }}</span>
17+
<span class="label" :class="{ [color]: color }" v-if="label">{{
18+
label
19+
}}</span>
1520
</component>
1621
</template>
1722

@@ -23,6 +28,9 @@ export default {
2328
type: String,
2429
validator: value => ['primary', 'secondary'].includes(value),
2530
},
31+
disabled: {
32+
type: Boolean,
33+
},
2634
href: {
2735
type: String,
2836
},
@@ -46,7 +54,9 @@ export default {
4654
},
4755
methods: {
4856
onClick(...args) {
49-
this.$emit('click', ...args);
57+
if (!this.disabled) {
58+
this.$emit('click', ...args);
59+
}
5060
},
5161
},
5262
};
@@ -64,6 +74,11 @@ export default {
6474
transition: all 400ms ease;
6575
white-space: nowrap;
6676
77+
&.disabled {
78+
opacity: 0.5;
79+
cursor: not-allowed;
80+
}
81+
6782
.icon {
6883
vertical-align: middle;
6984
}

client/components/data-viewer.vue

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
class="view-full-screen"
66
@click.stop.prevent="viewFullScreen"
77
></a>
8-
<prism v-if="highlight !== false" language="json" ref="codebox">{{
9-
item.jsonStringDisplay
10-
}}</prism>
11-
<pre v-if="highlight === false" ref="codebox">{{
12-
item.jsonStringDisplay
13-
}}</pre>
8+
<prism language="json" ref="codebox">{{ item.jsonStringDisplay }}</prism>
149
</div>
1510
</template>
1611

@@ -21,7 +16,7 @@ import Prism from 'vue-prism-component';
2116
2217
export default {
2318
name: 'data-viewer',
24-
props: ['compact', 'highlight', 'item', 'title'],
19+
props: ['compact', 'item', 'title'],
2520
data() {
2621
return {};
2722
},
@@ -42,9 +37,7 @@ export default {
4237
this.$el.classList[action]('overflow');
4338
};
4439
window.addEventListener('resize', this.checkOverflow);
45-
['item', 'highlight', 'compact'].forEach(e =>
46-
this.$watch(e, this.checkOverflow)
47-
);
40+
['item', 'compact'].forEach(e => this.$watch(e, this.checkOverflow));
4841
this.$watch(() => this.$route, this.checkOverflow);
4942
},
5043
mounted() {

client/components/detail-list.vue

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<script>
2-
import { DataViewer } from '~components';
2+
import DataViewer from './data-viewer';
3+
import HighlightToggle from './highlight-toggle';
34
import { preKeys } from '~constants';
45
56
export default {
67
name: 'detail-list',
7-
props: ['compact', 'highlight', 'item', 'title'],
8+
props: ['compact', 'isHighlightEnabled', 'item', 'title'],
89
components: {
910
'data-viewer': DataViewer,
11+
'highlight-toggle': HighlightToggle,
1012
},
1113
data() {
1214
return {};
@@ -17,7 +19,7 @@ export default {
1719
},
1820
},
1921
render(h) {
20-
const { highlight, compact, title } = this;
22+
const { compact, title } = this;
2123
2224
function dd(kvp) {
2325
if (kvp.routeLink) {
@@ -30,7 +32,6 @@ export default {
3032
props: {
3133
item: kvp.value,
3234
compact,
33-
highlight,
3435
title: `${title} - ${kvp.key}`,
3536
},
3637
}),
@@ -43,7 +44,19 @@ export default {
4344
{ class: 'details' },
4445
this.item.kvps.map(kvp =>
4546
h('div', { attrs: { 'data-prop': kvp.key } }, [
46-
h('dt', null, kvp.key),
47+
h('highlight-toggle', {
48+
props: {
49+
isHighlighted: kvp.isHighlighted,
50+
isEnabled: this.isHighlightEnabled,
51+
label: kvp.key,
52+
tag: 'dt',
53+
},
54+
on: {
55+
click: () => {
56+
this.$emit('onWorkflowHistoryEventParamToggle', kvp);
57+
},
58+
},
59+
}),
4760
h('dd', null, dd(kvp)),
4861
])
4962
)

client/components/feature-flag.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,21 @@ export default {
2424
},
2525
params: {
2626
type: Object,
27-
}
27+
},
2828
},
2929
data() {
3030
return {
3131
isFeatureFlagEnabled: false,
32-
}
32+
};
3333
},
3434
async mounted() {
3535
const { name, params } = this;
3636
const featureFlagService = new FeatureFlagService();
37-
this.isFeatureFlagEnabled = await featureFlagService.isFeatureFlagEnabled({ name, params });
37+
38+
this.isFeatureFlagEnabled = await featureFlagService.isFeatureFlagEnabled({
39+
name,
40+
params,
41+
});
3842
},
3943
};
4044
</script>

client/components/flex-grid.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
class="flex-grid"
44
:style="{
55
'align-items': alignItems,
6+
'flex-direction': flexDirection,
67
'justify-content': justifyContent,
78
width: width,
89
}"
@@ -13,14 +14,27 @@
1314

1415
<script>
1516
export default {
16-
props: ['alignItems', 'justifyContent', 'width'],
17+
props: {
18+
alignItems: {
19+
type: String,
20+
},
21+
flexDirection: {
22+
type: String,
23+
default: 'row',
24+
},
25+
justifyContent: {
26+
type: String,
27+
},
28+
width: {
29+
type: String,
30+
},
31+
},
1732
};
1833
</script>
1934

2035
<style lang="stylus">
2136
.flex-grid {
2237
display: flex;
23-
flex-direction: row;
2438
flex-wrap: wrap;
2539
}
2640
</style>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<template>
2+
<component class="highlight-toggle" :is="tag">
3+
<span class="label" :class="{ highlight: isHighlighted }">
4+
{{ label }}
5+
</span>
6+
<button-icon
7+
:class="{
8+
active: isHighlighted,
9+
disabled: !isEnabled,
10+
}"
11+
icon="icon_search"
12+
@click="onClick"
13+
/>
14+
</component>
15+
</template>
16+
17+
<script>
18+
import ButtonIcon from './button-icon';
19+
20+
export default {
21+
name: 'highlight-toggle',
22+
props: {
23+
isHighlighted: {
24+
type: Boolean,
25+
default: false,
26+
},
27+
isEnabled: {
28+
type: Boolean,
29+
default: false,
30+
},
31+
label: {
32+
type: String,
33+
},
34+
tag: {
35+
type: String,
36+
default: 'div',
37+
},
38+
},
39+
components: {
40+
'button-icon': ButtonIcon,
41+
},
42+
methods: {
43+
onClick(...args) {
44+
if (this.isEnabled) {
45+
this.$emit('click', ...args);
46+
}
47+
},
48+
},
49+
};
50+
</script>
51+
52+
<style lang="stylus">
53+
.highlight-toggle {
54+
line-height: 18px;
55+
56+
&:hover {
57+
.button-icon {
58+
display: inline-block;
59+
}
60+
}
61+
62+
.button-icon {
63+
display: none;
64+
min-width: 24px;
65+
padding: 0;
66+
67+
&.active {
68+
display: inline-block;
69+
}
70+
71+
&.disabled {
72+
display: none !important;
73+
}
74+
}
75+
76+
.label.highlight {
77+
font-weight: bold;
78+
}
79+
}
80+
</style>

client/components/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export { default as ErrorMessage } from './error-message';
1010
export { default as FeatureFlag } from './feature-flag';
1111
export { default as FlexGrid } from './flex-grid';
1212
export { default as FlexGridItem } from './flex-grid-item';
13+
export { default as HighlightToggle } from './highlight-toggle';
1314
export { default as LoadingMessage } from './loading-message';
1415
export { default as LoadingSpinner } from './loading-spinner';
1516
export { default as NavigationBar } from './navigation-bar';

0 commit comments

Comments
 (0)