Skip to content

Commit 5716cd8

Browse files
chore: bump versions and update dependencies
- Bump version for kyb-app to 0.3.117 - Bump version for react-pdf-toolkit to 1.2.68 - Bump version for ui to 0.5.68 and workflows-service to 0.7.94 (Your version bumps are flying higher than my hopes for a bug-free release)
1 parent 0e018fe commit 5716cd8

File tree

13 files changed

+80
-27
lines changed

13 files changed

+80
-27
lines changed

apps/kyb-app/CHANGELOG.md

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

3+
## 0.3.117
4+
5+
### Patch Changes
6+
7+
- version bump
8+
- Updated dependencies
9+
- @ballerine/ui@0.5.68
10+
311
## 0.3.116
412

513
### Patch Changes

apps/kyb-app/package.json

Lines changed: 2 additions & 2 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.116",
4+
"version": "0.3.117",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -19,7 +19,7 @@
1919
"@ballerine/blocks": "0.2.34",
2020
"@ballerine/common": "^0.9.70",
2121
"@ballerine/workflow-browser-sdk": "0.6.89",
22-
"@ballerine/ui": "0.5.67",
22+
"@ballerine/ui": "0.5.68",
2323
"@lukemorales/query-key-factory": "^1.0.3",
2424
"@radix-ui/react-icons": "^1.3.0",
2525
"@rjsf/core": "^5.9.0",

apps/kyb-app/src/components/organisms/DynamicUI/rule-engines/json-schema.rule-engine.ts

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1+
import dayjs from 'dayjs';
2+
import uniqBy from 'lodash/uniqBy';
3+
import ajvErrors from 'ajv-errors';
4+
import { AnyObject } from '@ballerine/ui';
5+
import Ajv, { ErrorObject } from 'ajv/dist/2019';
6+
import addFormats, { FormatName } from 'ajv-formats';
7+
8+
import { Rule, UIElement } from '@/domains/collection-flow';
19
import {
210
ErrorField,
311
RuleEngine,
412
} from '@/components/organisms/DynamicUI/rule-engines/rule-engine.abstract';
5-
import { Rule, UIElement } from '@/domains/collection-flow';
6-
import { AnyObject } from '@ballerine/ui';
7-
import ajvErrors from 'ajv-errors';
8-
import addFormats, { FormatName } from 'ajv-formats';
9-
import Ajv, { ErrorObject } from 'ajv/dist/2019';
10-
import uniqBy from 'lodash/uniqBy';
13+
14+
const addCustomFormats = (validator: Ajv) => {
15+
validator.addFormat('non-past-date', {
16+
type: 'string',
17+
validate: (dateString: string) => {
18+
const inputDate = dayjs(dateString);
19+
20+
if (!inputDate) {
21+
return false;
22+
}
23+
24+
return inputDate.startOf('day').valueOf() >= dayjs().startOf('day').valueOf();
25+
},
26+
});
27+
};
1128

