Browse metrics page (#47277)
* Add custom image for empty metrics * Add useFetchMetrics helper * Copy browse models page to metrics page * Add route for browse metrics page * Add useHasMetrics hook * Add link to browse metrics page to the sidebar * Simplify MetricsTable component * Render description markdown in table too * Add unit tests for browse metrics page * Remove custom padding * Fix line height of markdown cell * Add e2e tests for browse page * Fix metrics sorting * Fix types * Fix column widths and cell padding * Typo Co-authored-by:Kamil Mielnik <kamil@kamilmielnik.com> * Remove name check * Simplify alphabet * Remove resetSnowplow * Use helper to get metric in table * Use MouseEvent from React directly * Use --mb-color-icon-primary * Test ellipsification of description * Simplify useHasMetrics * Move useHasMetrics MainNavBar * Merge sortMetrics and sortModels into sortCards * Fix metric default description * Extract SidebarSkeleton to a separate component * Test sorting via Collection too * Use ModelTableRow to fix cursor * Share more components between ModelsTable and MetricsTable * Use the same simplified structure in ModelsTable as for MetricsTable * Render block-level elements as inline so ellipsis detection works * Pick better testid for metric name * Remove delay * Avoid type specificty error in sortCards * Add test for not opening in new tab * Remove useFetchMetrics defaults * Fix unit test import * Test meta-click with cypress * Add comment on inline markdown elements * Use model-name test id * Use correct colors for icon * Remove delay from browse models page too * Make meta key in test platform-dependent * Fix hover color on metrics table * Add focus styling for celss in the models and metrics table * Use MarkdownPreview for table cells * Define --mb-color-icon-primary * Make the collection link take up the whole height of the cell * Remove tabIndex from table rows * Rename ModelsTable.module.css to BrowseTable.module.css * Rename CardsTable to BrowseTable * Remove single module.css class in favor of styled components * Allow customising allowed elements * Allow forcing all markdown on one line * Render bold and italics in markdown descriptions and move content onto one line * Fix legacy tooltip in test * Make sure getValueForSorting returns a string * Remove empty file * Remove icon for metrics in the table * Remove else statement. Co-authored-by:
Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com> * Remove async findBy where possible * Add github issue link for TODO item * Disambiguate between getMetricDescription type * Be explicit with sortModelOrMetric --------- Co-authored-by:
Kamil Mielnik <kamil@kamilmielnik.com> Co-authored-by:
Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Showing
- e2e/test/scenarios/metrics/browse.cy.spec.ts 233 additions, 0 deletionse2e/test/scenarios/metrics/browse.cy.spec.ts
- e2e/test/scenarios/onboarding/home/browse.cy.spec.ts 20 additions, 0 deletionse2e/test/scenarios/onboarding/home/browse.cy.spec.ts
- frontend/src/metabase/browse/components/BrowseMetrics.tsx 90 additions, 0 deletionsfrontend/src/metabase/browse/components/BrowseMetrics.tsx
- frontend/src/metabase/browse/components/BrowseMetrics.unit.spec.tsx 255 additions, 0 deletions...rc/metabase/browse/components/BrowseMetrics.unit.spec.tsx
- frontend/src/metabase/browse/components/BrowseModels.tsx 5 additions, 3 deletionsfrontend/src/metabase/browse/components/BrowseModels.tsx
- frontend/src/metabase/browse/components/BrowseTable.styled.tsx 34 additions, 7 deletions...end/src/metabase/browse/components/BrowseTable.styled.tsx
- frontend/src/metabase/browse/components/EllipsifiedWithMarkdownTooltip.tsx 0 additions, 20 deletions...base/browse/components/EllipsifiedWithMarkdownTooltip.tsx
- frontend/src/metabase/browse/components/MetricsTable.tsx 295 additions, 0 deletionsfrontend/src/metabase/browse/components/MetricsTable.tsx
- frontend/src/metabase/browse/components/ModelsTable.module.css 0 additions, 5 deletions...end/src/metabase/browse/components/ModelsTable.module.css
- frontend/src/metabase/browse/components/ModelsTable.tsx 120 additions, 140 deletionsfrontend/src/metabase/browse/components/ModelsTable.tsx
- frontend/src/metabase/browse/components/utils.tsx 29 additions, 17 deletionsfrontend/src/metabase/browse/components/utils.tsx
- frontend/src/metabase/browse/components/utils.unit.spec.tsx 8 additions, 8 deletionsfrontend/src/metabase/browse/components/utils.unit.spec.tsx
- frontend/src/metabase/browse/test-utils.ts 19 additions, 1 deletionfrontend/src/metabase/browse/test-utils.ts
- frontend/src/metabase/browse/types.tsx 7 additions, 0 deletionsfrontend/src/metabase/browse/types.tsx
- frontend/src/metabase/common/hooks/use-fetch-metrics.tsx 10 additions, 0 deletionsfrontend/src/metabase/common/hooks/use-fetch-metrics.tsx
- frontend/src/metabase/core/components/MarkdownPreview/MarkdownPreview.module.css 47 additions, 0 deletions...ore/components/MarkdownPreview/MarkdownPreview.module.css
- frontend/src/metabase/core/components/MarkdownPreview/MarkdownPreview.tsx 13 additions, 4 deletions...abase/core/components/MarkdownPreview/MarkdownPreview.tsx
- frontend/src/metabase/core/components/MarkdownPreview/MarkdownPreview.unit.spec.tsx 17 additions, 2 deletions.../components/MarkdownPreview/MarkdownPreview.unit.spec.tsx
- frontend/src/metabase/css/core/colors.module.css 1 addition, 0 deletionsfrontend/src/metabase/css/core/colors.module.css
- frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/BrowseNavSection.tsx 39 additions, 7 deletions...iners/MainNavbar/MainNavbarContainer/BrowseNavSection.tsx
Loading
Please register or sign in to comment