Commit 3f20edc5 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '2647-move-jira-connect-app-to-own-dir' into 'master'

Move Jira Connect App code to own directory

See merge request gitlab-org/gitlab!65703
parents ccaf08c9 52aa076f
import axios from 'axios'; import axios from 'axios';
import { getJwt } from '~/jira_connect/utils'; import { getJwt } from './utils';
export const addSubscription = async (addPath, namespace) => { export const addSubscription = async (addPath, namespace) => {
const jwt = await getJwt(); const jwt = await getJwt();
......
<script> <script>
import { GlAlert, GlButton, GlLink, GlModal, GlModalDirective, GlSprintf } from '@gitlab/ui'; import { GlAlert, GlButton, GlLink, GlModal, GlModalDirective, GlSprintf } from '@gitlab/ui';
import { mapState, mapMutations } from 'vuex'; import { mapState, mapMutations } from 'vuex';
import { retrieveAlert, getLocation } from '~/jira_connect/utils'; import { retrieveAlert, getLocation } from '~/jira_connect/subscriptions/utils';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { SET_ALERT } from '../store/mutation_types'; import { SET_ALERT } from '../store/mutation_types';
import GroupsList from './groups_list.vue'; import GroupsList from './groups_list.vue';
......
<script> <script>
import { GlLoadingIcon, GlPagination, GlAlert, GlSearchBoxByType } from '@gitlab/ui'; import { GlLoadingIcon, GlPagination, GlAlert, GlSearchBoxByType } from '@gitlab/ui';
import { fetchGroups } from '~/jira_connect/api'; import { fetchGroups } from '~/jira_connect/subscriptions/api';
import { DEFAULT_GROUPS_PER_PAGE, MINIMUM_SEARCH_TERM_LENGTH } from '~/jira_connect/constants'; import {
DEFAULT_GROUPS_PER_PAGE,
MINIMUM_SEARCH_TERM_LENGTH,
} from '~/jira_connect/subscriptions/constants';
import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils'; import { parseIntPagination, normalizeHeaders } from '~/lib/utils/common_utils';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import GroupsListItem from './groups_list_item.vue'; import GroupsListItem from './groups_list_item.vue';
......
<script> <script>
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { helpPagePath } from '~/helpers/help_page_helper'; import { helpPagePath } from '~/helpers/help_page_helper';
import { addSubscription } from '~/jira_connect/api'; import { addSubscription } from '~/jira_connect/subscriptions/api';
import { persistAlert, reloadPage } from '~/jira_connect/utils'; import { persistAlert, reloadPage } from '~/jira_connect/subscriptions/utils';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import GroupItemName from './group_item_name.vue'; import GroupItemName from './group_item_name.vue';
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
import { GlButton, GlEmptyState, GlTable } from '@gitlab/ui'; import { GlButton, GlEmptyState, GlTable } from '@gitlab/ui';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import { mapMutations } from 'vuex'; import { mapMutations } from 'vuex';
import { removeSubscription } from '~/jira_connect/api'; import { removeSubscription } from '~/jira_connect/subscriptions/api';
import { reloadPage } from '~/jira_connect/utils'; import { reloadPage } from '~/jira_connect/subscriptions/utils';
import { __, s__ } from '~/locale'; import { __, s__ } from '~/locale';
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import { SET_ALERT } from '../store/mutation_types'; import { SET_ALERT } from '../store/mutation_types';
......
import '../webpack'; import '../../webpack';
import setConfigs from '@gitlab/ui/dist/config'; import setConfigs from '@gitlab/ui/dist/config';
import Vue from 'vue'; import Vue from 'vue';
import { getLocation, sizeToParent } from '~/jira_connect/utils';
import GlFeatureFlagsPlugin from '~/vue_shared/gl_feature_flags_plugin'; import GlFeatureFlagsPlugin from '~/vue_shared/gl_feature_flags_plugin';
import Translate from '~/vue_shared/translate'; import Translate from '~/vue_shared/translate';
import JiraConnectApp from './components/app.vue'; import JiraConnectApp from './components/app.vue';
import createStore from './store'; import createStore from './store';
import { getLocation, sizeToParent } from './utils';
const store = createStore(); const store = createStore();
......
...@@ -126,7 +126,7 @@ function generateEntries() { ...@@ -126,7 +126,7 @@ function generateEntries() {
default: defaultEntries, default: defaultEntries,
sentry: './sentry/index.js', sentry: './sentry/index.js',
performance_bar: './performance_bar/index.js', performance_bar: './performance_bar/index.js',
jira_connect_app: './jira_connect/index.js', jira_connect_app: './jira_connect/subscriptions/index.js',
}; };
return Object.assign(manualEntries, incrementalCompiler.filterEntryPoints(autoEntries)); return Object.assign(manualEntries, incrementalCompiler.filterEntryPoints(autoEntries));
......
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { addSubscription, removeSubscription, fetchGroups } from '~/jira_connect/api'; import { addSubscription, removeSubscription, fetchGroups } from '~/jira_connect/subscriptions/api';
import { getJwt } from '~/jira_connect/utils'; import { getJwt } from '~/jira_connect/subscriptions/utils';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import httpStatus from '~/lib/utils/http_status'; import httpStatus from '~/lib/utils/http_status';
jest.mock('~/jira_connect/utils', () => ({ jest.mock('~/jira_connect/subscriptions/utils', () => ({
getJwt: jest.fn().mockResolvedValue('jwt'), getJwt: jest.fn().mockResolvedValue('jwt'),
})); }));
......
import { GlAlert, GlButton, GlModal, GlLink } from '@gitlab/ui'; import { GlAlert, GlButton, GlModal, GlLink } from '@gitlab/ui';
import { mount, shallowMount } from '@vue/test-utils'; import { mount, shallowMount } from '@vue/test-utils';
import JiraConnectApp from '~/jira_connect/components/app.vue'; import JiraConnectApp from '~/jira_connect/subscriptions/components/app.vue';
import createStore from '~/jira_connect/store'; import createStore from '~/jira_connect/subscriptions/store';
import { SET_ALERT } from '~/jira_connect/store/mutation_types'; import { SET_ALERT } from '~/jira_connect/subscriptions/store/mutation_types';
import { __ } from '~/locale'; import { __ } from '~/locale';
jest.mock('~/jira_connect/utils', () => ({ jest.mock('~/jira_connect/subscriptions/utils', () => ({
retrieveAlert: jest.fn().mockReturnValue({ message: 'error message' }), retrieveAlert: jest.fn().mockReturnValue({ message: 'error message' }),
getLocation: jest.fn(), getLocation: jest.fn(),
})); }));
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import GroupItemName from '~/jira_connect/components/group_item_name.vue'; import GroupItemName from '~/jira_connect/subscriptions/components/group_item_name.vue';
import { mockGroup1 } from '../mock_data'; import { mockGroup1 } from '../mock_data';
describe('GroupItemName', () => { describe('GroupItemName', () => {
......
...@@ -2,13 +2,13 @@ import { GlButton } from '@gitlab/ui'; ...@@ -2,13 +2,13 @@ import { GlButton } from '@gitlab/ui';
import { mount, shallowMount } from '@vue/test-utils'; import { mount, shallowMount } from '@vue/test-utils';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import * as JiraConnectApi from '~/jira_connect/api'; import * as JiraConnectApi from '~/jira_connect/subscriptions/api';
import GroupItemName from '~/jira_connect/components/group_item_name.vue'; import GroupItemName from '~/jira_connect/subscriptions/components/group_item_name.vue';
import GroupsListItem from '~/jira_connect/components/groups_list_item.vue'; import GroupsListItem from '~/jira_connect/subscriptions/components/groups_list_item.vue';
import { persistAlert, reloadPage } from '~/jira_connect/utils'; import { persistAlert, reloadPage } from '~/jira_connect/subscriptions/utils';
import { mockGroup1 } from '../mock_data'; import { mockGroup1 } from '../mock_data';
jest.mock('~/jira_connect/utils'); jest.mock('~/jira_connect/subscriptions/utils');
describe('GroupsListItem', () => { describe('GroupsListItem', () => {
let wrapper; let wrapper;
......
...@@ -2,10 +2,10 @@ import { GlAlert, GlLoadingIcon, GlSearchBoxByType, GlPagination } from '@gitlab ...@@ -2,10 +2,10 @@ import { GlAlert, GlLoadingIcon, GlSearchBoxByType, GlPagination } from '@gitlab
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { fetchGroups } from '~/jira_connect/api'; import { fetchGroups } from '~/jira_connect/subscriptions/api';
import GroupsList from '~/jira_connect/components/groups_list.vue'; import GroupsList from '~/jira_connect/subscriptions/components/groups_list.vue';
import GroupsListItem from '~/jira_connect/components/groups_list_item.vue'; import GroupsListItem from '~/jira_connect/subscriptions/components/groups_list_item.vue';
import { DEFAULT_GROUPS_PER_PAGE } from '~/jira_connect/constants'; import { DEFAULT_GROUPS_PER_PAGE } from '~/jira_connect/subscriptions/constants';
import { mockGroup1, mockGroup2 } from '../mock_data'; import { mockGroup1, mockGroup2 } from '../mock_data';
const createMockGroup = (groupId) => { const createMockGroup = (groupId) => {
...@@ -19,7 +19,7 @@ const createMockGroups = (count) => { ...@@ -19,7 +19,7 @@ const createMockGroups = (count) => {
return [...new Array(count)].map((_, idx) => createMockGroup(idx)); return [...new Array(count)].map((_, idx) => createMockGroup(idx));
}; };
jest.mock('~/jira_connect/api', () => { jest.mock('~/jira_connect/subscriptions/api', () => {
return { return {
fetchGroups: jest.fn(), fetchGroups: jest.fn(),
}; };
......
...@@ -2,14 +2,14 @@ import { GlButton, GlEmptyState, GlTable } from '@gitlab/ui'; ...@@ -2,14 +2,14 @@ import { GlButton, GlEmptyState, GlTable } from '@gitlab/ui';
import { mount, shallowMount } from '@vue/test-utils'; import { mount, shallowMount } from '@vue/test-utils';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import * as JiraConnectApi from '~/jira_connect/api'; import * as JiraConnectApi from '~/jira_connect/subscriptions/api';
import SubscriptionsList from '~/jira_connect/components/subscriptions_list.vue'; import SubscriptionsList from '~/jira_connect/subscriptions/components/subscriptions_list.vue';
import createStore from '~/jira_connect/store'; import createStore from '~/jira_connect/subscriptions/store';
import { SET_ALERT } from '~/jira_connect/store/mutation_types'; import { SET_ALERT } from '~/jira_connect/subscriptions/store/mutation_types';
import { reloadPage } from '~/jira_connect/utils'; import { reloadPage } from '~/jira_connect/subscriptions/utils';
import { mockSubscription } from '../mock_data'; import { mockSubscription } from '../mock_data';
jest.mock('~/jira_connect/utils'); jest.mock('~/jira_connect/subscriptions/utils');
describe('SubscriptionsList', () => { describe('SubscriptionsList', () => {
let wrapper; let wrapper;
......
import { initJiraConnect } from '~/jira_connect'; import { initJiraConnect } from '~/jira_connect/subscriptions';
jest.mock('~/jira_connect/utils', () => ({ jest.mock('~/jira_connect/subscriptions/utils', () => ({
getLocation: jest.fn().mockResolvedValue('test/location'), getLocation: jest.fn().mockResolvedValue('test/location'),
})); }));
......
import mutations from '~/jira_connect/store/mutations'; import mutations from '~/jira_connect/subscriptions/store/mutations';
import state from '~/jira_connect/store/state'; import state from '~/jira_connect/subscriptions/store/state';
describe('JiraConnect store mutations', () => { describe('JiraConnect store mutations', () => {
let localState; let localState;
......
import { useLocalStorageSpy } from 'helpers/local_storage_helper'; import { useLocalStorageSpy } from 'helpers/local_storage_helper';
import { useMockLocationHelper } from 'helpers/mock_window_location_helper'; import { useMockLocationHelper } from 'helpers/mock_window_location_helper';
import { ALERT_LOCALSTORAGE_KEY } from '~/jira_connect/constants'; import { ALERT_LOCALSTORAGE_KEY } from '~/jira_connect/subscriptions/constants';
import { import {
persistAlert, persistAlert,
retrieveAlert, retrieveAlert,
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
getLocation, getLocation,
reloadPage, reloadPage,
sizeToParent, sizeToParent,
} from '~/jira_connect/utils'; } from '~/jira_connect/subscriptions/utils';
describe('JiraConnect utils', () => { describe('JiraConnect utils', () => {
describe('alert utils', () => { describe('alert utils', () => {
......
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