From a2b99cad1aa5bb8e945dae5a7dcd5401bf642adf Mon Sep 17 00:00:00 2001 From: gpveronica Date: Tue, 17 Dec 2024 15:59:47 +0100 Subject: [PATCH 01/28] wc - WiP Delete files #TASK-7220 #TASK-7100 Signed-off-by: gpveronica --- src/webcomponents/file/file-data-manager.js | 53 +++++++- src/webcomponents/file/file-delete.js | 143 ++++++++++++++++++++ 2 files changed, 192 insertions(+), 4 deletions(-) create mode 100644 src/webcomponents/file/file-delete.js diff --git a/src/webcomponents/file/file-data-manager.js b/src/webcomponents/file/file-data-manager.js index cf172b954..5b2adfea7 100644 --- a/src/webcomponents/file/file-data-manager.js +++ b/src/webcomponents/file/file-data-manager.js @@ -21,6 +21,7 @@ import GridCommons from "../commons/grid-commons"; import "../commons/data-list.js"; import "../loading-spinner.js"; import "./file-view.js"; +import "./file-delete.js"; import "./folder-create.js"; import "./file-create.js"; import "./file-fetch.js" @@ -114,6 +115,24 @@ export default class FileDataManager extends LitElement { icon: "fas fa-copy", render: () => this.renderFileCopy(), }, + /* + { + id: "file-execute", + title: "View", + icon: "", + modalTitle: "Execute", + modalId: `${this._prefix}FileExecuteModal`, + render: () => this.renderFileExecute(), + // permission: this.permissions["organization"](), + }, + */ + { + id: "file-delete", + title: "Delete", + icon: "far fa-trash-alt", + render: () => this.renderFileDelete(), + }, + ]; this.actions = { @@ -439,14 +458,23 @@ export default class FileDataManager extends LitElement { ModalUtils.show(this.currentAction["modalId"]); } - - onFileAction(e,id) { - ModalUtils.close(id); + #initOriginalObjects() { this.currentAction = {}; + this.fileId = ""; + this.file = {}; this.currentRoot.visited = false; this.route(this.currentRoot.file.id) } + onFileAction(e,id) { + ModalUtils.close(id); + this.#initOriginalObjects(); + } + + onCloseNotification() { + this.#initOriginalObjects(); + } + onCheckRow(e) {} renderFolderCreate() { @@ -500,7 +528,7 @@ export default class FileDataManager extends LitElement { modalSize: "modal-lg", }, render: () => { - debugger + // FIXME 20241217 Vero: unlink files for fetched files not working. Waiting for Pedro's feedback. return html` + + `; + } + addSearch(action, icon = "fa-search", placeholder = "Search ...", className = "", style = "") { return html`
@@ -734,6 +772,7 @@ export default class FileDataManager extends LitElement { width: "20", widthUnit: "%" }, + // CAUTION 20241217 Vero: Nacho, { title: "Format", field: "format", @@ -753,6 +792,12 @@ export default class FileDataManager extends LitElement { `; } }, + { + title: "Status", + field: "internal.status.id", + rowspan: 1, + colspan: 1, + }, { title: "Tags", field: "tags", diff --git a/src/webcomponents/file/file-delete.js b/src/webcomponents/file/file-delete.js new file mode 100644 index 000000000..c5378b085 --- /dev/null +++ b/src/webcomponents/file/file-delete.js @@ -0,0 +1,143 @@ +/** + * Copyright 2015-2024 OpenCB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {html, LitElement} from "lit"; +import UtilsNew from "../../core/utils-new.js"; +import LitUtils from "../commons/utils/lit-utils.js"; +import NotificationUtils from "../commons/utils/notification-utils.js"; + +export default class FileDelete extends LitElement { + + constructor() { + super(); + + this.#init(); + } + + createRenderRoot() { + return this; + } + + static get properties() { + return { + fileId: { + type: String, + }, + opencgaSession: { + type: Object, + }, + }; + } + + #init() { + this.JOB_ID = "file-delete"; + this._file = null; + this._config = this.getDefaultConfig(); + } + + #setLoading(value) { + this.isLoading = value; + this.requestUpdate(); + } + + update(changedProperties) { + if (changedProperties.has("fileId") || changedProperties.has("opencgaSession")) { + this.fileIdObserver(); + } + super.update(changedProperties); + } + + fileIdObserver() { + if (this.opencgaSession && this.fileId) { + const params = { + study: this.opencgaSession.study.fqn + }; + this.opencgaSession.opencgaClient.files() + .info(this.fileId, params) + .then(response => { + this._file = UtilsNew.objectClone(response.responses[0].results[0]); + this.requestUpdate(); + }) + .catch(response => { + console.error(response); + }); + } + } + + onSubmit() { + const params = { + study: this.opencgaSession.study.fqn, + jobId: `${this.JOB_ID}-${UtilsNew.getDatetime()}`, + }; + + const endpoint = this._file.external ? + this.opencgaSession.opencgaClient.files().unlink(this._file.id, params) : + this.opencgaSession.opencgaClient.files().delete(this._file.id, params); + + // FIXME 20241217 VERO: When trying to delete a file fetched from an external source in the root path: + // - If delete is used, opencga returns error "Use unlink". This is happening because the field "external" in this case is set to true in opencga. + // - If unlink is used, opencga returns error "[...] Could not unlink [...] Could not delete file: No documents could be found to be updated". + // Bug created: https://app.clickup.com/t/36631768/TASK-7291 + this.#setLoading(true); + endpoint + .then(() => { + NotificationUtils.dispatch(this, NotificationUtils.NOTIFY_SUCCESS, { + title: "Delete File: Job launched", + message: `Job ${params.jobId} has been launched successfully`, + }); + LitUtils.dispatchCustomEvent(this, "fileDelete", this._file.id, {}); + LitUtils.dispatchCustomEvent(this, "closeNotification", this._file.id, {}); + this._file = null; + }) + .catch(error => { + NotificationUtils.dispatch(this, NotificationUtils.NOTIFY_RESPONSE, error); + }) + .finally(() => { + this.#setLoading(false); + }); + } + + render() { + debugger + if (this.isLoading) { + return html``; + } + if (this._file) { + // Caution 20241218 Vero: displaying a notification for now. Deleting is launching and endpoint, but + // we are not seeing the job parameters in the meta endpoint. Waiting for Pedro's feedback. + return NotificationUtils.dispatch(this, NotificationUtils.NOTIFY_CONFIRMATION, { + title: `Delete File: File ${this._file.id} in organization ${this.opencgaSession.organization.id}`, + message: ` + Are you sure you want to delete the file ${this._file.id}? + `, + ok: () => { + this.onSubmit(); + }, + cancel: () => { + this._file = null; + LitUtils.dispatchCustomEvent(this, "closeNotification", null); + }, + }); + } + } + + getDefaultConfig() { + return {}; + } + +} + +customElements.define("file-delete", FileDelete); From c1a399f04e5819327c2a391b301c90ae26589348 Mon Sep 17 00:00:00 2001 From: gpveronica Date: Tue, 17 Dec 2024 16:00:06 +0100 Subject: [PATCH 02/28] wc - Tiny improvement in notification message #TASK-7220 #TASK-7100 Signed-off-by: gpveronica --- src/webcomponents/file/file-fetch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webcomponents/file/file-fetch.js b/src/webcomponents/file/file-fetch.js index 169ccacb7..d75b2585b 100644 --- a/src/webcomponents/file/file-fetch.js +++ b/src/webcomponents/file/file-fetch.js @@ -114,8 +114,8 @@ export default class FileFetch extends LitElement { .then(() => { this.#initOriginalObjects(); NotificationUtils.dispatch(this, NotificationUtils.NOTIFY_SUCCESS, { - title: "Job launched", - message: `Job ${jobId} has been launched successfully`, + title: "Fetch File: Job launched", + message: `Job ${params.jobId} has been launched successfully`, }); LitUtils.dispatchCustomEvent(this, "fileFetch", data); }) From a5d0521206f4794bac11105c53c074d4dcf0aab8 Mon Sep 17 00:00:00 2001 From: Josemi Date: Tue, 17 Dec 2024 17:06:25 +0100 Subject: [PATCH 03/28] wc: Rename vertical-navbar to vertical-menu and move to view folder #TASK-7216 #TASK-7100 --- .../commons/{vertical-navbar.js => view/vertical-menu.js} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename src/webcomponents/commons/{vertical-navbar.js => view/vertical-menu.js} (96%) diff --git a/src/webcomponents/commons/vertical-navbar.js b/src/webcomponents/commons/view/vertical-menu.js similarity index 96% rename from src/webcomponents/commons/vertical-navbar.js rename to src/webcomponents/commons/view/vertical-menu.js index 3bdb27fee..2ed991951 100644 --- a/src/webcomponents/commons/vertical-navbar.js +++ b/src/webcomponents/commons/view/vertical-menu.js @@ -1,7 +1,6 @@ import {LitElement, html, nothing} from "lit"; -import UtilsNew from "../../core/utils-new.js"; -export default class VerticalNavBar extends LitElement { +export default class VerticalMenu extends LitElement { constructor() { super(); @@ -122,4 +121,4 @@ export default class VerticalNavBar extends LitElement { } -customElements.define("vertical-navbar", VerticalNavBar); +customElements.define("vertical-menu", VerticalMenu); From 34e684d5d2e6c3d2bebfbb77738bc9ab1314f16a Mon Sep 17 00:00:00 2001 From: Josemi Date: Tue, 17 Dec 2024 17:06:50 +0100 Subject: [PATCH 04/28] wc: Fix usage of vertical-menu in organization admin #TASK-7216 #TASK-7100 --- src/webcomponents/organization/admin/organization-admin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webcomponents/organization/admin/organization-admin.js b/src/webcomponents/organization/admin/organization-admin.js index 34d4598c1..ebf5df908 100644 --- a/src/webcomponents/organization/admin/organization-admin.js +++ b/src/webcomponents/organization/admin/organization-admin.js @@ -21,7 +21,7 @@ import "../../project/projects-admin.js"; import "./project-admin-browser.js"; import "./organization-admin-detail.js"; import "../../commons/pages/restricted-access-page.js"; -import "../../commons/vertical-navbar.js"; +import "../../commons/view/vertical-menu.js"; export default class OrganizationAdmin extends LitElement { @@ -61,10 +61,10 @@ export default class OrganizationAdmin extends LitElement { title="Organization Admin: ${this.opencgaSession?.user?.organization}" icon="fas fa-sitemap"> - - + `; } From aeac24e78455ac539160caec65b2a99c9842e65c Mon Sep 17 00:00:00 2001 From: Josemi Date: Tue, 17 Dec 2024 17:07:11 +0100 Subject: [PATCH 05/28] wc: Fix usage of vertical-menu in study-admin #TASK-7216 #TASK-7100 --- src/webcomponents/study/admin/study-admin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webcomponents/study/admin/study-admin.js b/src/webcomponents/study/admin/study-admin.js index 3cfc46a06..efd164068 100644 --- a/src/webcomponents/study/admin/study-admin.js +++ b/src/webcomponents/study/admin/study-admin.js @@ -23,7 +23,7 @@ import "./study-admin-audit.js"; import "./study-admin-configuration.js"; import "../../variant/operation/clinical-analysis-configuration-update.js"; import "../../variant/operation/variant-secondary-sample-index-configure-operation.js"; -import "../../commons/vertical-navbar.js"; +import "../../commons/view/vertical-menu.js"; import "../../commons/pages/restricted-access-page.js"; export default class StudyAdmin extends LitElement { @@ -67,10 +67,10 @@ export default class StudyAdmin extends LitElement { return html ` - - + `; } From 4a460048bdfd09971d04cee59f4f9e671df60265 Mon Sep 17 00:00:00 2001 From: gpveronica Date: Tue, 17 Dec 2024 17:34:08 +0100 Subject: [PATCH 06/28] wc - Fix creation and modification dates #TASK-7220 #TASK-7100 Signed-off-by: gpveronica --- src/webcomponents/file/file-data-manager.js | 27 ++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/webcomponents/file/file-data-manager.js b/src/webcomponents/file/file-data-manager.js index 5b2adfea7..30d990e44 100644 --- a/src/webcomponents/file/file-data-manager.js +++ b/src/webcomponents/file/file-data-manager.js @@ -623,7 +623,7 @@ export default class FileDataManager extends LitElement { if (!this.opencgaSession || !this.currentRoot) { return null; } - +debugger return html` ${this.renderStyles()} @@ -820,15 +820,30 @@ export default class FileDataManager extends LitElement { }, { title: "Creation Date", - field: "creationDate", + field: "internal.registrationDate", rowspan: 1, colspan: 1, formatter: value => { + debugger return ` -
-
Created ${UtilsNew.dateFormatter(value)}
-
- `; +
+
${UtilsNew.dateFormatter(value)}
+
+ `; + } + }, + { + title: "Modification Date", + field: "internal.lastModified", + rowspan: 1, + colspan: 1, + formatter: value => { + debugger + return ` +
+
${UtilsNew.dateFormatter(value)}
+
+ `; } }, { From fbd9c999ead6d13f0baeeb70f111be82c1a701c9 Mon Sep 17 00:00:00 2001 From: gpveronica Date: Tue, 17 Dec 2024 17:44:10 +0100 Subject: [PATCH 07/28] wc - Add header #TASK-7220 #TASK-7100 Signed-off-by: gpveronica --- src/webcomponents/file/file-data-manager.js | 48 ++++++++++----------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/src/webcomponents/file/file-data-manager.js b/src/webcomponents/file/file-data-manager.js index 30d990e44..e7e0e81a1 100644 --- a/src/webcomponents/file/file-data-manager.js +++ b/src/webcomponents/file/file-data-manager.js @@ -681,7 +681,6 @@ debugger title: "Data File Manager", icon: "img/tools/icons/file_explorer.svg", dataList: { - showTableHeader: false, display: { float: "left" }, @@ -723,7 +722,7 @@ debugger ] }, table: { - showHeader: false, + showHeader: true, checkbox: false, checkboxIndex: 0, options: { @@ -838,7 +837,6 @@ debugger rowspan: 1, colspan: 1, formatter: value => { - debugger return `
${UtilsNew.dateFormatter(value)}
@@ -853,28 +851,28 @@ debugger colspan: 1, formatter: () => { return ` - + From 1a7ad50cb7e791aeb6e52d872afd60748c5770c9 Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 14:03:49 +0100 Subject: [PATCH 20/28] iva-app: Remove analysis tools configuration from iva config #TASK-7216 #TASK-7100 --- src/sites/iva/conf/config.js | 228 ----------------------------------- 1 file changed, 228 deletions(-) diff --git a/src/sites/iva/conf/config.js b/src/sites/iva/conf/config.js index 41db3e36d..48f5a0bfe 100644 --- a/src/sites/iva/conf/config.js +++ b/src/sites/iva/conf/config.js @@ -188,234 +188,6 @@ const CATALOG_NAVBAR_MENU = { ] }; -const ANALYSIS_TOOLS = { - id: "analysis", - name: "Analysis Tools", - description: "", - menu: [ - { - name: "Analysis Execution", - visibility: "public", - submenu: [ - { - id: "tool-analysis", - name: "Tool Executor", - description: "", - visibility: "public" - }, - { - id: "custom-tool-builder", - name: "Custom Tool Builder", - description: "", - visibility: "public" - }, - { - id: "workflow-analysis", - name: "Workflow Executor", - description: "", - visibility: "public" - }, - ], - }, - { - name: "Summary Stats", - visibility: "public", - submenu: [ - { - id: "sample-variant-stats", - name: "Sample Variant Stats", - description: "", - visibility: "public" - }, - { - id: "cohort-variant-stats", - name: "Cohort Variant Stats", - description: "", - visibility: "public" - }, - ], - }, - { - name: "Association Analysis", - visibility: "public", - submenu: [ - { - id: "gwas", - name: "Genome-Wide Association Study (GWAS)", - description: "Study of a genome-wide set of genetic variants in different individuals to see if any variant is associated with a trait", - visibility: "public", - }, - ], - }, - { - name: "Sample Analysis", - visibility: "public", - submenu: [ - { - id: "knockout", - name: "Knockout Analysis", - description: "", - visibility: "public" - }, - { - id: "sample-eligibility", - name: "Eligibility Analysis", - description: "", - visibility: "public" - }, - ], - }, - { - name: "Individual Analysis", - visibility: "public", - submenu: [ - { - id: "inferred-sex", - name: "Sex Inference", - description: "", - visibility: "public" - }, - { - id: "individual-relatedness", - name: "Relatedness", - description: "", - visibility: "public" - }, - { - id: "mendelian-error", - name: "Mendelian Errors", - description: "", - visibility: "public" - }, - ], - }, - { - name: "Cancer Analysis", - visibility: "public", - submenu: [ - { - id: "mutational-signature", - name: "Mutational Signature", - description: "", - visibility: "public" - }, - ], - }, - { - name: "Quality Control", - visibility: "public", - submenu: [ - { - id: "sample-qc", - name: "Sample Quality Control", - description: "Calculate different genetic checks and metrics and store data in Sample Catalog", - visibility: "public" - }, - { - id: "individual-qc", - name: "Individual Quality Control", - description: "Calculate different genetic checks and metrics and store data in Individual Catalog", - visibility: "public" - }, - { - id: "family-qc", - name: "Family Quality Control", - description: "Calculate different genetic checks and metrics and store data in Family Catalog", - visibility: "public" - }, - ], - }, - { - name: "Export", - visibility: "public", - submenu: [ - { - id: "variant-export", - name: "Variant Export", - description: ` - Filter and export variants, with their annotation and sample genotypes, - from the Variant Storage to a file in multiple supported formats (vcf, json, tped, ensembl vep tab...) - for being shared or processed by an external tool. - `, - visibility: "public" - }, - { - id: "variant-stats-exporter", - name: "Variant Stats Export", - description: "Export variant stats for different cohorts", - visibility: "public" - }, - ], - }, - { - name: "External Tools", - visibility: "public", - submenu: [ - { - id: "beacon", - name: "GA4GH Beacon", - description: "Find databases that have information about specific variants.", - visibility: "public" - }, - { - id: "plink", - name: "Plink", - description: "", - visibility: "public" - }, - { - id: "gatk", - name: "GATK", - description: "", - visibility: "public" - }, - { - id: "bcftools", - name: "BCFtools", - description: "", - visibility: "public" - }, - ], - }, - { - name: "Data Management", - visibility: "public", - submenu: [ - { - id: "alignment-index", - name: "Alignment Index", - description: "Create a .bai index file.", - visibility: "public" - }, - { - id: "coverage-index", - name: "Coverage Index", - description: "Precompute coverage in a BigWig file", - visibility: "public" - }, - ], - }, - { - name: "Summary Stats", - visibility: "public", - submenu: [ - { - id: "alignment-stats", - name: "Alignment Stats", - description: "Compute BAM stats using samtools", - visibility: "public" - }, - { - id: "beacon", - name: "GA4GH Beacon", - description: "Find databases that have information about specific variants.", - visibility: "public" - }, - ], - }, - ], -}; - const SUITE = { id: "suite", name: "OpenCB Suite", From 50a8b45b5f1eaebc64d0c360f7235b8b62befa3a Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 14:20:39 +0100 Subject: [PATCH 21/28] wc: Fix border color of secondary bar #TASK-7216 #TASK-7100 --- src/webcomponents/commons/layout/layout-secondary-bar.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/webcomponents/commons/layout/layout-secondary-bar.js b/src/webcomponents/commons/layout/layout-secondary-bar.js index c668b1a61..7d432db9b 100644 --- a/src/webcomponents/commons/layout/layout-secondary-bar.js +++ b/src/webcomponents/commons/layout/layout-secondary-bar.js @@ -1,5 +1,4 @@ import {html, LitElement} from "lit"; -import {styleMap} from "lit/directives/style-map.js"; export default class LayoutSecondaryBar extends LitElement { @@ -36,12 +35,8 @@ export default class LayoutSecondaryBar extends LitElement { } render() { - const secondaryBarStyle = styleMap({ - borderColor: (this.app.color || "") + "!important", - }); - return html` -
+
${this.app.title || this.app.name || "-"} From 19df20f000e3c9871577f45e23cff88e8d6210a9 Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 14:24:08 +0100 Subject: [PATCH 22/28] iva-app: Initialize color of other apps #TASK-7216 #TASK-7100 --- src/sites/iva/conf/config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sites/iva/conf/config.js b/src/sites/iva/conf/config.js index 48f5a0bfe..1a045dff3 100644 --- a/src/sites/iva/conf/config.js +++ b/src/sites/iva/conf/config.js @@ -423,6 +423,7 @@ const SUITE = { title: "Clinical Analysis", description: "Create cases, execute clinical interpretations, and create clinical reports.", icon: "fa-stethoscope", + color: "#FA8938", logo: "img/tools/icons/interpretation_portal_white.svg", logoAlt: "img/tools/icons/interpretation_portal.svg", visibility: "public", @@ -507,6 +508,7 @@ const SUITE = { title: "Data Catalog", description: "Manage and explore your data, files, samples, individuals, and families.", icon: "fa-archive", + color: "#15D0C1", logo: "img/tools/icons/interpretation_portal_white.svg", logoAlt: "img/tools/icons/interpretation_portal.svg", visibility: "public", @@ -615,6 +617,7 @@ const SUITE = { id: "admin", name: "Admin", icon: "fa-user-cog", + color: "#9C64F7", description: "Administration tools for managing users, projects, and studies.", logo: "img/tools/icons/file_explorer_white.svg", logoAlt: "img/tools/icons/file_explorer.svg", From f98f35b1a129d7ab5de1ce988a946b030d824f09 Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 14:33:03 +0100 Subject: [PATCH 23/28] webpack: Fix getting path to custom site configuration folder #TASK-7216 #TASK-7100 --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 10361d5e7..f9c780878 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -27,7 +27,7 @@ const getCustomSitePath = (entry, folder) => { return path.join(__dirname, "custom-sites", process.env.npm_config_custom_site, "iva", folder); } // return the default path - return path.join(__dirname, "src", "sites", entry, folder); + return path.join(entry === "iva" ? process.cwd() : __dirname, "src", "sites", entry, folder); }; // Setup middlewares for development server. From 617eef725f2b6f81aef18d20781556fc2e274bb0 Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 17:39:55 +0100 Subject: [PATCH 24/28] wc: Reset spacing top in welcome page #TASK-7216 #TASK-7100 --- src/webcomponents/commons/pages/welcome-page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webcomponents/commons/pages/welcome-page.js b/src/webcomponents/commons/pages/welcome-page.js index 5631dc0a5..a6db69cf8 100644 --- a/src/webcomponents/commons/pages/welcome-page.js +++ b/src/webcomponents/commons/pages/welcome-page.js @@ -99,7 +99,7 @@ export default class WelcomePage extends LitElement { } return html` -
+
${welcomePage?.logo ? html`
From edbefa295c06ee398e481202019d2e5900c3919d Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 17:46:31 +0100 Subject: [PATCH 25/28] wc: Fix logo styles in welcome page #TASK-7216 #TASK-7100 --- .../commons/pages/welcome-page.js | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/webcomponents/commons/pages/welcome-page.js b/src/webcomponents/commons/pages/welcome-page.js index a6db69cf8..1547a4c5b 100644 --- a/src/webcomponents/commons/pages/welcome-page.js +++ b/src/webcomponents/commons/pages/welcome-page.js @@ -108,7 +108,8 @@ export default class WelcomePage extends LitElement { class="${welcomePage.display?.logoClass}" src="${welcomePage.logo}" style="${welcomePage.display?.logoStyle}" - width="${welcomePage.display?.logoWidth || "240px"}" + width="${welcomePage.display?.logoWidth ?? "240px"}" + height="${welcomePage.display?.logoHeight ?? "auto"}" />
` : nothing} @@ -149,21 +150,13 @@ export default class WelcomePage extends LitElement {
- ${welcomePage?.bottomLogo?.img ? html` -
From 20513b97e55e75256c4be2473de2361d4432ae4a Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 17:46:52 +0100 Subject: [PATCH 26/28] wc: Fix color of study dashboard button #TASK-7216 #TASK-7100 --- src/webcomponents/commons/layout/layout-sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webcomponents/commons/layout/layout-sidebar.js b/src/webcomponents/commons/layout/layout-sidebar.js index 15ca0bc64..9d03b479b 100644 --- a/src/webcomponents/commons/layout/layout-sidebar.js +++ b/src/webcomponents/commons/layout/layout-sidebar.js @@ -74,7 +74,7 @@ export default class LayoutSidebar extends LitElement {
- ${this.renderButton({id: "study-dashboard", name: "Dashboard", icon: "fa-home"})} + ${this.renderButton({id: "study-dashboard", name: "Dashboard", icon: "fa-home", color: "#191C1F"})} ${this.config?.apps?.length > 0 ? html` ${this.renderSectionSeparator("Apps")} ${this.config.apps.map(app => this.renderButton(app))} From 5a0c439020d2555b67b7053d8679fa6ad717b1b5 Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 17:47:59 +0100 Subject: [PATCH 27/28] iva-app: Remove unused fields in welcome page configuration #TASK-7216 #TASK-7100 --- src/sites/iva/conf/config.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/sites/iva/conf/config.js b/src/sites/iva/conf/config.js index 1a045dff3..f0a825c14 100644 --- a/src/sites/iva/conf/config.js +++ b/src/sites/iva/conf/config.js @@ -264,12 +264,8 @@ const SUITE = { } }, welcomePage: { - display: { - titleStyle: "text-align:center" - }, title: "OpenCB Suite", logo: "img/iva.svg", - bottomLogo: {img: "", link: "", height: ""}, content: ` Welcome to the OpenCB Suite for whole genome variant analysis. This interactive tool allows finding genes affected by deleterious variants that segregate along family pedigrees, case-controls or sporadic samples. From be6fdd46a62470445cfbbd3fc4c1238860642aac Mon Sep 17 00:00:00 2001 From: Josemi Date: Wed, 18 Dec 2024 17:58:43 +0100 Subject: [PATCH 28/28] wc: Remove unused stuff #TASK-7216 #TASK-7100 --- src/webcomponents/commons/view/test/config.js | 343 ------------------ 1 file changed, 343 deletions(-) delete mode 100644 src/webcomponents/commons/view/test/config.js diff --git a/src/webcomponents/commons/view/test/config.js b/src/webcomponents/commons/view/test/config.js deleted file mode 100644 index 9ea08cba2..000000000 --- a/src/webcomponents/commons/view/test/config.js +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Copyright 2015-2016 OpenCB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {html} from "lit-html"; - -const individual = { - title: "Summary", - icon: "", - display: { - collapsable: true, - showTitle: false, - labelWidth: 2, - labelAlign: "left", - defaultValue: "-" - }, - sections: [ - { - title: "Two columns", - collapsed: false, - display: { - // style: "border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ddd", - leftColumnWith: 4, - columnSeparatorStyle: "border-right: 1px solid red" - }, - elements: [ - [ - { - name: "Name", - field: "name", - // type: "basic" (optional) - }, - { - name: "Name", - field: "namelkjsaljksajksa", - }, - { - name: "Father", - field: "father.id", - type: "basic", - display: { - format: { - style: "color: red" - } - } - }, - ], - [ - { - name: "Name", - field: "name", - // type: "basic" (optional) - }, - { - name: "Name", - field: "namelkjsaljksajksa", - }, - { - name: "Father", - field: "father.id", - type: "basic", - display: { - format: { - style: "color: red" - } - } - }, - ] - ] - }, - { - title: "General", - collapsed: false, - display: { - // style: "border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #ddd" - }, - elements: [ - // available types: basic (optional/default), complex, list (horizontal and vertical), table, plot, custom - { - name: "Individual ID", - type: "complex", - display: { - template: "${id} (UUID ${uuid} - Undefined ${uuuuuuid})", - format: { - uuid: { - style: "color: red" - } - }, - defaultValue: "NA" - } - }, - { - name: "Name", - field: "name", - // type: "basic" (optional) - }, - { - name: "Name", - field: "namelkjsaljksajksa", - }, - { - name: "Father", - field: "father.id", - type: "basic", - display: { - format: { - style: "color: red" - } - } - }, - { - name: "Mother of ${id}", - field: "mother.id", - type: "basic" - }, - { - name: "Sex (Karyotypic Sex)", - type: "complex", - display: { - template: "${sex} (${karyotypicSex})", - } - }, - { - name: "Sex (Karyotypic Sex)", - type: "custom", - // without the field "field" the param of render is data the whole config - display: { - render: data => { - return html`${data.sex} (${data.karyotypicSex})`; - }, - } - }, - { - type: "separator", - display: { - style: "width: 90%; border-width: 2px" - } - }, - { - name: "Phenotypes", - field: "phenotypes", - type: "list", - display: { - template: "${name} (${id})", - contentLayout: "horizontal", - separator: ", " - } - }, - { - name: "Phenotypes", - field: "phenotypes", - type: "list", - display: { - template: "${name} (${id})", - contentLayout: "vertical", - bullets: false, - format: { - id: { - link: "https://hpo.jax.org/app/browse/term/ID", - }, - name: { - style: "font-weight: bold" - } - }, - } - }, - { - name: "Phenotypes", - field: "phenotypes", - type: "list", - display: { - layout: "horizontal", - template: "${name} (${id})", - contentLayout: "bullets", - format: { - id: { - link: "https://hpo.jax.org/app/browse/term/ID", - }, - name: { - style: "font-weight: bold" - } - }, - defaultValue: "N/A" - } - }, - { - name: "Phenotypes", - field: "phenotypes", - type: "list", - display: { - layout: "vertical", - template: "${name} (${id})", - contentLayout: "bullets", - format: { - id: { - link: "https://hpo.jax.org/app/browse/term/ID", - }, - name: { - style: "font-weight: bold" - } - }, - defaultValue: "N/A" - } - }, - { - name: "Phenotypes", - field: "phenotypes", - type: "table", - display: { - columns: [ - { - name: "ID", field: "id", format: { - link: "https://hpo.jax.org/app/browse/term/ID", - } - }, - { - name: "Name", field: "name" - }, - { - name: "Source", field: "source" - }, - { - name: "Undefined Filed", field: "uf", defaultValue: "N/A", format: { - style: "font-weight: bold" - } - } - ], - defaultValue: "Empty array found", - border: true - } - }, - { - name: "Phenotypess", - field: "phenotypess", - type: "table", - display: { - columns: [ - { - name: "ID", field: "id", format: { - link: "https://hpo.jax.org/app/browse/term/ID", - style: "color: red" - } - }, - { - name: "Name", field: "name" - }, - { - name: "Source", field: "source" - }, - { - name: "Undefined Filed", field: "uf", defaultValue: "N/A", format: { - style: "font-weight: bold" - } - } - ], - defaultValue: "Emtpy array found", - border: true - } - }, - { - name: "Phenotypes", - field: "phenotypes", - type: "table", - display: { - layout: "vertical", - columns: [ - { - name: "ID", field: "id", format: { - link: "https://hpo.jax.org/app/browse/term/ID", - style: "color: red" - } - }, - { - name: "Name", field: "name" - }, - { - name: "Source", field: "source" - }, - { - name: "Undefined Filed", field: "uf", defaultValue: "N/A", format: { - style: "font-weight: bold" - } - } - ], - border: true - } - }, - { - name: "plotExample from Object", - field: "plotExample", - type: "plot", - display: { - chart: "column", - } - }, - { - name: "plotExample from Array", - field: "plotExampleArray", - type: "plot", - display: { - data: { - key: "id", - value: "total" - }, - chart: "column", - } - }, - { - name: "Phenotypes", - field: "phenotypes", - type: "custom", - display: { - render: data => { - return html`
${JSON.stringify(data, null, 2)}
- `; - } - } - }, - { - name: "Chart", - // field: "phenotypes", - data: {"INSERTION": 1, "SNV": 165398, "DELETION": 1, "INDEL": 7218}, - type: "plot", - display: { - chart: "column", - } - }, - ] - }, - ] -};