Skip to content

Commit

Permalink
wc - Fixed catalog and variant browser export config
Browse files Browse the repository at this point in the history
  • Loading branch information
gpveronica committed Nov 17, 2023
1 parent 157b13c commit c2e1047
Show file tree
Hide file tree
Showing 18 changed files with 175 additions and 161 deletions.
30 changes: 16 additions & 14 deletions src/webcomponents/clinical/clinical-analysis-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default class ClinicalAnalysisGrid extends LitElement {
this.toolbarSetting = {
...this._config,
newButtonLink: "#clinical-analysis-create/",
showCreate: true,
// columns: this._getDefaultColumns().filter(col => col.field && (!col.visible || col.visible === true))
};

Expand Down Expand Up @@ -878,7 +877,6 @@ export default class ClinicalAnalysisGrid extends LitElement {
`;
}
})}
`;
}

Expand All @@ -888,23 +886,27 @@ export default class ClinicalAnalysisGrid extends LitElement {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showToolbar: true,
showCreate: true,
showExport: false,
showReviewCase: true,
showInterpretation: true,
showReport: true,
showSettings: true,
showActions: true,
detailView: false,
// detailFormatter: this.detailFormatter, // function with the detail formatter
showSelectCheckbox: false,
multiSelection: false,
detailView: false,
// detailFormatter: this.detailFormatter
header: {
horizontalAlign: "center",
verticalAlign: "bottom"
},
// It comes from external settings, and it is used in _getDefaultColumns()
// columns: []

showToolbar: true,
showActions: true,

showCreate: true,
showExport: true,
showSettings: true,
exportTabs: ["download", "link", "code"],
highlights: [],

showReviewCase: true,
showInterpretation: true,
showReport: true,
};
}

