Skip to content

Commit

Permalink
Merge branch 'dev' into dev-105/preview-githubaction
Browse files Browse the repository at this point in the history
  • Loading branch information
MayurDuduka authored Jan 1, 2025
2 parents a2fa32c + bcd15d5 commit 9a3e22e
Show file tree
Hide file tree
Showing 89 changed files with 1,313 additions and 598 deletions.
11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
node_modules
dist

# Eslint config file itself
.eslintrc.cjs

# Config files
rollup.config.js
babel.config.js

# Config pkg
packages/config
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions apps/backoffice-v2/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ module.exports = {
callees: ['ctw'],
},
},
parserOptions: {
project: './tsconfig.eslint.json',
},
rules: {
'tailwindcss/no-custom-classname': 'off',
'tailwindcss/classnames-order': 'off',
},
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.eslint.json',
},
};
25 changes: 25 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# @ballerine/backoffice-v2

## 0.7.87

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.63
- @ballerine/workflow-browser-sdk@0.6.82
- @ballerine/workflow-node-sdk@0.6.82

## 0.7.86

### Patch Changes

- @ballerine/workflow-browser-sdk@0.6.81
- @ballerine/workflow-node-sdk@0.6.81

## 0.7.85

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.61
- @ballerine/workflow-browser-sdk@0.6.80
- @ballerine/workflow-node-sdk@0.6.80

## 0.7.84

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions apps/backoffice-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ballerine/backoffice-v2",
"version": "0.7.84",
"version": "0.7.87",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -53,11 +53,11 @@
},
"dependencies": {
"@ballerine/blocks": "0.2.30",
"@ballerine/common": "0.9.60",
"@ballerine/common": "0.9.63",
"@ballerine/react-pdf-toolkit": "^1.2.54",
"@ballerine/ui": "^0.5.54",
"@ballerine/workflow-browser-sdk": "0.6.79",
"@ballerine/workflow-node-sdk": "0.6.79",
"@ballerine/workflow-browser-sdk": "0.6.82",
"@ballerine/workflow-node-sdk": "0.6.82",
"@botpress/webchat": "^2.1.10",
"@botpress/webchat-generator": "^0.2.9",
"@fontsource/inter": "^4.5.15",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { useQuery } from '@tanstack/react-query';
import { useIsAuthenticated } from '@/domains/auth/context/AuthProvider/hooks/useIsAuthenticated/useIsAuthenticated';
import { apiClient } from '@/common/api-client/api-client';
import { Method } from '@/common/enums';
import { handleZodError } from '@/common/utils/handle-zod-error/handle-zod-error';
import { z } from 'zod';

export const MetricsResponseSchema = z.object({
riskLevelCounts: z.object({
low: z.number(),
medium: z.number(),
high: z.number(),
critical: z.number(),
}),
violationCounts: z.record(z.string(), z.number()),
});

export const fetchBusinessReportMetrics = async () => {
const [businessReportMetrics, error] = await apiClient({
endpoint: `../external/business-reports/metrics`,
method: Method.GET,
schema: MetricsResponseSchema,
});

return handleZodError(error, businessReportMetrics);
};

export const useBusinessReportMetricsQuery = () => {
const isAuthenticated = useIsAuthenticated();

return useQuery({
queryKey: ['business-report-metrics'],
queryFn: () => fetchBusinessReportMetrics(),
enabled: isAuthenticated,
keepPreviousData: true,
});
};
4 changes: 3 additions & 1 deletion apps/backoffice-v2/src/domains/ui-definition/fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { z } from 'zod';
export const translateUiDefinition = async ({
id,
partialUiDefinition,
locale,
}: {
id: string;
partialUiDefinition: Record<string, unknown>;
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { uiDefinitionQueryKeys } from '@/domains/ui-definition/query-keys';
export const useTranslateUiDefinitionQuery = ({
id,
partialUiDefinition,
locale,
}: {
id: string;
partialUiDefinition: Record<string, unknown>;
locale: string;
}) => {
return useQuery({
...uiDefinitionQueryKeys.translate({ id, partialUiDefinition }),
...uiDefinitionQueryKeys.translate({ id, partialUiDefinition, locale }),
enabled: !!partialUiDefinition && !!id,
});
};
5 changes: 4 additions & 1 deletion apps/backoffice-v2/src/domains/ui-definition/query-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ export const uiDefinitionQueryKeys = createQueryKeys('ui-definition', {
translate: ({
id,
partialUiDefinition,
locale,
}: {
id: string;
partialUiDefinition: Record<string, unknown>;
locale: string;
}) => {
return {
queryKey: [
{
id,
partialUiDefinition,
locale,
},
],
queryFn: () => translateUiDefinition({ id, partialUiDefinition }),
queryFn: () => translateUiDefinition({ id, partialUiDefinition, locale }),
};
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ export const WorkflowDefinitionConfigSchema = z
.optional(),
})
.optional(),
ubos: z
.object({
create: z
.object({
enabled: z.boolean().optional(),
})
.optional(),
})
.optional(),
})
.passthrough()
.nullable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
Expand Down Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const ubosFormJsonDefinition = {
'company-ownership-passport-number-input',
'company-ownership-date-of-birth-input',
'company-ownership-nationality-input',
'company-ownership-gender-input',
'company-ownership-country-input',
'company-ownership-city-input',
],
Expand Down Expand Up @@ -176,32 +175,6 @@ export const ubosFormJsonDefinition = {
},
},
},
{
name: 'company-ownership-gender-input',
type: 'json-form:text',
valueDestination: 'gender',
options: {
label: 'text.companyOwnership.gender.label',
hint: 'text.companyOwnership.gender.placeholder',
jsonFormDefinition: {
type: 'string',
oneOf: [
{
title: 'text.companyOwnership.gender.male',
const: 'male',
},
{
title: 'text.companyOwnership.gender.female',
const: 'female',
},
{
title: 'text.companyOwnership.gender.other',
const: 'other',
},
],
},
},
},
{
name: 'company-ownership-country-input',
type: 'json-form:text',
Expand Down
Loading

0 comments on commit 9a3e22e

Please sign in to comment.