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.5
edited by bougault
on 2022/11/17 13:00
Change comment: There is no comment for this version
To version 27.3
edited by bougault
on 2022/11/17 12:51
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -51,39 +51,23 @@
51 51   }
52 52   this[roleName] = !this[roleName];
53 53   this.filterUrl.searchParams.set('roles', this.rolesFilter.join("+"));
54 - // if search text then apply filter
55 - // else return filters result
54 + console.log(this.filterUrl.toString());
56 56   }
57 57   setSearchText(e) {
58 58   this.searchText = e.target.value;
59 59   }
60 60   handleSearch() {
60 + console.log(this.searchText);
61 61   if(this.searchText !== "") {
62 - Promise.all([
63 - this.fetchWikiSearch(),
64 - this.fetchFilterSearch()
65 - ])
66 - } else {
67 - console.log("no search text, should return filter search results if any");
62 + this.fetchWikiSearch();
68 68   }
69 69   }
70 - hasActiveFilters() {
71 - // we only look at role filters for POC.
72 - return this.roles.length > 0;
73 - }
74 74   fetchWikiSearch() {
75 75   // request should be built from component, not from "external" dependency. Leave it here like this for POC.
76 - return handleXWikiSearch(this.searchText);
67 + handleXWikiSearch(this.searchText).then(results => this.results = results);
77 77   }
78 - fetchFilterSearch() {
79 - return new Promise((resolve) => {
80 - if(hasActiveFilters) {
81 - fetch(this.filterUrl).then(console.log);
82 - } else {
83 - resolve(null);
84 - }
85 - });
86 - }
69 +
70 +
87 87   getLink(xwikiDocSpace) {
88 88   return `/bin/view/${xwikiDocSpace.replaceAll('.', '/')}`;
89 89   }