From c78a1844ddf6c83f9496290685579b4b508741cf Mon Sep 17 00:00:00 2001 From: gpveronica Date: Wed, 8 Jan 2025 12:42:26 +0100 Subject: [PATCH] wc - WiP Filters (to refactor after the discussion on new featured filters by default). #TASK-7220 #TASK-7100 Signed-off-by: gpveronica --- src/webcomponents/file/file-data-manager.js | 40 +++++++++++++-------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/webcomponents/file/file-data-manager.js b/src/webcomponents/file/file-data-manager.js index 48a693f14..6dac444fd 100644 --- a/src/webcomponents/file/file-data-manager.js +++ b/src/webcomponents/file/file-data-manager.js @@ -650,33 +650,30 @@ export default class FileDataManager extends LitElement { this.requestUpdate(); } - onQueryFilterSearch(e) { - debugger - let filesResponse = null; + onQueryFilterSearch() { + this.executedQuery = UtilsNew.objectClone(this.preparedQuery); const query = { study: this.opencgaSession.study.fqn, type: this.preparedQuery.directory ? "FILE,DIRECTORY" : "FILE", include: "id,name,path,uuid,sampleIds,jobId,status,format,bioformat,size,creationDate,modificationDate,internal,annotationSets", ...this.preparedQuery, }; - // Store the current filters this.lastFilters = {query}; this.opencgaSession.opencgaClient.files() .search(query) .then(response => { - debugger this.currentRoot = {}; // Prepare data for columns extensions this.searchResult = response.responses?.[0]?.results || []; - this.requestUpdate() + this.requestUpdate(); }) .catch(error => { console.error(error); }); } - + searchFiles() {} renderFilter() { const filter = this._config.filter; @@ -736,7 +733,7 @@ debugger --> -
+
-
+
- + ${UtilsNew.isNotEmpty(this.executedQuery) ? html` + + + `: nothing}
- + ${UtilsNew.isNotEmpty(this.currentRoot) ? html`
@@ -1109,9 +1121,9 @@ debugger ], filter: { id: "form-search", - icon: "fas fa-search", - label: "ACTIVE FILTERS", - name: "SEARCH", + icon: "fas fa-sliders-h", + label: "ADVANCED SEARCH", + name: "ADVANCED SEARCH", searchButton: true, sections: [ {