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