Commit 7182e9e2 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett Committed by Toon Claes

Pass multiple assignee availability boolean to FE and set for use in...

Pass multiple assignee availability boolean to FE and set for use in FilteredSearchTokenKeysIssuesEE
parent 12c6f2d3
......@@ -15,6 +15,10 @@ class FilteredSearchManager {
this.tokensContainer = this.container.querySelector('.tokens-container');
this.filteredSearchTokenKeys = gl.FilteredSearchTokenKeys;
gl.FilteredSearchTokenKeysIssuesEE.init({
multipleAssignees: this.filteredSearchInput.dataset.multipleAssignees,
});
if (this.page === 'issues' || this.page === 'boards') {
this.filteredSearchTokenKeys = gl.FilteredSearchTokenKeysIssuesEE;
}
......
......@@ -19,12 +19,16 @@ const weightConditions = [{
}];
class FilteredSearchTokenKeysIssuesEE extends gl.FilteredSearchTokenKeys {
static init(availableFeatures) {
this.availableFeatures = availableFeatures;
}
static get() {
const tokenKeys = Array.from(super.get());
// Enable multiple assignees
const assigneeTokenKey = tokenKeys.find(tk => tk.key === 'assignee');
assigneeTokenKey.type = 'array';
if (this.availableFeatures && this.availableFeatures.multipleAssignees) assigneeTokenKey.type = 'array';
tokenKeys.push(weightTokenKey);
return tokenKeys;
......
- type = local_assigns.fetch(:type)
- board = local_assigns.fetch(:board, nil)
- block_css_class = type != :boards_modal ? 'row-content-block second-block' : ''
- can_multiple_assignees = @project.feature_available?(:"multiple_#{type.to_s}_assignees")
.issues-filters
.issues-details-filters.filtered-search-block{ class: block_css_class, "v-pre" => type == :boards_modal }
......@@ -27,7 +28,7 @@
.scroll-container
%ul.tokens-container.list-unstyled
%li.input-token
%input.form-control.filtered-search{ id: "filtered-search-#{type.to_s}", placeholder: 'Search or filter results...', data: { 'project-id' => @project.id, 'username-params' => @users.to_json(only: [:id, :username]), 'base-endpoint' => project_path(@project) } }
%input.form-control.filtered-search{ id: "filtered-search-#{type.to_s}", placeholder: 'Search or filter results...', data: { 'project-id' => @project.id, 'username-params' => @users.to_json(only: [:id, :username]), 'base-endpoint' => project_path(@project), 'multiple-assignees' => can_multiple_assignees } }
= icon('filter')
#js-dropdown-hint.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown
%ul{ data: { dropdown: true } }
......
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