diff options
author | Martin Hanzel <mhanzel@gitlab.com> | 2019-06-07 16:23:10 +0300 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-06-07 16:23:10 +0300 |
commit | 25269f66ba60e211ad64ff08beb9799be1103c52 (patch) | |
tree | 6777cbeeeff46df5aaa1382e8dc3510b24d470ac /app/assets/javascripts | |
parent | 25ef3a9687494bea8927d7109f6e684beba2eb95 (diff) |
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.
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/boards/index.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/boards/models/assignee.js (renamed from app/assets/javascripts/vue_shared/models/assignee.js) | 0 | ||||
-rw-r--r-- | app/assets/javascripts/boards/models/issue.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/boards/models/label.js | 11 | ||||
-rw-r--r-- | app/assets/javascripts/boards/models/list.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/vue_shared/models/label.js | 13 |
6 files changed, 16 insertions, 18 deletions
diff --git a/app/assets/javascripts/boards/index.js b/app/assets/javascripts/boards/index.js index e9cab3e3bba..f2f37d22b97 100644 --- a/app/assets/javascripts/boards/index.js +++ b/app/assets/javascripts/boards/index.js @@ -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'; diff --git a/app/assets/javascripts/vue_shared/models/assignee.js b/app/assets/javascripts/boards/models/assignee.js index 4a29b0d0581..4a29b0d0581 100644 --- a/app/assets/javascripts/vue_shared/models/assignee.js +++ b/app/assets/javascripts/boards/models/assignee.js diff --git a/app/assets/javascripts/boards/models/issue.js b/app/assets/javascripts/boards/models/issue.js index f8ff20cb0cd..f858b162c6b 100644 --- a/app/assets/javascripts/boards/models/issue.js +++ b/app/assets/javascripts/boards/models/issue.js @@ -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'; diff --git a/app/assets/javascripts/boards/models/label.js b/app/assets/javascripts/boards/models/label.js new file mode 100644 index 00000000000..cd2a2c0137f --- /dev/null +++ b/app/assets/javascripts/boards/models/label.js @@ -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; diff --git a/app/assets/javascripts/boards/models/list.js b/app/assets/javascripts/boards/models/list.js index 08aecfab8a4..a9d88f19146 100644 --- a/app/assets/javascripts/boards/models/list.js +++ b/app/assets/javascripts/boards/models/list.js @@ -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'; diff --git a/app/assets/javascripts/vue_shared/models/label.js b/app/assets/javascripts/vue_shared/models/label.js deleted file mode 100644 index 2d2732d0661..00000000000 --- a/app/assets/javascripts/vue_shared/models/label.js +++ /dev/null @@ -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; |