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