Commit 144a63c1 authored by mlunoe's avatar mlunoe

Refactor(filtered search): share filter module

Move filter store module to be shared with the
filtered search component to allow other parts
of the application to use this store module
parent 334adc45
import Vue from 'vue';
import Vuex from 'vuex';
import filters from 'ee/analytics/shared/store/modules/filters';
import filters from '~/vue_shared/components/filtered_search_bar/store/modules/filters';
import * as actions from './actions';
import mergeRequests from './modules/merge_requests/index';
......
import Vue from 'vue';
import Vuex from 'vuex';
import filters from 'ee/analytics/shared/store/modules/filters';
import filters from '~/vue_shared/components/filtered_search_bar/store/modules/filters';
import * as actions from './actions';
import * as getters from './getters';
import mutations from './mutations';
......
import Vue from 'vue';
import Vuex from 'vuex';
import filters from 'ee/analytics/shared/store/modules/filters';
import filters from '~/vue_shared/components/filtered_search_bar/store/modules/filters';
import * as actions from './actions';
Vue.use(Vuex);
......
......@@ -6,8 +6,8 @@ import MergeRequestTable from 'ee/analytics/code_review_analytics/components/mer
import FilterBar from 'ee/analytics/code_review_analytics/components/filter_bar.vue';
import * as actions from 'ee/analytics/code_review_analytics/store/actions';
import createMergeRequestsState from 'ee/analytics/code_review_analytics/store/modules/merge_requests/state';
import createFiltersState from 'ee/analytics/shared/store/modules/filters/state';
import { TEST_HOST } from 'helpers/test_constants';
import createFiltersState from '~/vue_shared/components/filtered_search_bar/store/modules/filters/state';
const mockFilterManagerSetup = jest.fn();
jest.mock('ee/analytics/code_review_analytics/filtered_search_code_review_analytics', () =>
......
......@@ -4,14 +4,20 @@ import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import storeConfig from 'ee/analytics/code_review_analytics/store';
import FilterBar from 'ee/analytics/code_review_analytics/components/filter_bar.vue';
import initialFiltersState from 'ee/analytics/shared/store/modules/filters/state';
import {
filterMilestones,
filterLabels,
} from 'jest/vue_shared/components/filtered_search_bar/store/modules/filters/mock_data';
import {
getFilterParams,
getFilterValues,
} from 'jest/vue_shared/components/filtered_search_bar/store/modules/filters/test_helper';
import initialFiltersState from '~/vue_shared/components/filtered_search_bar/store/modules/filters/state';
import FilteredSearchBar from '~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue';
import * as utils from '~/vue_shared/components/filtered_search_bar/filtered_search_utils';
import UrlSync from '~/vue_shared/components/url_sync.vue';
import * as commonUtils from '~/lib/utils/common_utils';
import * as urlUtils from '~/lib/utils/url_utility';
import { filterMilestones, filterLabels } from '../../shared/store/modules/filters/mock_data';
import { getFilterParams, getFilterValues } from '../../shared/store/modules/filters/test_helper';
const localVue = createLocalVue();
localVue.use(Vuex);
......
......@@ -4,11 +4,14 @@ import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import storeConfig from 'ee/analytics/cycle_analytics/store';
import FilterBar from 'ee/analytics/cycle_analytics/components/filter_bar.vue';
import initialFiltersState from 'ee/analytics/shared/store/modules/filters/state';
import {
filterMilestones,
filterLabels,
} from 'jest/vue_shared/components/filtered_search_bar/store/modules/filters/mock_data';
import initialFiltersState from '~/vue_shared/components/filtered_search_bar/store/modules/filters/state';
import FilteredSearchBar from '~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue';
import UrlSync from '~/vue_shared/components/url_sync.vue';
import * as utils from '~/vue_shared/components/filtered_search_bar/filtered_search_utils';
import { filterMilestones, filterLabels } from '../../shared/store/modules/filters/mock_data';
import * as commonUtils from '~/lib/utils/common_utils';
import * as urlUtils from '~/lib/utils/url_utility';
......
import * as getters from 'ee/analytics/cycle_analytics/store/getters';
import {
filterMilestones,
filterUsers,
filterLabels,
} from 'jest/vue_shared/components/filtered_search_bar/store/modules/filters/mock_data';
import {
getFilterParams,
getFilterValues,
} from 'jest/vue_shared/components/filtered_search_bar/store/modules/filters/test_helper';
import {
startDate,
endDate,
......@@ -8,12 +17,6 @@ import {
issueStage,
stageMedians,
} from '../mock_data';
import {
filterMilestones,
filterUsers,
filterLabels,
} from '../../shared/store/modules/filters/mock_data';
import { getFilterParams, getFilterValues } from '../../shared/store/modules/filters/test_helper';
let state = null;
......
......@@ -4,20 +4,23 @@ import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import storeConfig from 'ee/analytics/merge_request_analytics/store';
import FilterBar from 'ee/analytics/merge_request_analytics/components/filter_bar.vue';
import initialFiltersState from 'ee/analytics/shared/store/modules/filters/state';
import { mockBranches } from 'jest/vue_shared/components/filtered_search_bar/mock_data';
import {
filterMilestones,
filterLabels,
filterUsers,
} from 'jest/vue_shared/components/filtered_search_bar/store/modules/filters/mock_data';
import {
getFilterParams,
getFilterValues,
} from 'jest/vue_shared/components/filtered_search_bar/store/modules/filters/test_helper';
import initialFiltersState from '~/vue_shared/components/filtered_search_bar/store/modules/filters/state';
import * as utils from '~/vue_shared/components/filtered_search_bar/filtered_search_utils';
import FilteredSearchBar from '~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue';
import UrlSync from '~/vue_shared/components/url_sync.vue';
import * as commonUtils from '~/lib/utils/common_utils';
import * as urlUtils from '~/lib/utils/url_utility';
import { ITEM_TYPE } from '~/groups/constants';
import {
filterMilestones,
filterLabels,
filterUsers,
} from '../../shared/store/modules/filters/mock_data';
import { getFilterParams, getFilterValues } from '../../shared/store/modules/filters/test_helper';
const localVue = createLocalVue();
localVue.use(Vuex);
......
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
import * as actions from 'ee/analytics/shared/store/modules/filters/actions';
import * as types from 'ee/analytics/shared/store/modules/filters/mutation_types';
import initialState from 'ee/analytics/shared/store/modules/filters/state';
import { mockBranches } from 'jest/vue_shared/components/filtered_search_bar/mock_data';
import * as actions from '~/vue_shared/components/filtered_search_bar/store/modules/filters/actions';
import * as types from '~/vue_shared/components/filtered_search_bar/store/modules/filters/mutation_types';
import initialState from '~/vue_shared/components/filtered_search_bar/store/modules/filters/state';
import httpStatusCodes from '~/lib/utils/http_status';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import Api from '~/api';
......
import { get } from 'lodash';
import initialState from 'ee/analytics/shared/store/modules/filters/state';
import mutations from 'ee/analytics/shared/store/modules/filters/mutations';
import * as types from 'ee/analytics/shared/store/modules/filters/mutation_types';
import { mockBranches } from 'jest/vue_shared/components/filtered_search_bar/mock_data';
import initialState from '~/vue_shared/components/filtered_search_bar/store/modules/filters/state';
import mutations from '~/vue_shared/components/filtered_search_bar/store/modules/filters/mutations';
import * as types from '~/vue_shared/components/filtered_search_bar/store/modules/filters/mutation_types';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { filterMilestones, filterUsers, filterLabels } from './mock_data';
......
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