From 99455d7874adc97b465fe057e609f52ac853fef3 Mon Sep 17 00:00:00 2001 From: gpveronica Date: Wed, 25 Oct 2023 01:17:59 +0200 Subject: [PATCH] wc - Added autocomplete to disease panel create, genes Signed-off-by: gpveronica --- .../filters/cellbase-search-autocomplete.js | 4 +- .../disease-panel/disease-panel-create.js | 38 +++++++++++-------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/webcomponents/commons/filters/cellbase-search-autocomplete.js b/src/webcomponents/commons/filters/cellbase-search-autocomplete.js index c0c4e8aad0..d6b1dad2f1 100644 --- a/src/webcomponents/commons/filters/cellbase-search-autocomplete.js +++ b/src/webcomponents/commons/filters/cellbase-search-autocomplete.js @@ -97,7 +97,9 @@ export default class CellbaseSearchAutocomplete extends LitElement { }, valueField: "name", placeholder: "Start typing an ensemble gene ID or name...", - queryParams: {}, // CAUTION: query params depends on the resource/operation (i.e. search, info) used + queryParams: { + exclude: "transcripts,annotation", + }, // CAUTION: query params depends on the resource/operation (i.e. search, info) used }, "VARIANT": {}, "PROTEIN": {}, diff --git a/src/webcomponents/disease-panel/disease-panel-create.js b/src/webcomponents/disease-panel/disease-panel-create.js index fcab8a5086..3b63af8014 100644 --- a/src/webcomponents/disease-panel/disease-panel-create.js +++ b/src/webcomponents/disease-panel/disease-panel-create.js @@ -20,6 +20,7 @@ import NotificationUtils from "../commons/utils/notification-utils.js"; import BioinfoUtils from "../../core/bioinfo/bioinfo-utils.js"; import LitUtils from "../commons/utils/lit-utils"; import "../commons/filters/cellbase-search-autocomplete.js"; +import UtilsNew from "../../core/utils-new"; export default class DiseasePanelCreate extends LitElement { @@ -68,6 +69,7 @@ export default class DiseasePanelCreate extends LitElement { // ] }; this.isLoading = false; + // NOTE Vero 20231025: Probably not needed. this.annotatedGenes = {}; this.displayConfigDefault = { style: "margin: 10px", @@ -80,13 +82,18 @@ export default class DiseasePanelCreate extends LitElement { update(changedProperties) { if (changedProperties.has("displayConfig")) { - this.displayConfig = {...this.displayConfigDefault, ...this.displayConfig}; + this.displayConfig = { + ...this.displayConfigDefault, + ...this.displayConfig + }; this._config = this.getDefaultConfig(); } super.update(changedProperties); } onFieldChange(e) { + // CAUTION 20232310 Vero: I have added the Autocomplete search, so the query would not be necessary + // for "Add Item" but required for "Add Batch". Think about how to take advantage of autocomplete. Discuss with Nacho. // Get gene.name and coordinates if (e.detail?.data?.genes?.length > 0) { for (const gene of e.detail.data.genes) { @@ -359,26 +366,25 @@ export default class DiseasePanelCreate extends LitElement { `, + search: { + title: "Autocomplete", + button: false, + render: (currentData, dataFormFilterChange) => html` + + + `, + }, }, elements: [ { - title: "Gene", + title: "Gene Name", field: "genes[].name", - type: "custom", + type: "input-text", display: { - placeholder: "Add gene...", - render: (data, dataFormFilterChange) => { - return html ` - - - `; - }, + placeholder: "Add gene name...", } }, {