From 1762112acd7d34cd75a8f4c198c75e0e4d1c2cdc Mon Sep 17 00:00:00 2001 From: sebastianpiresmolin Date: Sun, 19 Jan 2025 13:12:21 +0100 Subject: [PATCH 1/3] Testing if IDE respects my githook settings --- .githooks/pre-commit | 1 + 1 file changed, 1 insertion(+) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 980d3e54b6..59f3ff2d1b 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,2 +1,3 @@ #!/bin/sh +echo "Running pre-commit hook!" yarn lint && yarn check-types From 0f38f7b173065e656a87d887e47950ebd02bab9b Mon Sep 17 00:00:00 2001 From: sebastianpiresmolin Date: Sun, 19 Jan 2025 13:14:24 +0100 Subject: [PATCH 2/3] Removing echo. IDE respects the hook. --- .githooks/pre-commit | 1 - 1 file changed, 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 59f3ff2d1b..980d3e54b6 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,3 +1,2 @@ #!/bin/sh -echo "Running pre-commit hook!" yarn lint && yarn check-types From 92d4b56e5990c989cf7e15202c9f618c6236d26d Mon Sep 17 00:00:00 2001 From: sebastianpiresmolin Date: Sun, 19 Jan 2025 14:56:29 +0100 Subject: [PATCH 3/3] import useSheets to access firstRowIsHeaders state modify rowNumbers with tenary to +1 or +2 to index depening on firstRowIsHeaders(true/false) --- .../elements/ImportMessageList/ImportMessage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/features/import/components/ImportDialog/elements/ImportMessageList/ImportMessage.tsx b/src/features/import/components/ImportDialog/elements/ImportMessageList/ImportMessage.tsx index f3f8bab030..ad5097f149 100644 --- a/src/features/import/components/ImportDialog/elements/ImportMessageList/ImportMessage.tsx +++ b/src/features/import/components/ImportDialog/elements/ImportMessageList/ImportMessage.tsx @@ -12,6 +12,7 @@ import { import messageIds from 'features/import/l10n/messageIds'; import ProblemRowsText from './ProblemRowsText'; import { useMessages } from 'core/i18n'; +import useSheets from '../../../../hooks/useSheets'; type Props = { description?: string; @@ -32,7 +33,11 @@ const ImportMessage: FC = ({ }) => { const messages = useMessages(messageIds); - const rowNumbers = rowIndices?.map((rowIndex) => rowIndex + 1); + const { firstRowIsHeaders } = useSheets(); + + const rowNumbers = rowIndices?.map((rowIndex) => + firstRowIsHeaders ? rowIndex + 2 : rowIndex + 1 + ); return (