Skip to content

Commit 6f80271

Browse files
authored
Release/3.15.0 (#146)
* Feature/auth (#142) * Adding tracing to tchannel if bridge is on context * adding in stub for domain permission * removing reset permission * removing permission API as out-of-scope for first release * 3.8.0-beta.0 * adding console logs to debug why staging2 isnt reporting jaeger tracing * 3.8.0-beta.1 * removing log for bridge * refactoring workflow list screen * fixing spinner * removing settings cog and workflows from breadcrumb * eslint and small refactor for criteria * fixing tests * 3.14.0-beta.0 * Adding history archival and visibility archival to domain settings sc… (#113) * Adding history archival and visibility archival to domain settings screen. adding unit tests * fixing integration tests * lint fixes * PR comments * Feature/archival disabled (#115) * Adding history archival and visibility archival to domain settings screen. adding unit tests * fixing integration tests * lint fixes * starting work on archival screen * starting work on archival screen. Got async working in a vue component. * adding helpers to extract enabled flags * disabled messaging working * adding unit tests * adding more unit tests * splitting disabled messaging into new component. adding more unit tests. fixing webpack to point to new babel config file. * 3.14.0-beta.1 * fixing lint * Feature/archives disabled link (#116) * Adding history archival and visibility archival to domain settings screen. adding unit tests * adding link for copy * 3.14.0-beta.2 * adding support for multiple links * 3.14.0-beta.3 * fixing styling * 3.14.0-beta.4 * Feature/update idl (#120) * updating idl to latest * updating to latest idl. Fixing napa install to clear directory before copying * fixing tests * button-fill (#121) * button-fill * end file return * error-message (#122) * error-message * end file return * grid (#123) * grid * renaming component to flex grid * renaming flex grid column to flex grid item * loading spinner (#125) * no results (#126) * renaming archives to archival. breaking out helpers into separate files * removing unused file * more replacing archives * deleting unused file * text input (#127) * split out functions into reusable helpers (#128) * Feature/rename archives archival (#129) * renaming archives to archival. breaking out helpers into separate files * removing unused file * more replacing archives * deleting unused file * archival endpoint (#130) * archival endpoint * PR comments * Feature/archival service (#134) * archival service * PR comments * adding unit tests for workflow archival service * components and style updates to use in workflow archival screen. (#132) * components and style updates to use in workflow archival screen. * final style changes to help with scrolling table * helpers used on archival screen (#133) * Feature/archival screen (#135) * Adding history archival and visibility archival to domain settings screen. adding unit tests * renaming archives to archival for consistancy * 3.14.0-beta.5 * missed some references for rename * 3.14.0-beta.6 * adding basic screen and starting work on it. * got basic screen working with mocked data. need to hook up API. * making table into component to be reused on advanced screen. * moving search bar to grid. refactoring reusable helpers. removing advanced view for now. adding in date picker to archival screen. adding status. * fixing helpers. finished UI for archival view * formatting start time and end time * styling and fixing up potential errors * adding more protections * adding nextPageToken to query. fixing bug with next page token on workflow list screen. * moving hardcoded code into service. working on getting pagination working. * creating loading spinner component to help with loading paging. * got scrolling on table mostly working. got sticky headers working. * fixing spinner scroll bar issue. * got pagination working * hooking up archival API * adding error handling * adding advanced button to toggle between basic and advanced archival views. creating button component. * completed advanced archival screen. * removing consoles * lint fixes * splitting out basic vue functions into helpers * moving helpers into separate files * splitting out helper tests * updating spec to contain describe * using getErrorMessage common helper * adding tests for global helpers. * adding unit tests for get query params. renaming statusName to statusValue. * adding tests for get range. * getStatusValue tests * adding tests for getStatus * adding test for map response * adding tests for update query from range * lint fixes * updating idl to latest * updating to latest idl. Fixing napa install to clear directory before copying * fixing tests * 3.14.0-beta.7 * fixing bug with completed status not being set correctly. allowing workflow request to be cancellable when stacking requests. * fixing unit tests * small change from PR updates * removing grid and grid-column. these are now renamed to flex grid and flex grid item * fix lint * Feature/workflow history archival (#136) * Adding history archival and visibility archival to domain settings screen. adding unit tests * renaming archives to archival for consistancy * 3.14.0-beta.5 * missed some references for rename * 3.14.0-beta.6 * adding basic screen and starting work on it. * got basic screen working with mocked data. need to hook up API. * making table into component to be reused on advanced screen. * moving search bar to grid. refactoring reusable helpers. removing advanced view for now. adding in date picker to archival screen. adding status. * fixing helpers. finished UI for archival view * formatting start time and end time * styling and fixing up potential errors * adding more protections * adding nextPageToken to query. fixing bug with next page token on workflow list screen. * moving hardcoded code into service. working on getting pagination working. * creating loading spinner component to help with loading paging. * got scrolling on table mostly working. got sticky headers working. * fixing spinner scroll bar issue. * got pagination working * hooking up archival API * adding error handling * adding advanced button to toggle between basic and advanced archival views. creating button component. * completed advanced archival screen. * removing consoles * lint fixes * splitting out basic vue functions into helpers * moving helpers into separate files * splitting out helper tests * updating spec to contain describe * using getErrorMessage common helper * adding tests for global helpers. * adding unit tests for get query params. renaming statusName to statusValue. * adding tests for get range. * getStatusValue tests * adding tests for getStatus * adding test for map response * adding tests for update query from range * lint fixes * updating idl to latest * updating to latest idl. Fixing napa install to clear directory before copying * fixing tests * 3.14.0-beta.7 * fixing bug with completed status not being set correctly. allowing workflow request to be cancellable when stacking requests. * fixing unit tests * small change from PR updates * removing grid and grid-column. these are now renamed to flex grid and flex grid item * fix lint * got part of summary information from archival record. * adding extra data points for summary endpoint fallback * fixing list overflow * Got summary information working with archived workflows * 3.14.0-beta.8 * removing archival call as it wont work when deployed to environment. * 3.14.0-beta.9 * Feature/archival tweaks (#138) * Adding history archival and visibility archival to domain settings screen. adding unit tests * renaming archives to archival for consistancy * 3.14.0-beta.5 * missed some references for rename * 3.14.0-beta.6 * adding basic screen and starting work on it. * got basic screen working with mocked data. need to hook up API. * making table into component to be reused on advanced screen. * moving search bar to grid. refactoring reusable helpers. removing advanced view for now. adding in date picker to archival screen. adding status. * fixing helpers. finished UI for archival view * formatting start time and end time * styling and fixing up potential errors * adding more protections * adding nextPageToken to query. fixing bug with next page token on workflow list screen. * moving hardcoded code into service. working on getting pagination working. * creating loading spinner component to help with loading paging. * got scrolling on table mostly working. got sticky headers working. * fixing spinner scroll bar issue. * got pagination working * hooking up archival API * adding error handling * adding advanced button to toggle between basic and advanced archival views. creating button component. * completed advanced archival screen. * removing consoles * lint fixes * splitting out basic vue functions into helpers * moving helpers into separate files * splitting out helper tests * updating spec to contain describe * using getErrorMessage common helper * adding tests for global helpers. * adding unit tests for get query params. renaming statusName to statusValue. * adding tests for get range. * getStatusValue tests * adding tests for getStatus * adding test for map response * adding tests for update query from range * lint fixes * updating idl to latest * updating to latest idl. Fixing napa install to clear directory before copying * fixing tests * 3.14.0-beta.7 * fixing bug with completed status not being set correctly. allowing workflow request to be cancellable when stacking requests. * fixing unit tests * small change from PR updates * removing grid and grid-column. these are now renamed to flex grid and flex grid item * fix lint * got part of summary information from archival record. * adding extra data points for summary endpoint fallback * fixing list overflow * Got summary information working with archived workflows * 3.14.0-beta.8 * removing archival call as it wont work when deployed to environment. * 3.14.0-beta.9 * adjusting default time range to last 24 hours to help with performance. * adding isArchived flag and presenting in UI * adding lag message. moving constant out of helper and into constants file. need to add to advanced screen * refactoring into reusable loading-message component. added to basic and advanced screen. * 3.14.0-beta.10 * 3.15.0-beta.0 * Fix/lint and test (#139) * lint fixes * fixing unit test * adding authtoken to tchannel headers * 3.15.0-beta.1 * 3.14.0-beta.11 * adding head object to request * 3.15.0-beta.2 * attaching headers correctly * 3.15.0-beta.3 * changing to allow multiple auth token headers to be set. * 3.15.0-beta.4 * removing bridge * 3.15.0-beta.5 * enable / disable terminate workflow feature (#143) * adding feature flag to help with disabling terminate button * lint * adding tests. removing logs * adding test * 3.15.0-beta.6 * switching back to name as vue doesnt support using key as prop. config will still use key * 3.15.0-beta.7 * PR comments * PR comments * PR comments * Feature/environment selector (#145) * adding feature flag to help with disabling terminate button * lint * adding tests. removing logs * adding test * 3.15.0-beta.6 * switching back to name as vue doesnt support using key as prop. config will still use key * 3.15.0-beta.7 * adding environment select component and configuration. * Removing component and opt to use v-select. adding getEnv helper to get selected env. updating constants to not use real urls. * styling dropdown * adding tests for getEnvironment. * adding feature flag and creating examples for ENVIRONMENT_LIST. * 3.15.0-beta.8 * fixing dropdown to be clickable in all of region. * 3.15.0-beta.9 * margin already being added * adding current path to location when trying to change environment * 3.15.0-beta.10 * exclude current env from list. Adding path and query to new env path * 3.15.0-beta.11 * adding tests for new helpers * eslint fixes * PR comments * 3.15.0
1 parent ec2122d commit 6f80271

18 files changed

+319
-48
lines changed

client/App.vue

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
11
<script>
22
import { version } from '../package.json';
33
import logo from './assets/logo.svg';
4-
import { NotificationBar } from '~components';
5-
import { NOTIFICATION_TIMEOUT, NOTIFICATION_TYPE_SUCCESS } from '~constants';
4+
import { FeatureFlag, NotificationBar } from '~components';
5+
import {
6+
ENVIRONMENT_LIST,
7+
NOTIFICATION_TIMEOUT,
8+
NOTIFICATION_TYPE_SUCCESS,
9+
} from '~constants';
10+
import {
11+
getEnvironment,
12+
getEnvironmentList,
13+
getEnvironmentLocation,
14+
} from '~helpers';
615
716
export default {
817
components: {
9-
NotificationBar,
18+
'feature-flag': FeatureFlag,
19+
'notification-bar': NotificationBar,
1020
},
1121
data() {
22+
const { origin } = window.location;
23+
const environmentList = ENVIRONMENT_LIST;
24+
1225
return {
26+
environment: {
27+
list: getEnvironmentList({
28+
environmentList,
29+
origin,
30+
}),
31+
value: getEnvironment({
32+
environmentList,
33+
origin,
34+
}),
35+
},
1336
logo,
1437
notification: {
1538
message: '',
@@ -40,6 +63,19 @@ export default {
4063
}
4164
}
4265
},
66+
onEnvironmentSelectChange(environment) {
67+
if (environment === this.environment.value) {
68+
return;
69+
}
70+
71+
const { pathname, search } = window.location;
72+
73+
window.location = getEnvironmentLocation({
74+
environment,
75+
pathname,
76+
search,
77+
});
78+
},
4379
onNotification({ message, type = NOTIFICATION_TYPE_SUCCESS }) {
4480
this.notification.message = message;
4581
this.notification.type = type;
@@ -71,7 +107,7 @@ export default {
71107

72108
<template>
73109
<main @click="globalClick">
74-
<NotificationBar
110+
<notification-bar
75111
:message="notification.message"
76112
:onClose="onNotificationClose"
77113
:show="notification.show"
@@ -82,6 +118,17 @@ export default {
82118
<div v-html="logo"></div>
83119
<span class="version">{{ version }}</span>
84120
</a>
121+
122+
<feature-flag name="environment-select">
123+
<v-select
124+
class="environment-select"
125+
:on-change="onEnvironmentSelectChange"
126+
:options="environment.list"
127+
:searchable="false"
128+
:value="environment.value"
129+
/>
130+
</feature-flag>
131+
85132
<div class="domain" v-if="$route.params.domain">
86133
<a
87134
class="workflows"
@@ -195,6 +242,21 @@ header.top-bar
195242
bottom: 0;
196243
}
197244
245+
.environment-select {
246+
.dropdown-toggle {
247+
border-color: transparent;
248+
}
249+
250+
.open-indicator:before {
251+
border-color: uber-blue;
252+
}
253+
254+
.selected-tag {
255+
color: white;
256+
font-weight: bold;
257+
}
258+
}
259+
198260
body, main
199261
height 100%
200262
main
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export const isFlagEnabled = ({ flagHash = {}, name = '' }) =>
2+
flagHash[name] || false;
3+
4+
export const mapFlagsToHash = (flagArray = []) => {
5+
return flagArray.reduce((accumulator, { key = '', value = false }) => {
6+
accumulator[key] = value;
7+
8+
return accumulator;
9+
}, {});
10+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { isFlagEnabled, mapFlagsToHash } from './helpers';
2+
3+
describe('feature-flag helpers', () => {
4+
describe('isFlagEnabled', () => {
5+
it('should return false when passed name = "workflow-terminate" and flagHash = {}.', () => {
6+
const name = 'workflow-terminate';
7+
const flagHash = {};
8+
const output = isFlagEnabled({ flagHash, name });
9+
10+
expect(output).toEqual(false);
11+
});
12+
13+
it('should return true when passed name = "workflow-terminate" and flagHash = { "workflow-terminate": true }.', () => {
14+
const name = 'workflow-terminate';
15+
const flagHash = { 'workflow-terminate': true };
16+
const output = isFlagEnabled({ flagHash, name });
17+
18+
expect(output).toEqual(true);
19+
});
20+
21+
it('should return false when passed name = "workflow-terminate" and flagHash = { "workflow-terminate": false }.', () => {
22+
const name = 'workflow-terminate';
23+
const flagHash = { 'workflow-terminate': false };
24+
const output = isFlagEnabled({ flagHash, name });
25+
26+
expect(output).toEqual(false);
27+
});
28+
});
29+
30+
describe('mapFlagsToHash', () => {
31+
it('should return { "workflow-terminate": true } when passed flagArray = [{ key: "workflow-terminate", value: true }].', () => {
32+
const flagArray = [{ key: 'workflow-terminate', value: true }];
33+
const output = mapFlagsToHash(flagArray);
34+
35+
expect(output).toEqual({ 'workflow-terminate': true });
36+
});
37+
});
38+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<template>
2+
<div class="feature-flag" v-if="isFlagEnabled">
3+
<slot></slot>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import featureFlags from '../../feature-flags.json';
9+
import { isFlagEnabled, mapFlagsToHash } from './helpers';
10+
11+
export default {
12+
name: 'feature-flag',
13+
props: ['name'],
14+
computed: {
15+
flagHash() {
16+
return mapFlagsToHash(featureFlags);
17+
},
18+
isFlagEnabled() {
19+
const { flagHash, name } = this;
20+
21+
return isFlagEnabled({ flagHash, name });
22+
},
23+
},
24+
};
25+
</script>

client/components/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export { default as DetailList } from './detail-list';
66
export { default as DateRangePicker } from './date-range-picker';
77
export { default as DomainNavigation } from './domain-navigation';
88
export { default as ErrorMessage } from './error-message';
9+
export { default as FeatureFlag } from './feature-flag';
910
export { default as FlexGrid } from './flex-grid';
1011
export { default as FlexGridItem } from './flex-grid-item';
1112
export { default as LoadingMessage } from './loading-message';

client/constants.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
export const jsonKeys = ['result', 'input', 'details', 'data', 'Error'];
22
export const preKeys = jsonKeys.concat(['stackTrace', 'details.stackTrace']);
33

4+
export const ENVIRONMENT_LIST = [
5+
// Make sure to enable "environment-select" in feature-flags.json to enable environment select.
6+
//
7+
// Examples:
8+
//
9+
// {
10+
// label: 'Production',
11+
// value: 'http://<production-url>.com',
12+
// },
13+
// {
14+
// label: 'Staging',
15+
// value: 'http://<staging-url>.com',
16+
// },
17+
// {
18+
// label: 'Development',
19+
// value: 'http://<development-url>.com',
20+
// },
21+
// {
22+
// label: 'Localhost',
23+
// value: 'http://localhost:8088',
24+
// },
25+
];
26+
427
export const MAXIMUM_JSON_CHARACTER_LIMIT = 5000;
528
export const MAXIMUM_JSON_MESSAGE =
629
'\n ... to see more open full screen mode from top right arrow.';

client/feature-flags.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"key": "environment-select",
4+
"value": false
5+
},
6+
{
7+
"key": "workflow-terminate",
8+
"value": true
9+
}
10+
]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export default ({ environmentList, origin }) =>
2+
environmentList.filter(({ value }) => value !== origin);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import getEnvironmentList from './get-environment-list';
2+
3+
describe('getEnvironmentList', () => {
4+
it('should exclude the current environment from the list.', () => {
5+
const environmentList = [
6+
{
7+
value: 'https://production-environment.com',
8+
},
9+
{
10+
value: 'https://staging-environment.com',
11+
},
12+
{
13+
value: 'https://development-environment.com',
14+
},
15+
];
16+
const origin = 'https://production-environment.com';
17+
const output = getEnvironmentList({ environmentList, origin });
18+
19+
expect(output.length).toEqual(2);
20+
expect(output[0]).toEqual({
21+
value: 'https://staging-environment.com',
22+
});
23+
expect(output[1]).toEqual({
24+
value: 'https://development-environment.com',
25+
});
26+
});
27+
});
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export default ({ environment: { value }, pathname = '', search = '' }) =>
2+
`${value}${pathname}${search}`;

0 commit comments

Comments
 (0)