Commit a0d20757 authored by Andrew Fontaine's avatar Andrew Fontaine

Remove modules Folder from Feature Flags Store

The modules folder ended up being useless for organization once the
stores were split up.
parent e1686c6f
...@@ -28,7 +28,7 @@ import { ...@@ -28,7 +28,7 @@ import {
NEW_VERSION_FLAG, NEW_VERSION_FLAG,
LEGACY_FLAG, LEGACY_FLAG,
} from '../constants'; } from '../constants';
import { createNewEnvironmentScope } from '../store/modules/helpers'; import { createNewEnvironmentScope } from '../store/helpers';
export default { export default {
components: { components: {
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
NEW_FLAG_ALERT, NEW_FLAG_ALERT,
ROLLOUT_STRATEGY_ALL_USERS, ROLLOUT_STRATEGY_ALL_USERS,
} from '../constants'; } from '../constants';
import { createNewEnvironmentScope } from '../store/modules/helpers'; import { createNewEnvironmentScope } from '../store/helpers';
import featureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import featureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
......
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import createStore from './store/modules/edit'; import createStore from './store/edit';
import EditFeatureFlag from './components/edit_feature_flag.vue'; import EditFeatureFlag from './components/edit_feature_flag.vue';
Vue.use(Vuex); Vue.use(Vuex);
......
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import csrf from '~/lib/utils/csrf'; import csrf from '~/lib/utils/csrf';
import FeatureFlagsComponent from './components/feature_flags.vue'; import FeatureFlagsComponent from './components/feature_flags.vue';
import createStore from './store/modules/index'; import createStore from './store/index';
Vue.use(Vuex); Vue.use(Vuex);
......
import Vue from 'vue'; import Vue from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import createStore from './store/modules/new'; import createStore from './store/new';
import NewFeatureFlag from './components/new_feature_flag.vue'; import NewFeatureFlag from './components/new_feature_flag.vue';
Vue.use(Vuex); Vue.use(Vuex);
......
...@@ -3,7 +3,7 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -3,7 +3,7 @@ import axios from '~/lib/utils/axios_utils';
import { visitUrl } from '~/lib/utils/url_utility'; import { visitUrl } from '~/lib/utils/url_utility';
import { deprecatedCreateFlash as createFlash } from '~/flash'; import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { NEW_VERSION_FLAG } from '../../../constants'; import { NEW_VERSION_FLAG } from '../../constants';
import { mapFromScopesViewModel, mapStrategiesToRails } from '../helpers'; import { mapFromScopesViewModel, mapStrategiesToRails } from '../helpers';
/** /**
......
import * as types from './mutation_types'; import * as types from './mutation_types';
import { mapToScopesViewModel, mapStrategiesToViewModel } from '../helpers'; import { mapToScopesViewModel, mapStrategiesToViewModel } from '../helpers';
import { LEGACY_FLAG } from '../../../constants'; import { LEGACY_FLAG } from '../../constants';
export default { export default {
[types.REQUEST_FEATURE_FLAG](state) { [types.REQUEST_FEATURE_FLAG](state) {
......
import { LEGACY_FLAG } from '../../../constants'; import { LEGACY_FLAG } from '../../constants';
export default ({ path, endpoint }) => ({ export default ({ path, endpoint }) => ({
endpoint, endpoint,
......
...@@ -10,7 +10,7 @@ import { ...@@ -10,7 +10,7 @@ import {
fetchPercentageParams, fetchPercentageParams,
fetchUserIdParams, fetchUserIdParams,
LEGACY_FLAG, LEGACY_FLAG,
} from '../../constants'; } from '../constants';
/** /**
* Converts raw scope objects fetched from the API into an array of scope * Converts raw scope objects fetched from the API into an array of scope
......
import Vue from 'vue'; import Vue from 'vue';
import * as types from './mutation_types'; import * as types from './mutation_types';
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils'; import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
import { FEATURE_FLAG_SCOPE, USER_LIST_SCOPE } from '../../../constants'; import { FEATURE_FLAG_SCOPE, USER_LIST_SCOPE } from '../../constants';
import { mapToScopesViewModel } from '../helpers'; import { mapToScopesViewModel } from '../helpers';
const mapFlag = flag => ({ ...flag, scopes: mapToScopesViewModel(flag.scopes || []) }); const mapFlag = flag => ({ ...flag, scopes: mapToScopesViewModel(flag.scopes || []) });
......
import { FEATURE_FLAG_SCOPE, USER_LIST_SCOPE } from '../../../constants'; import { FEATURE_FLAG_SCOPE, USER_LIST_SCOPE } from '../../constants';
export default ({ endpoint, projectId, unleashApiInstanceId, rotateInstanceIdPath }) => ({ export default ({ endpoint, projectId, unleashApiInstanceId, rotateInstanceIdPath }) => ({
[FEATURE_FLAG_SCOPE]: [], [FEATURE_FLAG_SCOPE]: [],
......
import * as types from './mutation_types'; import * as types from './mutation_types';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { visitUrl } from '~/lib/utils/url_utility'; import { visitUrl } from '~/lib/utils/url_utility';
import { NEW_VERSION_FLAG } from '../../../constants'; import { NEW_VERSION_FLAG } from '../../constants';
import { mapFromScopesViewModel, mapStrategiesToRails } from '../helpers'; import { mapFromScopesViewModel, mapStrategiesToRails } from '../helpers';
/** /**
......
...@@ -6,7 +6,7 @@ import { TEST_HOST } from 'spec/test_constants'; ...@@ -6,7 +6,7 @@ import { TEST_HOST } from 'spec/test_constants';
import { mockTracking } from 'helpers/tracking_helper'; import { mockTracking } from 'helpers/tracking_helper';
import { LEGACY_FLAG, NEW_VERSION_FLAG, NEW_FLAG_ALERT } from '~/feature_flags/constants'; import { LEGACY_FLAG, NEW_VERSION_FLAG, NEW_FLAG_ALERT } from '~/feature_flags/constants';
import Form from '~/feature_flags/components/form.vue'; import Form from '~/feature_flags/components/form.vue';
import createStore from '~/feature_flags/store/modules/edit'; import createStore from '~/feature_flags/store/edit';
import EditFeatureFlag from '~/feature_flags/components/edit_feature_flag.vue'; import EditFeatureFlag from '~/feature_flags/components/edit_feature_flag.vue';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
......
...@@ -4,7 +4,7 @@ import MockAdapter from 'axios-mock-adapter'; ...@@ -4,7 +4,7 @@ import MockAdapter from 'axios-mock-adapter';
import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui'; import { GlEmptyState, GlLoadingIcon } from '@gitlab/ui';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import Api from '~/api'; import Api from '~/api';
import createStore from '~/feature_flags/store/modules/index'; import createStore from '~/feature_flags/store/index';
import FeatureFlagsTab from '~/feature_flags/components/feature_flags_tab.vue'; import FeatureFlagsTab from '~/feature_flags/components/feature_flags_tab.vue';
import FeatureFlagsComponent from '~/feature_flags/components/feature_flags.vue'; import FeatureFlagsComponent from '~/feature_flags/components/feature_flags.vue';
import FeatureFlagsTable from '~/feature_flags/components/feature_flags_table.vue'; import FeatureFlagsTable from '~/feature_flags/components/feature_flags_table.vue';
......
...@@ -4,7 +4,7 @@ import MockAdapter from 'axios-mock-adapter'; ...@@ -4,7 +4,7 @@ import MockAdapter from 'axios-mock-adapter';
import { GlAlert } from '@gitlab/ui'; import { GlAlert } from '@gitlab/ui';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import Form from '~/feature_flags/components/form.vue'; import Form from '~/feature_flags/components/form.vue';
import createStore from '~/feature_flags/store/modules/new'; import createStore from '~/feature_flags/store/new';
import NewFeatureFlag from '~/feature_flags/components/new_feature_flag.vue'; import NewFeatureFlag from '~/feature_flags/components/new_feature_flag.vue';
import { import {
ROLLOUT_STRATEGY_ALL_USERS, ROLLOUT_STRATEGY_ALL_USERS,
......
...@@ -11,18 +11,15 @@ import { ...@@ -11,18 +11,15 @@ import {
receiveFeatureFlagSuccess, receiveFeatureFlagSuccess,
receiveFeatureFlagError, receiveFeatureFlagError,
toggleActive, toggleActive,
} from '~/feature_flags/store/modules/edit/actions'; } from '~/feature_flags/store/edit/actions';
import state from '~/feature_flags/store/modules/edit/state'; import state from '~/feature_flags/store/edit/state';
import { import { mapStrategiesToRails, mapFromScopesViewModel } from '~/feature_flags/store/helpers';
mapStrategiesToRails,
mapFromScopesViewModel,
} from '~/feature_flags/store/modules/helpers';
import { import {
NEW_VERSION_FLAG, NEW_VERSION_FLAG,
LEGACY_FLAG, LEGACY_FLAG,
ROLLOUT_STRATEGY_ALL_USERS, ROLLOUT_STRATEGY_ALL_USERS,
} from '~/feature_flags/constants'; } from '~/feature_flags/constants';
import * as types from '~/feature_flags/store/modules/edit/mutation_types'; import * as types from '~/feature_flags/store/edit/mutation_types';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
jest.mock('~/lib/utils/url_utility'); jest.mock('~/lib/utils/url_utility');
......
import state from '~/feature_flags/store/modules/edit/state'; import state from '~/feature_flags/store/edit/state';
import mutations from '~/feature_flags/store/modules/edit/mutations'; import mutations from '~/feature_flags/store/edit/mutations';
import * as types from '~/feature_flags/store/modules/edit/mutation_types'; import * as types from '~/feature_flags/store/edit/mutation_types';
describe('Feature flags Edit Module Mutations', () => { describe('Feature flags Edit Module Mutations', () => {
let stateCopy; let stateCopy;
......
...@@ -5,7 +5,7 @@ import { ...@@ -5,7 +5,7 @@ import {
createNewEnvironmentScope, createNewEnvironmentScope,
mapStrategiesToViewModel, mapStrategiesToViewModel,
mapStrategiesToRails, mapStrategiesToRails,
} from '~/feature_flags/store/modules/helpers'; } from '~/feature_flags/store/helpers';
import { import {
ROLLOUT_STRATEGY_ALL_USERS, ROLLOUT_STRATEGY_ALL_USERS,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT, ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
......
...@@ -23,10 +23,10 @@ import { ...@@ -23,10 +23,10 @@ import {
deleteUserList, deleteUserList,
receiveDeleteUserListError, receiveDeleteUserListError,
clearAlert, clearAlert,
} from '~/feature_flags/store/modules/index/actions'; } from '~/feature_flags/store/index/actions';
import { mapToScopesViewModel } from '~/feature_flags/store/modules/helpers'; import { mapToScopesViewModel } from '~/feature_flags/store/helpers';
import state from '~/feature_flags/store/modules/index/state'; import state from '~/feature_flags/store/index/state';
import * as types from '~/feature_flags/store/modules/index/mutation_types'; import * as types from '~/feature_flags/store/index/mutation_types';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { getRequestData, rotateData, featureFlag, userList } from '../../mock_data'; import { getRequestData, rotateData, featureFlag, userList } from '../../mock_data';
......
import state from '~/feature_flags/store/modules/index/state'; import state from '~/feature_flags/store/index/state';
import mutations from '~/feature_flags/store/modules/index/mutations'; import mutations from '~/feature_flags/store/index/mutations';
import * as types from '~/feature_flags/store/modules/index/mutation_types'; import * as types from '~/feature_flags/store/index/mutation_types';
import { mapToScopesViewModel } from '~/feature_flags/store/modules/helpers'; import { mapToScopesViewModel } from '~/feature_flags/store/helpers';
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils'; import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
import { getRequestData, rotateData, featureFlag, userList } from '../../mock_data'; import { getRequestData, rotateData, featureFlag, userList } from '../../mock_data';
......
...@@ -6,19 +6,16 @@ import { ...@@ -6,19 +6,16 @@ import {
requestCreateFeatureFlag, requestCreateFeatureFlag,
receiveCreateFeatureFlagSuccess, receiveCreateFeatureFlagSuccess,
receiveCreateFeatureFlagError, receiveCreateFeatureFlagError,
} from '~/feature_flags/store/modules/new/actions'; } from '~/feature_flags/store/new/actions';
import state from '~/feature_flags/store/modules/new/state'; import state from '~/feature_flags/store/new/state';
import * as types from '~/feature_flags/store/modules/new/mutation_types'; import * as types from '~/feature_flags/store/new/mutation_types';
import { import {
ROLLOUT_STRATEGY_ALL_USERS, ROLLOUT_STRATEGY_ALL_USERS,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT, ROLLOUT_STRATEGY_PERCENT_ROLLOUT,
LEGACY_FLAG, LEGACY_FLAG,
NEW_VERSION_FLAG, NEW_VERSION_FLAG,
} from '~/feature_flags/constants'; } from '~/feature_flags/constants';
import { import { mapFromScopesViewModel, mapStrategiesToRails } from '~/feature_flags/store/helpers';
mapFromScopesViewModel,
mapStrategiesToRails,
} from '~/feature_flags/store/modules/helpers';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
jest.mock('~/lib/utils/url_utility'); jest.mock('~/lib/utils/url_utility');
......
import state from '~/feature_flags/store/modules/new/state'; import state from '~/feature_flags/store/new/state';
import mutations from '~/feature_flags/store/modules/new/mutations'; import mutations from '~/feature_flags/store/new/mutations';
import * as types from '~/feature_flags/store/modules/new/mutation_types'; import * as types from '~/feature_flags/store/new/mutation_types';
describe('Feature flags New Module Mutations', () => { describe('Feature flags New Module Mutations', () => {
let stateCopy; let stateCopy;
......
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