Commit 02c8ab92 authored by Kushal Pandya's avatar Kushal Pandya

Update class initialization syntax

parent efd54f00
/* eslint-disable class-methods-use-this */
import FilteredSearchTokenKeysIssues from 'ee/filtered_search/filtered_search_token_keys_issues';
import FilteredSearchContainer from '../filtered_search/container';
export default class FilteredSearchBoards extends gl.FilteredSearchManager {
constructor(store, updateUrl = false, cantEdit = []) {
super('boards');
super({
page: 'boards',
filteredSearchTokenKeys: FilteredSearchTokenKeysIssues,
stateFiltersSelector: '.issues-state-filters',
});
this.store = store;
this.updateUrl = updateUrl;
......
import projectSelect from '~/project_select';
import initFilteredSearch from '~/pages/search/init_filtered_search';
import { FILTERED_SEARCH } from '~/pages/constants';
import FilteredSearchTokenKeysIssues from 'ee/filtered_search/filtered_search_token_keys_issues';
export default () => {
initFilteredSearch(FILTERED_SEARCH.ISSUES);
initFilteredSearch({
page: FILTERED_SEARCH.ISSUES,
filteredSearchTokenKeys: FilteredSearchTokenKeysIssues,
});
projectSelect();
};
......@@ -3,6 +3,8 @@ import initFilteredSearch from '~/pages/search/init_filtered_search';
import { FILTERED_SEARCH } from '~/pages/constants';
export default () => {
initFilteredSearch(FILTERED_SEARCH.MERGE_REQUESTS);
initFilteredSearch({
page: FILTERED_SEARCH.MERGE_REQUESTS,
});
projectSelect();
};
......@@ -6,9 +6,13 @@ import UsersSelect from '~/users_select';
import initFilteredSearch from '~/pages/search/init_filtered_search';
import { FILTERED_SEARCH } from '~/pages/constants';
import { ISSUABLE_INDEX } from '~/pages/projects/constants';
import FilteredSearchTokenKeysIssues from 'ee/filtered_search/filtered_search_token_keys_issues';
document.addEventListener('DOMContentLoaded', () => {
initFilteredSearch(FILTERED_SEARCH.ISSUES);
initFilteredSearch({
page: FILTERED_SEARCH.ISSUES,
filteredSearchTokenKeys: FilteredSearchTokenKeysIssues,
});
new IssuableIndex(ISSUABLE_INDEX.ISSUE);
new ShortcutsNavigation();
......
......@@ -6,7 +6,9 @@ import { FILTERED_SEARCH } from '~/pages/constants';
import { ISSUABLE_INDEX } from '~/pages/projects/constants';
document.addEventListener('DOMContentLoaded', () => {
initFilteredSearch(FILTERED_SEARCH.MERGE_REQUESTS);
initFilteredSearch({
page: FILTERED_SEARCH.MERGE_REQUESTS,
});
new IssuableIndex(ISSUABLE_INDEX.MERGE_REQUEST); // eslint-disable-line no-new
new ShortcutsNavigation(); // eslint-disable-line no-new
new UsersSelect(); // eslint-disable-line no-new
......
export default (page) => {
export default ({ page, filteredSearchTokenKeys, stateFiltersSelector }) => {
const filteredSearchEnabled = gl.FilteredSearchManager && document.querySelector('.filtered-search');
if (filteredSearchEnabled) {
const filteredSearchManager = new gl.FilteredSearchManager(page);
const filteredSearchManager = new gl.FilteredSearchManager({
page,
filteredSearchTokenKeys,
stateFiltersSelector,
});
filteredSearchManager.setup();
}
};
/* eslint-disable class-methods-use-this */
import FilteredSearchTokenKeys from '~/filtered_search/filtered_search_token_keys';
const AUTHOR_PARAM_KEY = 'author_username';
export default class FilteredSearchServiceDesk extends gl.FilteredSearchManager {
constructor(supportBotData) {
super('service_desk');
super({
page: 'service_desk',
filteredSearchTokenKeys: FilteredSearchTokenKeys,
});
this.supportBotData = supportBotData;
}
......
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