Skip to content
代码片段 群组 项目
未验证 提交 8481d458 编辑于 作者: Savas Vedova's avatar Savas Vedova 提交者: GitLab
浏览文件

Merge branch '489744-use-vuex-ff-helper' into 'master'

Store VSA feature flag in the Vuex store

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167646



Merged-by: default avatarSavas Vedova <svedova@gitlab.com>
Approved-by: default avatarLukas Wanko <lwanko@gitlab.com>
Approved-by: default avatarSavas Vedova <svedova@gitlab.com>
Reviewed-by: default avatarAlex Pennells <apennells@gitlab.com>
Co-authored-by: default avatarAlex Pennells <apennells@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -149,5 +149,5 @@ export const extractVSAFeaturesFromGON = () => ({
cycleAnalyticsForProjects: Boolean(gon?.licensed_features?.cycleAnalyticsForProjects),
groupLevelAnalyticsDashboard: Boolean(gon?.licensed_features?.groupLevelAnalyticsDashboard),
// feature flags
vsaGroupAndProjectParity: Boolean(gon?.features?.vsaGroupAndProjectParity),
vsaStandaloneSettingsPage: Boolean(gon?.features?.vsaStandaloneSettingsPage),
});
......@@ -25,7 +25,7 @@ export const createValueStream = ({ commit, dispatch, getters }, data) => {
};
export const updateValueStream = (
{ commit, dispatch, getters },
{ state, commit, dispatch, getters },
{ id: valueStreamId, ...data },
) => {
const { namespacePath } = getters;
......@@ -33,7 +33,7 @@ export const updateValueStream = (
return apiUpdateValueStream({ namespacePath, valueStreamId, data })
.then(({ data: newValueStream }) => {
if (!gon.features?.vsaStandaloneSettingsPage) {
if (!state.features.vsaStandaloneSettingsPage) {
commit(types.RECEIVE_UPDATE_VALUE_STREAM_SUCCESS, newValueStream);
return dispatch('fetchCycleAnalyticsData');
}
......
......@@ -158,13 +158,9 @@ describe('Value Stream Analytics actions / value streams', () => {
};
const updateResp = { id: 'new value stream', is_custom: true, ...payload };
beforeEach(() => {
state = { currentGroup };
});
describe('with no errors', () => {
beforeEach(() => {
window.gon = { features: { vsaStandaloneSettingsPage: true } };
state = { currentGroup, features: { vsaStandaloneSettingsPage: true } };
mock.onPut(endpoints.valueStreamData).replyOnce(HTTP_STATUS_OK, updateResp);
});
......@@ -177,7 +173,7 @@ describe('Value Stream Analytics actions / value streams', () => {
describe('when `vsaStandaloneSettingsPage` feature flag is disabled', () => {
beforeEach(() => {
window.gon = { features: { vsaStandaloneSettingsPage: false } };
state = { currentGroup, features: { vsaStandaloneSettingsPage: false } };
});
it(`commits the ${types.REQUEST_UPDATE_VALUE_STREAM} and ${types.RECEIVE_UPDATE_VALUE_STREAM_SUCCESS} mutations and dispatches the 'fetchCycleAnalyticsData' action`, () => {
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册