diff --git a/src/sites/iva/conf/config.js b/src/sites/iva/conf/config.js index 70c361b35..520e09929 100644 --- a/src/sites/iva/conf/config.js +++ b/src/sites/iva/conf/config.js @@ -589,14 +589,9 @@ const 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. -

-
-
`, + 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. + `, }, aboutPage: { display: { @@ -655,6 +650,7 @@ const SUITE = { id: "research", name: "Research", // Short name of the app. This is the name that will be displayed in the sidebar title: "Research Environment", + description: "Explore variants in real-time and execute analysis and tools.", icon: "fa-flask", logo: "img/tools/icons/variant_browser_white.svg", logoAlt: "img/tools/icons/variant_browser.svg", @@ -662,109 +658,84 @@ const SUITE = { welcomePage: { display: { logoWidth: "100px", - titleStyle: "text-align:center;", - subtitleStyle: "text-align:center;" }, title: "Research Environment", - subtitle: "Explore variants in real-time and execute analysis and tools", - // logo: "img/Zetta_logo.png", - logo: "img/tools/icons/variant_browser.svg", + subtitle: "Explore variants in real-time and execute analysis.", content: ` -

- Welcome to the OpenCB Variant Analysis application.
- This interactive tool allows browse and run variant analysis. -

+ Variant Research Environment App implements different tools to focus on the analysis and interpretation of genomic variants + to understand their role in diseases, traits, and biological processes. It involves the use of our aggregated variant database, + bioinformatics tools, workflows, notebooks, and computational methods to identify, classify, and study variants for personalized medicine and genetic research. `, - links: [ - { - title: "Documentation", url: "http://docs.opencb.org/display/iva" - }, - ] + // links: [ + // { + // title: "Documentation", url: "http://docs.opencb.org/display/iva" + // }, + // ] }, menu: [ { id: "variant-browser", name: "Variant Browser", - icon: "img/tools/icons/variant_browser.svg", + icon: "fa-dna", visibility: "public", featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, + description: "Explore our high-performance and scalable aggregated variant database in real-time.", }, { id: "analysis-tools", - name: "Tools", - icon: "img/tools/icons/variant_browser.svg", + name: "Analysis Tools", + icon: "fa-tools", visibility: "public", featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, + description: "Execute analysis tools using data of the current study.", }, { id: "workflow-manager", name: "Workflow Manager", - icon: "img/tools/icons/variant_browser.svg", + icon: "fa-stream", visibility: "public", featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, + description: "Build, import and execute NextFlow workflows.", + }, + { + id: "tool-analysis", + name: "Custom Tool", + icon: "fa-rocket", + visibility: "public", + featured: true, + description: "Execute your own custom tools easily in the cloud.", }, { id: "jupyter-notebook", name: "Jupyter Notebooks", - icon: "img/tools/icons/variant_browser.svg", + icon: "fa-book", visibility: "public", featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, + description: "Create, share and execute Jupyter Notebooks with Python.", }, { id: "my-analysis", name: "My Analysis", - icon: "img/tools/icons/variant_browser.svg", + icon: "fa-cog", visibility: "public", featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, + description: "Explore and manage all your exceuted analysis.", + }, + { + id: "cohort-browser", + name: "Cohort Manager", + icon: "fa-search", + visibility: "public", + featured: true, + description: "Explore and manage all cohorts in the current study.", }, { id: "file-data-manager", name: "Data Manager", - icon: "img/tools/icons/variant_browser.svg", + icon: "fa-folder", visibility: "public", featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, + description: "Manage your data in the cloud", }, ], // fileExplorer: { @@ -782,32 +753,30 @@ const SUITE = { id: "clinical", name: "Clinical", title: "Clinical Analysis", + description: "Create cases, execute clinical interpretations, and create clinical reports.", icon: "fa-stethoscope", logo: "img/tools/icons/interpretation_portal_white.svg", logoAlt: "img/tools/icons/interpretation_portal.svg", visibility: "public", welcomePage: { title: "Clinical Analysis", - display: { - titleStyle: "text-align:center;", - subtitleStyle: "text-align:center;", - logoWidth: "100px", - }, - subtitle: "Interactive Case Interpreter", - // logo: "img/Zetta_logo.png", - logo: "img/tools/icons/interpretation_portal.svg", + // display: { + // titleStyle: "text-align:center;", + // subtitleStyle: "text-align:center;", + // logoWidth: "100px", + // }, + // subtitle: "Interactive Case Interpreter", content: ` -

- Welcome to the OpenCB Clinical Analysis Application -
- This app allows clinicians to create cases, execute clinical interpretations and create clinical reports. -

` + Welcome to the OpenCB Clinical Analysis Application. + This app allows clinicians to create cases, execute clinical interpretations and create clinical reports. + `, }, menu: [ { id: "clinical-analysis-portal", name: "Case Interpreter Portal", - icon: "img/tools/icons/interpretation_portal.svg", + // icon: "img/tools/icons/interpretation_portal.svg", + icon: "fa-file-medical", visibility: "public", featured: true, description: ` @@ -822,7 +791,8 @@ const SUITE = { { id: "disease-panel-browser", name: "Disease Panels", - icon: "img/tools/icons/interpretation_portal.svg", + // icon: "img/tools/icons/interpretation_portal.svg", + icon: "fa-th-list", visibility: "public", featured: true, description: ` @@ -837,7 +807,8 @@ const SUITE = { { id: "cvdb-browser", name: "Clinical Variant DB", - icon: "img/tools/icons/interpretation_portal.svg", + // icon: "img/tools/icons/interpretation_portal.svg", + icon: "fa-database", visibility: "public", featured: true, description: ` @@ -852,7 +823,8 @@ const SUITE = { { id: "clinical-configuration", name: "Configuration", - icon: "img/tools/icons/interpretation_portal.svg", + // icon: "img/tools/icons/interpretation_portal.svg", + icon: "fa-cog", visibility: "public", featured: true, description: ` @@ -880,55 +852,74 @@ const SUITE = { id: "catalog", name: "Catalog", title: "Data Catalog", + description: "Manage and explore your data, files, samples, individuals, and families.", icon: "fa-archive", logo: "img/tools/icons/interpretation_portal_white.svg", logoAlt: "img/tools/icons/interpretation_portal.svg", visibility: "public", welcomePage: { title: "Data Catalog", - display: { - titleStyle: "text-align:center;", - subtitleStyle: "text-align:center;", - logoWidth: "100px", - }, + // display: { + // titleStyle: "text-align:center;", + // subtitleStyle: "text-align:center;", + // logoWidth: "100px", + // }, subtitle: "", // logo: "img/Zetta_logo.png", - logo: "img/tools/icons/interpretation_portal.svg", + // logo: "img/tools/icons/interpretation_portal.svg", content: ` -

- Welcome to the Data Catalog Application -
- This app allows clinicians to create cases, execute clinical interpretations and create clinical reports. -

` + Welcome to the Data Catalog Application. + This app allows clinicians to create cases, execute clinical interpretations and create clinical reports. + `, }, menu: [ { id: "sample-browser", - name: "Sample and Individual", - icon: "img/tools/icons/variant_browser.svg", + name: "Sample Browser", + icon: "fa-vial", visibility: "public", featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, + description: "Explore and manage all samples in the current study.", }, { - id: "individual-browsers", - name: "Browsers", - icon: "img/tools/icons/variant_browser.svg", + id: "individual-browser", + name: "Individual Browser", + icon: "fa-user", visibility: "public", featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, + description: "Explore and manage all individuals in the current study.", + }, + { + id: "family-browser", + name: "Family Browser", + icon: "fa-users", + visibility: "public", + featured: true, + description: "Explore and manage all families in the current study.", + }, + { + id: "file-browser", + name: "File Browser", + icon: "fa-file", + visibility: "public", + featured: true, + description: "Explore and manage all files in the current study.", + }, + { + id: "note-browser", + name: "Note Browser", + icon: "fa-sticky-note", + visibility: "public", + featured: true, + description: "Explore and manage all notes in the current study.", + }, + { + id: "job-browser", + name: "Job Browser", + icon: "fa-rocket", + visibility: "public", + featured: true, + description: "Explore and manage all jobs in the current study.", }, // { // id: "workflow-manager", @@ -944,34 +935,34 @@ const SUITE = { // // `, // }, - { - id: "cohort-browser", - name: "Cohort Builder", - icon: "img/tools/icons/variant_browser.svg", - visibility: "public", - featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, - }, - { - id: "variable-set-browser", - name: "Custom Annotations", - icon: "img/tools/icons/variant_browser.svg", - visibility: "public", - featured: true, - description: ` -

Explore all variants identified by the current study.

- - `, - }, + // { + // id: "cohort-browser", + // name: "Cohort Builder", + // icon: "img/tools/icons/variant_browser.svg", + // visibility: "public", + // featured: true, + // description: ` + //

Explore all variants identified by the current study.

+ // + // `, + // }, + // { + // id: "variable-set-browser", + // name: "Custom Annotations", + // icon: "img/tools/icons/variant_browser.svg", + // visibility: "public", + // featured: true, + // description: ` + //

Explore all variants identified by the current study.

+ // + // `, + // }, ], // fileExplorer: { // visibility: "private" @@ -988,6 +979,7 @@ const SUITE = { id: "admin", name: "Admin", icon: "fa-user-cog", + description: "Administration tools for managing users, projects, and studies.", logo: "img/tools/icons/file_explorer_white.svg", logoAlt: "img/tools/icons/file_explorer.svg", visibility: "public", diff --git a/src/sites/iva/iva-app.js b/src/sites/iva/iva-app.js index 6bdb21132..231cbf603 100644 --- a/src/sites/iva/iva-app.js +++ b/src/sites/iva/iva-app.js @@ -63,6 +63,7 @@ import "../../webcomponents/clinical/clinical-analysis-create.js"; import "../../webcomponents/file/file-manager.js"; import "../../webcomponents/file/file-data-manager.js"; import "../../webcomponents/job/job-monitor.js"; +import "../../webcomponents/job/analysis/tool-analysis.js"; import "../../webcomponents/loading-spinner.js"; import "../../webcomponents/organization/admin/organization-admin.js"; import "../../webcomponents/project/projects-admin.js"; @@ -70,6 +71,7 @@ import "../../webcomponents/study/admin/study-admin.js"; import "../../webcomponents/study/admin/study-admin-iva.js"; import "../../webcomponents/study/admin/catalog-admin.js"; import "../../webcomponents/study/admin/variant/operations-admin.js"; +import "../../webcomponents/study/study-dashboard.js"; import "../../webcomponents/user/user-profile.js"; import "../../webcomponents/api/rest-api.js"; import "../../webcomponents/note/note-browser.js"; @@ -88,6 +90,8 @@ import "../../webcomponents/commons/layout/layout-primary-bar.js"; import "../../webcomponents/commons/layout/layout-secondary-bar.js"; import "../../webcomponents/commons/layout/layout-sidebar.js"; +import "../../webcomponents/commons/pages/welcome-page.js"; + import "../../webcomponents/clinical/rga/rga-browser.js"; import OpencgaCatalogUtils from "../../core/clients/opencga/opencga-catalog-utils"; @@ -932,14 +936,11 @@ class IvaApp extends LitElement { switch (this.tool) { case "home": content = html` -
- - -
+ + `; break; case "dahsboard": @@ -1607,6 +1608,14 @@ class IvaApp extends LitElement { `; break; + case "tool-analysis": + content = html` + + + `; + break; case "jupyter-notebook": content = html` `; break; + case "study-dashboard": + content = html` + + + `; + break; default: // TODO: check for extensions // ExtensionsManager.getTools().map(tool => html` diff --git a/src/webcomponents/commons/analysis/jupyter-notebook.js b/src/webcomponents/commons/analysis/jupyter-notebook.js index a0f6b813e..fc7de9d34 100644 --- a/src/webcomponents/commons/analysis/jupyter-notebook.js +++ b/src/webcomponents/commons/analysis/jupyter-notebook.js @@ -88,15 +88,14 @@ export default class JupyterNotebook extends LitElement { const token = this.opencgaSession.token; debugger return html` -
- -
- -
- - +
+

Jupyter Notebook

+
+ + +
`; } diff --git a/src/webcomponents/commons/layout/layout-sidebar.js b/src/webcomponents/commons/layout/layout-sidebar.js index e04ee5534..1cef5c304 100644 --- a/src/webcomponents/commons/layout/layout-sidebar.js +++ b/src/webcomponents/commons/layout/layout-sidebar.js @@ -64,7 +64,7 @@ export default class LayoutSidebar extends LitElement {
- ${this.renderButton({id: "dashboard", name: "Dashboard", icon: "fa-home"})} + ${this.renderButton({id: "study-dashboard", name: "Dashboard", icon: "fa-home"})} ${this.config?.apps?.length > 0 ? html` ${this.renderSectionSeparator("Apps")} ${this.config.apps.map(app => this.renderButton(app))} diff --git a/src/webcomponents/commons/pages/welcome-page.js b/src/webcomponents/commons/pages/welcome-page.js new file mode 100644 index 000000000..91ad345f7 --- /dev/null +++ b/src/webcomponents/commons/pages/welcome-page.js @@ -0,0 +1,170 @@ +import {LitElement, html, nothing} from "lit"; +import UtilsNew from "../../../core/utils-new.js"; +import {guardPage} from "../html-utils.js"; + +export default class WelcomePage extends LitElement { + + createRenderRoot() { + return this; + } + + static get properties() { + return { + app: { + type: Object + }, + opencgaSession: { + type: Object + }, + config: { + type: Object + } + }; + } + + renderApplications() { + const visibleApps = (this.config.apps || []).filter(app => { + return UtilsNew.isAppVisible(app, this.opencgaSession); + }); + + return html` +
+ ${visibleApps.map(item => html` +
+
+
+
+ +
+
+
${item.title || item.name}
+ ${item.description ? html` +
+ ${item.description} +
+ ` : nothing} + +
+
+ `)} +
+ `; + } + + renderTools() { + const visibleTools = (this.app.menu || []).filter(item => { + return UtilsNew.isAppVisible(item, this.opencgaSession); + }); + + return html` +
+ ${visibleTools.map(item => html` +
+
+
+ +
+
+
${item.title || item.name}
+ ${item.description ? html` +
+ ${UtilsNew.renderHTML(item.description)} +
+ ` : nothing} + + Enter ${item.name || item.title} + +
+ `)} +
+ `; + } + + render() { + // this checks if we are in the suite (global welcome) or in a specific app (app welcome) + const isWelcomeSuite = !this.app || this.app?.id === "suite"; + const welcomePage = isWelcomeSuite ? this.config.welcomePage : this.app.welcomePage; // get the welcome page config + + if (!UtilsNew.isNotEmptyArray(this.opencgaSession?.projects) || + this.opencgaSession.projects.every(p => !UtilsNew.isNotEmptyArray(p.studies))) { + return guardPage("You don't have projects or/and studies. Please contact the admin"); + } + + return html` +
+ + ${welcomePage?.logo ? html` +
+ ${welcomePage.display?.logoAlt || +
+ ` : nothing} + + + ${welcomePage?.title ? html` +
+
+ ${welcomePage.appLogo?.img ? html` + + ` : nothing} +
+ ${welcomePage.title} +
+
+ ${welcomePage?.subtitle ? html` +
+ ${welcomePage.subtitle} +
+ ` : nothing} +
+ `: nothing} + + + ${welcomePage?.content ? html` +
+
+ ${UtilsNew.renderHTML(welcomePage.content)} +
+
+ ` : nothing} + + +
+ ${isWelcomeSuite ? this.renderApplications() : this.renderTools()} +
+ + + ${welcomePage?.bottomLogo?.img ? html` + + ` : nothing} +
+ `; + } + +} + +customElements.define("welcome-page", WelcomePage); diff --git a/src/webcomponents/study/study-dashboard.js b/src/webcomponents/study/study-dashboard.js new file mode 100644 index 000000000..165cd92a3 --- /dev/null +++ b/src/webcomponents/study/study-dashboard.js @@ -0,0 +1,37 @@ +import {LitElement, html, nothing} from "lit"; +import UtilsNew from "../../core/utils-new.js"; + +export default class StudyDasboard extends LitElement { + + createRenderRoot() { + return this; + } + + static get properties() { + return { + app: { + type: Object + }, + opencgaSession: { + type: Object + }, + config: { + type: Object + } + }; + } + + render() { + return html` +
+

Fake Dashboard. Work in progress

+
+ +
+
+ `; + } + +} + +customElements.define("study-dashboard", StudyDasboard);