Move Vue models from vue_shared to boards

Some classes in vue_shared were used only by boards, so they were
moved to the boards directory.
This commit is contained in:
Martin Hanzel 2019-06-07 13:23:10 +00:00 committed by Kushal Pandya
parent 25ef3a9687
commit 25269f66ba
12 changed files with 28 additions and 30 deletions

View file

@ -3,8 +3,8 @@ import Vue from 'vue';
import Flash from '~/flash';
import { __ } from '~/locale';
import '~/vue_shared/models/label';
import '~/vue_shared/models/assignee';
import './models/label';
import './models/assignee';
import FilteredSearchBoards from './filtered_search_boards';
import eventHub from './eventhub';

View file

@ -4,7 +4,7 @@
/* global ListAssignee */
import Vue from 'vue';
import '~/vue_shared/models/label';
import './label';
import { isEE, convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import IssueProject from './project';
import boardsStore from '../stores/boards_store';

View file

@ -0,0 +1,11 @@
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
export default class ListLabel {
constructor(obj) {
Object.assign(this, convertObjectPropsToCamelCase(obj, { dropKeys: ['priority'] }), {
priority: obj.priority !== null ? obj.priority : Infinity,
});
}
}
window.ListLabel = ListLabel;

View file

@ -2,8 +2,8 @@
/* global ListIssue */
import { __ } from '~/locale';
import ListLabel from '~/vue_shared/models/label';
import ListAssignee from '~/vue_shared/models/assignee';
import ListLabel from './label';
import ListAssignee from './assignee';
import { isEE, urlParamsToObject } from '~/lib/utils/common_utils';
import boardsStore from '../stores/boards_store';
import ListMilestone from './milestone';

View file

@ -1,13 +0,0 @@
export default class ListLabel {
constructor(obj) {
this.id = obj.id;
this.title = obj.title;
this.type = obj.type;
this.color = obj.color;
this.textColor = obj.text_color;
this.description = obj.description;
this.priority = obj.priority !== null ? obj.priority : Infinity;
}
}
window.ListLabel = ListLabel;

View file

@ -1,7 +1,7 @@
/* global ListIssue */
import '~/vue_shared/models/label';
import '~/vue_shared/models/assignee';
import '~/boards/models/label';
import '~/boards/models/assignee';
import '~/boards/models/issue';
import '~/boards/models/list';
import Store from '~/boards/stores/modal_store';

View file

@ -7,8 +7,8 @@ import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import eventHub from '~/boards/eventhub';
import '~/vue_shared/models/label';
import '~/vue_shared/models/assignee';
import '~/boards/models/label';
import '~/boards/models/assignee';
import '~/boards/models/list';
import boardsStore from '~/boards/stores/boards_store';
import boardCard from '~/boards/components/board_card.vue';

View file

@ -6,8 +6,8 @@ import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import Cookies from 'js-cookie';
import '~/vue_shared/models/label';
import '~/vue_shared/models/assignee';
import '~/boards/models/label';
import '~/boards/models/assignee';
import '~/boards/models/issue';
import '~/boards/models/list';
import '~/boards/services/board_service';

View file

@ -4,8 +4,8 @@
import Vue from 'vue';
import '~/vue_shared/models/label';
import '~/vue_shared/models/assignee';
import '~/boards/models/label';
import '~/boards/models/assignee';
import '~/boards/models/issue';
import '~/boards/models/list';
import IssueCardInner from '~/boards/components/issue_card_inner.vue';

View file

@ -1,8 +1,8 @@
/* global ListIssue */
import Vue from 'vue';
import '~/vue_shared/models/label';
import '~/vue_shared/models/assignee';
import '~/boards/models/label';
import '~/boards/models/assignee';
import '~/boards/models/issue';
import '~/boards/models/list';
import '~/boards/services/board_service';

View file

@ -4,8 +4,8 @@
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
import _ from 'underscore';
import '~/vue_shared/models/label';
import '~/vue_shared/models/assignee';
import '~/boards/models/label';
import '~/boards/models/assignee';
import '~/boards/models/issue';
import '~/boards/models/list';
import '~/boards/services/board_service';