From ad9519c1815c09c8476aa56482bd33113042ad9b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 10 Jun 2022 16:50:42 +0000 Subject: [PATCH 1/4] chore(deps): update dependency vite to v2.9.12 --- frontend/package.json | 2 +- frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index d4ac9a73cf..debc5770e7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -94,7 +94,7 @@ "swr": "1.3.0", "tss-react": "3.7.0", "typescript": "4.7.3", - "vite": "2.9.10", + "vite": "2.9.12", "vite-plugin-env-compatible": "^1.1.1", "vite-plugin-svgr": "2.1.0", "vite-tsconfig-paths": "3.5.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 3561cb4ab8..949498d68b 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -6028,10 +6028,10 @@ vite-tsconfig-paths@3.5.0: recrawl-sync "^2.0.3" tsconfig-paths "^4.0.0" -vite@2.9.10: - version "2.9.10" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.10.tgz#f574d96655622c2e0fbc662edd0ed199c60fe91a" - integrity sha512-TwZRuSMYjpTurLqXspct+HZE7ONiW9d+wSWgvADGxhDPPyoIcNywY+RX4ng+QpK30DCa1l/oZgi2PLZDibhzbQ== +vite@2.9.12: + version "2.9.12" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.12.tgz#b1d636b0a8ac636afe9d83e3792d4895509a941b" + integrity sha512-suxC36dQo9Rq1qMB2qiRorNJtJAdxguu5TMvBHOc/F370KvqAe9t48vYp+/TbPKRNrMh/J55tOUmkuIqstZaew== dependencies: esbuild "^0.14.27" postcss "^8.4.13" From 7592e4f643d9f4a59a3f74b443c577fa214e0c53 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 10 Jun 2022 19:21:37 +0000 Subject: [PATCH 2/4] chore(deps): update dependency vitest to v0.14.2 --- frontend/package.json | 2 +- frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index debc5770e7..1c0c9a5285 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -98,7 +98,7 @@ "vite-plugin-env-compatible": "^1.1.1", "vite-plugin-svgr": "2.1.0", "vite-tsconfig-paths": "3.5.0", - "vitest": "0.14.1", + "vitest": "0.14.2", "whatwg-fetch": "^3.6.2" }, "jest": { diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 949498d68b..304c0e82e8 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -6052,10 +6052,10 @@ vite@^2.9.9: optionalDependencies: fsevents "~2.3.2" -vitest@0.14.1: - version "0.14.1" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.14.1.tgz#f2fd8b31abdbbadb9ee895f8fde35a068ea2a5f5" - integrity sha512-2UUm6jYgkwh7Y3VKSRR8OuaNCm+iA5LPDnal7jyITN39maZK9L+JVxqjtQ39PSFo5Fl3/BgaJvER6GGHX9JLxg== +vitest@0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.14.2.tgz#ac07b46d3cd3b5667d2bb803962f759a1b8f3f89" + integrity sha512-vXQUl8OUCqHmxKWscMGL+6Xl1pBJmYHZ8N85iNpLGrirAC2vhspu7b73ShRcLonmZT44BYZW+LBAVvn0L4jyVA== dependencies: "@types/chai" "^4.3.1" "@types/chai-subset" "^1.3.3" From d7bc30871f84d6426ca80f24c0fab2b4a0a2ef2b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 09:07:14 +0200 Subject: [PATCH 3/4] chore(deps): update dependency react-timeago to v7 (#1088) Co-authored-by: Renovate Bot --- frontend/package.json | 2 +- frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 1c0c9a5285..dbcb8e5ae8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -88,7 +88,7 @@ "react-router-dom": "6.3.0", "react-table": "7.8.0", "react-test-renderer": "17.0.2", - "react-timeago": "6.2.1", + "react-timeago": "7.1.0", "sass": "1.52.3", "semver": "7.3.7", "swr": "1.3.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 304c0e82e8..d7cf9f8ffe 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -5210,10 +5210,10 @@ react-test-renderer@17.0.2: react-shallow-renderer "^16.13.1" scheduler "^0.20.2" -react-timeago@6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/react-timeago/-/react-timeago-6.2.1.tgz#f19716811156617ceb9c9f9a44315d85197c7fba" - integrity sha512-b9EObWO8wy4qwfOzj+g/RQZRrPvtMv1Pz12FCdAWKWCXbDGt0rZLyiyTGEr0Lh1O8w5xa48CtRpl3LI+CtGCyw== +react-timeago@7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/react-timeago/-/react-timeago-7.1.0.tgz#248bc6aa40a561249e756b2df402c94f1a296a85" + integrity sha512-rouF7MiEm55fH791Y8cg+VobIJgx8gtNJ+gjr86R4ZqO1WKPkXiXjdT/lRzrvEkUzsxT1exHqV2V+Zdi114H3A== react-transition-group@^4.4.2: version "4.4.2" From e338319afa8d24a14024024346b3a0dc47a8e367 Mon Sep 17 00:00:00 2001 From: olav Date: Mon, 13 Jun 2022 09:25:36 +0200 Subject: [PATCH 4/4] refactor: avoid relative positioning for tbody (#1085) * refactor: expose vite dev server on local IP * refactor: avoid relative positioning for tbody * refactor: avoid height on tbody as well * refactor: use row height from theme --- .../SortableTableHeader.styles.ts | 2 ++ .../common/Table/Table/Table.styles.ts | 2 ++ .../FeatureToggleListTable.tsx | 26 ++++++++++--------- .../ProjectFeatureToggles.tsx | 26 ++++++++++--------- .../__snapshots__/TagTypeList.test.tsx.snap | 4 +-- frontend/vite.config.ts | 1 + 6 files changed, 35 insertions(+), 26 deletions(-) diff --git a/frontend/src/component/common/Table/SortableTableHeader/SortableTableHeader.styles.ts b/frontend/src/component/common/Table/SortableTableHeader/SortableTableHeader.styles.ts index 32f9ed3452..fb11a9dd4b 100644 --- a/frontend/src/component/common/Table/SortableTableHeader/SortableTableHeader.styles.ts +++ b/frontend/src/component/common/Table/SortableTableHeader/SortableTableHeader.styles.ts @@ -3,7 +3,9 @@ import { makeStyles } from 'tss-react/mui'; export const useStyles = makeStyles()(theme => ({ tableHeader: { '& > th': { + height: theme.shape.tableRowHeightCompact, border: 0, + '&:first-of-type': { borderTopLeftRadius: theme.shape.borderRadiusMedium, borderBottomLeftRadius: theme.shape.borderRadiusMedium, diff --git a/frontend/src/component/common/Table/Table/Table.styles.ts b/frontend/src/component/common/Table/Table/Table.styles.ts index 1897370c27..b006579729 100644 --- a/frontend/src/component/common/Table/Table/Table.styles.ts +++ b/frontend/src/component/common/Table/Table/Table.styles.ts @@ -4,6 +4,8 @@ export const useStyles = makeStyles<{ rowHeight: 'auto' | 'standard' | 'dense' | 'compact' | number; }>()((theme, { rowHeight }) => ({ table: { + position: 'relative', + '& tbody tr': { height: { diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListTable.tsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListTable.tsx index cb156e04be..9a3b0e76ac 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListTable.tsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListTable.tsx @@ -192,6 +192,9 @@ export const FeatureToggleListTable: VFC = () => { const [firstRenderedIndex, lastRenderedIndex] = useVirtualizedRange(rowHeight); + const tableHeight = + rowHeight * rows.length + theme.shape.tableRowHeightCompact; + return ( { } > - +
- + {rows.map((row, index) => { + const top = + index * rowHeight + + theme.shape.tableRowHeightCompact; + const isVirtual = index < firstRenderedIndex || index > lastRenderedIndex; @@ -273,10 +278,7 @@ export const FeatureToggleListTable: VFC = () => { {...row.getRowProps()} key={row.id} className={classes.row} - style={{ - top: `${index * rowHeight}px`, - display: 'flex', - }} + style={{ display: 'flex', top }} > {row.cells.map(cell => ( -
+
- + {rows.map((row, index) => { + const top = + index * rowHeight + + theme.shape.tableRowHeightCompact; + const isVirtual = index < firstRenderedIndex || index > lastRenderedIndex; @@ -493,10 +498,7 @@ export const ProjectFeatureToggles = ({ hover {...row.getRowProps()} className={styles.row} - style={{ - top: `${index * rowHeight}px`, - display: 'flex', - }} + style={{ display: 'flex', top }} > {row.cells.map(cell => (