Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK-5244 #831

Merged
merged 6 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions cypress/e2e/iva/file-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,17 @@ context("File Browser Grid", () => {
});
});

context("Grid",{tags: "@shortTask"}, () => {
it("should render", () => {
cy.get(browserGrid)
.should("be.visible");
});

it("should change page", () => {
UtilsTest.changePage(browserGrid,2);
UtilsTest.changePage(browserGrid,3);
});
});
// context("Grid",{tags: "@shortTask"}, () => {
// it("should render", () => {
// cy.get(browserGrid)
// .should("be.visible");
// });
//
// it("should change page", () => {
// UtilsTest.changePage(browserGrid,2);
// UtilsTest.changePage(browserGrid,3);
// });
// });

context("Row", () => {
it("should display row #3 as selected", () => {
Expand Down
8 changes: 4 additions & 4 deletions src/sites/iva/conf/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ const hosts = [
url: "https://demo.app.zettagenomics.com/opencga"
},
{
id: "testteam",
url: "https://test.app.zettagenomics.com/testteam/opencga"
id: "reference",
url: "https://test.app.zettagenomics.com/reference/opencga"
},
];

const opencga = {
host: hosts[1].url,
host: hosts[2].url,
version: "v2",
cookie: {
prefix: "iva-" + hosts[1].id
prefix: "iva-" + hosts[2].id
},
sso: {
active: false,
Expand Down
17 changes: 8 additions & 9 deletions src/webcomponents/commons/opencb-grid-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,26 +199,25 @@ export default class OpencbGridToolbar extends LitElement {
</div>

<!-- Add modals-->
${(this._config?.create && (this._settings.showCreate || this._settings.showNew)
&& OpencgaCatalogUtils.checkPermissions(this.opencgaSession?.study, this.opencgaSession?.user?.id, `WRITE_${this._config.resource}`)) ?
ModalUtils.create(this, `${this._prefix}CreateModal`, this._config.create) :
nothing}

${this._settings?.showExport && this._config?.export ? ModalUtils.create(this, `${this._prefix}ExportModal`, this._config.export) : nothing}

${this._settings?.showSettings && this._config?.settings ? ModalUtils.create(this, `${this._prefix}SettingModal`, this._config.settings) : nothing}

${(this._config?.create &&
(this._settings.showCreate || this._settings.showNew) &&
OpencgaCatalogUtils.checkPermissions(this.opencgaSession?.study, this.opencgaSession?.user?.id, `WRITE_${this._config.resource}`)) ?
ModalUtils.create(this, `${this._prefix}CreateModal`, this._config.create) :
nothing}
`;
}

getDefaultSettings() {
return {
// label: "records",
showCreate: true,
showDownload: true,
showExport: true,
showSettings: true,
download: ["Tab", "JSON"],
buttons: ["columns", "download"],
// download: ["Tab", "JSON"],
// buttons: ["columns", "download"],
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ export default class SampleCancerVariantStatsBrowser extends LitElement {
this.files = [];
this.filesByCaller = {};

this.query = {
region: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y",
};
// Nacho (08/11/2023): commented as part of the fix TASK-5244
// this.query = {
// region: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y",
// };
this.query = null;

this.queries = {};
this.circosPlot = null;
Expand Down Expand Up @@ -186,6 +188,7 @@ export default class SampleCancerVariantStatsBrowser extends LitElement {

// Update query with default 'fileData' parameters
this.query = {
region: "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y",
...this.query,
fileData: fileDataFilters.join(","),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ export default class CellbaseVariantAnnotationSummary extends LitElement {
}

render() {
const variantRegion = this.variantAnnotation.chromosome + ":" + this.variantAnnotation.start + "-" + this.variantAnnotation.start;
if (this.variantAnnotation === undefined || this.variantAnnotation === "" || this.proteinSubScore === undefined) {
return;
}
const variantRegion = this.variantAnnotation.chromosome + ":" + this.variantAnnotation.start + "-" + this.variantAnnotation.start;

const variantId = this.variantAnnotation.id ? this.variantAnnotation.id : `${this.variantAnnotation.chromosome}:${this.variantAnnotation.start}:${this.variantAnnotation.reference}:${this.variantAnnotation.alternate}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,17 +530,17 @@ class VariantInterpreterBrowserCancer extends LitElement {
],
result: {
grid: {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showExport: false,
detailView: true,
showReview: false,
showActions: true,
// pagination: true,
// pageSize: 10,
// pageList: [5, 10, 25],
// showExport: false,
// detailView: true,
// showReview: false,
// showActions: true,
showSelectCheckbox: true,
multiSelection: false,
nucleotideGenotype: true,
alleleStringLengthMax: 10,
// multiSelection: false,
// nucleotideGenotype: true,
// alleleStringLengthMax: 10,

genotype: {
type: "VAF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,17 @@ class VariantInterpreterBrowserCNV extends LitElement {
],
result: {
grid: {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showExport: false,
detailView: true,
showReview: false,
showActions: true,
// pagination: true,
// pageSize: 10,
// pageList: [5, 10, 25],
// showExport: false,
// detailView: true,
// showReview: false,
// showActions: true,
showSelectCheckbox: true,
multiSelection: false,
nucleotideGenotype: true,
alleleStringLengthMax: 10,
// multiSelection: false,
// nucleotideGenotype: true,
// alleleStringLengthMax: 10,

hideType: true,
hidePopulationFrequencies: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,17 +545,17 @@ class VariantInterpreterBrowserRd extends LitElement {
],
result: {
grid: {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showExport: false,
detailView: true,
showReview: true,
showActions: true,
// pagination: true,
// pageSize: 10,
// pageList: [5, 10, 25],
// showExport: false,
// detailView: true,
// showReview: true,
// showActions: true,
showSelectCheckbox: true,
multiSelection: false,
nucleotideGenotype: true,
alleleStringLengthMax: 10,
// multiSelection: false,
// nucleotideGenotype: true,
// alleleStringLengthMax: 10,

header: {
horizontalAlign: "center",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,16 @@ class VariantInterpreterBrowserRearrangement extends LitElement {
],
result: {
grid: {
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showExport: true,
detailView: true,
showReview: false,
showActions: true,
// pagination: true,
// pageSize: 10,
// pageList: [5, 10, 25],
// showExport: true,
// detailView: true,
// showReview: false,
// showActions: true,
showSelectCheckbox: true,
multiSelection: false,
nucleotideGenotype: true,
// multiSelection: false,
// nucleotideGenotype: true,
alleleStringLengthMax: 25,
header: {
horizontalAlign: "center",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ export default class VariantInterpreterGrid extends LitElement {
this.gridCommons = new GridCommons(this.gridId, this, this._config);

this.toolbarSetting = {
showCreate: false,
showExport: true,
showSettings: true,
exportTabs: ["download", "export", "link", "code"], // this is customisable in external settings in `table.toolbar`
// ...this._config,
// it comes from external settings
showColumns: false,
showSettings: true,
...this._config,
// columns: defaultColumns[0].filter(col => col.rowspan === 2 && col.colspan === 1 && col.visible !== false),
// gridColumns: defaultColumns, // original column structure
Expand All @@ -178,6 +178,7 @@ export default class VariantInterpreterGrid extends LitElement {
this.toolbarConfig = {
toolId: this.toolId,
resource: "CLINICAL_VARIANT",
disableCreate: true,
showInterpreterConfig: true,
columns: this._getDefaultColumns()
};
Expand Down Expand Up @@ -409,7 +410,7 @@ export default class VariantInterpreterGrid extends LitElement {
formatShowingRows: this.gridCommons.formatShowingRows,
showExport: this._config.showExport,
detailView: this._config.detailView,
detailFormatter: (value, row) => this.detailFormatter(value, row),
detailFormatter: this._config.detailFormatter,
formatLoadingMessage: () => "<div><loading-spinner></loading-spinner></div>",

// this makes the opencga-interpreted-variant-grid properties available in the bootstrap-table formatters
Expand Down Expand Up @@ -1532,13 +1533,20 @@ export default class VariantInterpreterGrid extends LitElement {

getDefaultConfig() {
return {
// Bootstrap Grid config
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showExport: false,
detailView: true,
showReview: true,
detailFormatter: this.detailFormatter,
// multiSelection: false,

// Custom config
showToolbar: true,
showCreate: false,
showExport: true,
showSettings: true,
showReview: true,
showSelectCheckbox: false,
showActions: true,
showEditReview: true,
Expand Down
12 changes: 10 additions & 2 deletions src/webcomponents/variant/variant-browser-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,14 @@ export default class VariantBrowserGrid extends LitElement {
...this.getDefaultConfig(),
...this.config,
};

this.gridCommons = new GridCommons(this.gridId, this, this._config);

// Config for the grid toolbar
this.toolbarSetting = {
showCreate: false,
showExport: true,
showSettings: true,
exportTabs: ["download", "export", "link", "code"], // this is customisable in external settings in `table.toolbar`
showColumns: false,
...this._config,
Expand Down Expand Up @@ -1064,16 +1067,21 @@ export default class VariantBrowserGrid extends LitElement {

getDefaultConfig() {
return {
// Bootstrap Grid config
pagination: true,
pageSize: 10,
pageList: [5, 10, 25],
showExport: false,
detailView: true,
detailFormatter: this.detailFormatter,
// multiSelection: false,

// Custom config
showToolbar: true,
showCreate: false,
showExport: true,
showSettings: true,
showSelectCheckbox: false,
showActions: true,
multiSelection: false,
nucleotideGenotype: true,
alleleStringLengthMax: 15,

Expand Down
13 changes: 8 additions & 5 deletions src/webcomponents/variant/variant-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ export default class VariantBrowser extends LitElement {
name: "Consequence Type",
render: (variant, active) => html`
<variant-consequence-type-view
.consequenceTypes="${variant.annotation.consequenceTypes}"
.consequenceTypes="${variant?.annotation?.consequenceTypes}"
.active="${active}">
</variant-consequence-type-view>
`,
Expand All @@ -683,7 +683,7 @@ export default class VariantBrowser extends LitElement {
name: "Population Frequencies",
render: (variant, active) => html`
<cellbase-population-frequency-grid
.populationFrequencies="${variant.annotation.populationFrequencies}"
.populationFrequencies="${variant?.annotation?.populationFrequencies}"
.active="${active}">
</cellbase-population-frequency-grid>
`,
Expand All @@ -693,8 +693,8 @@ export default class VariantBrowser extends LitElement {
name: "Clinical",
render: variant => html`
<variant-annotation-clinical-view
.traitAssociation="${variant.annotation.traitAssociation}"
.geneTraitAssociation="${variant.annotation.geneTraitAssociation}">
.traitAssociation="${variant?.annotation?.traitAssociation}"
.geneTraitAssociation="${variant?.annotation?.geneTraitAssociation}">
</variant-annotation-clinical-view>
`,
},
Expand Down Expand Up @@ -737,7 +737,10 @@ export default class VariantBrowser extends LitElement {
id: "json-view",
name: "JSON Data",
render: (variant, active) => html`
<json-viewer .data="${variant}" .active="${active}"></json-viewer>
<json-viewer
.data="${variant}"
.active="${active}">
</json-viewer>
`,
}
// TODO Think about Neeworks
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/variant/variant-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class VariantUtils {
"gene",
"type",
// Adding SAMPLES (includeSample=all in VB and Case samples in Sample VB)
...samples.map(sample => sample.id),
...samples.map(sample => sample.id || sample),
"consequenceType",
"deleteriousness.SIFT",
"deleteriousness.polyphen",
Expand Down
Loading