Commit 9e27bf87 authored by Simon Knox's avatar Simon Knox

use id instead of iid for issues

parent 34401f4b
...@@ -58,10 +58,8 @@ gl.issueBoards.BoardSidebar = Vue.extend({ ...@@ -58,10 +58,8 @@ gl.issueBoards.BoardSidebar = Vue.extend({
this.list = this.detail.list; this.list = this.detail.list;
this.$nextTick(() => { this.$nextTick(() => {
var issueUrl = this.$refs.assigneeDropdown.dataset.issueUpdate let issueUrl = this.$refs.assigneeDropdown.dataset.issueUpdate;
issueUrl = issueUrl.replace(':project_path', this.issue.project.path);
issueUrl = issueUrl.replace(":project_path", this.issue.project.path);
this.endpoint = issueUrl; this.endpoint = issueUrl;
}); });
}, },
......
...@@ -68,16 +68,19 @@ gl.issueBoards.IssueCardInner = Vue.extend({ ...@@ -68,16 +68,19 @@ gl.issueBoards.IssueCardInner = Vue.extend({
return this.issue.assignees.length > this.numberOverLimit; return this.issue.assignees.length > this.numberOverLimit;
}, },
cardUrl() { cardUrl() {
var baseUrl = this.issueLinkBase; let baseUrl = this.issueLinkBase;
if(this.groupId && this.issue.project) { if (this.groupId && this.issue.project) {
baseUrl = this.issueLinkBase.replace(":project_path", this.issue.project.path); baseUrl = this.issueLinkBase.replace(':project_path', this.issue.project.path);
} }
return `${baseUrl}/${this.issue.id}`; return `${baseUrl}/${this.issue.iid}`;
}, },
issueId() { issueId() {
return `#${this.issue.id}`; if (this.issue.iid) {
return `#${this.issue.iid}`;
}
return false;
}, },
showLabelFooter() { showLabelFooter() {
return this.issue.labels.find(l => this.showLabel(l)) !== undefined; return this.issue.labels.find(l => this.showLabel(l)) !== undefined;
...@@ -154,7 +157,7 @@ gl.issueBoards.IssueCardInner = Vue.extend({ ...@@ -154,7 +157,7 @@ gl.issueBoards.IssueCardInner = Vue.extend({
:title="issue.title">{{ issue.title }}</a> :title="issue.title">{{ issue.title }}</a>
<span <span
class="card-number" class="card-number"
v-if="issue.id" v-if="issueId"
> >
{{ issueId }} {{ issueId }}
</span> </span>
......
...@@ -29,7 +29,7 @@ gl.issueBoards.ModalFooter = Vue.extend({ ...@@ -29,7 +29,7 @@ gl.issueBoards.ModalFooter = Vue.extend({
const firstListIndex = 1; const firstListIndex = 1;
const list = this.modal.selectedList || this.state.lists[firstListIndex]; const list = this.modal.selectedList || this.state.lists[firstListIndex];
const selectedIssues = ModalStore.getSelectedIssues(); const selectedIssues = ModalStore.getSelectedIssues();
const issueIds = selectedIssues.map(issue => issue.globalId); const issueIds = selectedIssues.map(issue => issue.id);
// Post the data to the backend // Post the data to the backend
gl.boardService.bulkUpdate(issueIds, { gl.boardService.bulkUpdate(issueIds, {
......
...@@ -33,7 +33,7 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({ ...@@ -33,7 +33,7 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
} }
// Post the remove data // Post the remove data
gl.boardService.bulkUpdate([issue.globalId], data).catch(() => { gl.boardService.bulkUpdate([issue.id], data).catch(() => {
new Flash('Failed to remove issue from board, please try again.', 'alert'); new Flash('Failed to remove issue from board, please try again.', 'alert');
lists.forEach((list) => { lists.forEach((list) => {
......
...@@ -8,8 +8,8 @@ import Vue from 'vue'; ...@@ -8,8 +8,8 @@ import Vue from 'vue';
class ListIssue { class ListIssue {
constructor (obj, defaultAvatar) { constructor (obj, defaultAvatar) {
this.globalId = obj.id; this.id = obj.id;
this.id = obj.iid; this.iid = obj.iid;
this.title = obj.title; this.title = obj.title;
this.confidential = obj.confidential; this.confidential = obj.confidential;
this.dueDate = obj.due_date; this.dueDate = obj.due_date;
......
...@@ -175,7 +175,7 @@ class List { ...@@ -175,7 +175,7 @@ class List {
} }
findIssue (id) { findIssue (id) {
return this.issues.filter(issue => issue.id === id)[0]; return this.issues.find(issue => issue.id === id);
} }
removeIssue (removeIssue) { removeIssue (removeIssue) {
......
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