Skip to content

Commit

Permalink
feat(backoffice-v2): added aml block to kyb ubos tab (#2563)
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri-Levy committed Jul 25, 2024
1 parent e933843 commit 5507c1b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const getTabsToBlocksMap = ({
documentReviewBlocks,
businessInformationBlocks,
caseOverviewBlock,
amlWithContainerBlock,
customDataBlock,
] = blocks;

Expand Down Expand Up @@ -80,6 +81,7 @@ export const getTabsToBlocksMap = ({
[Tab.UBOS]: [
...ubosUserProvidedBlock,
...ubosRegistryProvidedBlock,
...amlWithContainerBlock,
...(createKycBlocks(blocksCreationParams?.workflow as TWorkflowById) || []),
],
[Tab.ASSOCIATED_COMPANIES]: [
Expand Down Expand Up @@ -108,7 +110,11 @@ export const getTabsToBlocksMap = ({

if (theme?.type === WorkflowDefinitionConfigThemeEnum.KYC) {
return {
[Tab.KYC]: [...businessInformationBlocks, ...createKycBlocks(blocksCreationParams?.workflow)],
[Tab.KYC]: [
...businessInformationBlocks,
...amlWithContainerBlock,
...createKycBlocks(blocksCreationParams?.workflow),
],
} as const;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { useSearchParamsByEntity } from '@/common/hooks/useSearchParamsByEntity/
import { useLocation } from 'react-router-dom';
import { omitPropsFromObjectWhitelist } from '@/common/utils/omit-props-from-object-whitelist/omit-props-from-object-whitelist';
import { useObjectEntriesBlock } from '@/lib/blocks/hooks/useObjectEntriesBlock/useObjectEntriesBlock';
import { useAmlBlock } from '@/lib/blocks/components/AmlBlock/hooks/useAmlBlock/useAmlBlock';

const registryInfoWhitelist = ['open_corporates'] as const;

Expand Down Expand Up @@ -397,6 +398,24 @@ export const useDefaultBlocksLogic = () => {
heading: 'Custom Data',
});

const amlData = useMemo(() => [workflow?.context?.aml], [workflow?.context?.aml]);

const amlBlock = useAmlBlock(amlData);

const amlWithContainerBlock = useMemo(() => {
if (!amlBlock?.length) {
return [];
}

return createBlocksTyped()
.addBlock()
.addCell({
type: 'block',
value: amlBlock,
})
.build();
}, [amlBlock]);

const allBlocks = useMemo(() => {
if (!workflow?.context?.entity) return [];

Expand Down Expand Up @@ -427,6 +446,7 @@ export const useDefaultBlocksLogic = () => {
businessInformationBlocks,
caseOverviewBlock,
customDataBlock,
amlWithContainerBlock,
];
}, [
associatedCompaniesBlock,
Expand Down Expand Up @@ -455,6 +475,7 @@ export const useDefaultBlocksLogic = () => {
businessInformationBlocks,
caseOverviewBlock,
customDataBlock,
amlWithContainerBlock,
workflow?.context?.entity,
]);

Expand Down

0 comments on commit 5507c1b

Please sign in to comment.