Commit d66b7003 authored by Kushal Pandya's avatar Kushal Pandya

Update init config for group and groupAncestor support

parent 45ca7722
...@@ -24,12 +24,8 @@ export default class FilteredSearchDropdownManager { ...@@ -24,12 +24,8 @@ export default class FilteredSearchDropdownManager {
this.filteredSearchTokenKeys = filteredSearchTokenKeys || FilteredSearchTokenKeys; this.filteredSearchTokenKeys = filteredSearchTokenKeys || FilteredSearchTokenKeys;
this.filteredSearchInput = this.container.querySelector('.filtered-search'); this.filteredSearchInput = this.container.querySelector('.filtered-search');
this.page = page; this.page = page;
<<<<<<< HEAD
this.groupsOnly = page === 'boards' && isGroup;
=======
this.groupsOnly = isGroup; this.groupsOnly = isGroup;
this.groupAncestor = isGroupAncestor; this.groupAncestor = isGroupAncestor;
>>>>>>> upstream/master
this.setupMapping(); this.setupMapping();
...@@ -72,11 +68,7 @@ export default class FilteredSearchDropdownManager { ...@@ -72,11 +68,7 @@ export default class FilteredSearchDropdownManager {
reference: null, reference: null,
gl: DropdownNonUser, gl: DropdownNonUser,
extraArguments: { extraArguments: {
<<<<<<< HEAD
endpoint: `${this.baseEndpoint}/milestones.json${this.groupsOnly ? '?only_group_milestones=true' : ''}`,
=======
endpoint: this.getMilestoneEndpoint(), endpoint: this.getMilestoneEndpoint(),
>>>>>>> upstream/master
symbol: '%', symbol: '%',
}, },
element: this.container.querySelector('#js-dropdown-milestone'), element: this.container.querySelector('#js-dropdown-milestone'),
...@@ -85,11 +77,7 @@ export default class FilteredSearchDropdownManager { ...@@ -85,11 +77,7 @@ export default class FilteredSearchDropdownManager {
reference: null, reference: null,
gl: DropdownNonUser, gl: DropdownNonUser,
extraArguments: { extraArguments: {
<<<<<<< HEAD
endpoint: `${this.baseEndpoint}/labels.json${this.groupsOnly ? '?only_group_labels=true' : ''}`,
=======
endpoint: this.getLabelsEndpoint(), endpoint: this.getLabelsEndpoint(),
>>>>>>> upstream/master
symbol: '~', symbol: '~',
preprocessing: DropdownUtils.duplicateLabelPreprocessing, preprocessing: DropdownUtils.duplicateLabelPreprocessing,
}, },
...@@ -117,13 +105,23 @@ export default class FilteredSearchDropdownManager { ...@@ -117,13 +105,23 @@ export default class FilteredSearchDropdownManager {
} }
getMilestoneEndpoint() { getMilestoneEndpoint() {
const endpoint = `${this.baseEndpoint}/milestones.json`; let endpoint = `${this.baseEndpoint}/milestones.json`;
// EE-only
if (this.groupsOnly) {
endpoint = `${endpoint}?only_group_milestones=true`;
}
return endpoint; return endpoint;
} }
getLabelsEndpoint() { getLabelsEndpoint() {
const endpoint = `${this.baseEndpoint}/labels.json`; let endpoint = `${this.baseEndpoint}/labels.json`;
// EE-only
if (this.groupsOnly) {
endpoint = `${endpoint}?only_group_labels=true`;
}
return endpoint; return endpoint;
} }
......
import FilteredSearchManager from '~/filtered_search/filtered_search_manager'; import FilteredSearchManager from '~/filtered_search/filtered_search_manager';
<<<<<<< HEAD
export default ({ page, filteredSearchTokenKeys, stateFiltersSelector }) => {
=======
export default ({ export default ({
page, page,
filteredSearchTokenKeys, filteredSearchTokenKeys,
...@@ -10,16 +7,12 @@ export default ({ ...@@ -10,16 +7,12 @@ export default ({
isGroupAncestor, isGroupAncestor,
stateFiltersSelector, stateFiltersSelector,
}) => { }) => {
>>>>>>> upstream/master
const filteredSearchEnabled = FilteredSearchManager && document.querySelector('.filtered-search'); const filteredSearchEnabled = FilteredSearchManager && document.querySelector('.filtered-search');
if (filteredSearchEnabled) { if (filteredSearchEnabled) {
const filteredSearchManager = new FilteredSearchManager({ const filteredSearchManager = new FilteredSearchManager({
page, page,
<<<<<<< HEAD
=======
isGroup, isGroup,
isGroupAncestor, isGroupAncestor,
>>>>>>> upstream/master
filteredSearchTokenKeys, filteredSearchTokenKeys,
stateFiltersSelector, stateFiltersSelector,
}); });
......
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