diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/assets/javascripts/boards/stores/boards_store.js | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/assets/javascripts/boards/stores/boards_store.js')
-rw-r--r-- | app/assets/javascripts/boards/stores/boards_store.js | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index 30c71d64085..faf4f9ebfd3 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -15,6 +15,7 @@ import { import { __ } from '~/locale'; import axios from '~/lib/utils/axios_utils'; import { mergeUrlParams } from '~/lib/utils/url_utility'; +import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import eventHub from '../eventhub'; import { ListType } from '../constants'; import IssueProject from '../models/project'; @@ -303,7 +304,11 @@ const boardsStore = { onNewListIssueResponse(list, issue, data) { issue.refreshData(data); - if (list.issuesSize > 1) { + if ( + !gon.features.boardsWithSwimlanes && + !gon.features.graphqlBoardLists && + list.issues.length > 1 + ) { const moveBeforeId = list.issues[1].id; this.moveIssue(issue.id, null, null, null, moveBeforeId); } @@ -513,6 +518,10 @@ const boardsStore = { eventHub.$emit('updateTokens'); }, + performSearch() { + eventHub.$emit('performSearch'); + }, + setListDetail(newList) { this.detail.list = newList; }, @@ -706,6 +715,10 @@ const boardsStore = { }, newIssue(id, issue) { + if (typeof id === 'string') { + id = getIdFromGraphQLId(id); + } + return axios.post(this.generateIssuesPath(id), { issue, }); @@ -714,6 +727,10 @@ const boardsStore = { newListIssue(list, issue) { list.addIssue(issue, null, 0); list.issuesSize += 1; + let listId = list.id; + if (typeof listId === 'string') { + listId = getIdFromGraphQLId(listId); + } return this.newIssue(list.id, issue) .then(res => res.data) @@ -854,21 +871,6 @@ const boardsStore = { }, refreshIssueData(issue, obj) { - // issue.id = obj.id; - // issue.iid = obj.iid; - // issue.title = obj.title; - // issue.confidential = obj.confidential; - // issue.dueDate = obj.due_date || obj.dueDate; - // issue.sidebarInfoEndpoint = obj.issue_sidebar_endpoint; - // issue.referencePath = obj.reference_path || obj.referencePath; - // issue.path = obj.real_path || obj.webUrl; - // issue.toggleSubscriptionEndpoint = obj.toggle_subscription_endpoint; - // issue.project_id = obj.project_id; - // issue.timeEstimate = obj.time_estimate || obj.timeEstimate; - // issue.assignableLabelsEndpoint = obj.assignable_labels_endpoint; - // issue.blocked = obj.blocked; - // issue.epic = obj.epic; - const convertedObj = convertObjectPropsToCamelCase(obj, { dropKeys: ['issue_sidebar_endpoint', 'real_path', 'webUrl'], }); |