Skip to content

Commit 9882b09

Browse files
committed
chore: merge dev changes
2 parents f2fbedf + c83a724 commit 9882b09

File tree

47 files changed

+2251
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2251
-702
lines changed

apps/backoffice-v2/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# @ballerine/backoffice-v2
22

3+
## 0.7.72
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/ui@0.5.47
9+
- @ballerine/workflow-browser-sdk@0.6.68
10+
- @ballerine/workflow-node-sdk@0.6.68
11+
- @ballerine/react-pdf-toolkit@1.2.47
12+
13+
## 0.7.71
14+
15+
### Patch Changes
16+
17+
- Updated dependencies
18+
- @ballerine/common@0.9.53
19+
- @ballerine/ui@0.5.46
20+
- @ballerine/workflow-browser-sdk@0.6.67
21+
- @ballerine/workflow-node-sdk@0.6.67
22+
- @ballerine/react-pdf-toolkit@1.2.46
23+
324
## 0.7.70
425

526
### Patch Changes

apps/backoffice-v2/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ballerine/backoffice-v2",
3-
"version": "0.7.70",
3+
"version": "0.7.72",
44
"description": "Ballerine - Backoffice",
55
"homepage": "https://github.com/ballerine-io/ballerine",
66
"type": "module",
@@ -52,11 +52,11 @@
5252
},
5353
"dependencies": {
5454
"@ballerine/blocks": "0.2.27",
55-
"@ballerine/common": "0.9.52",
56-
"@ballerine/react-pdf-toolkit": "^1.2.45",
57-
"@ballerine/ui": "^0.5.45",
58-
"@ballerine/workflow-browser-sdk": "0.6.66",
59-
"@ballerine/workflow-node-sdk": "0.6.66",
55+
"@ballerine/common": "0.9.53",
56+
"@ballerine/react-pdf-toolkit": "^1.2.47",
57+
"@ballerine/ui": "^0.5.47",
58+
"@ballerine/workflow-browser-sdk": "0.6.68",
59+
"@ballerine/workflow-node-sdk": "0.6.68",
6060
"@botpress/webchat": "^2.1.10",
6161
"@botpress/webchat-generator": "^0.2.9",
6262
"@fontsource/inter": "^4.5.15",

apps/backoffice-v2/src/common/utils/fetcher/fetcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const fetcher: IFetcher = async ({
6969
return await handlePromise(res.blob());
7070
}
7171

72-
if (!res.headers.get('content-length') || res.headers.get('content-length') > '0') {
72+
if (!res.headers.get('content-length') || Number(res.headers.get('content-length')) > 0) {
7373
// TODO: make sure its json by checking the content-type in order to safe access to json method
7474
return await handlePromise(res.json());
7575
}

apps/kyb-app/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# kyb-app
22

3+
## 0.3.83
4+
5+
### Patch Changes
6+
7+
- version bump
8+
: Please enter a summary for your changes.
9+
- Updated dependencies
10+
- @ballerine/ui@0.5.47
11+
- @ballerine/workflow-browser-sdk@0.6.68
12+
13+
## 0.3.82
14+
15+
### Patch Changes
16+
17+
- Updated dependencies
18+
- @ballerine/common@0.9.53
19+
- @ballerine/ui@0.5.46
20+
- @ballerine/workflow-browser-sdk@0.6.67
21+
322
## 0.3.81
423

524
### Patch Changes

apps/kyb-app/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/kyb-app",
33
"private": true,
4-
"version": "0.3.81",
4+
"version": "0.3.83",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -16,9 +16,9 @@
1616
},
1717
"dependencies": {
1818
"@ballerine/blocks": "0.2.27",
19-
"@ballerine/common": "^0.9.52",
20-
"@ballerine/ui": "0.5.45",
21-
"@ballerine/workflow-browser-sdk": "0.6.66",
19+
"@ballerine/common": "^0.9.53",
20+
"@ballerine/ui": "0.5.47",
21+
"@ballerine/workflow-browser-sdk": "0.6.68",
2222
"@lukemorales/query-key-factory": "^1.0.3",
2323
"@radix-ui/react-icons": "^1.3.0",
2424
"@rjsf/core": "^5.9.0",
@@ -61,7 +61,7 @@
6161
"uuid": "^9.0.0",
6262
"vite-plugin-terminal": "^1.1.0",
6363
"xstate": "^4.38.2",
64-
"zod": "^3.21.4"
64+
"zod": "^3.23.4"
6565
},
6666
"devDependencies": {
6767
"@ballerine/config": "^1.1.25",

apps/kyb-app/src/common/providers/DependenciesProvider/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isExceptionWillBeHandled } from '@/common/utils/helpers';
12
import { HTTPError } from 'ky';
23

34
interface IErrorBody {
@@ -22,6 +23,5 @@ export const getJsonErrors = async (errors: HTTPError[]) => {
2223
export const isShouldIgnoreErrors = async (errors: HTTPError[]) => {
2324
const errorResponses = await getJsonErrors(errors);
2425

25-
// TODO: We should have different error status for this to avoid strict comparison to error message
26-
return errorResponses.every(({ message }) => message === 'No EndUser is set for this token');
26+
return errorResponses.every(error => isExceptionWillBeHandled(error as unknown as HTTPError));
2727
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { HTTPError } from 'ky';
2+
3+
export const isExceptionWillBeHandled = (error: HTTPError) => {
4+
return error.message === 'No EndUser is set for this token';
5+
};

apps/kyb-app/src/common/utils/request.ts

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getAccessToken } from '@/helpers/get-access-token.helper';
22
import * as Sentry from '@sentry/react';
33
import ky, { HTTPError } from 'ky';
4+
import { isExceptionWillBeHandled } from './helpers';
45

56
export const request = ky.create({
67
prefixUrl: import.meta.env.VITE_API_URL || `${window.location.origin}/api/v1/`,
@@ -25,33 +26,40 @@ export const request = ky.create({
2526

2627
try {
2728
responseBody = await error.response.clone().text();
28-
} catch (_) {
29-
/* empty */
30-
}
29+
const responseJson = await error.response.clone().json();
3130

32-
Sentry.withScope(function (scope) {
33-
// group errors together based on their request and response
34-
scope.setFingerprint([
35-
request.method,
36-
request.url,
37-
String(error.response.status),
38-
getAccessToken() || 'anonymous',
39-
]);
40-
Sentry.setUser({
41-
id: getAccessToken() || 'anonymous',
42-
});
31+
const isShouldIgnore = isExceptionWillBeHandled({
32+
message: (responseJson as { message: string }).message,
33+
} as HTTPError);
34+
35+
if (isShouldIgnore) return error as HTTPError;
4336

44-
Sentry.captureException(error, {
45-
extra: {
46-
ErrorMessage: `StatusCode: ${response?.status}, URL:${response?.url}`,
47-
// @ts-ignore
48-
reqId: response?.headers?.['X-Request-ID'],
49-
bodyRaw: responseBody,
50-
},
37+
throw error;
38+
} catch (error) {
39+
Sentry.withScope(scope => {
40+
// group errors together based on their request and response
41+
scope.setFingerprint([
42+
request.method,
43+
request.url,
44+
String((error as HTTPError).response.status),
45+
getAccessToken() || 'anonymous',
46+
]);
47+
Sentry.setUser({
48+
id: getAccessToken() || 'anonymous',
49+
});
50+
51+
Sentry.captureException(error, {
52+
extra: {
53+
ErrorMessage: `StatusCode: ${response?.status}, URL:${response?.url}`,
54+
// @ts-ignore
55+
reqId: response?.headers?.['X-Request-ID'],
56+
bodyRaw: responseBody,
57+
},
58+
});
5159
});
52-
});
5360

54-
return error;
61+
return error as HTTPError;
62+
}
5563
},
5664
],
5765
},

apps/kyb-app/src/components/organisms/UIRenderer/elements/JSONForm/components/Multiselect/Multiselect.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export const Multiselect = ({
2525
(params, option) => {
2626
return (
2727
<Chip
28-
key={option.value}
28+
key={option?.value}
2929
className="h-6"
3030
variant={definition?.options.variants?.chip?.wrapper}
3131
>
32-
<Chip.Label text={option.title} variant={definition?.options.variants?.chip?.label} />
32+
<Chip.Label text={option?.title} variant={definition?.options.variants?.chip?.label} />
3333
<Chip.UnselectButton
3434
{...params.unselectButtonProps}
3535
icon={<X className="hover:text-muted-foreground h-3 w-3 text-white" />}

apps/kyb-app/src/components/organisms/UIRenderer/elements/JSONForm/hocs/withDynamicUIInput/withDynamicUIInput.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import { useUIElementState } from '@/components/organisms/UIRenderer/hooks/useUI
1010
import { UIElement } from '@/domains/collection-flow';
1111
import { AnyObject, ErrorsList, RJSFInputAdapter, RJSFInputProps } from '@ballerine/ui';
1212
import get from 'lodash/get';
13-
import { useCallback, useMemo } from 'react';
13+
import { useCallback, useEffect, useMemo } from 'react';
14+
import { useEventEmitterLogic } from '@/components/organisms/DynamicUI/StateManager/components/ActionsHandler';
15+
import { useRefValue } from '@/hooks/useRefValue';
1416

1517
const findLastDigit = (str: string) => {
1618
const digitRegex = /_(\d+)_/g;
@@ -122,6 +124,13 @@ export const withDynamicUIInput = (
122124

123125
const { validationErrors, warnings } = useUIElementErrors(definition);
124126

127+
const emitEvent = useEventEmitterLogic(definition);
128+
const emitEventRef = useRefValue(emitEvent);
129+
130+
useEffect(() => {
131+
emitEventRef.current('onMount');
132+
}, [emitEventRef]);
133+
125134
return (
126135
<div className="flex flex-col gap-2">
127136
<Component

0 commit comments

Comments
 (0)