From 41cf3567a58cf15dd654fb6c7f4b24b92a6f2c9d Mon Sep 17 00:00:00 2001 From: Danil Kostromin Date: Wed, 27 Mar 2024 02:42:03 +0200 Subject: [PATCH] fix(log): scroll to saved line When saving location at line number log sometimes throws error due to not being able to find row by id. Changed to searching row from raw data model and not using library method. Also updated tanstack-table to latest version Signed-off-by: Danil Kostromin --- .../log-container/log-container.tsx | 2 +- package.json | 4 +- pnpm-lock.yaml | 45 +++++++------------ 3 files changed, 19 insertions(+), 32 deletions(-) diff --git a/libs/bublik/features/log/src/lib/containers/log-container/log-container.tsx b/libs/bublik/features/log/src/lib/containers/log-container/log-container.tsx index c262bd53..aabddfba 100644 --- a/libs/bublik/features/log/src/lib/containers/log-container/log-container.tsx +++ b/libs/bublik/features/log/src/lib/containers/log-container/log-container.tsx @@ -89,7 +89,7 @@ export const LogPickerContainer = () => { if (!lineNumber) return; // 1. Expand parent rows before we can scroll to row - const row = table.getRow(lineNumber); + const row = table.getRowModel().rowsById[lineNumber]; if (!row) return console.log('No row found with id', lineNumber); diff --git a/package.json b/package.json index 73551082..90ee8084 100644 --- a/package.json +++ b/package.json @@ -74,8 +74,8 @@ "@react-stately/calendar": "^3.4.2", "@react-stately/datepicker": "^3.9.0", "@reduxjs/toolkit": "^1.9.7", - "@tanstack/react-table": "^8.10.7", - "@tanstack/react-table-devtools": "^8.7.6", + "@tanstack/react-table": "^8.15.0", + "@tanstack/react-table-devtools": "^8.15.0", "clipboard-copy": "^4.0.1", "clsx": "^2.0.0", "cmdk": "^0.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d04a79a6..5e0ecc48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -108,11 +108,11 @@ dependencies: specifier: ^1.9.7 version: 1.9.7(react-redux@8.1.3)(react@18.2.0) '@tanstack/react-table': - specifier: ^8.10.7 - version: 8.10.7(react-dom@18.2.0)(react@18.2.0) + specifier: ^8.15.0 + version: 8.15.0(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-table-devtools': - specifier: ^8.7.6 - version: 8.7.6(react-dom@18.2.0)(react@18.2.0) + specifier: ^8.15.0 + version: 8.15.0(react-dom@18.2.0)(react@18.2.0) clipboard-copy: specifier: ^4.0.1 version: 4.0.1 @@ -10394,43 +10394,32 @@ packages: tailwindcss: 3.3.1(postcss@8.4.21)(ts-node@10.9.1) dev: true - /@tanstack/react-table-devtools@8.7.6(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-t6+8ch6BCsEOMjZ+WG2aWQd+Jy8/YfCIf7e7MWKtIXuqZcwCjyzHPsSeddjgzKalX+gGLlAkIEKcThWuISmqVg==} + /@tanstack/react-table-devtools@8.15.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-hwyrpP3xplu4sPKAe87KaQSiZotAh8gyXf07jzws/uybSD8ANBRc54mtkosSSacpgbl8DjDBc4o5jeOtZaC6Jw==} engines: {node: '>=12'} peerDependencies: - react: '>=16' - react-dom: '>=16' - dependencies: - '@tanstack/react-table': 8.0.0-alpha.1(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: false - - /@tanstack/react-table@8.0.0-alpha.1(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-0fwp0ihCrvAhA3KWXdWMA3RL9uw3M/UjUvEVkj9APaBt1Q0fJmBTQfzAg3590MraLjRpiiX9/YsRLKj8Dv5b1w==} - engines: {node: '>=12'} - peerDependencies: - react: '>=16' - react-dom: '>=16' + react: '>=16.8' + react-dom: '>=16.8' dependencies: + '@tanstack/react-table': 8.15.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@tanstack/react-table@8.10.7(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-bXhjA7xsTcsW8JPTTYlUg/FuBpn8MNjiEPhkNhIGCUR6iRQM2+WEco4OBpvDeVcR9SE+bmWLzdfiY7bCbCSVuA==} + /@tanstack/react-table@8.15.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-8K4RSROUtXUtfiezV6Ehl8z99axFrkQnxXi0vjWBJv3Tsm5x4EyrgXI7d2tOOMoANykKZLB6S1sGZGemoMRt7Q==} engines: {node: '>=12'} peerDependencies: - react: '>=16' - react-dom: '>=16' + react: '>=16.8' + react-dom: '>=16.8' dependencies: - '@tanstack/table-core': 8.10.7 + '@tanstack/table-core': 8.14.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@tanstack/table-core@8.10.7: - resolution: {integrity: sha512-KQk5OMg5OH6rmbHZxuNROvdI+hKDIUxANaHlV+dPlNN7ED3qYQ/WkpY2qlXww1SIdeMlkIhpN/2L00rof0fXFw==} + /@tanstack/table-core@8.14.0: + resolution: {integrity: sha512-wDhpKJahGHWhmRt4RxtV3pES63CoeadljGWS/xeS9OJr1HBl2NB+OO44ht3sxDH5j5TRDAbQzC0NvSlsUfn7lQ==} engines: {node: '>=12'} dev: false @@ -18955,8 +18944,6 @@ packages: peerDependenciesMeta: webpack: optional: true - webpack-sources: - optional: true dependencies: webpack: 5.88.2(@swc/core@1.3.95)(esbuild@0.17.19) webpack-sources: 3.2.3