From 4252f57e058eb667139b1794fdac3ecb9f6e5ec0 Mon Sep 17 00:00:00 2001 From: gpveronica Date: Tue, 9 Jan 2024 19:26:00 +0100 Subject: [PATCH] wc - Updated interpreter browser and grid for merging allowed settings per browser Signed-off-by: gpveronica --- .../variant-interpreter-browser-template.js | 8 ++------ .../variant-interpreter-grid.js | 15 ++++++++++----- .../variant-interpreter-rearrangement-grid.js | 19 ++++++++++++++----- .../interpretation/variant-interpreter.js | 2 +- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/webcomponents/variant/interpretation/variant-interpreter-browser-template.js b/src/webcomponents/variant/interpretation/variant-interpreter-browser-template.js index a6812dc775..07ae779e01 100644 --- a/src/webcomponents/variant/interpretation/variant-interpreter-browser-template.js +++ b/src/webcomponents/variant/interpretation/variant-interpreter-browser-template.js @@ -147,13 +147,9 @@ class VariantInterpreterBrowserTemplate extends LitElement { this._config.filter = UtilsNew.mergeFiltersAndDetails(this._config?.filter, this.settings); } + // BROWSER: Admin browser configuration merged with internal default configuration. if (this.settings?.table) { - const {toolbar, ...otherTableProps} = this.settings.table; - UtilsNew.setObjectValue(this._config, "filter.result.grid", { - ...this._config.filter.result.grid, - ...otherTableProps, - ...toolbar, - }); + UtilsNew.mergeTableSettings(this._config, this.settings, "INTERPRETER", this.toolId, this.opencgaSession); } // Apply User grid configuration. Only 'pageSize', 'columns', 'geneSet', 'consequenceType' and 'populationFrequenciesConfig' are set diff --git a/src/webcomponents/variant/interpretation/variant-interpreter-grid.js b/src/webcomponents/variant/interpretation/variant-interpreter-grid.js index 20a396242f..e6277b0867 100644 --- a/src/webcomponents/variant/interpretation/variant-interpreter-grid.js +++ b/src/webcomponents/variant/interpretation/variant-interpreter-grid.js @@ -174,8 +174,11 @@ export default class VariantInterpreterGrid extends LitElement { }; this.gridCommons = new GridCommons(this.gridId, this, this._config); + // Settings for the grid toolbar + const {toolbar, ...otherTableProps} = this._config; this.toolbarSetting = { - ...this._config, + ...otherTableProps, + ...toolbar, showCreate: false, // columns: defaultColumns[0].filter(col => col.rowspan === 2 && col.colspan === 1 && col.visible !== false), // gridColumns: defaultColumns, // original column structure @@ -1532,10 +1535,12 @@ export default class VariantInterpreterGrid extends LitElement { showToolbar: true, showActions: true, - showCreate: false, - showExport: true, - showSettings: true, - exportTabs: ["download", "export", "link", "code"], // this is customisable in external settings in `table.toolbar` + toolbar: { + showCreate: false, + showSettings: true, + showExport: true, + exportTabs: ["download", "export", "link", "code"] + }, hideType: false, hidePopulationFrequencies: false, diff --git a/src/webcomponents/variant/interpretation/variant-interpreter-rearrangement-grid.js b/src/webcomponents/variant/interpretation/variant-interpreter-rearrangement-grid.js index ac0c21b611..31399e9a43 100644 --- a/src/webcomponents/variant/interpretation/variant-interpreter-rearrangement-grid.js +++ b/src/webcomponents/variant/interpretation/variant-interpreter-rearrangement-grid.js @@ -125,15 +125,18 @@ export default class VariantInterpreterRearrangementGrid extends LitElement { }; this.gridCommons = new GridCommons(this.gridId, this, this._config); + // Settings for the grid toolbar + const {toolbar, ...otherTableProps} = this._config; this.toolbarSetting = { - ...this._config, + ...otherTableProps, + ...toolbar, }; this.toolbarConfig = { toolId: this.toolId, resource: "CLINICAL_VARIANT", showInterpreterConfig: true, - columns: this._getDefaultColumns() + columns: this._getDefaultColumns(), }; this.requestUpdate(); this.renderVariants(); @@ -738,7 +741,10 @@ export default class VariantInterpreterRearrangementGrid extends LitElement { NotificationUtils.dispatch(this, NotificationUtils.NOTIFY_RESPONSE, response); }) .finally(() => { - this.toolbarConfig = {...this.toolbarConfig, downloading: false}; + this.toolbarConfig = { + ...this.toolbarConfig, + downloading: false, + }; this.requestUpdate(); }); } @@ -939,13 +945,16 @@ export default class VariantInterpreterRearrangementGrid extends LitElement { pagination: true, pageSize: 10, pageList: [5, 10, 25], - showExport: true, - showSettings: true, showReview: true, showEditReview: true, showSelectCheckbox: false, showActions: false, + toolbar: { + showExport: true, + showSettings: true, + }, + alleleStringLengthMax: 50, // genotype: { diff --git a/src/webcomponents/variant/interpretation/variant-interpreter.js b/src/webcomponents/variant/interpretation/variant-interpreter.js index 8e8ce7163b..641347e4ab 100644 --- a/src/webcomponents/variant/interpretation/variant-interpreter.js +++ b/src/webcomponents/variant/interpretation/variant-interpreter.js @@ -401,7 +401,7 @@ class VariantInterpreter extends LitElement { ${this.clinicalAnalysis.interpretation?.method?.name ? html`
- ${this.clinicalAnalysis.interpretation.method.name} + ${this.clinicalAnalysis.interpretation.method.name}
` : null}