Commit c7f3ea33 authored by Takuya Noguchi's avatar Takuya Noguchi

Rename "CYCLE_ANALYTICS_*" variables in EE with "VALUE_STREAM_*"

Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent bf0e082a
...@@ -115,14 +115,14 @@ export const fetchStageMedianValues = ({ dispatch, commit, getters }) => { ...@@ -115,14 +115,14 @@ export const fetchStageMedianValues = ({ dispatch, commit, getters }) => {
export const requestCycleAnalyticsData = ({ commit }) => commit(types.REQUEST_VALUE_STREAM_DATA); export const requestCycleAnalyticsData = ({ commit }) => commit(types.REQUEST_VALUE_STREAM_DATA);
export const receiveCycleAnalyticsDataSuccess = ({ commit, dispatch }) => { export const receiveCycleAnalyticsDataSuccess = ({ commit, dispatch }) => {
commit(types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS); commit(types.RECEIVE_VALUE_STREAM_DATA_SUCCESS);
dispatch('typeOfWork/fetchTopRankedGroupLabels'); dispatch('typeOfWork/fetchTopRankedGroupLabels');
}; };
export const receiveCycleAnalyticsDataError = ({ commit }, { response = {} }) => { export const receiveCycleAnalyticsDataError = ({ commit }, { response = {} }) => {
const { status = httpStatus.INTERNAL_SERVER_ERROR } = response; const { status = httpStatus.INTERNAL_SERVER_ERROR } = response;
commit(types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR, status); commit(types.RECEIVE_VALUE_STREAM_DATA_ERROR, status);
if (status !== httpStatus.FORBIDDEN) { if (status !== httpStatus.FORBIDDEN) {
createFlash(__('There was an error while fetching value stream analytics data.')); createFlash(__('There was an error while fetching value stream analytics data.'));
} }
......
...@@ -6,8 +6,8 @@ export const SET_DATE_RANGE = 'SET_DATE_RANGE'; ...@@ -6,8 +6,8 @@ export const SET_DATE_RANGE = 'SET_DATE_RANGE';
export const SET_SELECTED_VALUE_STREAM = 'SET_SELECTED_VALUE_STREAM'; export const SET_SELECTED_VALUE_STREAM = 'SET_SELECTED_VALUE_STREAM';
export const REQUEST_VALUE_STREAM_DATA = 'REQUEST_VALUE_STREAM_DATA'; export const REQUEST_VALUE_STREAM_DATA = 'REQUEST_VALUE_STREAM_DATA';
export const RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS = 'RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS'; export const RECEIVE_VALUE_STREAM_DATA_SUCCESS = 'RECEIVE_VALUE_STREAM_DATA_SUCCESS';
export const RECEIVE_CYCLE_ANALYTICS_DATA_ERROR = 'RECEIVE_CYCLE_ANALYTICS_DATA_ERROR'; export const RECEIVE_VALUE_STREAM_DATA_ERROR = 'RECEIVE_VALUE_STREAM_DATA_ERROR';
export const REQUEST_STAGE_DATA = 'REQUEST_STAGE_DATA'; export const REQUEST_STAGE_DATA = 'REQUEST_STAGE_DATA';
export const RECEIVE_STAGE_DATA_SUCCESS = 'RECEIVE_STAGE_DATA_SUCCESS'; export const RECEIVE_STAGE_DATA_SUCCESS = 'RECEIVE_STAGE_DATA_SUCCESS';
......
...@@ -19,11 +19,11 @@ export default { ...@@ -19,11 +19,11 @@ export default {
[types.REQUEST_VALUE_STREAM_DATA](state) { [types.REQUEST_VALUE_STREAM_DATA](state) {
state.isLoading = true; state.isLoading = true;
}, },
[types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS](state) { [types.RECEIVE_VALUE_STREAM_DATA_SUCCESS](state) {
state.errorCode = null; state.errorCode = null;
state.isLoading = false; state.isLoading = false;
}, },
[types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR](state, errCode) { [types.RECEIVE_VALUE_STREAM_DATA_ERROR](state, errCode) {
state.errorCode = errCode; state.errorCode = errCode;
state.isLoading = false; state.isLoading = false;
}, },
......
...@@ -327,7 +327,7 @@ describe('Value Stream Analytics actions', () => { ...@@ -327,7 +327,7 @@ describe('Value Stream Analytics actions', () => {
describe('receiveCycleAnalyticsDataError', () => { describe('receiveCycleAnalyticsDataError', () => {
beforeEach(() => {}); beforeEach(() => {});
it(`commits the ${types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR} mutation on a 403 response`, () => { it(`commits the ${types.RECEIVE_VALUE_STREAM_DATA_ERROR} mutation on a 403 response`, () => {
const response = { status: 403 }; const response = { status: 403 };
return testAction( return testAction(
actions.receiveCycleAnalyticsDataError, actions.receiveCycleAnalyticsDataError,
...@@ -335,7 +335,7 @@ describe('Value Stream Analytics actions', () => { ...@@ -335,7 +335,7 @@ describe('Value Stream Analytics actions', () => {
state, state,
[ [
{ {
type: types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR, type: types.RECEIVE_VALUE_STREAM_DATA_ERROR,
payload: response.status, payload: response.status,
}, },
], ],
...@@ -343,7 +343,7 @@ describe('Value Stream Analytics actions', () => { ...@@ -343,7 +343,7 @@ describe('Value Stream Analytics actions', () => {
); );
}); });
it(`commits the ${types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR} mutation on a non 403 error response`, () => { it(`commits the ${types.RECEIVE_VALUE_STREAM_DATA_ERROR} mutation on a non 403 error response`, () => {
const response = { status: 500 }; const response = { status: 500 };
return testAction( return testAction(
actions.receiveCycleAnalyticsDataError, actions.receiveCycleAnalyticsDataError,
...@@ -351,7 +351,7 @@ describe('Value Stream Analytics actions', () => { ...@@ -351,7 +351,7 @@ describe('Value Stream Analytics actions', () => {
state, state,
[ [
{ {
type: types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR, type: types.RECEIVE_VALUE_STREAM_DATA_ERROR,
payload: response.status, payload: response.status,
}, },
], ],
......
...@@ -131,9 +131,9 @@ describe('Value Stream Analytics mutations', () => { ...@@ -131,9 +131,9 @@ describe('Value Stream Analytics mutations', () => {
); );
}); });
describe(`${types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS}`, () => { describe(`${types.RECEIVE_VALUE_STREAM_DATA_SUCCESS}`, () => {
it('will set isLoading=false and errorCode=null', () => { it('will set isLoading=false and errorCode=null', () => {
mutations[types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS](state, { mutations[types.RECEIVE_VALUE_STREAM_DATA_SUCCESS](state, {
stats: [], stats: [],
stages: [], stages: [],
}); });
...@@ -157,11 +157,11 @@ describe('Value Stream Analytics mutations', () => { ...@@ -157,11 +157,11 @@ describe('Value Stream Analytics mutations', () => {
}); });
}); });
describe(`${types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR}`, () => { describe(`${types.RECEIVE_VALUE_STREAM_DATA_ERROR}`, () => {
it('sets errorCode correctly', () => { it('sets errorCode correctly', () => {
const errorCode = 403; const errorCode = 403;
mutations[types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR](state, errorCode); mutations[types.RECEIVE_VALUE_STREAM_DATA_ERROR](state, errorCode);
expect(state.isLoading).toBe(false); expect(state.isLoading).toBe(false);
expect(state.errorCode).toBe(errorCode); expect(state.errorCode).toBe(errorCode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment