globalSearch.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. const subManager = new SubsManager();
  2. BlazeComponent.extendComponent({
  3. events() {
  4. return [
  5. {
  6. 'click .js-due-cards-view-change': Popup.open('globalSearchViewChange'),
  7. },
  8. ];
  9. },
  10. }).register('globalSearchHeaderBar');
  11. Template.globalSearch.helpers({
  12. userId() {
  13. return Meteor.userId();
  14. },
  15. });
  16. BlazeComponent.extendComponent({
  17. events() {
  18. return [
  19. {
  20. 'click .js-due-cards-view-me'() {
  21. Utils.setDueCardsView('me');
  22. Popup.close();
  23. },
  24. 'click .js-due-cards-view-all'() {
  25. Utils.setDueCardsView('all');
  26. Popup.close();
  27. },
  28. },
  29. ];
  30. },
  31. }).register('globalSearchViewChangePopup');
  32. BlazeComponent.extendComponent({
  33. onCreated() {
  34. this.searching = new ReactiveVar(false);
  35. this.hasResults = new ReactiveVar(false);
  36. this.hasQueryErrors = new ReactiveVar(false);
  37. this.query = new ReactiveVar('');
  38. this.resultsHeading = new ReactiveVar('');
  39. this.searchLink = new ReactiveVar(null);
  40. this.myLists = new ReactiveVar([]);
  41. this.myLabelNames = new ReactiveVar([]);
  42. this.myBoardNames = new ReactiveVar([]);
  43. this.results = new ReactiveVar([]);
  44. this.hasNextPage = new ReactiveVar(false);
  45. this.hasPreviousPage = new ReactiveVar(false);
  46. this.queryParams = null;
  47. this.parsingErrors = [];
  48. this.resultsCount = 0;
  49. this.totalHits = 0;
  50. this.queryErrors = null;
  51. this.colorMap = null;
  52. this.resultsPerPage = 25;
  53. Meteor.call('myLists', (err, data) => {
  54. if (!err) {
  55. this.myLists.set(data);
  56. }
  57. });
  58. Meteor.call('myLabelNames', (err, data) => {
  59. if (!err) {
  60. this.myLabelNames.set(data);
  61. }
  62. });
  63. Meteor.call('myBoardNames', (err, data) => {
  64. if (!err) {
  65. this.myBoardNames.set(data);
  66. }
  67. });
  68. },
  69. onRendered() {
  70. Meteor.subscribe('setting');
  71. // eslint-disable-next-line no-console
  72. //console.log('lang:', TAPi18n.getLanguage());
  73. this.colorMap = Boards.colorMap();
  74. // eslint-disable-next-line no-console
  75. // console.log('colorMap:', this.colorMap);
  76. if (Session.get('globalQuery')) {
  77. this.searchAllBoards(Session.get('globalQuery'));
  78. }
  79. },
  80. resetSearch() {
  81. this.searching.set(false);
  82. this.results.set([]);
  83. this.hasResults.set(false);
  84. this.hasQueryErrors.set(false);
  85. this.resultsHeading.set('');
  86. this.parsingErrors = [];
  87. this.resultsCount = 0;
  88. this.totalHits = 0;
  89. this.queryErrors = null;
  90. },
  91. getSessionData() {
  92. return SessionData.findOne({
  93. userId: Meteor.userId(),
  94. sessionId: SessionData.getSessionId(),
  95. });
  96. },
  97. getResults() {
  98. // eslint-disable-next-line no-console
  99. // console.log('getting results');
  100. if (this.queryParams) {
  101. const sessionData = this.getSessionData();
  102. // eslint-disable-next-line no-console
  103. // console.log('selector:', sessionData.getSelector());
  104. // console.log('session data:', sessionData);
  105. const cards = Cards.find({ _id: { $in: sessionData.cards } });
  106. this.queryErrors = sessionData.errors;
  107. if (this.queryErrors.length) {
  108. this.hasQueryErrors.set(true);
  109. return null;
  110. }
  111. if (cards) {
  112. this.totalHits = sessionData.totalHits;
  113. this.resultsCount = cards.count();
  114. this.resultsStart = sessionData.lastHit - this.resultsCount + 1;
  115. this.resultsEnd = sessionData.lastHit;
  116. this.resultsHeading.set(this.getResultsHeading());
  117. this.results.set(cards);
  118. this.hasNextPage.set(sessionData.lastHit < sessionData.totalHits);
  119. this.hasPreviousPage.set(
  120. sessionData.lastHit - sessionData.resultsCount > 0,
  121. );
  122. }
  123. }
  124. this.resultsCount = 0;
  125. return null;
  126. },
  127. errorMessages() {
  128. if (this.parsingErrors.length) {
  129. return this.parsingErrorMessages();
  130. }
  131. return this.queryErrorMessages();
  132. },
  133. parsingErrorMessages() {
  134. const messages = [];
  135. if (this.parsingErrors.length) {
  136. this.parsingErrors.forEach(err => {
  137. messages.push(TAPi18n.__(err.tag, err.value));
  138. });
  139. }
  140. return messages;
  141. },
  142. queryErrorMessages() {
  143. messages = [];
  144. this.queryErrors.forEach(err => {
  145. let value = err.color ? TAPi18n.__(`color-${err.value}`) : err.value;
  146. if (!value) {
  147. value = err.value;
  148. }
  149. messages.push(TAPi18n.__(err.tag, value));
  150. });
  151. return messages;
  152. },
  153. searchAllBoards(query) {
  154. query = query.trim();
  155. // eslint-disable-next-line no-console
  156. //console.log('query:', query);
  157. this.query.set(query);
  158. this.resetSearch();
  159. if (!query) {
  160. return;
  161. }
  162. this.searching.set(true);
  163. const reOperator1 = new RegExp(
  164. '^((?<operator>[\\p{Letter}\\p{Mark}]+):|(?<abbrev>[#@]))(?<value>[\\p{Letter}\\p{Mark}]+)(\\s+|$)',
  165. 'iu',
  166. );
  167. const reOperator2 = new RegExp(
  168. '^((?<operator>[\\p{Letter}\\p{Mark}]+):|(?<abbrev>[#@]))(?<quote>["\']*)(?<value>.*?)\\k<quote>(\\s+|$)',
  169. 'iu',
  170. );
  171. const reText = new RegExp('^(?<text>\\S+)(\\s+|$)', 'u');
  172. const reQuotedText = new RegExp(
  173. '^(?<quote>["\'])(?<text>.*?)\\k<quote>(\\s+|$)',
  174. 'u',
  175. );
  176. const operators = {
  177. 'operator-board': 'boards',
  178. 'operator-board-abbrev': 'boards',
  179. 'operator-swimlane': 'swimlanes',
  180. 'operator-swimlane-abbrev': 'swimlanes',
  181. 'operator-list': 'lists',
  182. 'operator-list-abbrev': 'lists',
  183. 'operator-label': 'labels',
  184. 'operator-label-abbrev': 'labels',
  185. 'operator-user': 'users',
  186. 'operator-user-abbrev': 'users',
  187. 'operator-member': 'members',
  188. 'operator-member-abbrev': 'members',
  189. 'operator-assignee': 'assignees',
  190. 'operator-assignee-abbrev': 'assignees',
  191. 'operator-status': 'status',
  192. 'operator-due': 'dueAt',
  193. 'operator-created': 'createdAt',
  194. 'operator-modified': 'modifiedAt',
  195. 'operator-comment': 'comments',
  196. 'operator-has': 'has',
  197. };
  198. const predicates = {
  199. due: {
  200. 'predicate-overdue': 'overdue',
  201. },
  202. durations: {
  203. 'predicate-week': 'week',
  204. 'predicate-month': 'month',
  205. 'predicate-quarter': 'quarter',
  206. 'predicate-year': 'year',
  207. },
  208. status: {
  209. 'predicate-archived': 'archived',
  210. 'predicate-all': 'all',
  211. 'predicate-ended': 'ended',
  212. 'predicate-public': 'public',
  213. 'predicate-private': 'private',
  214. },
  215. sorts: {
  216. 'predicate-due': 'dueAt',
  217. 'predicate-created': 'createdAt',
  218. 'predicate-modified': 'modifiedAt',
  219. },
  220. has: {
  221. 'predicate-description': 'description',
  222. 'predicate-checklist': 'checklist',
  223. 'predicate-attachment': 'attachment',
  224. },
  225. };
  226. const predicateTranslations = {};
  227. Object.entries(predicates).forEach(([category, catPreds]) => {
  228. predicateTranslations[category] = {};
  229. Object.entries(catPreds).forEach(([tag, value]) => {
  230. predicateTranslations[category][TAPi18n.__(tag)] = value;
  231. });
  232. });
  233. // eslint-disable-next-line no-console
  234. // console.log('predicateTranslations:', predicateTranslations);
  235. const operatorMap = {};
  236. Object.entries(operators).forEach(([key, value]) => {
  237. operatorMap[TAPi18n.__(key).toLowerCase()] = value;
  238. });
  239. // eslint-disable-next-line no-console
  240. // console.log('operatorMap:', operatorMap);
  241. const params = {
  242. limit: this.resultsPerPage,
  243. boards: [],
  244. swimlanes: [],
  245. lists: [],
  246. users: [],
  247. members: [],
  248. assignees: [],
  249. labels: [],
  250. status: [],
  251. dueAt: null,
  252. createdAt: null,
  253. modifiedAt: null,
  254. comments: [],
  255. has: [],
  256. };
  257. let text = '';
  258. while (query) {
  259. m = query.match(reOperator1);
  260. if (!m) {
  261. m = query.match(reOperator2);
  262. if (m) {
  263. query = query.replace(reOperator2, '');
  264. }
  265. } else {
  266. query = query.replace(reOperator1, '');
  267. }
  268. if (m) {
  269. let op;
  270. if (m.groups.operator) {
  271. op = m.groups.operator.toLowerCase();
  272. } else {
  273. op = m.groups.abbrev.toLowerCase();
  274. }
  275. // eslint-disable-next-line no-prototype-builtins
  276. if (operatorMap.hasOwnProperty(op)) {
  277. let value = m.groups.value;
  278. if (operatorMap[op] === 'labels') {
  279. if (value in this.colorMap) {
  280. value = this.colorMap[value];
  281. // console.log('found color:', value);
  282. }
  283. } else if (
  284. ['dueAt', 'createdAt', 'modifiedAt'].includes(operatorMap[op])
  285. ) {
  286. let days = parseInt(value, 10);
  287. let duration = null;
  288. if (isNaN(days)) {
  289. if (predicateTranslations.durations[value]) {
  290. duration = predicateTranslations.durations[value];
  291. value = moment();
  292. } else if (predicateTranslations.due[value] === 'overdue') {
  293. value = moment();
  294. duration = 'days';
  295. days = 0;
  296. } else {
  297. this.parsingErrors.push({
  298. tag: 'operator-number-expected',
  299. value: { operator: op, value },
  300. });
  301. value = null;
  302. }
  303. } else {
  304. value = moment();
  305. }
  306. if (value) {
  307. if (operatorMap[op] === 'dueAt') {
  308. value = value.add(days, duration ? duration : 'days').format();
  309. } else {
  310. value = value
  311. .subtract(days, duration ? duration : 'days')
  312. .format();
  313. }
  314. }
  315. } else if (operatorMap[op] === 'sort') {
  316. if (!predicateTranslations.sorts[value]) {
  317. this.parsingErrors.push({
  318. tag: 'operator-sort-invalid',
  319. value,
  320. });
  321. } else {
  322. value = predicateTranslations.sorts[value];
  323. }
  324. } else if (operatorMap[op] === 'status') {
  325. if (!predicateTranslations.status[value]) {
  326. this.parsingErrors.push({
  327. tag: 'operator-status-invalid',
  328. value,
  329. });
  330. } else {
  331. value = predicateTranslations.status[value];
  332. }
  333. } else if (operatorMap[op] === 'has') {
  334. if (!predicateTranslations.has[value]) {
  335. this.parsingErrors.push({
  336. tag: 'operator-has-invalid',
  337. value,
  338. });
  339. } else {
  340. value = predicateTranslations.has[value];
  341. }
  342. }
  343. if (Array.isArray(params[operatorMap[op]])) {
  344. params[operatorMap[op]].push(value);
  345. } else {
  346. params[operatorMap[op]] = value;
  347. }
  348. } else {
  349. this.parsingErrors.push({
  350. tag: 'operator-unknown-error',
  351. value: op,
  352. });
  353. }
  354. continue;
  355. }
  356. m = query.match(reQuotedText);
  357. if (!m) {
  358. m = query.match(reText);
  359. if (m) {
  360. query = query.replace(reText, '');
  361. }
  362. } else {
  363. query = query.replace(reQuotedText, '');
  364. }
  365. if (m) {
  366. text += (text ? ' ' : '') + m.groups.text;
  367. }
  368. }
  369. // eslint-disable-next-line no-console
  370. // console.log('text:', text);
  371. params.text = text;
  372. // eslint-disable-next-line no-console
  373. console.log('params:', params);
  374. this.queryParams = params;
  375. if (this.parsingErrors.length) {
  376. this.searching.set(false);
  377. this.queryErrors = this.parsingErrorMessages();
  378. this.hasResults.set(true);
  379. this.hasQueryErrors.set(true);
  380. return;
  381. }
  382. this.autorun(() => {
  383. const handle = Meteor.subscribe(
  384. 'globalSearch',
  385. SessionData.getSessionId(),
  386. params,
  387. );
  388. Tracker.nonreactive(() => {
  389. Tracker.autorun(() => {
  390. if (handle.ready()) {
  391. this.getResults();
  392. this.searching.set(false);
  393. this.hasResults.set(true);
  394. }
  395. });
  396. });
  397. });
  398. },
  399. nextPage() {
  400. sessionData = this.getSessionData();
  401. const params = {
  402. limit: this.resultsPerPage,
  403. selector: sessionData.getSelector(),
  404. skip: sessionData.lastHit,
  405. };
  406. this.autorun(() => {
  407. const handle = Meteor.subscribe(
  408. 'globalSearch',
  409. SessionData.getSessionId(),
  410. params,
  411. );
  412. Tracker.nonreactive(() => {
  413. Tracker.autorun(() => {
  414. if (handle.ready()) {
  415. this.getResults();
  416. this.searching.set(false);
  417. this.hasResults.set(true);
  418. }
  419. });
  420. });
  421. });
  422. },
  423. previousPage() {
  424. sessionData = this.getSessionData();
  425. const params = {
  426. limit: this.resultsPerPage,
  427. selector: sessionData.getSelector(),
  428. skip:
  429. sessionData.lastHit - sessionData.resultsCount - this.resultsPerPage,
  430. };
  431. this.autorun(() => {
  432. const handle = Meteor.subscribe(
  433. 'globalSearch',
  434. SessionData.getSessionId(),
  435. params,
  436. );
  437. Tracker.nonreactive(() => {
  438. Tracker.autorun(() => {
  439. if (handle.ready()) {
  440. this.getResults();
  441. this.searching.set(false);
  442. this.hasResults.set(true);
  443. }
  444. });
  445. });
  446. });
  447. },
  448. getResultsHeading() {
  449. if (this.resultsCount === 0) {
  450. return TAPi18n.__('no-cards-found');
  451. } else if (this.resultsCount === 1) {
  452. return TAPi18n.__('one-card-found');
  453. } else if (this.resultsCount === this.totalHits) {
  454. return TAPi18n.__('n-cards-found', this.resultsCount);
  455. }
  456. return TAPi18n.__('n-n-of-n-cards-found', {
  457. start: this.resultsStart,
  458. end: this.resultsEnd,
  459. total: this.totalHits,
  460. });
  461. },
  462. getSearchHref() {
  463. const baseUrl = window.location.href.replace(/([?#].*$|\s*$)/, '');
  464. return `${baseUrl}?q=${encodeURIComponent(this.query.get())}`;
  465. },
  466. searchInstructions() {
  467. tags = {
  468. operator_board: TAPi18n.__('operator-board'),
  469. operator_list: TAPi18n.__('operator-list'),
  470. operator_swimlane: TAPi18n.__('operator-swimlane'),
  471. operator_comment: TAPi18n.__('operator-comment'),
  472. operator_label: TAPi18n.__('operator-label'),
  473. operator_label_abbrev: TAPi18n.__('operator-label-abbrev'),
  474. operator_user: TAPi18n.__('operator-user'),
  475. operator_user_abbrev: TAPi18n.__('operator-user-abbrev'),
  476. operator_member: TAPi18n.__('operator-member'),
  477. operator_member_abbrev: TAPi18n.__('operator-member-abbrev'),
  478. operator_assignee: TAPi18n.__('operator-assignee'),
  479. operator_assignee_abbrev: TAPi18n.__('operator-assignee-abbrev'),
  480. operator_due: TAPi18n.__('operator-due'),
  481. operator_created: TAPi18n.__('operator-created'),
  482. operator_modified: TAPi18n.__('operator-modified'),
  483. operator_status: TAPi18n.__('operator-status'),
  484. operator_has: TAPi18n.__('operator-has'),
  485. predicate_overdue: TAPi18n.__('predicate-overdue'),
  486. predicate_archived: TAPi18n.__('predicate-archived'),
  487. predicate_all: TAPi18n.__('predicate-all'),
  488. predicate_ended: TAPi18n.__('predicate-ended'),
  489. predicate_week: TAPi18n.__('predicate-week'),
  490. predicate_month: TAPi18n.__('predicate-month'),
  491. predicate_quarter: TAPi18n.__('predicate-quarter'),
  492. predicate_year: TAPi18n.__('predicate-year'),
  493. predicate_attachment: TAPi18n.__('predicate-attachment'),
  494. predicate_description: TAPi18n.__('predicate-description'),
  495. predicate_checklist: TAPi18n.__('predicate-checklist'),
  496. predicate_public: TAPi18n.__('predicate-public'),
  497. predicate_private: TAPi18n.__('predicate-private'),
  498. };
  499. text = `# ${TAPi18n.__('globalSearch-instructions-heading')}`;
  500. text += `\n${TAPi18n.__('globalSearch-instructions-description', tags)}`;
  501. text += `\n${TAPi18n.__('globalSearch-instructions-operators', tags)}`;
  502. text += `\n* ${TAPi18n.__(
  503. 'globalSearch-instructions-operator-board',
  504. tags,
  505. )}`;
  506. text += `\n* ${TAPi18n.__(
  507. 'globalSearch-instructions-operator-list',
  508. tags,
  509. )}`;
  510. text += `\n* ${TAPi18n.__(
  511. 'globalSearch-instructions-operator-swimlane',
  512. tags,
  513. )}`;
  514. text += `\n* ${TAPi18n.__(
  515. 'globalSearch-instructions-operator-comment',
  516. tags,
  517. )}`;
  518. text += `\n* ${TAPi18n.__(
  519. 'globalSearch-instructions-operator-label',
  520. tags,
  521. )}`;
  522. text += `\n* ${TAPi18n.__(
  523. 'globalSearch-instructions-operator-hash',
  524. tags,
  525. )}`;
  526. text += `\n* ${TAPi18n.__(
  527. 'globalSearch-instructions-operator-user',
  528. tags,
  529. )}`;
  530. text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-at', tags)}`;
  531. text += `\n* ${TAPi18n.__(
  532. 'globalSearch-instructions-operator-member',
  533. tags,
  534. )}`;
  535. text += `\n* ${TAPi18n.__(
  536. 'globalSearch-instructions-operator-assignee',
  537. tags,
  538. )}`;
  539. text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-due', tags)}`;
  540. text += `\n* ${TAPi18n.__(
  541. 'globalSearch-instructions-operator-created',
  542. tags,
  543. )}`;
  544. text += `\n* ${TAPi18n.__(
  545. 'globalSearch-instructions-operator-modified',
  546. tags,
  547. )}`;
  548. text += `\n* ${TAPi18n.__(
  549. 'globalSearch-instructions-status-archived',
  550. tags,
  551. )}`;
  552. text += `\n* ${TAPi18n.__(
  553. 'globalSearch-instructions-status-public',
  554. tags,
  555. )}`;
  556. text += `\n* ${TAPi18n.__(
  557. 'globalSearch-instructions-status-private',
  558. tags,
  559. )}`;
  560. text += `\n* ${TAPi18n.__('globalSearch-instructions-status-all', tags)}`;
  561. text += `\n* ${TAPi18n.__('globalSearch-instructions-status-ended', tags)}`;
  562. text += `\n* ${TAPi18n.__('globalSearch-instructions-operator-has', tags)}`;
  563. text += `\n## ${TAPi18n.__('heading-notes')}`;
  564. text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-1', tags)}`;
  565. text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-2', tags)}`;
  566. text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-3', tags)}`;
  567. text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-3-2', tags)}`;
  568. text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-4', tags)}`;
  569. text += `\n* ${TAPi18n.__('globalSearch-instructions-notes-5', tags)}`;
  570. return text;
  571. },
  572. labelColors() {
  573. return Boards.simpleSchema()._schema['labels.$.color'].allowedValues.map(
  574. color => {
  575. return { color, name: TAPi18n.__(`color-${color}`) };
  576. },
  577. );
  578. },
  579. events() {
  580. return [
  581. {
  582. 'submit .js-search-query-form'(evt) {
  583. evt.preventDefault();
  584. this.searchAllBoards(evt.target.searchQuery.value);
  585. },
  586. 'click .js-next-page'(evt) {
  587. evt.preventDefault();
  588. this.nextPage();
  589. },
  590. 'click .js-previous-page'(evt) {
  591. evt.preventDefault();
  592. this.previousPage();
  593. },
  594. 'click .js-label-color'(evt) {
  595. evt.preventDefault();
  596. const input = document.getElementById('global-search-input');
  597. this.query.set(
  598. `${input.value} ${TAPi18n.__('operator-label')}:"${
  599. evt.currentTarget.textContent
  600. }"`,
  601. );
  602. document.getElementById('global-search-input').focus();
  603. },
  604. 'click .js-board-title'(evt) {
  605. evt.preventDefault();
  606. const input = document.getElementById('global-search-input');
  607. this.query.set(
  608. `${input.value} ${TAPi18n.__('operator-board')}:"${
  609. evt.currentTarget.textContent
  610. }"`,
  611. );
  612. document.getElementById('global-search-input').focus();
  613. },
  614. 'click .js-list-title'(evt) {
  615. evt.preventDefault();
  616. const input = document.getElementById('global-search-input');
  617. this.query.set(
  618. `${input.value} ${TAPi18n.__('operator-list')}:"${
  619. evt.currentTarget.textContent
  620. }"`,
  621. );
  622. document.getElementById('global-search-input').focus();
  623. },
  624. 'click .js-label-name'(evt) {
  625. evt.preventDefault();
  626. const input = document.getElementById('global-search-input');
  627. this.query.set(
  628. `${input.value} ${TAPi18n.__('operator-label')}:"${
  629. evt.currentTarget.textContent
  630. }"`,
  631. );
  632. document.getElementById('global-search-input').focus();
  633. },
  634. },
  635. ];
  636. },
  637. }).register('globalSearch');