Changes for page Context Search
Last modified by bougault on 2023/02/20 16:29
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -26,7 +26,6 @@ 26 26 this.viewer = false; 27 27 this.rolesFilter = []; 28 28 this.filterUrl = new URL(`${document.location.origin}/rest/v1/collabs?search=&offset=0&orderField=title&order=asc&favorite=true&roles=`); 29 - this.results = []; 30 30 } 31 31 toggleRoleFilter(roleName) { 32 32 if(this.rolesFilter.indexOf(roleName) == -1) { ... ... @@ -43,12 +43,12 @@ 43 43 handleSearch() { 44 44 console.log(this.searchText); 45 45 if(this.searchText !== "") { 46 - this.fetchWikiSearch();45 + fetchWikiSearch(); 47 47 } 48 48 } 49 49 fetchWikiSearch() { 50 50 // request should be built from component, not from "external" dependency. Leave it here like this for POC. 51 - handleXWikiSearch(this.searchText).then(results => this.results =results);50 + handleXWikiSearch(this.searchText).then(results => console.log(results)); 52 52 } 53 53 buildFilter() { 54 54 //https://wiki-dev.ebrains.eu/rest/v1/collabs?search=&offset=0&orderField=title&order=asc&favorite=true&roles= ... ... @@ -74,8 +74,8 @@ 74 74 function handleXWikiSearch(searchString) { 75 75 return new Promise((resolve) => { 76 76 require(['jquery'], function($) { 77 - constsolrServiceURL = new XWiki.Document('SuggestSolrService', 'XWiki').getURL('get');78 - //contextSearchButton.addEventListener('click', function() {76 + var solrServiceURL = new XWiki.Document('SuggestSolrService', 'XWiki').getURL('get'); 77 + contextSearchButton.addEventListener('click', function() { 79 79 $.post(solrServiceURL, { 80 80 outputSyntax: 'plain', 81 81 media: 'json', ... ... @@ -86,7 +86,7 @@ 86 86 ].join('\n'), 87 87 input: searchString 88 88 }).then(resolve); 89 - //});88 + }); 90 90 }); 91 91 }); 92 92 }