Skip to content

Commit

Permalink
Merge branch 'dev' into illiar/feat/collection-flow-customization
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterkmr committed Jul 2, 2024
2 parents a3d7e10 + 2549b85 commit d7692f9
Show file tree
Hide file tree
Showing 195 changed files with 5,203 additions and 1,509 deletions.
4 changes: 3 additions & 1 deletion .github/actions/test-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ runs:

- name: Test
shell: bash
run: pnpm test -- --verbose false
run: |
export NODE_OPTIONS="--max-old-space-size=8192"
pnpm test -- --verbose false
env:
ENVIRONMENT_NAME: test
JEST_HTML_REPORTER_PAGE_TITLE: ${{ github.ref_name }}
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/unit-test-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ runs:

- name: Test
shell: bash
run: pnpm test:unit
run: |
export NODE_OPTIONS="--max-old-space-size=8192"
pnpm test:unit
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "data-migrations"]
path = services/workflows-service/prisma/data-migrations
url = git@github.com:ballerine-io/wf-data-migration.git
branch = dev
ignore = dirty
branch = main
ignore = dirty
17 changes: 17 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
# @ballerine/backoffice-v2

## 0.7.15

### Patch Changes

- document changes
- Updated dependencies
- @ballerine/common@0.9.10
- @ballerine/blocks@0.2.4
- @ballerine/react-pdf-toolkit@1.2.4
- @ballerine/ui@0.5.4
- @ballerine/workflow-browser-sdk@0.6.16
- @ballerine/workflow-node-sdk@0.6.16

## 0.7.14

### Patch Changes

- @ballerine/workflow-browser-sdk@0.6.15
- @ballerine/workflow-node-sdk@0.6.15
- Updated dependencies
- @ballerine/common@0.9.9
- @ballerine/workflow-browser-sdk@0.6.15
- @ballerine/workflow-node-sdk@0.6.15

## 0.7.13