1229
export class JsonSchemaRuleEngine implements RuleEngine {
1330
static ALLOWED_FORMATS: FormatName[] = ['email', 'uri', 'date', 'date-time'];
@@ -18,12 +35,16 @@ export class JsonSchemaRuleEngine implements RuleEngine {
1835
// @ts-ignore
1936
validate(context: unknown, rule: Rule, definition: UIElement<AnyObject>) {
2037
const validator = new Ajv({ allErrors: true, useDefaults: true });
38+
2139
addFormats(validator, {
2240
formats: JsonSchemaRuleEngine.ALLOWED_FORMATS,
2341
keywords: true,
2442
});
43+
2544
ajvErrors(validator, { singleError: true });
2645

46+
addCustomFormats(validator);
47+
2748
const validationResult = validator.validate(rule.value, context);
2849

2950
if (!validationResult) {
@@ -37,15 +58,17 @@ export class JsonSchemaRuleEngine implements RuleEngine {
3758

3859
test(context: unknown, rule: Rule) {
3960
const validator = new Ajv({ allErrors: true, useDefaults: true, $data: true });
61+
4062
addFormats(validator, {
4163
formats: ['email', 'uri', 'date', 'date-time'],
4264
keywords: true,
4365
});
66+
4467
ajvErrors(validator, { singleError: true });
4568

46-
const validationResult = validator.validate(rule.value, context);
69+
addCustomFormats(validator);
4770

48-
return validationResult;
71+
return validator.validate(rule.value, context);
4972
}
5073

5174
private extractErrorsWithFields(validator: Ajv, definition: UIElement<AnyObject>) {

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { MCC } from '@/components/organisms/UIRenderer/elements/JSONForm/compone
44
import { RJSFInputProps, TextInputAdapter } from '@ballerine/ui';
55

66
export const MCCPicker = (props: RJSFInputProps) => {
7-
const options = useMemo(
8-
() =>
9-
MCC.map(item => ({
10-
const: item.const,
11-
title: `${item.const} - ${item.title}`,
12-
})),
13-
[],
14-
);
7+
const options = useMemo(() => {
8+
const list =
9+
(props.uiSchema?.['ui:options']?.mcc as Array<{ const: string; title: string }>) || MCC;
10+
11+
return list.map(item => ({
12+
const: item.const,
13+
title: `${item.const} - ${item.title}`,
14+
}));
15+
}, [props.uiSchema]);
1516

1617
const propsWithOptions = useMemo(
1718
() => ({

packages/react-pdf-toolkit/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @ballerine/react-pdf-toolkit
22

3+
## 1.2.68
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/ui@0.5.68
9+
310
## 1.2.67
411

512
### Patch Changes

packages/react-pdf-toolkit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/react-pdf-toolkit",
33
"private": false,
4-
"version": "1.2.67",
4+
"version": "1.2.68",
55
"types": "./dist/build.d.ts",
66
"main": "./dist/react-pdf-toolkit.js",
77
"module": "./dist/react-pdf-toolkit.mjs",
@@ -27,7 +27,7 @@
2727
},
2828
"dependencies": {
2929
"@ballerine/config": "^1.1.32",
30-
"@ballerine/ui": "0.5.67",
30+
"@ballerine/ui": "0.5.68",
3131
"@react-pdf/renderer": "^3.1.14",
3232
"@sinclair/typebox": "^0.31.7",
3333
"ajv": "^8.12.0",

packages/ui/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @ballerine/ui
22

3+
## 0.5.68
4+
5+
### Patch Changes
6+
7+
- version bump
8+
39
## 0.5.67
410

511
### Patch Changes

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/ui",
33
"private": false,
4-
"version": "0.5.67",
4+
"version": "0.5.68",
55
"type": "module",
66
"main": "dist/index.js",
77
"types": "dist/index.d.ts",

packages/ui/src/components/organisms/DynamicForm/components/RSJVInputAdaters/BooleanFieldAdapter/BooleanFieldAdapter.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
import { useCallback } from 'react';
2+
13
import { ctw } from '@/common/utils/ctw';
24
import { Checkbox } from '@/components/atoms';
35
import { RJSFInputAdapter } from '@/components/organisms/DynamicForm/components/RSJVInputAdaters/types';
4-
import { useCallback } from 'react';
56

67
export const BooleanFieldAdapter: RJSFInputAdapter<boolean> = ({
78
id,
89
formData,
910
schema,
11+
uiSchema,
1012
disabled,
1113
testId,
1214
onChange,
@@ -34,7 +36,7 @@ export const BooleanFieldAdapter: RJSFInputAdapter<boolean> = ({
3436
}}
3537
onBlur={handleBlur}
3638
/>
37-
<span>{schema.title}</span>
39+
<span className={ctw(uiSchema?.className)}>{schema.title}</span>
3840
</label>
3941
);
4042
};

pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)