Commit 1d5628b2 authored by Denys Mishunov's avatar Denys Mishunov

Merge branch 'cngo-move-code-to-issuable' into 'master'

Move code to ~/issuable

See merge request gitlab-org/gitlab!76741
parents 5f6e5a34 6eef6eb6
...@@ -9,8 +9,8 @@ import { ...@@ -9,8 +9,8 @@ import {
} from '@gitlab/ui'; } from '@gitlab/ui';
import IssueDueDate from '~/boards/components/issue_due_date.vue'; import IssueDueDate from '~/boards/components/issue_due_date.vue';
import { sprintf } from '~/locale'; import { sprintf } from '~/locale';
import relatedIssuableMixin from '../../mixins/related_issuable_mixin'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import CiIcon from '../ci_icon.vue'; import relatedIssuableMixin from '../mixins/related_issuable_mixin';
import IssueAssignees from './issue_assignees.vue'; import IssueAssignees from './issue_assignees.vue';
import IssueMilestone from './issue_milestone.vue'; import IssueMilestone from './issue_milestone.vue';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { GlLink, GlLoadingIcon, GlIcon } from '@gitlab/ui'; import { GlLink, GlLoadingIcon, GlIcon } from '@gitlab/ui';
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import { sprintf, __, n__ } from '~/locale'; import { sprintf, __, n__ } from '~/locale';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/issuable/components/related_issuable_item.vue';
import { parseIssuableData } from '~/issues/show/utils/parse_data'; import { parseIssuableData } from '~/issues/show/utils/parse_data';
export default { export default {
......
...@@ -28,7 +28,7 @@ import { convertToCamelCase } from '~/lib/utils/text_utility'; ...@@ -28,7 +28,7 @@ import { convertToCamelCase } from '~/lib/utils/text_utility';
import { mergeUrlParams, setUrlFragment, isExternal } from '~/lib/utils/url_utility'; import { mergeUrlParams, setUrlFragment, isExternal } from '~/lib/utils/url_utility';
import { sprintf, __ } from '~/locale'; import { sprintf, __ } from '~/locale';
import initUserPopovers from '~/user_popovers'; import initUserPopovers from '~/user_popovers';
import IssueAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import IssueAssignees from '~/issuable/components/issue_assignees.vue';
export default { export default {
i18n: { i18n: {
......
<script> <script>
import { GlLink, GlIcon } from '@gitlab/ui'; import { GlLink, GlIcon } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import Issuable from '~/vue_shared/mixins/issuable';
import issuableStateMixin from '../mixins/issuable_state'; import issuableStateMixin from '../mixins/issuable_state';
export default { export default {
...@@ -9,8 +8,17 @@ export default { ...@@ -9,8 +8,17 @@ export default {
GlIcon, GlIcon,
GlLink, GlLink,
}, },
mixins: [Issuable, issuableStateMixin], mixins: [issuableStateMixin],
props: {
issuableType: {
required: true,
type: String,
},
},
computed: { computed: {
issuableDisplayName() {
return this.issuableType.replace(/_/g, ' ');
},
projectArchivedWarning() { projectArchivedWarning() {
return __('This project is archived and cannot be commented on.'); return __('This project is archived and cannot be commented on.');
}, },
......
<script> <script>
import { GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import relatedIssuableMixin from '~/vue_shared/mixins/related_issuable_mixin'; import relatedIssuableMixin from '~/issuable/mixins/related_issuable_mixin';
export default { export default {
name: 'IssueToken', name: 'IssueToken',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
import sortableConfig from '~/sortable/sortable_config'; import sortableConfig from '~/sortable/sortable_config';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/issuable/components/related_issuable_item.vue';
export default { export default {
name: 'RelatedIssuesList', name: 'RelatedIssuesList',
......
...@@ -6,7 +6,7 @@ import { isScopedLabel } from '~/lib/utils/common_utils'; ...@@ -6,7 +6,7 @@ import { isScopedLabel } from '~/lib/utils/common_utils';
import { differenceInSeconds, getTimeago, SECONDS_IN_DAY } from '~/lib/utils/datetime_utility'; import { differenceInSeconds, getTimeago, SECONDS_IN_DAY } from '~/lib/utils/datetime_utility';
import { isExternal, setUrlFragment } from '~/lib/utils/url_utility'; import { isExternal, setUrlFragment } from '~/lib/utils/url_utility';
import { __, n__, sprintf } from '~/locale'; import { __, n__, sprintf } from '~/locale';
import IssuableAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import IssuableAssignees from '~/issuable/components/issue_assignees.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
export default { export default {
......
export default {
props: {
issuableType: {
required: true,
type: String,
},
},
computed: {
issuableDisplayName() {
return this.issuableType.replace(/_/g, ' ');
},
},
};
...@@ -16,8 +16,8 @@ import ItemDueDate from '~/boards/components/issue_due_date.vue'; ...@@ -16,8 +16,8 @@ import ItemDueDate from '~/boards/components/issue_due_date.vue';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { isScopedLabel } from '~/lib/utils/common_utils'; import { isScopedLabel } from '~/lib/utils/common_utils';
import ItemAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import ItemAssignees from '~/issuable/components/issue_assignees.vue';
import ItemMilestone from '~/vue_shared/components/issue/issue_milestone.vue'; import ItemMilestone from '~/issuable/components/issue_milestone.vue';
import { ChildType, ChildState, itemRemoveModalId } from '../constants'; import { ChildType, ChildState, itemRemoveModalId } from '../constants';
import EpicHealthStatus from './epic_health_status.vue'; import EpicHealthStatus from './epic_health_status.vue';
......
<script> <script>
import { GlIcon } from '@gitlab/ui'; import { GlIcon } from '@gitlab/ui';
import { n__ } from '~/locale'; import { n__ } from '~/locale';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/issuable/components/related_issuable_item.vue';
export default { export default {
name: 'BlockingMergeRequestsBody', name: 'BlockingMergeRequestsBody',
......
...@@ -4,8 +4,8 @@ import { TEST_HOST } from 'helpers/test_constants'; ...@@ -4,8 +4,8 @@ import { TEST_HOST } from 'helpers/test_constants';
import { import {
defaultAssignees, defaultAssignees,
defaultMilestone, defaultMilestone,
} from 'jest/vue_shared/components/issue/related_issuable_mock_data'; } from 'jest/issuable/components/related_issuable_mock_data';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/issuable/components/related_issuable_item.vue';
describe('RelatedIssuableItem', () => { describe('RelatedIssuableItem', () => {
let wrapper; let wrapper;
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import IssueWeight from 'ee/boards/components/issue_card_weight.vue'; import IssueWeight from 'ee/boards/components/issue_card_weight.vue';
import { issuable1 } from 'jest/vue_shared/components/issue/related_issuable_mock_data'; import { issuable1 } from 'jest/issuable/components/related_issuable_mock_data';
import RelatedIssuesList from '~/related_issues/components/related_issues_list.vue'; import RelatedIssuesList from '~/related_issues/components/related_issues_list.vue';
import { PathIdSeparator } from '~/related_issues/constants'; import { PathIdSeparator } from '~/related_issues/constants';
......
...@@ -13,8 +13,8 @@ import createDefaultStore from 'ee/related_items_tree/store'; ...@@ -13,8 +13,8 @@ import createDefaultStore from 'ee/related_items_tree/store';
import * as epicUtils from 'ee/related_items_tree/utils/epic_utils'; import * as epicUtils from 'ee/related_items_tree/utils/epic_utils';
import ItemDueDate from '~/boards/components/issue_due_date.vue'; import ItemDueDate from '~/boards/components/issue_due_date.vue';
import { PathIdSeparator } from '~/related_issues/constants'; import { PathIdSeparator } from '~/related_issues/constants';
import ItemAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import ItemAssignees from '~/issuable/components/issue_assignees.vue';
import ItemMilestone from '~/vue_shared/components/issue/issue_milestone.vue'; import ItemMilestone from '~/issuable/components/issue_milestone.vue';
import { import {
mockParentItem, mockParentItem,
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import BlockingMergeRequestBody from 'ee/vue_merge_request_widget/components/blocking_merge_requests/blocking_merge_request_body.vue'; import BlockingMergeRequestBody from 'ee/vue_merge_request_widget/components/blocking_merge_requests/blocking_merge_request_body.vue';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/issuable/components/related_issuable_item.vue';
describe('BlockingMergeRequestBody', () => { describe('BlockingMergeRequestBody', () => {
it('shows hidden merge request text if hidden MRs exist', () => { it('shows hidden merge request text if hidden MRs exist', () => {
......
...@@ -10,7 +10,7 @@ module QA ...@@ -10,7 +10,7 @@ module QA
element :issuable_search_container element :issuable_search_container
end end
view 'app/assets/javascripts/vue_shared/components/issue/issue_assignees.vue' do view 'app/assets/javascripts/issuable/components/issue_assignees.vue' do
element :assignee_link element :assignee_link
element :avatar_counter_content element :avatar_counter_content
end end
......
...@@ -11,7 +11,7 @@ module QA ...@@ -11,7 +11,7 @@ module QA
include Page::Component::Issuable::Sidebar include Page::Component::Issuable::Sidebar
prepend Mobile::Page::Project::Issue::Show if Runtime::Env.mobile_layout? prepend Mobile::Page::Project::Issue::Show if Runtime::Env.mobile_layout?
view 'app/assets/javascripts/vue_shared/components/issue/related_issuable_item.vue' do view 'app/assets/javascripts/issuable/components/related_issuable_item.vue' do
element :remove_related_issue_button element :remove_related_issue_button
end end
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { mockAssigneesList } from 'jest/boards/mock_data'; import { mockAssigneesList } from 'jest/boards/mock_data';
import IssueAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import IssueAssignees from '~/issuable/components/issue_assignees.vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue'; import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
const TEST_CSS_CLASSES = 'test-classes'; const TEST_CSS_CLASSES = 'test-classes';
......
...@@ -3,7 +3,7 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -3,7 +3,7 @@ import { shallowMount } from '@vue/test-utils';
import Vue from 'vue'; import Vue from 'vue';
import { mockMilestone } from 'jest/boards/mock_data'; import { mockMilestone } from 'jest/boards/mock_data';
import IssueMilestone from '~/vue_shared/components/issue/issue_milestone.vue'; import IssueMilestone from '~/issuable/components/issue_milestone.vue';
const createComponent = (milestone = mockMilestone) => { const createComponent = (milestone = mockMilestone) => {
const Component = Vue.extend(IssueMilestone); const Component = Vue.extend(IssueMilestone);
......
...@@ -2,7 +2,7 @@ import { mount } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { mount } from '@vue/test-utils';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import IssueDueDate from '~/boards/components/issue_due_date.vue'; import IssueDueDate from '~/boards/components/issue_due_date.vue';
import { formatDate } from '~/lib/utils/datetime_utility'; import { formatDate } from '~/lib/utils/datetime_utility';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/issuable/components/related_issuable_item.vue';
import { defaultAssignees, defaultMilestone } from './related_issuable_mock_data'; import { defaultAssignees, defaultMilestone } from './related_issuable_mock_data';
describe('RelatedIssuableItem', () => { describe('RelatedIssuableItem', () => {
......
...@@ -4,7 +4,7 @@ import { ...@@ -4,7 +4,7 @@ import {
issuable1, issuable1,
issuable2, issuable2,
issuable3, issuable3,
} from 'jest/vue_shared/components/issue/related_issuable_mock_data'; } from 'jest/issuable/components/related_issuable_mock_data';
import RelatedIssuesBlock from '~/related_issues/components/related_issues_block.vue'; import RelatedIssuesBlock from '~/related_issues/components/related_issues_block.vue';
import { import {
linkedIssueTypesMap, linkedIssueTypesMap,
......
...@@ -5,7 +5,7 @@ import { ...@@ -5,7 +5,7 @@ import {
issuable3, issuable3,
issuable4, issuable4,
issuable5, issuable5,
} from 'jest/vue_shared/components/issue/related_issuable_mock_data'; } from 'jest/issuable/components/related_issuable_mock_data';
import IssueDueDate from '~/boards/components/issue_due_date.vue'; import IssueDueDate from '~/boards/components/issue_due_date.vue';
import RelatedIssuesList from '~/related_issues/components/related_issues_list.vue'; import RelatedIssuesList from '~/related_issues/components/related_issues_list.vue';
import { PathIdSeparator } from '~/related_issues/constants'; import { PathIdSeparator } from '~/related_issues/constants';
......
...@@ -5,7 +5,7 @@ import { ...@@ -5,7 +5,7 @@ import {
defaultProps, defaultProps,
issuable1, issuable1,
issuable2, issuable2,
} from 'jest/vue_shared/components/issue/related_issuable_mock_data'; } from 'jest/issuable/components/related_issuable_mock_data';
import createFlash from '~/flash'; import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import RelatedIssuesRoot from '~/related_issues/components/related_issues_root.vue'; import RelatedIssuesRoot from '~/related_issues/components/related_issues_root.vue';
......
...@@ -4,7 +4,7 @@ import { ...@@ -4,7 +4,7 @@ import {
issuable3, issuable3,
issuable4, issuable4,
issuable5, issuable5,
} from 'jest/vue_shared/components/issue/related_issuable_mock_data'; } from 'jest/issuable/components/related_issuable_mock_data';
import RelatedIssuesStore from '~/related_issues/stores/related_issues_store'; import RelatedIssuesStore from '~/related_issues/stores/related_issues_store';
describe('RelatedIssuesStore', () => { describe('RelatedIssuesStore', () => {
......
...@@ -4,7 +4,7 @@ import mockData from 'test_fixtures/issues/related_merge_requests.json'; ...@@ -4,7 +4,7 @@ import mockData from 'test_fixtures/issues/related_merge_requests.json';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import RelatedMergeRequests from '~/issues/related_merge_requests/components/related_merge_requests.vue'; import RelatedMergeRequests from '~/issues/related_merge_requests/components/related_merge_requests.vue';
import createStore from '~/issues/related_merge_requests/store/index'; import createStore from '~/issues/related_merge_requests/store/index';
import RelatedIssuableItem from '~/vue_shared/components/issue/related_issuable_item.vue'; import RelatedIssuableItem from '~/issuable/components/related_issuable_item.vue';
const API_ENDPOINT = '/api/v4/projects/2/issues/33/related_merge_requests'; const API_ENDPOINT = '/api/v4/projects/2/issues/33/related_merge_requests';
const localVue = createLocalVue(); const localVue = createLocalVue();
......
...@@ -7,7 +7,7 @@ import { isScopedLabel } from '~/lib/utils/common_utils'; ...@@ -7,7 +7,7 @@ import { isScopedLabel } from '~/lib/utils/common_utils';
import { formatDate } from '~/lib/utils/datetime_utility'; import { formatDate } from '~/lib/utils/datetime_utility';
import { mergeUrlParams } from '~/lib/utils/url_utility'; import { mergeUrlParams } from '~/lib/utils/url_utility';
import initUserPopovers from '~/user_popovers'; import initUserPopovers from '~/user_popovers';
import IssueAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import IssueAssignees from '~/issuable/components/issue_assignees.vue';
import { simpleIssue, testAssignees, testLabels } from '../issuable_list_test_data'; import { simpleIssue, testAssignees, testLabels } from '../issuable_list_test_data';
jest.mock('~/user_popovers'); jest.mock('~/user_popovers');
......
...@@ -2,7 +2,7 @@ import { GlLink, GlLabel, GlIcon, GlFormCheckbox, GlSprintf } from '@gitlab/ui'; ...@@ -2,7 +2,7 @@ import { GlLink, GlLabel, GlIcon, GlFormCheckbox, GlSprintf } from '@gitlab/ui';
import { useFakeDate } from 'helpers/fake_date'; import { useFakeDate } from 'helpers/fake_date';
import { shallowMountExtended as shallowMount } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended as shallowMount } from 'helpers/vue_test_utils_helper';
import IssuableItem from '~/vue_shared/issuable/list/components/issuable_item.vue'; import IssuableItem from '~/vue_shared/issuable/list/components/issuable_item.vue';
import IssuableAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import IssuableAssignees from '~/issuable/components/issue_assignees.vue';
import { mockIssuable, mockRegularLabel, mockScopedLabel } from '../mock_data'; import { mockIssuable, mockRegularLabel, mockScopedLabel } 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