Commit 56506ff8 authored by Fatih Acet's avatar Fatih Acet

Send lockVersion from MR description task list

parent b119fcb2
...@@ -35,6 +35,7 @@ function MergeRequest(opts) { ...@@ -35,6 +35,7 @@ function MergeRequest(opts) {
dataType: 'merge_request', dataType: 'merge_request',
fieldName: 'description', fieldName: 'description',
selector: '.detail-page-description', selector: '.detail-page-description',
lockVersion: this.$el.data('lockVersion'),
onSuccess: result => { onSuccess: result => {
document.querySelector('#task_status').innerText = result.task_status; document.querySelector('#task_status').innerText = result.task_status;
document.querySelector('#task_status_short').innerText = result.task_status_short; document.querySelector('#task_status_short').innerText = result.task_status_short;
......
...@@ -30,11 +30,7 @@ export default class TaskList { ...@@ -30,11 +30,7 @@ export default class TaskList {
// Prevent duplicate event bindings // Prevent duplicate event bindings
this.disable(); this.disable();
$(this.taskListContainerSelector).taskList('enable'); $(this.taskListContainerSelector).taskList('enable');
$(document).on( $(document).on('tasklist:changed', this.taskListContainerSelector, this.update.bind(this));
'tasklist:changed',
this.taskListContainerSelector,
this.update.bind(this),
);
} }
getTaskListTarget(e = {}) { getTaskListTarget(e = {}) {
......
...@@ -11,4 +11,5 @@ class MergeRequestBasicEntity < Grape::Entity ...@@ -11,4 +11,5 @@ class MergeRequestBasicEntity < Grape::Entity
expose :labels, using: LabelEntity expose :labels, using: LabelEntity
expose :assignee, using: API::Entities::UserBasic expose :assignee, using: API::Entities::UserBasic
expose :task_status, :task_status_short expose :task_status, :task_status_short
expose :lock_version, :lock_version
end end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
- page_card_attributes @merge_request.card_attributes - page_card_attributes @merge_request.card_attributes
- suggest_changes_help_path = help_page_path('user/discussions/index.md', anchor: 'suggest-changes') - suggest_changes_help_path = help_page_path('user/discussions/index.md', anchor: 'suggest-changes')
.merge-request{ data: { mr_action: j(params[:tab].presence || 'show'), url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project) } } .merge-request{ data: { mr_action: j(params[:tab].presence || 'show'), url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project), lock_version: @merge_request.lock_version } }
= render "projects/merge_requests/mr_title" = render "projects/merge_requests/mr_title"
.merge-request-details.issuable-details{ data: { id: @merge_request.project.id } } .merge-request-details.issuable-details{ data: { id: @merge_request.project.id } }
......
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