Commit e66def12 authored by Valery Sizov's avatar Valery Sizov

Merge branch 'multiple_assignees_review' of gitlab.com:gitlab-org/gitlab-ee...

Merge branch 'multiple_assignees_review' of gitlab.com:gitlab-org/gitlab-ee into fix_specs_for_multiple_assignees
parents a7a49b63 4cdb14d2
...@@ -24,7 +24,7 @@ export default class TemplateSelector { ...@@ -24,7 +24,7 @@ export default class TemplateSelector {
search: { search: {
fields: ['name'], fields: ['name'],
}, },
clicked: (item, el, e) => this.fetchFileTemplate(item, el, e), clicked: options => this.fetchFileTemplate(options),
text: item => item.name, text: item => item.name,
}); });
} }
...@@ -51,7 +51,10 @@ export default class TemplateSelector { ...@@ -51,7 +51,10 @@ export default class TemplateSelector {
return this.$dropdownContainer.removeClass('hidden'); return this.$dropdownContainer.removeClass('hidden');
} }
fetchFileTemplate(item, el, e) { fetchFileTemplate(options) {
const { e } = options;
const item = options.selectedObj;
e.preventDefault(); e.preventDefault();
return this.requestFile(item); return this.requestFile(item);
} }
......
...@@ -52,7 +52,9 @@ ...@@ -52,7 +52,9 @@
filterable: true, filterable: true,
selectable: true, selectable: true,
multiSelect: true, multiSelect: true,
clicked (label, $el, e) { clicked (options) {
const { e } = options;
const label = options.selectedObj;
e.preventDefault(); e.preventDefault();
if (!Store.findList('title', label.title)) { if (!Store.findList('title', label.title)) {
......
...@@ -43,7 +43,9 @@ ...@@ -43,7 +43,9 @@
return $el.text(); return $el.text();
}, },
clicked: (selected, $link) => { clicked: (options) => {
const $link = options.$el;
if (!$link.data('revert')) { if (!$link.data('revert')) {
this.formSubmit(null, $link); this.formSubmit(null, $link);
} else { } else {
......
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
}); });
} }
NamespaceSelect.prototype.onSelectItem = function(item, el, e) { NamespaceSelect.prototype.onSelectItem = function(options) {
const { e } = options;
return e.preventDefault(); return e.preventDefault();
}; };
......
...@@ -119,7 +119,8 @@ import Cookies from 'js-cookie'; ...@@ -119,7 +119,8 @@ import Cookies from 'js-cookie';
toggleLabel: function(obj, $el) { toggleLabel: function(obj, $el) {
return $el.text().trim(); return $el.text().trim();
}, },
clicked: function(selected, $el, e) { clicked: function(options) {
const { e } = options;
e.preventDefault(); e.preventDefault();
if ($('input[name="ref"]').length) { if ($('input[name="ref"]').length) {
var $form = $dropdown.closest('form'); var $form = $dropdown.closest('form');
......
...@@ -53,7 +53,10 @@ ...@@ -53,7 +53,10 @@
onHide(); onHide();
} }
}, },
clicked(item, $el, e) { clicked(opts) {
const { $el, e } = opts;
const item = opts.selectedObj;
e.preventDefault(); e.preventDefault();
if ($el.is('.is-active')) { if ($el.is('.is-active')) {
......
...@@ -35,7 +35,8 @@ class ProtectedBranchDropdown { ...@@ -35,7 +35,8 @@ class ProtectedBranchDropdown {
return _.escape(protectedBranch.id); return _.escape(protectedBranch.id);
}, },
onFilter: this.toggleCreateNewButton.bind(this), onFilter: this.toggleCreateNewButton.bind(this),
clicked: (item, $el, e) => { clicked: (options) => {
const { $el, e } = options;
e.preventDefault(); e.preventDefault();
this.onSelect(); this.onSelect();
} }
......
...@@ -16,6 +16,10 @@ export default { ...@@ -16,6 +16,10 @@ export default {
type: Array, type: Array,
required: true, required: true,
}, },
editable: {
type: Boolean,
required: true,
},
}, },
computed: { computed: {
firstUser() { firstUser() {
...@@ -142,7 +146,9 @@ export default { ...@@ -142,7 +146,9 @@ export default {
<div class="value hide-collapsed"> <div class="value hide-collapsed">
<template v-if="hasNoUsers"> <template v-if="hasNoUsers">
<span class="assign-yourself no-value"> <span class="assign-yourself no-value">
No assignee - No assignee
<template v-if="editable">
-
<button <button
type="button" type="button"
class="btn-link" class="btn-link"
...@@ -150,6 +156,7 @@ export default { ...@@ -150,6 +156,7 @@ export default {
> >
assign yourself assign yourself
</button> </button>
</template>
</span> </span>
</template> </template>
<template v-else-if="hasOneUser"> <template v-else-if="hasOneUser">
......
...@@ -76,6 +76,7 @@ export default { ...@@ -76,6 +76,7 @@ export default {
class="value" class="value"
:root-path="store.rootPath" :root-path="store.rootPath"
:users="store.assignees" :users="store.assignees"
:editable="store.editable"
@assign-self="assignSelf" @assign-self="assignSelf"
/> />
</div> </div>
......
...@@ -27,7 +27,7 @@ export default class SidebarStore { ...@@ -27,7 +27,7 @@ export default class SidebarStore {
this.timeEstimate = data.time_estimate; this.timeEstimate = data.time_estimate;
this.totalTimeSpent = data.total_time_spent; this.totalTimeSpent = data.total_time_spent;
this.humanTimeEstimate = data.human_time_estimate; this.humanTimeEstimate = data.human_time_estimate;
this.humanTimeSpent = data.human_time_spent; this.humanTotalTimeSpent = data.human_total_time_spent;
} }
addAssignee(assignee) { addAssignee(assignee) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
":editable" => can?(current_user, :admin_issue, @project) } ":editable" => can?(current_user, :admin_issue, @project) }
%assignees.value{ "root-path" => "#{root_url}", %assignees.value{ "root-path" => "#{root_url}",
":users" => "issue.assignees", ":users" => "issue.assignees",
":editable" => can?(current_user, :admin_issue, @project),
"@assign-self" => "assignSelf" } "@assign-self" => "assignSelf" }
- if can?(current_user, :admin_issue, @project) - if can?(current_user, :admin_issue, @project)
......
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