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 26.37
edited by bougault
on 2022/11/16 15:32
Change comment: There is no comment for this version
To version 26.43
edited by bougault
on 2022/11/16 15:42
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -36,13 +36,12 @@
36 36   }
37 37  
38 38   function removeRole(role) {
39 - filters.roles.filter(r => r !== 'administrator')
39 + filters.roles = filters.roles.filter(r => r !== role)
40 40   }
41 41  
42 42   const filterInputs = document.querySelectorAll('input[data-role-filter]');
43 - console.log(filterInputs);
43 +
44 44   filterInputs.forEach(function(filterIpt) {
45 - console.log(filterIpt);
46 46   filterIpt.addEventListener('click', function() {
47 47   const role = this.getAttribute('data-role-filter');
48 48   if(this.checked) {
... ... @@ -50,10 +50,17 @@
50 50   } else {
51 51   removeRole(role);
52 52   }
53 - console.log(filters);
52 + runFilteredRequest();
54 54   })
55 55   });
56 56  
56 + function runFilteredRequest() {
57 + const urlParams = new URLSearchParams();
58 + for(filter in filters) {
59 + urlParams.set(filter, filters[filter]);
60 + }
61 + console.log(urlParams);
62 + }
57 57   // https://wiki-dev.ebrains.eu/rest/v1/collabs?search=&offset=0&orderField=title&order=asc&favorite=false&roles=administrator
58 58   const contextSearchType = document.getElementById("context-search-type");
59 59   const contextSearchText = document.getElementById("context-search-text");
... ... @@ -70,7 +70,7 @@
70 70   handleXWikiSearch('bougaultx');
71 71   break
72 72   default:
73 - handleXWikiSearch('', applyAdministratorFilter)
79 + handleXWikiSearch('')
74 74   }
75 75  
76 76   });