From 2c878e844bc2d10664d798570560c04fad6acc27 Mon Sep 17 00:00:00 2001 From: Kevin Schaper Date: Fri, 4 Oct 2024 15:14:21 -0700 Subject: [PATCH] Show all association tables together (#775) Show all association tables at once on a node page rather than having to select the association type from an option box. From the initial first pass, I think the minimum to make this work is going to also include making the page nav always visible and making sure it has scrollspy functionality. This may turn into a longer lived PR if we find that we need to tweak table content before we want to merge. --- frontend/e2e/node.test.ts | 34 +--- frontend/e2e/search.test.ts | 2 +- frontend/src/components/AppHeading.vue | 9 + frontend/src/components/AppPredicateBadge.vue | 7 +- frontend/src/components/AppSection.vue | 52 +++++- frontend/src/components/AppTable.vue | 84 ++++----- frontend/src/components/ThePhenogrid.vue | 2 +- .../src/components/TheTableOfContents.vue | 83 ++++----- frontend/src/global/styles.scss | 7 +- frontend/src/global/variables.scss | 3 + frontend/src/pages/node/AssociationsTable.vue | 62 ++++--- frontend/src/pages/node/PageNode.vue | 2 +- .../pages/node/SectionAssociationDetails.vue | 22 +-- .../src/pages/node/SectionAssociations.vue | 164 ++++++------------ .../src/pages/node/SectionBreadcrumbs.vue | 2 +- frontend/src/pages/node/SectionExtra.vue | 2 +- frontend/src/pages/node/SectionHierarchy.vue | 6 +- frontend/src/pages/node/SectionOverview.vue | 4 +- frontend/src/pages/node/SectionTitle.vue | 28 +-- .../src/pages/node/SectionVisualization.vue | 2 + 20 files changed, 254 insertions(+), 323 deletions(-) diff --git a/frontend/e2e/node.test.ts b/frontend/e2e/node.test.ts index 3ab1f6d25..7234be7ab 100644 --- a/frontend/e2e/node.test.ts +++ b/frontend/e2e/node.test.ts @@ -13,44 +13,12 @@ test("Table of contents works", async ({ page }) => { /table of contents/i, ); - /** starts closed (due to small screen size) */ - await expect(page.locator(".toc button")).toHaveAttribute( - "aria-expanded", - "false", - ); - - /** click button to open */ - await page.locator(".toc").click(); - await expect(page.locator(".toc button")).toHaveAttribute( - "aria-expanded", - "true", - ); - - /** click off to close (with small screen size) */ - await page.locator("body").click({ position: { x: 500, y: 500 } }); - await expect(page.locator(".toc button")).toHaveAttribute( - "aria-expanded", - "false", - ); - - /** open again and check contents */ - await page.locator(".toc").click(); - await expect( - page.locator(".toc", { hasText: /Overview/i }).first(), - ).toBeVisible(); - await expect( - page.locator(".toc", { hasText: /Hierarchy/i }).first(), - ).toBeVisible(); - await expect( - page.locator(".toc", { hasText: /Associations/i }).first(), - ).toBeVisible(); - /** check if solo selection mode works */ await page.locator(".toc .checkbox").click(); await expect( page .locator("main") - .getByText(/Overview/i) + .getByText(/Ehlers-Danlos syndrome, hypermobility/i) .first(), ).toBeVisible(); await expect( diff --git a/frontend/e2e/search.test.ts b/frontend/e2e/search.test.ts index 1d1fbc87e..bdbaf48d9 100644 --- a/frontend/e2e/search.test.ts +++ b/frontend/e2e/search.test.ts @@ -19,7 +19,7 @@ test("Recent/frequent results show", async ({ page }) => { for (const node of nodes) { await page.goto("/" + node); - await expect(page.locator("#overview")).toBeVisible(); + await expect(page.locator("#hierarchy")).toBeVisible(); } await page.goto("/explore"); diff --git a/frontend/src/components/AppHeading.vue b/frontend/src/components/AppHeading.vue index b140d5828..1b96d267c 100644 --- a/frontend/src/components/AppHeading.vue +++ b/frontend/src/components/AppHeading.vue @@ -148,4 +148,13 @@ section.fill { } } } +section.inset { + h1, + h2, + h3 { + margin-bottom: 1px; + padding-bottom: 3px; + border-bottom: 2px solid $theme; + } +} diff --git a/frontend/src/components/AppPredicateBadge.vue b/frontend/src/components/AppPredicateBadge.vue index 83c6c135e..8c5e4d0ef 100644 --- a/frontend/src/components/AppPredicateBadge.vue +++ b/frontend/src/components/AppPredicateBadge.vue @@ -4,10 +4,10 @@ @@ -24,6 +24,7 @@ type Props = { reverse?: boolean; /** whether to display arrows vertically */ vertical?: boolean; + arrows?: boolean; }; const props = defineProps(); @@ -42,8 +43,6 @@ const arrowDirection = computed(() =>