Disabled add issues button if no lists exist
This commit is contained in:
parent
b129187267
commit
6c828906a2
|
@ -88,12 +88,25 @@ $(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// This element is outside the Vue app
|
gl.IssueBoardsModalAddBtn = new Vue({
|
||||||
$(document)
|
el: '#js-add-issues-btn',
|
||||||
.off('click', '.js-show-add-issues')
|
data: {
|
||||||
.on('click', '.js-show-add-issues', (e) => {
|
modal: ModalStore.store,
|
||||||
e.preventDefault();
|
store: Store.state,
|
||||||
|
},
|
||||||
ModalStore.store.showAddIssuesModal = true;
|
computed: {
|
||||||
|
disabled() {
|
||||||
|
return Store.shouldAddBlankState();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
template: `
|
||||||
|
<button
|
||||||
|
class="btn btn-create pull-right prepend-left-10 has-tooltip"
|
||||||
|
type="button"
|
||||||
|
:disabled="disabled"
|
||||||
|
@click="modal.showAddIssuesModal = true">
|
||||||
|
Add issues
|
||||||
|
</button>
|
||||||
|
`,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Projects
|
||||||
|
|
||||||
def index
|
def index
|
||||||
issues = ::Boards::Issues::ListService.new(project, current_user, filter_params).execute
|
issues = ::Boards::Issues::ListService.new(project, current_user, filter_params).execute
|
||||||
issues = issues.page(params[:page])
|
issues = issues.page(params[:page]).per(params[:per] || 20)
|
||||||
|
|
||||||
render json: {
|
render json: {
|
||||||
issues: serialize_as_json(issues),
|
issues: serialize_as_json(issues),
|
||||||
|
|
|
@ -38,8 +38,7 @@
|
||||||
#js-boards-search.issue-boards-search
|
#js-boards-search.issue-boards-search
|
||||||
%input.pull-left.form-control{ type: "search", placeholder: "Filter by name...", "v-model" => "filters.search", "debounce" => "250" }
|
%input.pull-left.form-control{ type: "search", placeholder: "Filter by name...", "v-model" => "filters.search", "debounce" => "250" }
|
||||||
- if can?(current_user, :admin_list, @project)
|
- if can?(current_user, :admin_list, @project)
|
||||||
%button.btn.btn-create.pull-right.prepend-left-10.js-show-add-issues{ type: "button" }
|
#js-add-issues-btn.pull-right.prepend-left-10
|
||||||
Add issues
|
|
||||||
.dropdown.pull-right
|
.dropdown.pull-right
|
||||||
%button.btn.btn-create.btn-inverted.js-new-board-list{ type: "button", data: { toggle: "dropdown", labels: labels_filter_path, namespace_path: @project.try(:namespace).try(:path), project_path: @project.try(:path) } }
|
%button.btn.btn-create.btn-inverted.js-new-board-list{ type: "button", data: { toggle: "dropdown", labels: labels_filter_path, namespace_path: @project.try(:namespace).try(:path), project_path: @project.try(:path) } }
|
||||||
Add list
|
Add list
|
||||||
|
|
Loading…
Reference in New Issue