Skip to content

Commit 0c6fb39

Browse files
authored
Release/3.18.0 (#168)
* Feature/tasklist partition (#166) * moving tasklist into separate folder. adding partition page and navigation tabs * alphabetizing tchannel client api. added listTaskListPartition and hooked up route. Adding front end api call. Need more context to proceed. * finished task list partition screen * adding metrics page. making feature flag style display inline. * 3.18.0-beta.0 * fixing things for PR * lint * fixing test * fix for event which should not be a span but a point. (#167) * 3.18.0-beta.1 * Feature/domain metrics (#169) * adding blank metrics page for domain. * lint fixes * 3.18.0-beta.2 * changing from route variables to props. Fixing props for metrics screen. (#170) * 3.18.0-beta.3 * 3.18.0-beta.4 * Server side feature flags (#171) * updated code to work with server side feature flags instead of using feature flags json. * fixing tests * abstracting common helper out of service. * 3.18.0-beta.5 * allowing endpoint to call next middleware * 3.18.0-beta.6 * PR comments * fixing failing tests * reverting change as it destabilizes test on CI * updating fetch-mock package to latest. adding delay for fullWorkflowHistory api call mock. * lowering fetch-mock package version to see if increases stability. * adding release notes for cadence server go and ui. (#172) * 3.18.0
1 parent e375cc8 commit 0c6fb39

36 files changed

+438
-117
lines changed

babel.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ module.exports = {
66
"alias": {
77
"~constants": "./client/constants",
88
"~components": "./client/components",
9-
"~helpers": "./client/helpers"
10-
}
9+
"~helpers": "./client/helpers",
10+
"~services": "./client/services",
11+
},
1112
}
1213
],
1314
["@babel/plugin-transform-regenerator"]

client/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export default {
190190
</a>
191191
</flex-grid-item>
192192

193-
<feature-flag name="environment-select">
193+
<feature-flag name="environmentSelect">
194194
<flex-grid-item>
195195
<v-select
196196
class="environment-select"

client/components/button-fill.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ export default {
2424
color: {
2525
type: String,
2626
default: 'primary',
27-
validator: value =>
28-
['primary', 'secondary', 'tertiary'].includes(value),
27+
validator: value => ['primary', 'secondary', 'tertiary'].includes(value),
2928
},
3029
disabled: {
3130
type: Boolean,

client/components/feature-flag.vue

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,50 @@
11
<template>
2-
<div class="feature-flag" v-if="isFeatureFlagEnabled">
2+
<div
3+
class="feature-flag"
4+
:class="{ [display]: display }"
5+
v-if="isFeatureFlagEnabled"
6+
>
37
<slot></slot>
48
</div>
59
</template>
610

711
<script>
8-
import { isFeatureFlagEnabled } from '~helpers';
12+
import { FeatureFlagService } from '~services';
913
1014
export default {
1115
name: 'feature-flag',
12-
props: ['name'],
13-
computed: {
14-
isFeatureFlagEnabled() {
15-
const { name } = this;
16-
17-
return isFeatureFlagEnabled(name);
16+
props: {
17+
display: {
18+
type: String,
19+
validator: value => ['inline', 'inline-block'].includes(value),
20+
},
21+
name: {
22+
required: true,
23+
type: String,
1824
},
25+
params: {
26+
type: Object,
27+
}
28+
},
29+
data() {
30+
return {
31+
isFeatureFlagEnabled: false,
32+
}
33+
},
34+
async mounted() {
35+
const { name, params } = this;
36+
const featureFlagService = new FeatureFlagService();
37+
this.isFeatureFlagEnabled = await featureFlagService.isFeatureFlagEnabled({ name, params });
1938
},
2039
};
2140
</script>
41+
<style lang="stylus">
42+
.feature-flag {
43+
&.inline {
44+
display: inline;
45+
}
46+
&.inline-block {
47+
display: inline-block;
48+
}
49+
}
50+
</style>

client/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const DATE_FORMAT_OPTIONS = [
1111
];
1212

1313
export const ENVIRONMENT_LIST = [
14-
// Make sure to enable "environment-select" in feature-flags.json to enable environment select.
14+
// Make sure to enable "environmentSelect" in feature-flags.json to enable environment select.
1515
//
1616
// Examples:
1717
//

client/feature-flags.json

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const getQueryStringFromObject = (params = {}) => {
2+
const paramKeys = Object.keys(params);
3+
if (paramKeys.length === 0) {
4+
return '';
5+
}
6+
return '?' + paramKeys.map((queryName) =>
7+
encodeURIComponent(queryName) + '=' + encodeURIComponent(params[queryName])
8+
).join('&');
9+
};
10+
11+
export default getQueryStringFromObject;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import getQueryStringFromObject from './get-query-string-from-object';
2+
3+
describe('getQueryStringFromObject', () => {
4+
it('should return empty string when no params are passed.', () => {
5+
const output = getQueryStringFromObject();
6+
expect(output).toEqual('');
7+
});
8+
9+
it('should return an url encoded query param string when params are passed.', () => {
10+
const output = getQueryStringFromObject({
11+
stringParam: 'string',
12+
booleanParam: true,
13+
numberParam: 20,
14+
});
15+
expect(output).toEqual('?stringParam=string&booleanParam=true&numberParam=20');
16+
});
17+
});

client/helpers/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ export { default as getErrorMessage } from './get-error-message';
77
export { default as getJsonStringObject } from './get-json-string-object';
88
export { default as getKeyValuePairs } from './get-key-value-pairs';
99
export { default as getLatestNewsItems } from './get-latest-news-items';
10+
export { default as getQueryStringFromObject } from './get-query-string-from-object';
1011
export { default as getStartTimeIsoString } from './get-start-time-iso-string';
1112
export { default as getStringElipsis } from './get-string-elipsis';
1213
export { default as http } from './http';
1314
export { default as injectMomentDurationFormat } from './inject-moment-duration-format';
14-
export { default as isFeatureFlagEnabled } from './is-feature-flag-enabled';
1515
export { default as jsonTryParse } from './json-try-parse';
1616
export { default as mapDomainDescription } from './map-domain-description';
1717
export { default as shortName } from './short-name';

client/helpers/is-feature-flag-enabled.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)