Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
103c78f1
Commit
103c78f1
authored
Jan 31, 2017
by
Phil Hughes
Committed by
Fatih Acet
Feb 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes labels instead of closing issue when clicking remove button
parent
32a97ef1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
18 deletions
+38
-18
app/assets/javascripts/boards/boards_bundle.js.es6
app/assets/javascripts/boards/boards_bundle.js.es6
+2
-1
app/assets/javascripts/boards/components/modal/empty_state.js.es6
...ts/javascripts/boards/components/modal/empty_state.js.es6
+1
-1
app/assets/javascripts/boards/components/modal/footer.js.es6
app/assets/javascripts/boards/components/modal/footer.js.es6
+2
-8
app/assets/javascripts/boards/components/modal/header.js.es6
app/assets/javascripts/boards/components/modal/header.js.es6
+1
-1
app/assets/javascripts/boards/components/modal/index.js.es6
app/assets/javascripts/boards/components/modal/index.js.es6
+3
-2
app/assets/javascripts/boards/components/sidebar/remove_issue.js.es6
...javascripts/boards/components/sidebar/remove_issue.js.es6
+11
-2
app/assets/javascripts/boards/services/board_service.js.es6
app/assets/javascripts/boards/services/board_service.js.es6
+17
-2
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+1
-0
app/views/projects/boards/_show.html.haml
app/views/projects/boards/_show.html.haml
+0
-1
No files found.
app/assets/javascripts/boards/boards_bundle.js.es6
View file @
103c78f1
...
@@ -45,6 +45,7 @@ $(() => {
...
@@ -45,6 +45,7 @@ $(() => {
disabled: $boardApp.dataset.disabled === 'true',
disabled: $boardApp.dataset.disabled === 'true',
issueLinkBase: $boardApp.dataset.issueLinkBase,
issueLinkBase: $boardApp.dataset.issueLinkBase,
rootPath: $boardApp.dataset.rootPath,
rootPath: $boardApp.dataset.rootPath,
bulkUpdatePath: $boardApp.dataset.bulkUpdatePath,
detailIssue: Store.detail
detailIssue: Store.detail
},
},
computed: {
computed: {
...
@@ -53,7 +54,7 @@ $(() => {
...
@@ -53,7 +54,7 @@ $(() => {
},
},
},
},
created () {
created () {
gl.boardService = new BoardService(this.endpoint, this.boardId);
gl.boardService = new BoardService(this.endpoint, this.b
ulkUpdatePath, this.b
oardId);
},
},
mounted () {
mounted () {
Store.disabled = this.disabled;
Store.disabled = this.disabled;
...
...
app/assets/javascripts/boards/components/modal/empty_state.js.es6
View file @
103c78f1
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
:href="newIssuePath"
:href="newIssuePath"
class="btn btn-success btn-inverted"
class="btn btn-success btn-inverted"
v-if="activeTab === 'all'">
v-if="activeTab === 'all'">
Create
issue
New
issue
</a>
</a>
<button
<button
type="button"
type="button"
...
...
app/assets/javascripts/boards/components/modal/footer.js.es6
View file @
103c78f1
...
@@ -4,9 +4,6 @@
...
@@ -4,9 +4,6 @@
const ModalStore = gl.issueBoards.ModalStore;
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalFooter = Vue.extend({
gl.issueBoards.ModalFooter = Vue.extend({
props: [
'bulkUpdatePath',
],
data() {
data() {
return ModalStore.store;
return ModalStore.store;
},
},
...
@@ -30,11 +27,8 @@
...
@@ -30,11 +27,8 @@
const issueIds = selectedIssues.map(issue => issue.globalId);
const issueIds = selectedIssues.map(issue => issue.globalId);
// Post the data to the backend
// Post the data to the backend
this.$http.post(this.bulkUpdatePath, {
gl.boardService.bulkUpdate(issueIds, {
update: {
add_label_ids: [list.label.id],
issuable_ids: issueIds.join(','),
add_label_ids: [list.label.id],
},
});
});
// Add the issues on the frontend
// Add the issues on the frontend
...
...
app/assets/javascripts/boards/components/modal/header.js.es6
View file @
103c78f1
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
return 'Select all';
return 'Select all';
}
}
return '
Un-
select all';
return '
De
select all';
},
},
},
},
methods: {
methods: {
...
...
app/assets/javascripts/boards/components/modal/index.js.es6
View file @
103c78f1
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
gl.issueBoards.IssuesModal = Vue.extend({
gl.issueBoards.IssuesModal = Vue.extend({
props: [
props: [
'blankStateImage', 'newIssuePath', '
bulkUpdatePath', '
issueLinkBase',
'blankStateImage', 'newIssuePath', 'issueLinkBase',
'rootPath',
'rootPath',
],
],
data() {
data() {
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
} else if (!this.showAddIssuesModal) {
} else if (!this.showAddIssuesModal) {
this.issues = [];
this.issues = [];
this.selectedIssues = [];
this.selectedIssues = [];
this.issuesCount = false;
}
}
},
},
},
},
...
@@ -101,7 +102,7 @@
...
@@ -101,7 +102,7 @@
<i class="fa fa-spinner fa-spin"></i>
<i class="fa fa-spinner fa-spin"></i>
</div>
</div>
</section>
</section>
<modal-footer
:bulk-update-path="bulkUpdatePath"
></modal-footer>
<modal-footer></modal-footer>
</div>
</div>
</div>
</div>
`,
`,
...
...
app/assets/javascripts/boards/components/sidebar/remove_issue.js.es6
View file @
103c78f1
...
@@ -11,9 +11,18 @@
...
@@ -11,9 +11,18 @@
],
],
methods: {
methods: {
removeIssue() {
removeIssue() {
const doneList = Store.findList('type', 'done', false);
const lists = this.issue.getLists();
const labelIds = lists.map(list => list.label.id);
Store.moveIssueToList(this.list, doneList, this.issue, 0);
// Post the remove data
gl.boardService.bulkUpdate([this.issue.globalId], {
remove_label_ids: labelIds,
});
// Remove from the frontend store
lists.forEach((list) => {
list.removeIssue(this.issue);
});
Store.detail.issue = {};
Store.detail.issue = {};
},
},
...
...
app/assets/javascripts/boards/services/board_service.js.es6
View file @
103c78f1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/* global Vue */
/* global Vue */
class BoardService {
class BoardService {
constructor (root, boardId) {
constructor (root, b
ulkUpdatePath, b
oardId) {
this.boards = Vue.resource(`${root}{/id}.json`, {}, {
this.boards = Vue.resource(`${root}{/id}.json`, {}, {
issues: {
issues: {
method: 'GET',
method: 'GET',
...
@@ -16,7 +16,12 @@ class BoardService {
...
@@ -16,7 +16,12 @@ class BoardService {
}
}
});
});
this.issue = Vue.resource(`${root}/${boardId}/issues{/id}`, {});
this.issue = Vue.resource(`${root}/${boardId}/issues{/id}`, {});
this.issues = Vue.resource(`${root}/${boardId}/lists{/id}/issues`, {});
this.issues = Vue.resource(`${root}/${boardId}/lists{/id}/issues`, {}, {
bulkUpdate: {
method: 'POST',
url: bulkUpdatePath,
},
});
Vue.http.interceptors.push((request, next) => {
Vue.http.interceptors.push((request, next) => {
request.headers['X-CSRF-Token'] = $.rails.csrfToken();
request.headers['X-CSRF-Token'] = $.rails.csrfToken();
...
@@ -75,6 +80,16 @@ class BoardService {
...
@@ -75,6 +80,16 @@ class BoardService {
getBacklog(data) {
getBacklog(data) {
return this.boards.issues(data);
return this.boards.issues(data);
}
}
bulkUpdate(issueIds, extraData = {}) {
const data = {
update: Object.assign(extraData, {
issuable_ids: issueIds.join(','),
}),
};
return this.issues.bulkUpdate(data);
}
}
}
window.BoardService = BoardService;
window.BoardService = BoardService;
app/helpers/boards_helper.rb
View file @
103c78f1
...
@@ -8,6 +8,7 @@ module BoardsHelper
...
@@ -8,6 +8,7 @@ module BoardsHelper
disabled:
"
#{
!
can?
(
current_user
,
:admin_list
,
@project
)
}
"
,
disabled:
"
#{
!
can?
(
current_user
,
:admin_list
,
@project
)
}
"
,
issue_link_base:
namespace_project_issues_path
(
@project
.
namespace
,
@project
),
issue_link_base:
namespace_project_issues_path
(
@project
.
namespace
,
@project
),
root_path:
root_path
,
root_path:
root_path
,
bulk_update_path:
bulk_update_namespace_project_issues_path
(
@project
.
namespace
,
@project
),
}
}
end
end
end
end
app/views/projects/boards/_show.html.haml
View file @
103c78f1
...
@@ -29,6 +29,5 @@
...
@@ -29,6 +29,5 @@
=
render
"projects/boards/components/sidebar"
=
render
"projects/boards/components/sidebar"
%board-add-issues-modal
{
"blank-state-image"
=>
render
(
'shared/empty_states/icons/issues.svg'
),
%board-add-issues-modal
{
"blank-state-image"
=>
render
(
'shared/empty_states/icons/issues.svg'
),
"new-issue-path"
=>
new_namespace_project_issue_path
(
@project
.
namespace
,
@project
),
"new-issue-path"
=>
new_namespace_project_issue_path
(
@project
.
namespace
,
@project
),
"bulk-update-path"
=>
bulk_update_namespace_project_issues_path
(
@project
.
namespace
,
@project
),
":issue-link-base"
=>
"issueLinkBase"
,
":issue-link-base"
=>
"issueLinkBase"
,
":root-path"
=>
"rootPath"
}
":root-path"
=>
"rootPath"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment