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 }) => {
export const requestCycleAnalyticsData = ({ commit }) => commit(types.REQUEST_VALUE_STREAM_DATA);
export const receiveCycleAnalyticsDataSuccess = ({ commit, dispatch }) => {
commit(types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS);
commit(types.RECEIVE_VALUE_STREAM_DATA_SUCCESS);
dispatch('typeOfWork/fetchTopRankedGroupLabels');
};
export const receiveCycleAnalyticsDataError = ({ commit }, { 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) {
createFlash(__('There was an error while fetching value stream analytics data.'));
}
......
......@@ -6,8 +6,8 @@ export const SET_DATE_RANGE = 'SET_DATE_RANGE';
export const SET_SELECTED_VALUE_STREAM = 'SET_SELECTED_VALUE_STREAM';
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_CYCLE_ANALYTICS_DATA_ERROR = 'RECEIVE_CYCLE_ANALYTICS_DATA_ERROR';
export const RECEIVE_VALUE_STREAM_DATA_SUCCESS = 'RECEIVE_VALUE_STREAM_DATA_SUCCESS';
export const RECEIVE_VALUE_STREAM_DATA_ERROR = 'RECEIVE_VALUE_STREAM_DATA_ERROR';
export const REQUEST_STAGE_DATA = 'REQUEST_STAGE_DATA';
export const RECEIVE_STAGE_DATA_SUCCESS = 'RECEIVE_STAGE_DATA_SUCCESS';
......
......@@ -19,11 +19,11 @@ export default {
[types.REQUEST_VALUE_STREAM_DATA](state) {
state.isLoading = true;
},
[types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS](state) {
[types.RECEIVE_VALUE_STREAM_DATA_SUCCESS](state) {
state.errorCode = null;
state.isLoading = false;
},
[types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR](state, errCode) {
[types.RECEIVE_VALUE_STREAM_DATA_ERROR](state, errCode) {
state.errorCode = errCode;
state.isLoading = false;
},
......
......@@ -327,7 +327,7 @@ describe('Value Stream Analytics actions', () => {
describe('receiveCycleAnalyticsDataError', () => {
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 };
return testAction(
actions.receiveCycleAnalyticsDataError,
......@@ -335,7 +335,7 @@ describe('Value Stream Analytics actions', () => {
state,
[
{
type: types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR,
type: types.RECEIVE_VALUE_STREAM_DATA_ERROR,
payload: response.status,
},
],
......@@ -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 };
return testAction(
actions.receiveCycleAnalyticsDataError,
......@@ -351,7 +351,7 @@ describe('Value Stream Analytics actions', () => {
state,
[
{
type: types.RECEIVE_CYCLE_ANALYTICS_DATA_ERROR,
type: types.RECEIVE_VALUE_STREAM_DATA_ERROR,
payload: response.status,
},
],
......
......@@ -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', () => {
mutations[types.RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS](state, {
mutations[types.RECEIVE_VALUE_STREAM_DATA_SUCCESS](state, {
stats: [],
stages: [],
});
......@@ -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', () => {
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.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