Commit abaa80eb authored by Roman Rodionov's avatar Roman Rodionov Committed by Phil Hughes

Replace ee-specific code for boards/issue_card_inner (EE-port)

parent 59e73693
...@@ -4,7 +4,7 @@ import { GlTooltipDirective } from '@gitlab/ui'; ...@@ -4,7 +4,7 @@ import { GlTooltipDirective } from '@gitlab/ui';
import { sprintf, __ } from '~/locale'; import { sprintf, __ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue';
import IssueCardWeight from 'ee/boards/components/issue_card_weight.vue'; import issueCardInner from 'ee_else_ce/boards/mixins/issue_card_inner';
import UserAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import UserAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
import IssueDueDate from './issue_due_date.vue'; import IssueDueDate from './issue_due_date.vue';
...@@ -19,13 +19,14 @@ export default { ...@@ -19,13 +19,14 @@ export default {
UserAvatarLink, UserAvatarLink,
TooltipOnTruncate, TooltipOnTruncate,
IssueDueDate, IssueDueDate,
IssueCardWeight,
IssueTimeEstimate, IssueTimeEstimate,
IssueCardWeight: () => import('ee_component/boards/components/issue_card_weight.vue'),
IssueCardInnerScopedLabel, IssueCardInnerScopedLabel,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [issueCardInner],
props: { props: {
issue: { issue: {
type: Object, type: Object,
...@@ -137,14 +138,6 @@ export default { ...@@ -137,14 +138,6 @@ export default {
this.applyFilter(filter); this.applyFilter(filter);
}, },
filterByWeight(weight) {
if (!this.updateFilters) return;
const issueWeight = encodeURIComponent(weight);
const filter = `weight=${issueWeight}`;
this.applyFilter(filter);
},
applyFilter(filter) { applyFilter(filter) {
const filterPath = boardsStore.filter.path.split('&'); const filterPath = boardsStore.filter.path.split('&');
const filterIndex = filterPath.indexOf(filter); const filterIndex = filterPath.indexOf(filter);
......
export default {
methods: {
filterByWeight() {},
},
};
---
title: Move ee-specific code from boards/components/issue_card_inner.vue
merge_request: 27394
author: Roman Rodionov
type: other
export default {
methods: {
filterByWeight(weight) {
if (!this.updateFilters) return;
const issueWeight = encodeURIComponent(weight);
const filter = `weight=${issueWeight}`;
this.applyFilter(filter);
},
},
};
---
title: Move ee-specific code from boards/components/issue_card_inner.vue
merge_request: 11032
author: Roman Rodionov
type: other
/* global ListLabel */ /* global ListLabel */
/* global ListIssue */
import Vue from 'vue'; import Vue from 'vue';
import _ from 'underscore'; import _ from 'underscore';
import '~/vue_shared/models/label'; import '~/vue_shared/models/label';
import '~/vue_shared/models/assignee'; import '~/vue_shared/models/assignee';
import '~/boards/models/issue';
import '~/boards/models/list'; import '~/boards/models/list';
import IssueCardInner from '~/boards/components/issue_card_inner.vue'; import IssueCardInner from '~/boards/components/issue_card_inner.vue';
import { listObj } from 'spec/boards/mock_data'; import { listObj } from 'spec/boards/mock_data';
import ListIssueEE from 'ee/boards/models/issue';
describe('Issue card component', () => { describe('Issue card component', () => {
const label1 = new ListLabel({ const label1 = new ListLabel({
...@@ -27,7 +26,7 @@ describe('Issue card component', () => { ...@@ -27,7 +26,7 @@ describe('Issue card component', () => {
setFixtures('<div class="test-container"></div>'); setFixtures('<div class="test-container"></div>');
list = listObj; list = listObj;
issue = new ListIssue({ issue = new ListIssueEE({
title: 'Testing', title: 'Testing',
id: 1, id: 1,
iid: 1, iid: 1,
...@@ -36,6 +35,7 @@ describe('Issue card component', () => { ...@@ -36,6 +35,7 @@ describe('Issue card component', () => {
assignees: [], assignees: [],
reference_path: '#1', reference_path: '#1',
real_path: '/test/1', real_path: '/test/1',
weight: 1,
}); });
component = new Vue({ component = new Vue({
...@@ -112,4 +112,10 @@ describe('Issue card component', () => { ...@@ -112,4 +112,10 @@ describe('Issue card component', () => {
.catch(done.fail); .catch(done.fail);
}); });
}); });
describe('weights', () => {
it('shows weight component', () => {
expect(component.$el.querySelector('.board-card-weight')).not.toBeNull();
});
});
}); });
...@@ -285,4 +285,10 @@ describe('Issue card component', () => { ...@@ -285,4 +285,10 @@ describe('Issue card component', () => {
.catch(done.fail); .catch(done.fail);
}); });
}); });
describe('weights', () => {
it('not shows weight component', () => {
expect(component.$el.querySelector('.board-card-weight')).toBeNull();
});
});
}); });
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