Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

Context Search - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Changes for page Context Search

Last modified by bougault on 2023/02/20 16:29

From version 27.51
edited by bougault
on 2022/11/17 14:18
Change comment: There is no comment for this version
To version 27.42
edited by bougault
on 2022/11/17 13:56
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -58,19 +58,11 @@
58 58   setSearchText(e) {
59 59   this.searchText = e.target.value;
60 60   }
61 - handleSearch(textSearch) {
62 - if(this.searchText !== "" || textSearch) {
61 + handleSearch() {
62 +
63 + if(this.searchText !== "") {
63 63   if(this.searchText !== this.prevSearchText) {
64 64   this.prevSearchText = this.searchText;
65 - this.fetchWikiSearch().then(results => {
66 - this.resultsCache = results;
67 - if(this.hasActiveFilters()) {
68 - this.fetchFilterSearch().then(this.filterResults);
69 - } else {
70 - this.results = results;
71 - }
72 - })
73 - /*
74 74   Promise.all([
75 75   this.fetchWikiSearch(),
76 76   this.fetchFilterSearch()
... ... @@ -79,7 +79,6 @@
79 79   this.resultsCache = wikiSearchResults;
80 80   console.log(wikiSearchResults, collabSearchResults);
81 81   });
82 - */
83 83   } else if (this.searchText === this.prevSearchText && this.hasActiveFilters()) {
84 84   this.fetchFilterSearch().then(this.filterResults)
85 85   } else {
... ... @@ -86,7 +86,6 @@
86 86   this.results = this.resultsCache;
87 87   }
88 88   } else {
89 - this.clearResults();
90 90   console.log("no search text, should return filter search results if any");
91 91   this.fetchFilterSearch().then(collabs => {
92 92   console.log("Format and display collabs", collabs);
... ... @@ -114,10 +114,6 @@
114 114   const collabSpaces = filteredCollabs.map(collab => `Collabs.${collab.name}`);
115 115   this.results = this.resultsCache.filter(result => collabSpaces.some(space => result.space.startsWith(space)));
116 116   }
117 - clearResults() {
118 - this.results = [];
119 - this.resultsCache = [];
120 - }
121 121   getLink(xwikiDocSpace) {
122 122   return `/bin/view/${xwikiDocSpace.replaceAll('.', '/')}`;
123 123   }
... ... @@ -126,7 +126,7 @@
126 126  <div>
127 127   <div>
128 128   <input @change="${this.setSearchText}" type="text" placeholder="Search..." />
129 - <button @click="${() => this.handleSearch(true)}">Search</button>
115 + <button @click="${this.handleSearch}">Search</button>
130 130   </div>
131 131   <div>
132 132   <label><input type="checkbox" @change="${() => this.toggleRoleFilter('administrator')}" .checked="${this.administratorFilter}"/> Administrator</label>