Skip to content

Commit 33e956d

Browse files
authored
feat(model-ad): add visualization overview functionality (Sage-Bionetworks#3678)
1 parent 18608bd commit 33e956d

28 files changed

+735
-20
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Page, expect, test } from '@playwright/test';
2+
3+
export const closeVisualizationOverviewDialog = async (page: Page) => {
4+
await test.step('close visualization overview dialog', async () => {
5+
const dialog = page.getByRole('dialog');
6+
7+
const closeBtn = dialog.getByRole('button').first();
8+
await closeBtn.click();
9+
10+
await expect(dialog).toBeHidden();
11+
});
12+
};

apps/model-ad/app/e2e/home.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test.describe('home', () => {
1111

1212
await modelOverviewCard.click();
1313

14-
await expect(page).toHaveURL('/comparison/model');
14+
await page.waitForURL('/comparison/model');
1515
await expect(page.getByRole('heading', { level: 1, name: 'Model Overview' })).toBeVisible();
1616
});
1717

@@ -25,7 +25,7 @@ test.describe('home', () => {
2525

2626
await geneExpressionCard.click();
2727

28-
await expect(page).toHaveURL('/comparison/expression');
28+
await page.waitForURL('/comparison/expression');
2929
await expect(page.getByRole('heading', { level: 1, name: 'Gene Expression' })).toBeVisible();
3030
});
3131

@@ -39,7 +39,7 @@ test.describe('home', () => {
3939

4040
await diseaseCorrelationCard.click();
4141

42-
await expect(page).toHaveURL('/comparison/correlation');
42+
await page.waitForURL('/comparison/correlation');
4343
await expect(
4444
page.getByRole('heading', { level: 1, name: 'Disease Correlation' }),
4545
).toBeVisible();

apps/model-ad/app/e2e/model-overview-comparison-tool.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { expect, test } from '@playwright/test';
22
import { baseURL } from '../playwright.config';
3+
import { closeVisualizationOverviewDialog } from './helpers/comparison-tool';
34

45
test.describe('model overview', () => {
56
test('share URL button copies URL to clipboard', async ({ page, context }) => {
@@ -14,6 +15,9 @@ test.describe('model overview', () => {
1415

1516
await page.waitForURL(path);
1617

18+
// close the visualization overview dialog
19+
await closeVisualizationOverviewDialog(page);
20+
1721
await shareUrlButton.click();
1822

1923
const clipboardContent = await page.evaluate(() => navigator.clipboard.readText());

libs/explorers/comparison-tool/src/lib/comparison-tool.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<explorers-comparison-tool-table />
1414
<ng-content></ng-content>
1515
<explorers-help-links />
16-
<explorers-legend-panel />
1716
<explorers-comparison-tool-filter-panel
1817
[filterConfigs]="currentConfig()?.filters || []"
1918
[(isOpen)]="isFilterPanelOpen"

libs/explorers/comparison-tool/src/lib/comparison-tool.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { ComparisonToolFilterPanelComponent } from './comparison-tool-filter-pan
77
import { ComparisonToolHeaderComponent } from './comparison-tool-header/comparison-tool-header.component';
88
import { ComparisonToolTableComponent } from './comparison-tool-table/comparison-tool-table.component';
99
import { HelpLinksComponent } from './help-links/help-links.component';
10-
import { LegendPanelComponent } from './legend-panel/legend-panel.component';
1110

1211
@Component({
1312
selector: 'explorers-comparison-tool',
@@ -18,7 +17,6 @@ import { LegendPanelComponent } from './legend-panel/legend-panel.component';
1817
ComparisonToolControlsComponent,
1918
ComparisonToolFilterListComponent,
2019
ComparisonToolTableComponent,
21-
LegendPanelComponent,
2220
HelpLinksComponent,
2321
],
2422
templateUrl: './comparison-tool.component.html',

libs/explorers/comparison-tool/src/lib/help-links/help-links.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
</div>
1313
</div>
1414
</div>
15+
16+
<explorers-legend-panel />
17+
<explorers-visualization-overview-panel />

libs/explorers/comparison-tool/src/lib/help-links/help-links.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { Component, computed, inject } from '@angular/core';
22
import { ComparisonToolService } from '@sagebionetworks/explorers/services';
3+
import { LegendPanelComponent } from './legend-panel/legend-panel.component';
4+
import { VisualizationOverviewPanelComponent } from './visualization-overview-panel/visualization-overview-panel.component';
35

46
@Component({
57
selector: 'explorers-help-links',
8+
imports: [LegendPanelComponent, VisualizationOverviewPanelComponent],
69
templateUrl: './help-links.component.html',
710
styleUrls: ['./help-links.component.scss'],
811
})

libs/explorers/comparison-tool/src/lib/legend-panel/legend-panel.component.html renamed to libs/explorers/comparison-tool/src/lib/help-links/legend-panel/legend-panel.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
[sizeChartText]="viewConfig().legendPanelConfig.sizeChartText"
1818
></explorers-legend>
1919
<ng-template #footer>
20-
<a (click)="onHowToClick()">Visualization Overview</a>
20+
<a (click)="openVisualizationOverviewDialog()">Visualization Overview</a>
2121
</ng-template>
2222
</p-dialog>

libs/explorers/comparison-tool/src/lib/legend-panel/legend-panel.component.ts renamed to libs/explorers/comparison-tool/src/lib/help-links/legend-panel/legend-panel.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export class LegendPanelComponent {
1515

1616
viewConfig = this.comparisonToolService.viewConfig;
1717

18-
onHowToClick() {
19-
//TODO implement
18+
openVisualizationOverviewDialog() {
19+
// close the legend panel and open the visualization overview
20+
this.comparisonToolService.setLegendVisibility(false);
21+
this.comparisonToolService.setVisualizationOverviewVisibility(true);
2022
}
2123
}

0 commit comments

Comments
 (0)