Commit a0d178ab authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'fix-annotations-feature-flag-check' into 'master'

Fix annotations actions and feature flag

See merge request gitlab-org/gitlab!29546
parents 6fdd8b52 ec075934
...@@ -90,7 +90,7 @@ export const fetchData = ({ dispatch }) => { ...@@ -90,7 +90,7 @@ export const fetchData = ({ dispatch }) => {
* ready after the BE piece is implemented. * ready after the BE piece is implemented.
* https://gitlab.com/gitlab-org/gitlab/-/issues/211330 * https://gitlab.com/gitlab-org/gitlab/-/issues/211330
*/ */
if (isFeatureFlagEnabled('metrics_dashboard_annotations')) { if (isFeatureFlagEnabled('metricsDashboardAnnotations')) {
dispatch('fetchAnnotations'); dispatch('fetchAnnotations');
} }
}; };
...@@ -283,8 +283,6 @@ export const receiveEnvironmentsDataFailure = ({ commit }) => { ...@@ -283,8 +283,6 @@ export const receiveEnvironmentsDataFailure = ({ commit }) => {
}; };
export const fetchAnnotations = ({ state, dispatch }) => { export const fetchAnnotations = ({ state, dispatch }) => {
dispatch('requestAnnotations');
return gqClient return gqClient
.mutate({ .mutate({
mutation: getAnnotations, mutation: getAnnotations,
...@@ -309,9 +307,6 @@ export const fetchAnnotations = ({ state, dispatch }) => { ...@@ -309,9 +307,6 @@ export const fetchAnnotations = ({ state, dispatch }) => {
}); });
}; };
// While this commit does not update the state it will
// eventually be useful to show a loading state
export const requestAnnotations = ({ commit }) => commit(types.REQUEST_ANNOTATIONS);
export const receiveAnnotationsSuccess = ({ commit }, data) => export const receiveAnnotationsSuccess = ({ commit }, data) =>
commit(types.RECEIVE_ANNOTATIONS_SUCCESS, data); commit(types.RECEIVE_ANNOTATIONS_SUCCESS, data);
export const receiveAnnotationsFailure = ({ commit }) => commit(types.RECEIVE_ANNOTATIONS_FAILURE); export const receiveAnnotationsFailure = ({ commit }) => commit(types.RECEIVE_ANNOTATIONS_FAILURE);
......
...@@ -4,7 +4,6 @@ export const RECEIVE_METRICS_DASHBOARD_SUCCESS = 'RECEIVE_METRICS_DASHBOARD_SUCC ...@@ -4,7 +4,6 @@ export const RECEIVE_METRICS_DASHBOARD_SUCCESS = 'RECEIVE_METRICS_DASHBOARD_SUCC
export const RECEIVE_METRICS_DASHBOARD_FAILURE = 'RECEIVE_METRICS_DASHBOARD_FAILURE'; export const RECEIVE_METRICS_DASHBOARD_FAILURE = 'RECEIVE_METRICS_DASHBOARD_FAILURE';
// Annotations // Annotations
export const REQUEST_ANNOTATIONS = 'REQUEST_ANNOTATIONS';
export const RECEIVE_ANNOTATIONS_SUCCESS = 'RECEIVE_ANNOTATIONS_SUCCESS'; export const RECEIVE_ANNOTATIONS_SUCCESS = 'RECEIVE_ANNOTATIONS_SUCCESS';
export const RECEIVE_ANNOTATIONS_FAILURE = 'RECEIVE_ANNOTATIONS_FAILURE'; export const RECEIVE_ANNOTATIONS_FAILURE = 'RECEIVE_ANNOTATIONS_FAILURE';
......
...@@ -260,10 +260,7 @@ describe('Monitoring store actions', () => { ...@@ -260,10 +260,7 @@ describe('Monitoring store actions', () => {
null, null,
state, state,
[], [],
[ [{ type: 'receiveAnnotationsSuccess', payload: annotationsData }],
{ type: 'requestAnnotations' },
{ type: 'receiveAnnotationsSuccess', payload: annotationsData },
],
() => { () => {
expect(mockMutate).toHaveBeenCalledWith(mutationVariables); expect(mockMutate).toHaveBeenCalledWith(mutationVariables);
}, },
...@@ -288,7 +285,7 @@ describe('Monitoring store actions', () => { ...@@ -288,7 +285,7 @@ describe('Monitoring store actions', () => {
null, null,
state, state,
[], [],
[{ type: 'requestAnnotations' }, { type: 'receiveAnnotationsFailure' }], [{ type: 'receiveAnnotationsFailure' }],
() => { () => {
expect(mockMutate).toHaveBeenCalledWith(mutationVariables); expect(mockMutate).toHaveBeenCalledWith(mutationVariables);
}, },
......
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