Expand Down
21 changes: 13 additions & 8 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.14",
"version": "0.7.15",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"repository": {
Expand Down Expand Up @@ -50,11 +50,12 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/blocks": "0.2.3",
"@ballerine/common": "0.9.8",
"@ballerine/ui": "^0.5.3",
"@ballerine/workflow-browser-sdk": "0.6.15",
"@ballerine/workflow-node-sdk": "0.6.15",
"@ballerine/blocks": "0.2.4",
"@ballerine/common": "0.9.10",
"@ballerine/react-pdf-toolkit": "^1.2.4",
"@ballerine/ui": "^0.5.4",
"@ballerine/workflow-browser-sdk": "0.6.16",
"@ballerine/workflow-node-sdk": "0.6.16",
"@fontsource/inter": "^4.5.15",
"@formkit/auto-animate": "1.0.0-beta.5",
"@hookform/resolvers": "^3.1.0",
Expand All @@ -74,6 +75,7 @@
"@radix-ui/react-slot": "^1.0.1",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@react-pdf/renderer": "^3.1.14",
"@radix-ui/react-tooltip": "^1.0.7",
"@rjsf/utils": "^5.9.0",
"@tanstack/react-query": "^4.19.1",
Expand All @@ -83,6 +85,7 @@
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
"dayjs": "^1.11.6",
"date-fns": "^3.0.6",
"eslint-plugin-tailwindcss": "^3.8.0",
"face-api.js": "^0.22.2",
"framer-motion": "^8.3.4",
Expand All @@ -96,6 +99,7 @@
"msw": "^1.0.0",
"qs": "^6.11.2",
"react": "^18.2.0",
"react-day-picker": "^8.10.1",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.13",
"react-hook-form": "^7.43.9",
Expand All @@ -106,6 +110,7 @@
"react-leaflet": "^4.2.1",
"react-router-dom": "^6.11.2",
"react-zoom-pan-pinch": "^3.0.8",
"recharts": "^2.7.2",
"sonner": "^1.4.3",
"string-ts": "^1.2.0",
"tailwind-merge": "^1.10.0",
Expand All @@ -116,8 +121,8 @@
"zod": "^3.22.3"
},
"devDependencies": {
"@ballerine/config": "^1.1.2",
"@ballerine/eslint-config-react": "^2.0.2",
"@ballerine/config": "^1.1.3",
"@ballerine/eslint-config-react": "^2.0.3",
"@cspell/cspell-types": "^6.31.1",
"@faker-js/faker": "^7.6.0",
"@playwright/test": "^1.32.1",
Expand Down
3 changes: 3 additions & 0 deletions apps/backoffice-v2/public/locales/en/toast.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
"success": "The alerts decision have been reverted successfully.",
"error": "Error occurred while reverting the alerts decision."
},
"pdf_certificate": {
"error": "Failed to open PDF certificate."
},
"business_report_creation": {
"success": "Merchant check created successfully.",
"error": "Error occurred while creating a merchant check.",
Expand Down
6 changes: 5 additions & 1 deletion apps/backoffice-v2/public/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"home": {
"greeting": "Welcome"
}
}
20 changes: 20 additions & 0 deletions apps/backoffice-v2/src/Router/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import { NotFoundRedirect } from '@/pages/NotFound/NotFound';
import { TransactionMonitoringAlerts } from '@/pages/TransactionMonitoringAlerts/TransactionMonitoringAlerts.page';
import { TransactionMonitoring } from '@/pages/TransactionMonitoring/TransactionMonitoring';
import { TransactionMonitoringAlertsAnalysisPage } from '@/pages/TransactionMonitoringAlertsAnalysis/TransactionMonitoringAlertsAnalysis.page';
import { Home } from '@/pages/Home/Home.page';
import { Statistics } from '@/pages/Statistics/Statistics.page';
import { Workflows } from '@/pages/Workflows/Workflows.page';
import { Profiles } from '@/pages/Profiles/Profiles.page';
import { Individuals } from '@/pages/Profiles/Individuals/Individuals.page';
import { MerchantMonitoring } from '@/pages/MerchantMonitoring/MerchantMonitoring.page';
Expand Down Expand Up @@ -146,6 +149,23 @@ const router = createBrowserRouter([
},
],
},
{
path: '/:locale/home',
element: <Home />,
children: [
{
path: '/:locale/home/statistics',
element: <Statistics />,
errorElement: <RouteError />,
},
{
path: '/:locale/home/workflows',
element: <Workflows />,
errorElement: <RouteError />,
},
],
errorElement: <RouteError />,
},
],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { RiskIndicatorsSummary } from '@/common/components/molecules/RiskIndicat
import { Card } from '@/common/components/atoms/Card/Card';
import { CardHeader } from '@/common/components/atoms/Card/Card.Header';
import { CardContent } from '@/common/components/atoms/Card/Card.Content';
import { TextWithNAFallback } from '@/common/components/atoms/TextWithNAFallback/TextWithNAFallback';
import { ctw } from '@/common/utils/ctw/ctw';
import { severityToClassName, severityToTextClassName } from '@/common/constants';
import { severityToClassName } from '@/common/constants';
import { Badge } from '@ballerine/ui';
import { titleCase } from 'string-ts';
import { getSeverityFromRiskScore } from '@/common/utils/get-severity-from-risk-score';
Expand Down Expand Up @@ -37,22 +36,6 @@ export const BusinessReportSummary: FunctionComponent<{
<CardHeader className={'pt-4 font-bold'}>
<span className={'mb-1'}>Overall Risk Level</span>
<div className="flex items-center space-x-2">
<TextWithNAFallback
className={ctw(
{
[severityToTextClassName[
(severity?.toUpperCase() as keyof typeof severityToClassName) ?? 'DEFAULT'
]]: riskScore || riskScore === 0,
},
{
'text-destructive': severity === Severity.CRITICAL,
},
'text-4xl font-bold',
)}
checkFalsy={false}
>
{riskScore}
</TextWithNAFallback>
{(riskScore || riskScore === 0) && (
<Badge
className={ctw(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React, { ComponentProps } from 'react';
import { CalendarIcon } from '@radix-ui/react-icons';
import { formatDate } from '@/common/utils/format-date';
import { ctw } from '@/common/utils/ctw/ctw';
import { Button } from '../../atoms/Button/Button';
import { Calendar } from '../../organisms/Calendar/Calendar';
import { Popover, PopoverContent, PopoverTrigger } from '@ballerine/ui';

type TDateRangePickerProps = {
onChange: NonNullable<ComponentProps<typeof Calendar>['onSelect']>;
value: NonNullable<ComponentProps<typeof Calendar>['selected']>;
className?: ComponentProps<'div'>['className'];
};

export const DateRangePicker = ({ onChange, value, className }: TDateRangePickerProps) => {
return (
<div className={ctw('grid gap-2', className)}>
<Popover>
<PopoverTrigger asChild>
<Button
id="date"
variant={'outline'}
className={ctw('w-[300px] justify-start text-left font-normal', {
'text-muted-foreground': !value,
})}
>
<CalendarIcon className="size-4 mr-2" />
{value?.from && value?.to && (
<>
{formatDate(value.from, 'LLL dd, y')} - {formatDate(value.to, 'LLL dd, y')}
</>
)}
{value?.from && !value?.to && formatDate(value.from, 'LLL dd, y')}
{!value?.from && !value?.to && <span>Pick a date</span>}
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="start">
<Calendar
initialFocus
mode="range"
selected={value}
onSelect={onChange}
numberOfMonths={2}
/>
</PopoverContent>
</Popover>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ import {

export const OverallRiskLevel: FunctionComponent<{
riskScore: number;
riskLevels: {
legalRisk: TSeverity;
chargebackRisk: TSeverity;
reputationRisk: TSeverity;
transactionLaunderingRisk: TSeverity;
};
riskLevels: Record<string, TSeverity>;
}> = ({ riskScore, riskLevels }) => {
const severity = getSeverityFromRiskScore(riskScore);

Expand All @@ -34,22 +29,6 @@ export const OverallRiskLevel: FunctionComponent<{
<CardHeader className={'pb-2 pt-4 font-bold'}>Overall Risk Level</CardHeader>
<CardContent>
<div className="mb-8 flex items-center space-x-2">
<TextWithNAFallback
className={ctw(
{
[severityToTextClassName[
(severity?.toUpperCase() as keyof typeof severityToClassName) ?? 'DEFAULT'
]]: riskScore || riskScore === 0,
},
{
'text-destructive': severity === Severity.CRITICAL,
},
'text-4xl font-bold',
)}
checkFalsy={false}
>
{riskScore}
</TextWithNAFallback>
{(riskScore || riskScore === 0) && (
<Badge
className={ctw(
Expand All @@ -70,7 +49,9 @@ export const OverallRiskLevel: FunctionComponent<{
<TableHeader className={'[&_tr]:border-b-0'}>
<TableRow className={'hover:bg-[unset]'}>
<TableHead className={'h-0 ps-0 font-bold text-foreground'}>Risk Type</TableHead>
<TableHead className={'h-0 ps-0 font-bold text-foreground'}>Risk Level</TableHead>
<TableHead className={'h-0 min-w-[9ch] ps-0 font-bold text-foreground'}>
Risk Level
</TableHead>
</TableRow>
</TableHeader>
<TableBody>
Expand All @@ -88,7 +69,7 @@ export const OverallRiskLevel: FunctionComponent<{
},
)}
>
{titleCase(riskLevel ?? '')}
<TextWithNAFallback>{titleCase(riskLevel ?? '')}</TextWithNAFallback>
</TableCell>
</TableRow>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const RiskIndicator = ({
violations,
}: {
title: string;
search: string;
search: string | undefined;
violations: Array<{
label: string;
severity: string;
Expand All @@ -22,17 +22,19 @@ export const RiskIndicator = ({
<div>
<h3 className="mb-3 space-x-4 font-bold text-slate-500">
<span>{title}</span>
<Link
className={buttonVariants({
variant: 'link',
className: 'h-[unset] cursor-pointer !p-0 !text-blue-500',
})}
to={{
search,
}}
>
View
</Link>
{search && (
<Link
className={buttonVariants({
variant: 'link',
className: 'h-[unset] cursor-pointer !p-0 !text-blue-500',
})}
to={{
search,
}}
>
View
</Link>
)}
</h3>
<ul className="list-inside list-disc">
{!!violations?.length &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ export const RiskIndicatorsSummary: FunctionComponent<{
return (
<Card className={'col-span-full'}>
<CardHeader className={'pt-4 font-bold'}>Risk Indicators</CardHeader>
<CardContent className={'grid grid-cols-3 gap-4'}>
{riskIndicators?.map(riskIndicator => (
<RiskIndicator
key={riskIndicator.title}
title={riskIndicator.title}
search={riskIndicator.search}
violations={riskIndicator.violations}
/>
))}
<CardContent className={'grid grid-cols-2 gap-4 xl:grid-cols-3'}>
{!!riskIndicators?.length &&
riskIndicators?.map(riskIndicator => (
<RiskIndicator
key={riskIndicator.title}
title={riskIndicator.title}
search={riskIndicator.search}
violations={riskIndicator.violations}
/>
))}
{!riskIndicators?.length && <p>No risk indicators detected.</p>}
</CardContent>
</Card>
);
Expand Down
Loading

0 comments on commit d7692f9

Please sign in to comment.