diff --git a/README.md b/README.md index 4702d91733..535ee869b1 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ Once the process is complete, _2 tabs_ will open in your browser: We appreciate all types of contributions and believe that an active community is the secret to a rich and stable product. Here are some of the ways you can contribute: -- Give us feedback in our [Slack community](https://join.slack.com/t/ballerine-oss/shared_invite/zt-1iu6otkok-OqBF3TrcpUmFd9oUjNs2iw) +- Give us feedback in our [Slack community](https://join.slack.com/t/ballerine-oss/shared_invite/zt-1il7txerq-K0YrXtlzMttGgD3XXYxlfw) - Help with bugs and features on [our Issues page](https://github.com/ballerine-io/ballerine/issues) - Submit a [feature request](https://github.com/ballerine-io/ballerine/issues/new?assignees=&labels=enhancement%2C+feature&template=feature_request.md) or [bug report](https://github.com/ballerine-io/ballerine/issues/new?assignees=&labels=bug&template=bug_report.md) diff --git a/apps/backoffice-v2/src/domains/ui-definition/fetchers.ts b/apps/backoffice-v2/src/domains/ui-definition/fetchers.ts index 0308ac3940..02ff4fa5fd 100644 --- a/apps/backoffice-v2/src/domains/ui-definition/fetchers.ts +++ b/apps/backoffice-v2/src/domains/ui-definition/fetchers.ts @@ -8,12 +8,14 @@ import { z } from 'zod'; export const translateUiDefinition = async ({ id, partialUiDefinition, + locale, }: { id: string; partialUiDefinition: Record; + locale: string; }) => { const [data, error] = await apiClient({ - endpoint: `../case-management/ui-definition/${id}/translate/en`, + endpoint: `../case-management/ui-definition/${id}/translate/${locale}`, method: Method.POST, body: { partialUiDefinition, diff --git a/apps/backoffice-v2/src/domains/ui-definition/hooks/queries/useTranslateUiDefinitionQuery/useTranslateUiDefinitionQuery.tsx b/apps/backoffice-v2/src/domains/ui-definition/hooks/queries/useTranslateUiDefinitionQuery/useTranslateUiDefinitionQuery.tsx index 67680ebfec..9972b24f4b 100644 --- a/apps/backoffice-v2/src/domains/ui-definition/hooks/queries/useTranslateUiDefinitionQuery/useTranslateUiDefinitionQuery.tsx +++ b/apps/backoffice-v2/src/domains/ui-definition/hooks/queries/useTranslateUiDefinitionQuery/useTranslateUiDefinitionQuery.tsx @@ -5,12 +5,14 @@ import { uiDefinitionQueryKeys } from '@/domains/ui-definition/query-keys'; export const useTranslateUiDefinitionQuery = ({ id, partialUiDefinition, + locale, }: { id: string; partialUiDefinition: Record; + locale: string; }) => { return useQuery({ - ...uiDefinitionQueryKeys.translate({ id, partialUiDefinition }), + ...uiDefinitionQueryKeys.translate({ id, partialUiDefinition, locale }), enabled: !!partialUiDefinition && !!id, }); }; diff --git a/apps/backoffice-v2/src/domains/ui-definition/query-keys.ts b/apps/backoffice-v2/src/domains/ui-definition/query-keys.ts index 0ac3ac904e..3e994ac1ae 100644 --- a/apps/backoffice-v2/src/domains/ui-definition/query-keys.ts +++ b/apps/backoffice-v2/src/domains/ui-definition/query-keys.ts @@ -5,18 +5,21 @@ export const uiDefinitionQueryKeys = createQueryKeys('ui-definition', { translate: ({ id, partialUiDefinition, + locale, }: { id: string; partialUiDefinition: Record; + locale: string; }) => { return { queryKey: [ { id, partialUiDefinition, + locale, }, ], - queryFn: () => translateUiDefinition({ id, partialUiDefinition }), + queryFn: () => translateUiDefinition({ id, partialUiDefinition, locale }), }; }, }); diff --git a/apps/backoffice-v2/src/domains/workflow-definitions/fetchers.ts b/apps/backoffice-v2/src/domains/workflow-definitions/fetchers.ts index 19e5352b5a..836c371ef3 100644 --- a/apps/backoffice-v2/src/domains/workflow-definitions/fetchers.ts +++ b/apps/backoffice-v2/src/domains/workflow-definitions/fetchers.ts @@ -56,6 +56,15 @@ export const WorkflowDefinitionConfigSchema = z .optional(), }) .optional(), + ubos: z + .object({ + create: z + .object({ + enabled: z.boolean().optional(), + }) + .optional(), + }) + .optional(), }) .passthrough() .nullable(); diff --git a/apps/backoffice-v2/src/lib/blocks/components/KycBlock/hooks/useKycBlock/useKycBlock.tsx b/apps/backoffice-v2/src/lib/blocks/components/KycBlock/hooks/useKycBlock/useKycBlock.tsx index 9d4f5054e8..06adfc78db 100644 --- a/apps/backoffice-v2/src/lib/blocks/components/KycBlock/hooks/useKycBlock/useKycBlock.tsx +++ b/apps/backoffice-v2/src/lib/blocks/components/KycBlock/hooks/useKycBlock/useKycBlock.tsx @@ -373,19 +373,6 @@ export const useKycBlock = ({ className: 'mt-0', }, }) - .addCell({ - type: 'callToAction', - value: { - text: 'Initiate KYC', - onClick: onInitiateKyc, - props: { - className: - 'justify-self-end px-2 py-0 text-xs aria-disabled:pointer-events-none aria-disabled:opacity-50', - variant: 'outline', - disabled: !event, - }, - }, - }) .build() .flat(1), }) @@ -564,6 +551,19 @@ export const useKycBlock = ({ className: 'py-4 text-slate-500', }, }) + .addCell({ + type: 'callToAction', + value: { + text: 'Initiate KYC', + onClick: onInitiateKyc, + props: { + className: + 'px-2 py-0 text-xs aria-disabled:pointer-events-none aria-disabled:opacity-50 ms-3', + variant: 'outline', + disabled: !event, + }, + }, + }) .buildFlat(), }) .addCell({ diff --git a/apps/backoffice-v2/src/lib/blocks/hooks/useManageUbosBlock/useManageUbosBlock.tsx b/apps/backoffice-v2/src/lib/blocks/hooks/useManageUbosBlock/useManageUbosBlock.tsx index 69bd4a0b94..8ea0091896 100644 --- a/apps/backoffice-v2/src/lib/blocks/hooks/useManageUbosBlock/useManageUbosBlock.tsx +++ b/apps/backoffice-v2/src/lib/blocks/hooks/useManageUbosBlock/useManageUbosBlock.tsx @@ -25,8 +25,15 @@ import { transformErrors } from '@/pages/Entities/components/CaseCreation/compon import { useTranslateUiDefinitionQuery } from '@/domains/ui-definition/hooks/queries/useTranslateUiDefinitionQuery/useTranslateUiDefinitionQuery'; import { useDeleteUbosByIdsMutation } from '@/domains/workflows/hooks/mutations/useDeleteUbosByIdsMutation/useDeleteUbosByIdsMutation'; import { useCreateUboMutation } from '@/domains/workflows/hooks/mutations/useCreateUboMutation/useCreateUboMutation'; +import { useLocale } from '@/common/hooks/useLocale/useLocale'; -export const useManageUbosBlock = () => { +export const useManageUbosBlock = ({ + create, +}: { + create: { + enabled: boolean; + }; +}) => { const { data: workflow } = useCurrentCaseQuery(); const { data: workflowDefinition } = useWorkflowDefinitionByIdQuery({ workflowDefinitionId: workflow?.workflowDefinition?.id ?? '', @@ -34,15 +41,24 @@ export const useManageUbosBlock = () => { const uiDefinition = workflowDefinition?.uiDefinitions?.find( uiDefinition => uiDefinition.uiContext === 'collection_flow', ); + const locale = useLocale(); const { data: translatedUbos } = useTranslateUiDefinitionQuery({ id: uiDefinition?.id ?? '', partialUiDefinition: ubosFormJsonDefinition, + locale, }); const { formSchema, uiSchema } = createFormSchemaFromUIElements(translatedUbos ?? {}); const [isAddingUbo, _toggleIsAddingUbo, toggleOnIsAddingUbo, toggleOffIsAddingUbo] = useToggle(); + const [isManageUbosOpen, toggleIsManageUbosOpen] = useToggle(); const { mutate: mutateCreateUbo } = useCreateUboMutation({ workflowId: workflow?.id, - onSuccess: toggleOffIsAddingUbo, + onSuccess: () => { + if (!isAddingUbo) { + return; + } + + toggleOffIsAddingUbo(); + }, }); const { mutate: mutateDeleteUbosByIds } = useDeleteUbosByIdsMutation({ workflowId: workflow?.id, @@ -107,6 +123,7 @@ export const useManageUbosBlock = () => { { description={

Are you sure you want to remove this UBO? This action will be logged, and the - UBO's data will be removed from the case and webhooks. + UBO's data will be removed from the case.

} content={null} @@ -191,8 +208,11 @@ export const useManageUbosBlock = () => { type: 'node', value: ( { } content={
- {!isAddingUbo && ( + {(!create.enabled || !isAddingUbo) && (

Manage UBOs

{ }} props={{ scroll: { - className: 'h-[73vh]', + className: '[&>div]:max-h-[73vh]', }, }} /> - + {create.enabled && ( + + )}
)} - {isAddingUbo && ( -
- - - - -
+ +
+

Add UBO

+ + div>fieldset>div:first-of-type]:py-0 [&>div]:py-0'} + /> + +
+ )}
} diff --git a/apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx b/apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx index d5577c46a6..b89381528c 100644 --- a/apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx +++ b/apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx @@ -339,7 +339,12 @@ export const useDefaultBlocksLogic = () => { isRequestTimedOut: workflow?.context?.pluginsOutput?.ubo?.isRequestTimedOut, }); - const manageUbosBlock = useManageUbosBlock(); + const manageUbosBlock = useManageUbosBlock({ + create: { + ...workflow?.workflowDefinition?.config?.ubos?.create, + enabled: workflow?.workflowDefinition?.config?.ubos?.create?.enabled ?? false, + }, + }); const directorsUserProvidedBlock = useDirectorsUserProvidedBlock(directorsUserProvided); diff --git a/apps/kyb-app/CHANGELOG.md b/apps/kyb-app/CHANGELOG.md index 227c5508f4..1437d7bc61 100644 --- a/apps/kyb-app/CHANGELOG.md +++ b/apps/kyb-app/CHANGELOG.md @@ -1,5 +1,12 @@ # kyb-app +## 0.3.98 + +### Patch Changes + +- Updated dependencies + - @ballerine/ui@0.5.55 + ## 0.3.97 ### Patch Changes diff --git a/apps/kyb-app/package.json b/apps/kyb-app/package.json index 4faeb2b42e..36d142a226 100644 --- a/apps/kyb-app/package.json +++ b/apps/kyb-app/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/kyb-app", "private": true, - "version": "0.3.97", + "version": "0.3.98", "type": "module", "scripts": { "dev": "vite", @@ -17,7 +17,7 @@ "dependencies": { "@ballerine/blocks": "0.2.30", "@ballerine/common": "^0.9.60", - "@ballerine/ui": "0.5.54", + "@ballerine/ui": "0.5.55", "@ballerine/workflow-browser-sdk": "0.6.79", "@lukemorales/query-key-factory": "^1.0.3", "@radix-ui/react-icons": "^1.3.0", diff --git a/packages/react-pdf-toolkit/CHANGELOG.md b/packages/react-pdf-toolkit/CHANGELOG.md index c6d67701b6..b86f999341 100644 --- a/packages/react-pdf-toolkit/CHANGELOG.md +++ b/packages/react-pdf-toolkit/CHANGELOG.md @@ -1,5 +1,12 @@ # @ballerine/react-pdf-toolkit +## 1.2.55 + +### Patch Changes + +- Updated dependencies + - @ballerine/ui@0.5.55 + ## 1.2.54 ### Patch Changes diff --git a/packages/react-pdf-toolkit/package.json b/packages/react-pdf-toolkit/package.json index 7033f5b022..ab638f9861 100644 --- a/packages/react-pdf-toolkit/package.json +++ b/packages/react-pdf-toolkit/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/react-pdf-toolkit", "private": false, - "version": "1.2.54", + "version": "1.2.55", "types": "./dist/build.d.ts", "main": "./dist/react-pdf-toolkit.js", "module": "./dist/react-pdf-toolkit.mjs", @@ -27,7 +27,7 @@ }, "dependencies": { "@ballerine/config": "^1.1.28", - "@ballerine/ui": "0.5.54", + "@ballerine/ui": "0.5.55", "@react-pdf/renderer": "^3.1.14", "@sinclair/typebox": "^0.31.7", "ajv": "^8.12.0", diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index c5062fabbd..840c22b243 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,11 @@ # @ballerine/ui +## 0.5.55 + +### Patch Changes + +- Fixed phone input styling + ## 0.5.54 ### Patch Changes diff --git a/packages/ui/package.json b/packages/ui/package.json index e6831113bc..bc50b531e5 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/ui", "private": false, - "version": "0.5.54", + "version": "0.5.55", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/ui/src/components/atoms/inputs/PhoneNumberInput/PhoneNumberInput.tsx b/packages/ui/src/components/atoms/inputs/PhoneNumberInput/PhoneNumberInput.tsx index cbe559d057..1d906e123b 100644 --- a/packages/ui/src/components/atoms/inputs/PhoneNumberInput/PhoneNumberInput.tsx +++ b/packages/ui/src/components/atoms/inputs/PhoneNumberInput/PhoneNumberInput.tsx @@ -27,12 +27,12 @@ export const PhoneNumberInput = (props: PhoneNumberInputProps) => { {...restProps} disabled={disabled} disableSearchIcon={disableSearchIcon} - containerClass="flex items-center border border-input h-9 focus-within:ring-ring focus-within:ring-1 rounded-md font-inter disabled:cursor-not-allowed disabled:opacity-50" - inputClass="w-full h-8 border-none outline-none disabled:cursor-not-allowed disabled:opacity-50" + containerClass="flex items-center border border-input focus-within:ring-ring focus-within:ring-1 rounded-md font-inter disabled:cursor-not-allowed disabled:opacity-50" + inputClass="w-full h-8 !border-none outline-none disabled:cursor-not-allowed disabled:opacity-50" searchClass={styles.searchInput} inputProps={{ ...restProps.inputProps, 'data-testid': testId }} buttonClass={clsx( - 'border-none rounded-l-md', + '!border-none rounded-l-md', { 'cursor-not-allowed opacity-50': disabled }, styles.hiddenArrow, styles.flagCenter, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 387a743b8b..8f83642efc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -524,7 +524,7 @@ importers: specifier: ^0.9.60 version: link:../../packages/common '@ballerine/ui': - specifier: 0.5.54 + specifier: 0.5.55 version: link:../../packages/ui '@ballerine/workflow-browser-sdk': specifier: 0.6.79 @@ -1504,7 +1504,7 @@ importers: specifier: ^1.1.28 version: link:../config '@ballerine/ui': - specifier: 0.5.54 + specifier: 0.5.55 version: link:../ui '@react-pdf/renderer': specifier: ^3.1.14 @@ -25388,7 +25388,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.3) debug: 3.2.7 eslint: 8.54.0 eslint-import-resolver-node: 0.3.9 @@ -25553,7 +25553,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 diff --git a/services/workflows-service/src/case-management/case-management.service.ts b/services/workflows-service/src/case-management/case-management.service.ts index bde7b25e3c..d78e49e54d 100644 --- a/services/workflows-service/src/case-management/case-management.service.ts +++ b/services/workflows-service/src/case-management/case-management.service.ts @@ -94,6 +94,12 @@ export class CaseManagementService { transaction, }); + if (!workflowRuntimeData.businessId) { + throw new BadRequestException( + `Attempted to create a UBO to a parent workflow without a business`, + ); + } + const uboToEntityAdapter = (ubo => { return { id: randomUUID(), @@ -131,12 +137,6 @@ export class CaseManagementService { transaction, ); - if (!workflowRuntimeData.businessId) { - throw new BadRequestException( - `Attempted to create a UBO to a parent workflow without a business`, - ); - } - await transaction.endUsersOnBusinesses.create({ data: { endUserId: ballerineEntityId, diff --git a/services/workflows-service/src/workflow/schemas/zod-schemas.ts b/services/workflows-service/src/workflow/schemas/zod-schemas.ts index a981b6203e..a19d763037 100644 --- a/services/workflows-service/src/workflow/schemas/zod-schemas.ts +++ b/services/workflows-service/src/workflow/schemas/zod-schemas.ts @@ -81,6 +81,15 @@ export const ConfigSchema = z .optional(), }) .optional(), + ubos: z + .object({ + create: z + .object({ + enabled: z.boolean().optional(), + }) + .optional(), + }) + .optional(), }) .strict() .optional();