From 198e9d7c3313f67259a7ec269bf6d47912a89fd6 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Mon, 30 Sep 2024 16:39:43 +0300 Subject: [PATCH] feat: added format fallback to date input in ui package (#2736) --- apps/kyb-app/CHANGELOG.md | 2 + packages/react-pdf-toolkit/CHANGELOG.md | 1 + packages/ui/CHANGELOG.md | 1 + .../DatePickerInput/DatePickerInput.tsx | 12 +- pnpm-lock.yaml | 106 +++++++++--------- .../workflows-service/prisma/data-migrations | 2 +- 6 files changed, 69 insertions(+), 55 deletions(-) diff --git a/apps/kyb-app/CHANGELOG.md b/apps/kyb-app/CHANGELOG.md index 68070f79df..da4f4219ea 100644 --- a/apps/kyb-app/CHANGELOG.md +++ b/apps/kyb-app/CHANGELOG.md @@ -4,6 +4,8 @@ ### Patch Changes +- Updated dependencies + - @ballerine/ui@0.5.34 - Bump - Updated dependencies - @ballerine/blocks@0.2.20 diff --git a/packages/react-pdf-toolkit/CHANGELOG.md b/packages/react-pdf-toolkit/CHANGELOG.md index 385203efd6..641ac948ca 100644 --- a/packages/react-pdf-toolkit/CHANGELOG.md +++ b/packages/react-pdf-toolkit/CHANGELOG.md @@ -4,6 +4,7 @@ ### Patch Changes +- Updated dependencies - Bump - Updated dependencies - @ballerine/config@1.1.18 diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index b8b08ad350..3f1aee0db2 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -4,6 +4,7 @@ ### Patch Changes +- Added fallback date format to date input - Bump - Updated dependencies - @ballerine/common@0.9.34 diff --git a/packages/ui/src/components/molecules/inputs/DatePickerInput/DatePickerInput.tsx b/packages/ui/src/components/molecules/inputs/DatePickerInput/DatePickerInput.tsx index 20caf42978..2041794a79 100644 --- a/packages/ui/src/components/molecules/inputs/DatePickerInput/DatePickerInput.tsx +++ b/packages/ui/src/components/molecules/inputs/DatePickerInput/DatePickerInput.tsx @@ -59,7 +59,17 @@ export const DatePickerInput = ({ return value.toISOString(); } - return value.format(outputValueFormat); + const date = value.format(outputValueFormat); + + if (!dayjs(date).isValid()) { + console.warn( + `Invalid outputValueFormat: "${outputValueFormat}" provided. iso will be used.`, + ); + + return value.toISOString(); + } + + return date; }, [outputValueFormat], ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 77a3486d6a..8ca4d052d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,22 +67,22 @@ importers: apps/backoffice-v2: dependencies: '@ballerine/blocks': - specifier: 0.2.19 + specifier: 0.2.20 version: link:../../packages/blocks '@ballerine/common': - specifier: 0.9.33 + specifier: 0.9.34 version: link:../../packages/common '@ballerine/react-pdf-toolkit': - specifier: ^1.2.33 + specifier: ^1.2.34 version: link:../../packages/react-pdf-toolkit '@ballerine/ui': - specifier: ^0.5.33 + specifier: ^0.5.34 version: link:../../packages/ui '@ballerine/workflow-browser-sdk': - specifier: 0.6.45 + specifier: 0.6.46 version: link:../../sdks/workflow-browser-sdk '@ballerine/workflow-node-sdk': - specifier: 0.6.45 + specifier: 0.6.46 version: link:../../sdks/workflow-node-sdk '@botpress/webchat': specifier: ^2.1.10 @@ -290,10 +290,10 @@ importers: version: 3.22.4 devDependencies: '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/config '@ballerine/eslint-config-react': - specifier: ^2.0.17 + specifier: ^2.0.18 version: link:../../packages/eslint-config-react '@cspell/cspell-types': specifier: ^6.31.1 @@ -434,16 +434,16 @@ importers: apps/kyb-app: dependencies: '@ballerine/blocks': - specifier: 0.2.19 + specifier: 0.2.20 version: link:../../packages/blocks '@ballerine/common': - specifier: ^0.9.33 + specifier: ^0.9.34 version: link:../../packages/common '@ballerine/ui': - specifier: 0.5.33 + specifier: 0.5.34 version: link:../../packages/ui '@ballerine/workflow-browser-sdk': - specifier: 0.6.45 + specifier: 0.6.46 version: link:../../sdks/workflow-browser-sdk '@lukemorales/query-key-factory': specifier: ^1.0.3 @@ -573,10 +573,10 @@ importers: version: 3.22.4 devDependencies: '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/config '@ballerine/eslint-config-react': - specifier: ^2.0.17 + specifier: ^2.0.18 version: link:../../packages/eslint-config-react '@jest/globals': specifier: ^29.7.0 @@ -678,10 +678,10 @@ importers: apps/workflows-dashboard: dependencies: '@ballerine/common': - specifier: ^0.9.33 + specifier: ^0.9.34 version: link:../../packages/common '@ballerine/ui': - specifier: ^0.5.33 + specifier: ^0.5.34 version: link:../../packages/ui '@lukemorales/query-key-factory': specifier: ^1.0.3 @@ -817,10 +817,10 @@ importers: version: 3.22.4 devDependencies: '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/config '@ballerine/eslint-config-react': - specifier: ^2.0.17 + specifier: ^2.0.18 version: link:../../packages/eslint-config-react '@cspell/cspell-types': specifier: ^6.31.1 @@ -910,10 +910,10 @@ importers: examples/headless-example: dependencies: '@ballerine/common': - specifier: 0.9.33 + specifier: 0.9.34 version: link:../../packages/common '@ballerine/workflow-browser-sdk': - specifier: 0.6.45 + specifier: 0.6.46 version: link:../../sdks/workflow-browser-sdk '@felte/reporter-svelte': specifier: ^1.1.5 @@ -1007,7 +1007,7 @@ importers: examples/report-generation-example: dependencies: '@ballerine/react-pdf-toolkit': - specifier: ^1.2.33 + specifier: ^1.2.34 version: link:../../packages/react-pdf-toolkit react: specifier: ^18.2.0 @@ -1050,7 +1050,7 @@ importers: packages/blocks: dependencies: '@ballerine/common': - specifier: ^0.9.33 + specifier: ^0.9.34 version: link:../common devDependencies: '@babel/core': @@ -1066,10 +1066,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../config '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../eslint-config '@rollup/plugin-babel': specifier: 5.3.1 @@ -1241,10 +1241,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../config '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -1390,7 +1390,7 @@ importers: packages/eslint-config-react: dependencies: '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../eslint-config eslint-plugin-react: specifier: ^7.33.2 @@ -1402,10 +1402,10 @@ importers: packages/react-pdf-toolkit: dependencies: '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../config '@ballerine/ui': - specifier: 0.5.33 + specifier: 0.5.34 version: link:../ui '@react-pdf/renderer': specifier: ^3.1.14 @@ -1524,10 +1524,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../config '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -1629,7 +1629,7 @@ importers: packages/ui: dependencies: '@ballerine/common': - specifier: ^0.9.33 + specifier: ^0.9.34 version: link:../common '@emotion/react': specifier: ^11.11.1 @@ -1741,10 +1741,10 @@ importers: version: 3.22.4 devDependencies: '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../config '@ballerine/eslint-config-react': - specifier: ^2.0.17 + specifier: ^2.0.18 version: link:../eslint-config-react '@cspell/cspell-types': specifier: ^6.31.1 @@ -1852,7 +1852,7 @@ importers: packages/workflow-core: dependencies: '@ballerine/common': - specifier: 0.9.33 + specifier: 0.9.34 version: link:../common ajv: specifier: ^8.12.0 @@ -1886,10 +1886,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../config '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -2027,7 +2027,7 @@ importers: sdks/web-ui-sdk: dependencies: '@ballerine/common': - specifier: 0.9.33 + specifier: 0.9.34 version: link:../../packages/common '@zerodevx/svelte-toast': specifier: ^0.8.0 @@ -2154,10 +2154,10 @@ importers: sdks/workflow-browser-sdk: dependencies: '@ballerine/common': - specifier: 0.9.33 + specifier: 0.9.34 version: link:../../packages/common '@ballerine/workflow-core': - specifier: 0.6.45 + specifier: 0.6.46 version: link:../../packages/workflow-core xstate: specifier: ^4.37.0 @@ -2173,10 +2173,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/config '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -2296,7 +2296,7 @@ importers: sdks/workflow-node-sdk: dependencies: '@ballerine/workflow-core': - specifier: 0.6.45 + specifier: 0.6.46 version: link:../../packages/workflow-core json-logic-js: specifier: ^2.0.2 @@ -2315,10 +2315,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/config '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -2541,13 +2541,13 @@ importers: specifier: 3.347.1 version: 3.347.1 '@ballerine/common': - specifier: 0.9.33 + specifier: 0.9.34 version: link:../../packages/common '@ballerine/workflow-core': - specifier: 0.6.45 + specifier: 0.6.46 version: link:../../packages/workflow-core '@ballerine/workflow-node-sdk': - specifier: 0.6.45 + specifier: 0.6.46 version: link:../../sdks/workflow-node-sdk '@faker-js/faker': specifier: ^7.6.0 @@ -2719,10 +2719,10 @@ importers: version: 3.22.4 devDependencies: '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/config '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -2884,7 +2884,7 @@ importers: specifier: ^4.0.0 version: 4.0.0(astro@3.3.3)(tailwindcss@3.3.5)(ts-node@10.9.1) '@ballerine/common': - specifier: ^0.9.33 + specifier: ^0.9.34 version: link:../../packages/common astro: specifier: 3.3.3 @@ -2897,10 +2897,10 @@ importers: version: 0.14.5 devDependencies: '@ballerine/config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/config '@ballerine/eslint-config': - specifier: ^1.1.17 + specifier: ^1.1.18 version: link:../../packages/eslint-config eslint: specifier: ^8.46.0 diff --git a/services/workflows-service/prisma/data-migrations b/services/workflows-service/prisma/data-migrations index e810f58cf3..fd7066512f 160000 --- a/services/workflows-service/prisma/data-migrations +++ b/services/workflows-service/prisma/data-migrations @@ -1 +1 @@ -Subproject commit e810f58cf3f020290ff9639251d1d9e13d227b48 +Subproject commit fd7066512f965853d4a236ba7e40b397d60df175