Expand Down
8 changes: 3 additions & 5 deletions src/webcomponents/clinical/clinical-analysis-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ export default class ClinicalAnalysisGroup extends LitElement {
this._config = {
...this.getDefaultConfig(),
...this.config,
toolbar: {
...(this.config.toolbar || {}),
showCreate: false, // Hide create button in each grid
},
showCreate: false, // Caution: force create false independently of admin/default decision.
};

this.updateGroups();
Expand Down Expand Up @@ -125,7 +122,7 @@ export default class ClinicalAnalysisGroup extends LitElement {
return html`
<div>
<div style="display:flex;">
${this.config?.toolbar?.showCreate ? html`
${this.config?.showCreate ? html`
<a type="button" href="#clinical-analysis-create/" class="btn btn-default btn-sm text-black">
<i class="fas fa-columns icon-padding"></i>
<span>New</span>
Expand Down Expand Up @@ -163,6 +160,7 @@ export default class ClinicalAnalysisGroup extends LitElement {
getDefaultConfig() {
return {
showToolbar: false,
showCreate: false,
groups: [
{
id: "analyst",
Expand Down
18 changes: 9 additions & 9 deletions src/webcomponents/cohort/cohort-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ export default class CohortBrowser extends LitElement {
this._config.filter = UtilsNew.mergeFiltersAndDetails(this._config?.filter, this.settings);
}

UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config?.filter?.result.grid,
...this.settings.table
});

UtilsNew.setObjectValue(this._config, "filter.result.grid.toolbar", {
...this._config.filter?.result?.grid?.toolbar,
...this.settings.table?.toolbar
});
// Grid configuration and take out toolbar admin/user settings to grid level.
if (this.settings?.table) {
const {toolbar, ...otherTableProps} = this.settings.table;
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config.filter.result.grid,
...otherTableProps,
...toolbar,
});
}

// Apply User grid configuration. Only 'pageSize' and 'columns' are set
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
Expand Down
18 changes: 10 additions & 8 deletions src/webcomponents/cohort/cohort-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,20 +469,22 @@ export default class CohortGrid extends LitElement {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showToolbar: true,
showCreate: true,
showExport: true,
showSettings: true,
showActions: true,
multiSelection: false,
showSelectCheckbox: false,
detailView: false,
detailFormatter: null, // function with the detail formatter
multiSelection: false,
header: {
horizontalAlign: "center",
verticalAlign: "bottom"
},
// It comes from external settings, and it is used in _getDefaultColumns()
// columns: []

showToolbar: true,
showActions: true,

showCreate: true,
showExport: true,
showSettings: true,
exportTabs: ["download", "link", "code"],
};
}

Expand Down
10 changes: 6 additions & 4 deletions src/webcomponents/commons/opencb-grid-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ export default class OpencbGridToolbar extends LitElement {
if (changedProperties.has("settings")) {
this._settings = {
...this.getDefaultSettings(),
...this.settings};
...this.settings,
};
}

if (changedProperties.has("config")) {
this._config = {
...this.getDefaultConfig(),
...this.config
...this.config,
};
}

Expand Down Expand Up @@ -185,7 +186,6 @@ export default class OpencbGridToolbar extends LitElement {
</div>
` : nothing}
<!-- && this._config? !== undefined-->
${this._settings?.showSettings ? html`
<div class="btn-group">
<button data-action="settings" type="button" class="btn btn-default btn-sm" @click="${this.onActionClick}">
Expand Down Expand Up @@ -215,8 +215,10 @@ export default class OpencbGridToolbar extends LitElement {
return {
// label: "records",
showCreate: true,
showDownload: true,
showExport: true,
showSettings: true,
showDownload: false,
showColumns: false,
download: ["Tab", "JSON"],
buttons: ["columns", "download"],
};
Expand Down
18 changes: 9 additions & 9 deletions src/webcomponents/disease-panel/disease-panel-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ export default class DiseasePanelBrowser extends LitElement {
this._config.filter = UtilsNew.mergeFiltersAndDetails(this._config?.filter, this.settings);
}

UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config?.filter?.result.grid,
...this.settings?.table
});

UtilsNew.setObjectValue(this._config, "filter.result.grid.toolbar", {
...this._config.filter?.result?.grid?.toolbar,
...this.settings?.table?.toolbar
});
// Grid configuration and take out toolbar admin/user settings to grid level.
if (this.settings?.table) {
const {toolbar, ...otherTableProps} = this.settings.table;
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config.filter.result.grid,
...otherTableProps,
...toolbar,
});
}

// Apply User grid configuration. Only 'pageSize' and 'columns' are set
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
Expand Down
17 changes: 10 additions & 7 deletions src/webcomponents/disease-panel/disease-panel-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export default class DiseasePanelGrid extends LitElement {
this.gridCommons = new GridCommons(this.gridId, this, this._config);

this.toolbarSetting = {
// buttons: ["columns", "download"],
...this._config,
};

Expand Down Expand Up @@ -590,18 +589,22 @@ export default class DiseasePanelGrid extends LitElement {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showToolbar: true,
showCreate: true,
showExport: true,
showSettings: true,
showActions: true,
showSelectCheckbox: false,
multiSelection: false,
detailView: false,
detailFormatter: null, // function with the detail formatter
multiSelection: false,
header: {
horizontalAlign: "center",
verticalAlign: "bottom"
},

showToolbar: true,
showActions: true,

showCreate: true,
showExport: true,
showSettings: true,
exportTabs: ["download", "link", "code"],
};
}

Expand Down
18 changes: 9 additions & 9 deletions src/webcomponents/family/family-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ export default class FamilyBrowser extends LitElement {
this._config.filter = UtilsNew.mergeFiltersAndDetails(this._config?.filter, this.settings);
}

UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config?.filter?.result.grid,
...this.settings.table
});

UtilsNew.setObjectValue(this._config, "filter.result.grid.toolbar", {
...this._config.filter?.result?.grid?.toolbar,
...this.settings.table?.toolbar
});
// Grid configuration and take out toolbar admin/user settings to grid level.
if (this.settings?.table) {
const {toolbar, ...otherTableProps} = this.settings.table;
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config.filter.result.grid,
...otherTableProps,
...toolbar,
});
}

// Apply User grid configuration. Only 'pageSize' and 'columns' are set
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
Expand Down
20 changes: 11 additions & 9 deletions src/webcomponents/family/family-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export default class FamilyGrid extends LitElement {

// Settings for the grid toolbar
this.toolbarSetting = {
// buttons: ["columns", "download"],
...this._config,
};

Expand Down Expand Up @@ -635,19 +634,22 @@ export default class FamilyGrid extends LitElement {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showToolbar: true,
showCreate: true,
showExport: true,
showSettings: true,
showActions: true,
showSelectCheckbox: true,
detailView: true,
detailFormatter: this.detailFormatter, // function with the detail formatter
showSelectCheckbox: false,
multiSelection: false,
detailFormatter: this.detailFormatter, // function with the detail formatter
detailView: true,
header: {
horizontalAlign: "center",
verticalAlign: "bottom"
},

showToolbar: true,
showActions: true,

showCreate: true,
showExport: true,
showSettings: true,
exportTabs: ["download", "link", "code"],
};
}

Expand Down
18 changes: 9 additions & 9 deletions src/webcomponents/file/file-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ export default class FileBrowser extends LitElement {
this._config.filter = UtilsNew.mergeFiltersAndDetails(this._config?.filter, this.settings);
}

UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config?.filter?.result.grid,
...this.settings.table
});

UtilsNew.setObjectValue(this._config, "filter.result.grid.toolbar", {
...this._config.filter?.result?.grid?.toolbar,
...this.settings.table?.toolbar
});
// Grid configuration and take out toolbar admin/user settings to grid level.
if (this.settings?.table) {
const {toolbar, ...otherTableProps} = this.settings.table;
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config.filter.result.grid,
...otherTableProps,
...toolbar,
});
}

// Apply User grid configuration. Only 'pageSize' and 'columns' are set
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
Expand Down
17 changes: 10 additions & 7 deletions src/webcomponents/file/file-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export default class OpencgaFileGrid extends LitElement {

// Config for the grid toolbar
this.toolbarSetting = {
// buttons: ["download"],
...this._config,
};

Expand Down Expand Up @@ -526,15 +525,19 @@ export default class OpencgaFileGrid extends LitElement {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showToolbar: true,
showCreate: true,
showExport: true,
showSettings: true,
showActions: true,
showSelectCheckbox: false,
multiSelection: false,
detailView: false,
detailFormatter: null, // function with the detail formatter
multiSelection: false,

showToolbar: true,
showActions: true,

showCreate: false,
showExport: true,
showSettings: true,
exportTabs: ["download", "link", "code"],

skipExtensions: false,
};
}
Expand Down
18 changes: 9 additions & 9 deletions src/webcomponents/individual/individual-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ export default class IndividualBrowser extends LitElement {
this._config.filter = UtilsNew.mergeFiltersAndDetails(this._config?.filter, this.settings);
}

UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config?.filter?.result.grid,
...this.settings.table
});

UtilsNew.setObjectValue(this._config, "filter.result.grid.toolbar", {
...this._config.filter?.result?.grid?.toolbar,
...this.settings.table?.toolbar
});
// Grid configuration and take out toolbar admin/user settings to grid level.
if (this.settings?.table) {
const {toolbar, ...otherTableProps} = this.settings.table;
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
...this._config.filter.result.grid,
...otherTableProps,
...toolbar,
});
}

// Apply User grid configuration. Only 'pageSize' and 'columns' are set
UtilsNew.setObjectValue(this._config, "filter.result.grid", {
Expand Down
Loading

0 comments on commit c2e1047

Please sign in to comment.