Commit d46b4a0d authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch '263670-consider-moving-members-to-main-javascripts-directory' into 'master'

Move members JS from `vue_shared` to main JS directory [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!46995
parents 26b1c5d1 19a751e7
<script> <script>
import { mapState, mapMutations } from 'vuex'; import { mapState, mapMutations } from 'vuex';
import { GlAlert } from '@gitlab/ui'; import { GlAlert } from '@gitlab/ui';
import MembersTable from '~/vue_shared/components/members/table/members_table.vue'; import MembersTable from '~/members/components/table/members_table.vue';
import { scrollToElement } from '~/lib/utils/common_utils'; import { scrollToElement } from '~/lib/utils/common_utils';
import { HIDE_ERROR } from '~/vuex_shared/modules/members/mutation_types'; import { HIDE_ERROR } from '~/members/store/mutation_types';
export default { export default {
name: 'GroupMembersApp', name: 'GroupMembersApp',
......
...@@ -3,7 +3,7 @@ import Vuex from 'vuex'; ...@@ -3,7 +3,7 @@ import Vuex from 'vuex';
import { GlToast } from '@gitlab/ui'; import { GlToast } from '@gitlab/ui';
import { parseDataAttributes } from 'ee_else_ce/groups/members/utils'; import { parseDataAttributes } from 'ee_else_ce/groups/members/utils';
import App from './components/app.vue'; import App from './components/app.vue';
import membersModule from '~/vuex_shared/modules/members'; import membersStore from '~/members/store';
export const initGroupMembersApp = (el, tableFields, tableAttrs, requestFormatter) => { export const initGroupMembersApp = (el, tableFields, tableAttrs, requestFormatter) => {
if (!el) { if (!el) {
...@@ -13,15 +13,15 @@ export const initGroupMembersApp = (el, tableFields, tableAttrs, requestFormatte ...@@ -13,15 +13,15 @@ export const initGroupMembersApp = (el, tableFields, tableAttrs, requestFormatte
Vue.use(Vuex); Vue.use(Vuex);
Vue.use(GlToast); Vue.use(GlToast);
const store = new Vuex.Store({ const store = new Vuex.Store(
...membersModule({ membersStore({
...parseDataAttributes(el), ...parseDataAttributes(el),
currentUserId: gon.current_user_id || null, currentUserId: gon.current_user_id || null,
tableFields, tableFields,
tableAttrs, tableAttrs,
requestFormatter, requestFormatter,
}), }),
}); );
return new Vue({ return new Vue({
el, el,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui'; import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
import LeaveModal from '../modals/leave_modal.vue'; import LeaveModal from '../modals/leave_modal.vue';
import { LEAVE_MODAL_ID } from '../constants'; import { LEAVE_MODAL_ID } from '../../constants';
export default { export default {
name: 'LeaveButton', name: 'LeaveButton',
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
RemoveMemberButton, RemoveMemberButton,
LeaveButton, LeaveButton,
LdapOverrideButton: () => LdapOverrideButton: () =>
import('ee_component/vue_shared/components/members/ldap/ldap_override_button.vue'), import('ee_component/members/components/ldap/ldap_override_button.vue'),
}, },
props: { props: {
member: { member: {
......
<script> <script>
import { GlAvatarLink, GlAvatarLabeled } from '@gitlab/ui'; import { GlAvatarLink, GlAvatarLabeled } from '@gitlab/ui';
import { AVATAR_SIZE } from '../constants'; import { AVATAR_SIZE } from '../../constants';
export default { export default {
name: 'GroupAvatar', name: 'GroupAvatar',
......
<script> <script>
import { GlAvatarLabeled } from '@gitlab/ui'; import { GlAvatarLabeled } from '@gitlab/ui';
import { AVATAR_SIZE } from '../constants'; import { AVATAR_SIZE } from '../../constants';
export default { export default {
name: 'InviteAvatar', name: 'InviteAvatar',
......
...@@ -5,9 +5,9 @@ import { ...@@ -5,9 +5,9 @@ import {
GlBadge, GlBadge,
GlSafeHtmlDirective as SafeHtml, GlSafeHtmlDirective as SafeHtml,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { generateBadges } from 'ee_else_ce/vue_shared/components/members/utils'; import { generateBadges } from 'ee_else_ce/members/utils';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { AVATAR_SIZE } from '../constants'; import { AVATAR_SIZE } from '../../constants';
import { glEmojiTag } from '~/emoji'; import { glEmojiTag } from '~/emoji';
export default { export default {
......
...@@ -3,7 +3,7 @@ import { mapState } from 'vuex'; ...@@ -3,7 +3,7 @@ import { mapState } from 'vuex';
import { GlModal, GlForm, GlSprintf, GlTooltipDirective } from '@gitlab/ui'; import { GlModal, GlForm, GlSprintf, GlTooltipDirective } from '@gitlab/ui';
import csrf from '~/lib/utils/csrf'; import csrf from '~/lib/utils/csrf';
import { __, s__, sprintf } from '~/locale'; import { __, s__, sprintf } from '~/locale';
import { LEAVE_MODAL_ID } from '../constants'; import { LEAVE_MODAL_ID } from '../../constants';
export default { export default {
name: 'LeaveModal', name: 'LeaveModal',
......
...@@ -3,7 +3,7 @@ import { mapState, mapActions } from 'vuex'; ...@@ -3,7 +3,7 @@ import { mapState, mapActions } from 'vuex';
import { GlModal, GlSprintf, GlForm } from '@gitlab/ui'; import { GlModal, GlSprintf, GlForm } from '@gitlab/ui';
import csrf from '~/lib/utils/csrf'; import csrf from '~/lib/utils/csrf';
import { __, s__, sprintf } from '~/locale'; import { __, s__, sprintf } from '~/locale';
import { REMOVE_GROUP_LINK_MODAL_ID } from '../constants'; import { REMOVE_GROUP_LINK_MODAL_ID } from '../../constants';
export default { export default {
name: 'RemoveGroupLinkModal', name: 'RemoveGroupLinkModal',
......
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
formatDate, formatDate,
getDayDifference, getDayDifference,
} from '~/lib/utils/datetime_utility'; } from '~/lib/utils/datetime_utility';
import { DAYS_TO_EXPIRE_SOON } from '../constants'; import { DAYS_TO_EXPIRE_SOON } from '../../constants';
export default { export default {
name: 'ExpiresAt', name: 'ExpiresAt',
......
...@@ -3,7 +3,7 @@ import UserActionButtons from '../action_buttons/user_action_buttons.vue'; ...@@ -3,7 +3,7 @@ import UserActionButtons from '../action_buttons/user_action_buttons.vue';
import GroupActionButtons from '../action_buttons/group_action_buttons.vue'; import GroupActionButtons from '../action_buttons/group_action_buttons.vue';
import InviteActionButtons from '../action_buttons/invite_action_buttons.vue'; import InviteActionButtons from '../action_buttons/invite_action_buttons.vue';
import AccessRequestActionButtons from '../action_buttons/access_request_action_buttons.vue'; import AccessRequestActionButtons from '../action_buttons/access_request_action_buttons.vue';
import { MEMBER_TYPES } from '../constants'; import { MEMBER_TYPES } from '../../constants';
export default { export default {
name: 'MemberActionButtons', name: 'MemberActionButtons',
......
<script> <script>
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { GlTable, GlBadge } from '@gitlab/ui'; import { GlTable, GlBadge } from '@gitlab/ui';
import MembersTableCell from 'ee_else_ce/vue_shared/components/members/table/members_table_cell.vue'; import MembersTableCell from 'ee_else_ce/members/components/table/members_table_cell.vue';
import { import { canOverride, canRemove, canResend, canUpdate } from 'ee_else_ce/members/utils';
canOverride, import { FIELDS } from '../../constants';
canRemove,
canResend,
canUpdate,
} from 'ee_else_ce/vue_shared/components/members/utils';
import { FIELDS } from '../constants';
import initUserPopovers from '~/user_popovers'; import initUserPopovers from '~/user_popovers';
import MemberAvatar from './member_avatar.vue'; import MemberAvatar from './member_avatar.vue';
import MemberSource from './member_source.vue'; import MemberSource from './member_source.vue';
...@@ -34,9 +29,7 @@ export default { ...@@ -34,9 +29,7 @@ export default {
RemoveGroupLinkModal, RemoveGroupLinkModal,
ExpirationDatepicker, ExpirationDatepicker,
LdapOverrideConfirmationModal: () => LdapOverrideConfirmationModal: () =>
import( import('ee_component/members/components/ldap/ldap_override_confirmation_modal.vue'),
'ee_component/vue_shared/components/members/ldap/ldap_override_confirmation_modal.vue'
),
}, },
computed: { computed: {
...mapState(['members', 'tableFields', 'tableAttrs', 'currentUserId', 'sourceId']), ...mapState(['members', 'tableFields', 'tableAttrs', 'currentUserId', 'sourceId']),
......
<script> <script>
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { MEMBER_TYPES } from '../constants'; import { MEMBER_TYPES } from '../../constants';
import { isGroup, isDirectMember, isCurrentUser, canRemove, canResend, canUpdate } from '../utils'; import {
isGroup,
isDirectMember,
isCurrentUser,
canRemove,
canResend,
canUpdate,
} from '../../utils';
export default { export default {
name: 'MembersTableCell', name: 'MembersTableCell',
......
...@@ -9,8 +9,7 @@ export default { ...@@ -9,8 +9,7 @@ export default {
components: { components: {
GlDropdown, GlDropdown,
GlDropdownItem, GlDropdownItem,
LdapDropdownItem: () => LdapDropdownItem: () => import('ee_component/members/components/ldap/ldap_dropdown_item.vue'),
import('ee_component/vue_shared/components/members/ldap/ldap_dropdown_item.vue'),
}, },
props: { props: {
member: { member: {
......
import createState from 'ee_else_ce/members/store/state';
import mutations from 'ee_else_ce/members/store/mutations';
import * as actions from 'ee_else_ce/members/store/actions';
export default initialState => ({
state: createState(initialState),
actions,
mutations,
});
import createState from 'ee_else_ce/vuex_shared/modules/members/state';
import mutations from 'ee_else_ce/vuex_shared/modules/members/mutations';
import * as actions from 'ee_else_ce/vuex_shared/modules/members/actions';
export default initialState => ({
namespaced: true,
state: createState(initialState),
actions,
mutations,
});
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import { GlModal, GlSprintf } from '@gitlab/ui'; import { GlModal, GlSprintf } from '@gitlab/ui';
import { __, s__ } from '~/locale'; import { __, s__ } from '~/locale';
import { LDAP_OVERRIDE_CONFIRMATION_MODAL_ID } from '../constants'; import { LDAP_OVERRIDE_CONFIRMATION_MODAL_ID } from '../../constants';
export default { export default {
name: 'LdapOverrideConfirmationModal', name: 'LdapOverrideConfirmationModal',
......
<script> <script>
import CEMembersTableCell from '~/vue_shared/components/members/table/members_table_cell.vue'; import CEMembersTableCell from '~/members/components/table/members_table_cell.vue';
import { canOverride } from '../utils'; import { canOverride } from '../../utils';
export default { export default {
name: 'MembersTableCell', name: 'MembersTableCell',
......
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';
export * from '~/vuex_shared/modules/members/actions'; export * from '~/members/store/actions';
export const updateLdapOverride = async ({ state, commit }, { memberId, override }) => { export const updateLdapOverride = async ({ state, commit }, { memberId, override }) => {
try { try {
......
import Vue from 'vue'; import Vue from 'vue';
import * as types from './mutation_types'; import * as types from './mutation_types';
import CEMutations from '~/vuex_shared/modules/members/mutations'; import CEMutations from '~/members/store/mutations';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { findMember } from '~/vuex_shared/modules/members/utils'; import { findMember } from '~/members/store/utils';
export default { export default {
...CEMutations, ...CEMutations,
......
import createState from '~/vuex_shared/modules/members/state'; import createState from '~/members/store/state';
export default initialState => { export default initialState => {
const { ldapOverridePath } = initialState; const { ldapOverridePath } = initialState;
......
import { __ } from '~/locale'; import { __ } from '~/locale';
import { generateBadges as CEGenerateBadges } from '~/vue_shared/components/members/utils'; import { generateBadges as CEGenerateBadges } from '~/members/utils';
export { export {
isGroup, isGroup,
...@@ -8,7 +8,7 @@ export { ...@@ -8,7 +8,7 @@ export {
canRemove, canRemove,
canResend, canResend,
canUpdate, canUpdate,
} from '~/vue_shared/components/members/utils'; } from '~/members/utils';
export const generateBadges = (member, isCurrentUser) => [ export const generateBadges = (member, isCurrentUser) => [
...CEGenerateBadges(member, isCurrentUser), ...CEGenerateBadges(member, isCurrentUser),
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import LdapOverrideButton from 'ee/vue_shared/components/members/ldap/ldap_override_button.vue';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { member } from 'jest/vue_shared/components/members/mock_data'; import { member } from 'jest/members/mock_data';
import UserActionButtons from '~/vue_shared/components/members/action_buttons/user_action_buttons.vue'; import LdapOverrideButton from 'ee/members/components/ldap/ldap_override_button.vue';
import UserActionButtons from '~/members/components/action_buttons/user_action_buttons.vue';
describe('UserActionButtons', () => { describe('UserActionButtons', () => {
let wrapper; let wrapper;
......
import { GlBadge } from '@gitlab/ui'; import { GlBadge } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { member as memberMock } from 'jest/vue_shared/components/members/mock_data'; import { member as memberMock } from 'jest/members/mock_data';
import UserAvatar from '~/vue_shared/components/members/avatars/user_avatar.vue'; import UserAvatar from '~/members/components/avatars/user_avatar.vue';
describe('UserAvatar', () => { describe('UserAvatar', () => {
let wrapper; let wrapper;
......
import { GlDropdownItem } from '@gitlab/ui'; import { GlDropdownItem } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import LdapDropdownItem from 'ee/vue_shared/components/members/ldap/ldap_dropdown_item.vue';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import LdapDropdownItem from 'ee/members/components/ldap/ldap_dropdown_item.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import LdapOverrideButton from 'ee/vue_shared/components/members/ldap/ldap_override_button.vue';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import { member } from 'jest/vue_shared/components/members/mock_data'; import { member } from 'jest/members/mock_data';
import LdapOverrideButton from 'ee/members/components/ldap/ldap_override_button.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
...@@ -3,10 +3,10 @@ import { within } from '@testing-library/dom'; ...@@ -3,10 +3,10 @@ import { within } from '@testing-library/dom';
import { mount, createLocalVue, createWrapper } from '@vue/test-utils'; import { mount, createLocalVue, createWrapper } from '@vue/test-utils';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { LDAP_OVERRIDE_CONFIRMATION_MODAL_ID } from 'ee/vue_shared/components/members/constants';
import LdapOverrideConfirmationModal from 'ee/vue_shared/components/members/ldap/ldap_override_confirmation_modal.vue';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { member } from 'jest/vue_shared/components/members/mock_data'; import { member } from 'jest/members/mock_data';
import { LDAP_OVERRIDE_CONFIRMATION_MODAL_ID } from 'ee/members/constants';
import LdapOverrideConfirmationModal from 'ee/members/components/ldap/ldap_override_confirmation_modal.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
import { GlDatepicker } from '@gitlab/ui'; import { GlDatepicker } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { member } from 'jest/vue_shared/components/members/mock_data'; import { member } from 'jest/members/mock_data';
import ExpirationDatepicker from '~/vue_shared/components/members/table/expiration_datepicker.vue'; import ExpirationDatepicker from '~/members/components/table/expiration_datepicker.vue';
describe('ExpirationDatepicker', () => { describe('ExpirationDatepicker', () => {
let wrapper; let wrapper;
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import MembersTableCell from 'ee/vue_shared/components/members/table/members_table_cell.vue'; import { member as memberMock } from 'jest/members/mock_data';
import { member as memberMock } from 'jest/vue_shared/components/members/mock_data'; import MembersTableCell from 'ee/members/components/table/members_table_cell.vue';
describe('MemberTableCell', () => { describe('MemberTableCell', () => {
const WrappedComponent = { const WrappedComponent = {
......
import { within } from '@testing-library/dom'; import { within } from '@testing-library/dom';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { member as memberMock, members } from 'jest/vue_shared/components/members/mock_data'; import { member as memberMock, members } from 'jest/members/mock_data';
import MembersTable from '~/vue_shared/components/members/table/members_table.vue'; import MembersTable from '~/members/components/table/members_table.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
import { GlDropdown } from '@gitlab/ui'; import { GlDropdown } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import LdapDropdownItem from 'ee/vue_shared/components/members/ldap/ldap_dropdown_item.vue';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { member } from 'jest/vue_shared/components/members/mock_data'; import { member } from 'jest/members/mock_data';
import RoleDropdown from '~/vue_shared/components/members/table/role_dropdown.vue'; import LdapDropdownItem from 'ee/members/components/ldap/ldap_dropdown_item.vue';
import RoleDropdown from '~/members/components/table/role_dropdown.vue';
describe('RoleDropdown', () => { describe('RoleDropdown', () => {
let wrapper; let wrapper;
......
import axios from 'axios'; import axios from 'axios';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { noop } from 'lodash'; import { noop } from 'lodash';
import { members, member } from 'jest/members/mock_data';
import testAction from 'helpers/vuex_action_helper';
import * as types from 'ee/members/store/mutation_types';
import { import {
updateLdapOverride, updateLdapOverride,
showLdapOverrideConfirmationModal, showLdapOverrideConfirmationModal,
hideLdapOverrideConfirmationModal, hideLdapOverrideConfirmationModal,
} from 'ee/vuex_shared/modules/members/actions'; } from 'ee/members/store/actions';
import * as types from 'ee/vuex_shared/modules/members/mutation_types';
import testAction from 'helpers/vuex_action_helper';
import { members, member } from 'jest/vue_shared/components/members/mock_data';
import httpStatusCodes from '~/lib/utils/http_status'; import httpStatusCodes from '~/lib/utils/http_status';
describe('Vuex members actions', () => { describe('Vuex members actions', () => {
......
import * as types from 'ee/vuex_shared/modules/members/mutation_types'; import { members, member } from 'jest/members/mock_data';
import mutations from 'ee/vuex_shared/modules/members/mutations'; import mutations from 'ee/members/store/mutations';
import { members, member } from 'jest/vue_shared/components/members/mock_data'; import * as types from 'ee/members/store/mutation_types';
describe('Vuex members mutations', () => { describe('Vuex members mutations', () => {
describe(types.RECEIVE_LDAP_OVERRIDE_SUCCESS, () => { describe(types.RECEIVE_LDAP_OVERRIDE_SUCCESS, () => {
......
import { generateBadges, canOverride } from 'ee/vue_shared/components/members/utils'; import { member as memberMock } from 'jest/members/mock_data';
import { member as memberMock } from 'jest/vue_shared/components/members/mock_data'; import { generateBadges, canOverride } from 'ee/members/utils';
describe('Members Utils', () => { describe('Members Utils', () => {
describe('generateBadges', () => { describe('generateBadges', () => {
......
...@@ -22,12 +22,12 @@ module QA ...@@ -22,12 +22,12 @@ module QA
element :group_row element :group_row
end end
view 'app/assets/javascripts/vue_shared/components/members/table/role_dropdown.vue' do view 'app/assets/javascripts/members/components/table/role_dropdown.vue' do
element :access_level_dropdown element :access_level_dropdown
element :access_level_link element :access_level_link
end end
view 'app/assets/javascripts/vue_shared/components/members/action_buttons/remove_member_button.vue' do view 'app/assets/javascripts/members/components/action_buttons/remove_member_button.vue' do
element :delete_member_button element :delete_member_button
end end
......
...@@ -4,11 +4,8 @@ import Vuex from 'vuex'; ...@@ -4,11 +4,8 @@ import Vuex from 'vuex';
import { GlAlert } from '@gitlab/ui'; import { GlAlert } from '@gitlab/ui';
import App from '~/groups/members/components/app.vue'; import App from '~/groups/members/components/app.vue';
import * as commonUtils from '~/lib/utils/common_utils'; import * as commonUtils from '~/lib/utils/common_utils';
import { import { RECEIVE_MEMBER_ROLE_ERROR, HIDE_ERROR } from '~/members/store/mutation_types';
RECEIVE_MEMBER_ROLE_ERROR, import mutations from '~/members/store/mutations';
HIDE_ERROR,
} from '~/vuex_shared/modules/members/mutation_types';
import mutations from '~/vuex_shared/modules/members/mutations';
describe('GroupMembersApp', () => { describe('GroupMembersApp', () => {
const localVue = createLocalVue(); const localVue = createLocalVue();
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import AccessRequestActionButtons from '~/vue_shared/components/members/action_buttons/access_request_action_buttons.vue'; import AccessRequestActionButtons from '~/members/components/action_buttons/access_request_action_buttons.vue';
import RemoveMemberButton from '~/vue_shared/components/members/action_buttons/remove_member_button.vue'; import RemoveMemberButton from '~/members/components/action_buttons/remove_member_button.vue';
import ApproveAccessRequestButton from '~/vue_shared/components/members/action_buttons/approve_access_request_button.vue'; import ApproveAccessRequestButton from '~/members/components/action_buttons/approve_access_request_button.vue';
import { accessRequest as member } from '../mock_data'; import { accessRequest as member } from '../../mock_data';
describe('AccessRequestActionButtons', () => { describe('AccessRequestActionButtons', () => {
let wrapper; let wrapper;
......
...@@ -2,7 +2,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlButton, GlForm } from '@gitlab/ui'; import { GlButton, GlForm } from '@gitlab/ui';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import ApproveAccessRequestButton from '~/vue_shared/components/members/action_buttons/approve_access_request_button.vue'; import ApproveAccessRequestButton from '~/members/components/action_buttons/approve_access_request_button.vue';
jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' })); jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' }));
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import InviteActionButtons from '~/vue_shared/components/members/action_buttons/invite_action_buttons.vue'; import InviteActionButtons from '~/members/components/action_buttons/invite_action_buttons.vue';
import RemoveMemberButton from '~/vue_shared/components/members/action_buttons/remove_member_button.vue'; import RemoveMemberButton from '~/members/components/action_buttons/remove_member_button.vue';
import ResendInviteButton from '~/vue_shared/components/members/action_buttons/resend_invite_button.vue'; import ResendInviteButton from '~/members/components/action_buttons/resend_invite_button.vue';
import { invite as member } from '../mock_data'; import { invite as member } from '../../mock_data';
describe('InviteActionButtons', () => { describe('InviteActionButtons', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import LeaveButton from '~/vue_shared/components/members/action_buttons/leave_button.vue'; import LeaveButton from '~/members/components/action_buttons/leave_button.vue';
import LeaveModal from '~/vue_shared/components/members/modals/leave_modal.vue'; import LeaveModal from '~/members/components/modals/leave_modal.vue';
import { LEAVE_MODAL_ID } from '~/vue_shared/components/members/constants'; import { LEAVE_MODAL_ID } from '~/members/constants';
import { member } from '../mock_data'; import { member } from '../../mock_data';
describe('LeaveButton', () => { describe('LeaveButton', () => {
let wrapper; let wrapper;
......
...@@ -2,8 +2,8 @@ import { mount, createLocalVue } from '@vue/test-utils'; ...@@ -2,8 +2,8 @@ import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import RemoveGroupLinkButton from '~/vue_shared/components/members/action_buttons/remove_group_link_button.vue'; import RemoveGroupLinkButton from '~/members/components/action_buttons/remove_group_link_button.vue';
import { group } from '../mock_data'; import { group } from '../../mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import RemoveMemberButton from '~/vue_shared/components/members/action_buttons/remove_member_button.vue'; import RemoveMemberButton from '~/members/components/action_buttons/remove_member_button.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
...@@ -2,7 +2,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import ResendInviteButton from '~/vue_shared/components/members/action_buttons/resend_invite_button.vue'; import ResendInviteButton from '~/members/components/action_buttons/resend_invite_button.vue';
jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' })); jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' }));
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import UserActionButtons from '~/vue_shared/components/members/action_buttons/user_action_buttons.vue'; import UserActionButtons from '~/members/components/action_buttons/user_action_buttons.vue';
import RemoveMemberButton from '~/vue_shared/components/members/action_buttons/remove_member_button.vue'; import RemoveMemberButton from '~/members/components/action_buttons/remove_member_button.vue';
import LeaveButton from '~/vue_shared/components/members/action_buttons/leave_button.vue'; import LeaveButton from '~/members/components/action_buttons/leave_button.vue';
import { member, orphanedMember } from '../mock_data'; import { member, orphanedMember } from '../../mock_data';
describe('UserActionButtons', () => { describe('UserActionButtons', () => {
let wrapper; let wrapper;
......
import { mount, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import { getByText as getByTextHelper } from '@testing-library/dom'; import { getByText as getByTextHelper } from '@testing-library/dom';
import { GlAvatarLink } from '@gitlab/ui'; import { GlAvatarLink } from '@gitlab/ui';
import { group as member } from '../mock_data'; import { group as member } from '../../mock_data';
import GroupAvatar from '~/vue_shared/components/members/avatars/group_avatar.vue'; import GroupAvatar from '~/members/components/avatars/group_avatar.vue';
describe('MemberList', () => { describe('MemberList', () => {
let wrapper; let wrapper;
......
import { mount, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import { getByText as getByTextHelper } from '@testing-library/dom'; import { getByText as getByTextHelper } from '@testing-library/dom';
import { invite as member } from '../mock_data'; import { invite as member } from '../../mock_data';
import InviteAvatar from '~/vue_shared/components/members/avatars/invite_avatar.vue'; import InviteAvatar from '~/members/components/avatars/invite_avatar.vue';
describe('MemberList', () => { describe('MemberList', () => {
let wrapper; let wrapper;
......
import { mount, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import { within } from '@testing-library/dom'; import { within } from '@testing-library/dom';
import { GlAvatarLink, GlBadge } from '@gitlab/ui'; import { GlAvatarLink, GlBadge } from '@gitlab/ui';
import { member as memberMock, orphanedMember } from '../mock_data'; import { member as memberMock, orphanedMember } from '../../mock_data';
import UserAvatar from '~/vue_shared/components/members/avatars/user_avatar.vue'; import UserAvatar from '~/members/components/avatars/user_avatar.vue';
describe('UserAvatar', () => { describe('UserAvatar', () => {
let wrapper; let wrapper;
......
...@@ -3,9 +3,9 @@ import { GlModal, GlForm } from '@gitlab/ui'; ...@@ -3,9 +3,9 @@ import { GlModal, GlForm } from '@gitlab/ui';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import { within } from '@testing-library/dom'; import { within } from '@testing-library/dom';
import Vuex from 'vuex'; import Vuex from 'vuex';
import LeaveModal from '~/vue_shared/components/members/modals/leave_modal.vue'; import LeaveModal from '~/members/components/modals/leave_modal.vue';
import { LEAVE_MODAL_ID } from '~/vue_shared/components/members/constants'; import { LEAVE_MODAL_ID } from '~/members/constants';
import { member } from '../mock_data'; import { member } from '../../mock_data';
jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' })); jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' }));
......
...@@ -3,9 +3,9 @@ import { GlModal, GlForm } from '@gitlab/ui'; ...@@ -3,9 +3,9 @@ import { GlModal, GlForm } from '@gitlab/ui';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import { within } from '@testing-library/dom'; import { within } from '@testing-library/dom';
import Vuex from 'vuex'; import Vuex from 'vuex';
import RemoveGroupLinkModal from '~/vue_shared/components/members/modals/remove_group_link_modal.vue'; import RemoveGroupLinkModal from '~/members/components/modals/remove_group_link_modal.vue';
import { REMOVE_GROUP_LINK_MODAL_ID } from '~/vue_shared/components/members/constants'; import { REMOVE_GROUP_LINK_MODAL_ID } from '~/members/constants';
import { group } from '../mock_data'; import { group } from '../../mock_data';
jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' })); jest.mock('~/lib/utils/csrf', () => ({ token: 'mock-csrf-token' }));
......
import { mount, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import { within } from '@testing-library/dom'; import { within } from '@testing-library/dom';
import { useFakeDate } from 'helpers/fake_date'; import { useFakeDate } from 'helpers/fake_date';
import CreatedAt from '~/vue_shared/components/members/table/created_at.vue'; import CreatedAt from '~/members/components/table/created_at.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
describe('CreatedAt', () => { describe('CreatedAt', () => {
......
...@@ -4,8 +4,8 @@ import { nextTick } from 'vue'; ...@@ -4,8 +4,8 @@ import { nextTick } from 'vue';
import { GlDatepicker } from '@gitlab/ui'; import { GlDatepicker } from '@gitlab/ui';
import { useFakeDate } from 'helpers/fake_date'; import { useFakeDate } from 'helpers/fake_date';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import ExpirationDatepicker from '~/vue_shared/components/members/table/expiration_datepicker.vue'; import ExpirationDatepicker from '~/members/components/table/expiration_datepicker.vue';
import { member } from '../mock_data'; import { member } from '../../mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
...@@ -2,7 +2,7 @@ import { mount, createWrapper } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { mount, createWrapper } from '@vue/test-utils';
import { within } from '@testing-library/dom'; import { within } from '@testing-library/dom';
import { useFakeDate } from 'helpers/fake_date'; import { useFakeDate } from 'helpers/fake_date';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import ExpiresAt from '~/vue_shared/components/members/table/expires_at.vue'; import ExpiresAt from '~/members/components/table/expires_at.vue';
describe('ExpiresAt', () => { describe('ExpiresAt', () => {
// March 15th, 2020 // March 15th, 2020
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { MEMBER_TYPES } from '~/vue_shared/components/members/constants'; import { MEMBER_TYPES } from '~/members/constants';
import { member as memberMock, group, invite, accessRequest } from '../mock_data'; import { member as memberMock, group, invite, accessRequest } from '../../mock_data';
import MemberActionButtons from '~/vue_shared/components/members/table/member_action_buttons.vue'; import MemberActionButtons from '~/members/components/table/member_action_buttons.vue';
import UserActionButtons from '~/vue_shared/components/members/action_buttons/user_action_buttons.vue'; import UserActionButtons from '~/members/components/action_buttons/user_action_buttons.vue';
import GroupActionButtons from '~/vue_shared/components/members/action_buttons/group_action_buttons.vue'; import GroupActionButtons from '~/members/components/action_buttons/group_action_buttons.vue';
import InviteActionButtons from '~/vue_shared/components/members/action_buttons/invite_action_buttons.vue'; import InviteActionButtons from '~/members/components/action_buttons/invite_action_buttons.vue';
import AccessRequestActionButtons from '~/vue_shared/components/members/action_buttons/access_request_action_buttons.vue'; import AccessRequestActionButtons from '~/members/components/action_buttons/access_request_action_buttons.vue';
describe('MemberActionButtons', () => { describe('MemberActionButtons', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { MEMBER_TYPES } from '~/vue_shared/components/members/constants'; import { MEMBER_TYPES } from '~/members/constants';
import { member as memberMock, group, invite, accessRequest } from '../mock_data'; import { member as memberMock, group, invite, accessRequest } from '../../mock_data';
import MemberAvatar from '~/vue_shared/components/members/table/member_avatar.vue'; import MemberAvatar from '~/members/components/table/member_avatar.vue';
import UserAvatar from '~/vue_shared/components/members/avatars/user_avatar.vue'; import UserAvatar from '~/members/components/avatars/user_avatar.vue';
import GroupAvatar from '~/vue_shared/components/members/avatars/group_avatar.vue'; import GroupAvatar from '~/members/components/avatars/group_avatar.vue';
import InviteAvatar from '~/vue_shared/components/members/avatars/invite_avatar.vue'; import InviteAvatar from '~/members/components/avatars/invite_avatar.vue';
describe('MemberList', () => { describe('MemberList', () => {
let wrapper; let wrapper;
......
import { mount, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import { getByText as getByTextHelper } from '@testing-library/dom'; import { getByText as getByTextHelper } from '@testing-library/dom';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import MemberSource from '~/vue_shared/components/members/table/member_source.vue'; import MemberSource from '~/members/components/table/member_source.vue';
describe('MemberSource', () => { describe('MemberSource', () => {
let wrapper; let wrapper;
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { MEMBER_TYPES } from '~/vue_shared/components/members/constants'; import { MEMBER_TYPES } from '~/members/constants';
import { member as memberMock, group, invite, accessRequest } from '../mock_data'; import { member as memberMock, group, invite, accessRequest } from '../../mock_data';
import MembersTableCell from '~/vue_shared/components/members/table/members_table_cell.vue'; import MembersTableCell from '~/members/components/table/members_table_cell.vue';
describe('MemberList', () => { describe('MembersTableCell', () => {
const WrappedComponent = { const WrappedComponent = {
props: { props: {
memberType: { memberType: {
......
...@@ -6,21 +6,21 @@ import { ...@@ -6,21 +6,21 @@ import {
within, within,
} from '@testing-library/dom'; } from '@testing-library/dom';
import { GlBadge, GlTable } from '@gitlab/ui'; import { GlBadge, GlTable } from '@gitlab/ui';
import MembersTable from '~/vue_shared/components/members/table/members_table.vue'; import MembersTable from '~/members/components/table/members_table.vue';
import MemberAvatar from '~/vue_shared/components/members/table/member_avatar.vue'; import MemberAvatar from '~/members/components/table/member_avatar.vue';
import MemberSource from '~/vue_shared/components/members/table/member_source.vue'; import MemberSource from '~/members/components/table/member_source.vue';
import ExpiresAt from '~/vue_shared/components/members/table/expires_at.vue'; import ExpiresAt from '~/members/components/table/expires_at.vue';
import CreatedAt from '~/vue_shared/components/members/table/created_at.vue'; import CreatedAt from '~/members/components/table/created_at.vue';
import RoleDropdown from '~/vue_shared/components/members/table/role_dropdown.vue'; import RoleDropdown from '~/members/components/table/role_dropdown.vue';
import ExpirationDatepicker from '~/vue_shared/components/members/table/expiration_datepicker.vue'; import ExpirationDatepicker from '~/members/components/table/expiration_datepicker.vue';
import MemberActionButtons from '~/vue_shared/components/members/table/member_action_buttons.vue'; import MemberActionButtons from '~/members/components/table/member_action_buttons.vue';
import * as initUserPopovers from '~/user_popovers'; import * as initUserPopovers from '~/user_popovers';
import { member as memberMock, invite, accessRequest } from '../mock_data'; import { member as memberMock, invite, accessRequest } from '../../mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
describe('MemberList', () => { describe('MembersTable', () => {
let wrapper; let wrapper;
const createStore = (state = {}) => { const createStore = (state = {}) => {
......
...@@ -5,8 +5,8 @@ import { within } from '@testing-library/dom'; ...@@ -5,8 +5,8 @@ import { within } from '@testing-library/dom';
import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import RoleDropdown from '~/vue_shared/components/members/table/role_dropdown.vue'; import RoleDropdown from '~/members/components/table/role_dropdown.vue';
import { member } from '../mock_data'; import { member } from '../../mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
import { noop } from 'lodash'; import { noop } from 'lodash';
import axios from 'axios'; import axios from 'axios';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { members, group } from 'jest/vue_shared/components/members/mock_data'; import { members, group } from 'jest/members/mock_data';
import testAction from 'helpers/vuex_action_helper'; import testAction from 'helpers/vuex_action_helper';
import { useFakeDate } from 'helpers/fake_date'; import { useFakeDate } from 'helpers/fake_date';
import httpStatusCodes from '~/lib/utils/http_status'; import httpStatusCodes from '~/lib/utils/http_status';
import * as types from '~/vuex_shared/modules/members/mutation_types'; import * as types from '~/members/store/mutation_types';
import { import {
updateMemberRole, updateMemberRole,
showRemoveGroupLinkModal, showRemoveGroupLinkModal,
hideRemoveGroupLinkModal, hideRemoveGroupLinkModal,
updateMemberExpiration, updateMemberExpiration,
} from '~/vuex_shared/modules/members/actions'; } from '~/members/store/actions';
describe('Vuex members actions', () => { describe('Vuex members actions', () => {
describe('update member actions', () => { describe('update member actions', () => {
......
import { members, group } from 'jest/vue_shared/components/members/mock_data'; import { members, group } from 'jest/members/mock_data';
import mutations from '~/vuex_shared/modules/members/mutations'; import mutations from '~/members/store/mutations';
import * as types from '~/vuex_shared/modules/members/mutation_types'; import * as types from '~/members/store/mutation_types';
describe('Vuex members mutations', () => { describe('Vuex members mutations', () => {
describe('update member mutations', () => { describe('update member mutations', () => {
......
import { members } from 'jest/vue_shared/components/members/mock_data'; import { members } from 'jest/members/mock_data';
import { findMember } from '~/vuex_shared/modules/members/utils'; import { findMember } from '~/members/store/utils';
describe('Members Vuex utils', () => { describe('Members Vuex utils', () => {
describe('findMember', () => { describe('findMember', () => {
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
canResend, canResend,
canUpdate, canUpdate,
canOverride, canOverride,
} from '~/vue_shared/components/members/utils'; } from '~/members/utils';
import { member as memberMock, group, invite } from './mock_data'; import { member as memberMock, group, invite } from './mock_data';
const DIRECT_MEMBER_ID = 178; const DIRECT_MEMBER_ID = 178;
......
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