diff options
Diffstat (limited to 'app/assets/javascripts/boards/stores/boards_store.js')
-rw-r--r-- | app/assets/javascripts/boards/stores/boards_store.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index f233228614f..010eda9b6c5 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -12,6 +12,10 @@ import axios from '~/lib/utils/axios_utils'; import { mergeUrlParams } from '~/lib/utils/url_utility'; import eventHub from '../eventhub'; import { ListType } from '../constants'; +import IssueProject from '../models/project'; +import ListLabel from '../models/label'; +import ListAssignee from '../models/assignee'; +import ListMilestone from '../models/milestone'; const boardsStore = { disabled: false, @@ -593,6 +597,38 @@ const boardsStore = { clearMultiSelect() { this.multiSelect.list = []; }, + refreshIssueData(issue, obj, defaultAvatar) { + issue.id = obj.id; + issue.iid = obj.iid; + issue.title = obj.title; + issue.confidential = obj.confidential; + issue.dueDate = obj.due_date; + issue.sidebarInfoEndpoint = obj.issue_sidebar_endpoint; + issue.referencePath = obj.reference_path; + issue.path = obj.real_path; + issue.toggleSubscriptionEndpoint = obj.toggle_subscription_endpoint; + issue.project_id = obj.project_id; + issue.timeEstimate = obj.time_estimate; + issue.assignableLabelsEndpoint = obj.assignable_labels_endpoint; + issue.blocked = obj.blocked; + + if (obj.project) { + issue.project = new IssueProject(obj.project); + } + + if (obj.milestone) { + issue.milestone = new ListMilestone(obj.milestone); + issue.milestone_id = obj.milestone.id; + } + + if (obj.labels) { + issue.labels = obj.labels.map(label => new ListLabel(label)); + } + + if (obj.assignees) { + issue.assignees = obj.assignees.map(a => new ListAssignee(a, defaultAvatar)); + } + }, }; BoardsStoreEE.initEESpecific(boardsStore); |