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.

CLB Search Component - HBP Wiki

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


Changes for page CLB Search Component

Last modified by bougault on 2023/01/17 11:42

From version 7.13
edited by bougault
on 2023/01/13 14:10
Change comment: There is no comment for this version
To version 7.7
edited by bougault
on 2023/01/13 13:50
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -11,12 +11,7 @@
11 11  
12 12   createTemplate(htmlString) {
13 13   const template = document.createElement('template');
14 - template.innerHTML = `
15 - <style>
16 - ${this.styles}
17 - </style>
18 - ${htmlString}
19 - `;
14 + template.innerHTML = htmlString;
20 20   return template;
21 21   }
22 22  
... ... @@ -31,11 +31,10 @@
31 31  
32 32  customElements.define('clb-simplified-search',
33 33   class extends ClbComponent {
34 - searchBaseUrl = '/bin/get/XWiki/SuggestSolrService?outputSyntax=plain&media=json&nb=10&query=q%3D%22__INPUT__%22~100%0Afq%3Dtype%3ADOCUMENT%0Afq%3Dspace%3ACollabs.*&input=';
29 + searchBaseUrl = 'https://wiki-dev.ebrains.eu/bin/get/XWiki/SuggestSolrService?outputSyntax=plain&media=json&nb=10&offset=0&query=q%3D%22__INPUT__%22~100%0Afq%3Dtype%3ADOCUMENT%0Afq%3Dspace%3ACollabs.*&input=';
35 35   constructor() {
36 36   super();
37 37   this.results = [];
38 - this.offset = 0;
39 39   }
40 40  
41 41   connectedCallback() {
... ... @@ -58,7 +58,7 @@
58 58  
59 59   handleSearch = () => {
60 60   const value = this.$('input[type="text"]').value;
61 - fetch(`${this.searchBaseUrl}${encodeURIComponent(value)}&offset=${this.offset}`)
55 + fetch(`${this.searchBaseUrl}${encodeURIComponent(value)}`)
62 62   .then(res => res.json())
63 63   .then(this.renderResults);
64 64   }