diff --git a/src/core/utils-new.js b/src/core/utils-new.js index 2da8eda7a..fcc9b51ac 100644 --- a/src/core/utils-new.js +++ b/src/core/utils-new.js @@ -304,32 +304,10 @@ export default class UtilsNew { return document.createRange().createContextualFragment(`${html}`); } - static jobStatusFormatter(status, appendDescription = false) { - const description = appendDescription && status.description ? `
${status.description}` : ""; - // FIXME remove this backward-compatibility check in next v2.3 - const statusId = status.id || status.name; - switch (statusId) { - case "PENDING": - case "QUEUED": - return ` ${statusId}${description}`; - case "RUNNING": - return ` ${statusId}${description}`; - case "DONE": - return ` ${statusId}${description}`; - case "ERROR": - return ` ${statusId}${description}`; - case "UNKNOWN": - return ` ${statusId}${description}`; - case "ABORTED": - return ` ${statusId}${description}`; - case "DELETED": - return ` ${statusId}${description}`; - } - return "-"; - } - // Capitalizes the first letter of a string and lowercase the rest. - static capitalize = ([first, ...rest]) => first.toUpperCase() + rest.join("").toLowerCase(); + static capitalize([first, ...rest]) { + return first.toUpperCase() + rest.join("").toLowerCase(); + } /* * This function creates a table (rows and columns) a given Object or array of Objects using the fields provided. diff --git a/src/webcomponents/clinical/analysis/rd-tiering-analysis.js b/src/webcomponents/clinical/analysis/rd-tiering-analysis.js index c92ee9adb..4ac8966af 100644 --- a/src/webcomponents/clinical/analysis/rd-tiering-analysis.js +++ b/src/webcomponents/clinical/analysis/rd-tiering-analysis.js @@ -20,7 +20,6 @@ import UtilsNew from "../../../core/utils-new.js"; import "../../commons/forms/data-form.js"; import "../../commons/filters/catalog-search-autocomplete.js"; - export default class RdTieringAnalysis extends LitElement { constructor() { @@ -161,7 +160,7 @@ export default class RdTieringAnalysis extends LitElement { display: { render: (panels, dataFormFilterChange) => { // Get whether disease panels can be modified or are fixed - const casePanelLock = !!this.clinicalAnalysis; + const casePanelLock = !!this.clinicalAnalysis?.panelLocked; // Get the list of disease panels for the dropdown let diseasePanels = []; if (casePanelLock) { diff --git a/src/webcomponents/clinical/clinical-analysis-create.js b/src/webcomponents/clinical/clinical-analysis-create.js index 843e9b53d..38dd40ad9 100644 --- a/src/webcomponents/clinical/clinical-analysis-create.js +++ b/src/webcomponents/clinical/clinical-analysis-create.js @@ -108,7 +108,7 @@ export default class ClinicalAnalysisCreate extends LitElement { // id: this.opencgaSession?.user?.id // }, comments: [], - panelLock: false, + panelLocked: false, samples: [], }; } @@ -506,7 +506,7 @@ export default class ClinicalAnalysisCreate extends LitElement { }, { title: "Disease Panel Lock", - field: "panelLock", + field: "panelLocked", type: "toggle-switch", display: { helpMessage: "You must select at least one of the Clinical Analysis panels to enable Disease Panel Lock.", @@ -530,7 +530,7 @@ export default class ClinicalAnalysisCreate extends LitElement { return html` diff --git a/src/webcomponents/clinical/clinical-analysis-grid.js b/src/webcomponents/clinical/clinical-analysis-grid.js index d178f2bc6..64c721d31 100644 --- a/src/webcomponents/clinical/clinical-analysis-grid.js +++ b/src/webcomponents/clinical/clinical-analysis-grid.js @@ -362,9 +362,7 @@ export default class ClinicalAnalysisGrid extends LitElement { } statusFormatter(value, row) { - // TODO remove this code as soon as new OpenCGA configuration is in place - const _status = this.opencgaSession.study?.internal?.configuration?.clinical?.status || []; - + const status = this.opencgaSession.study?.internal?.configuration?.clinical?.status || []; const hasWriteAccess = OpencgaCatalogUtils.checkPermissions(this.opencgaSession.study, this.opencgaSession.user.id, "WRITE_CLINICAL_ANALYSIS"); const isEditable = !this._config.readOnlyMode && hasWriteAccess && !row.locked; // status is editable @@ -382,7 +380,7 @@ export default class ClinicalAnalysisGrid extends LitElement { ${isEditable ? `