Skip to content

Commit f4975a5

Browse files
Omri-Levyalonp99MatanYadaevtomer-shvadronshanegrouber
authored
Dev -> Sb (#2917)
* chore: update package versions and dependencies - Bump package versions across various modules - Update dependencies to the latest stable versions (With this many updates, your dependencies have more frequent flyer miles than I do) * feat(workflow-definition): add configuration examples for vendors - Include detailed configuration examples for various vendors - Improve clarity on vendor integration and usage (These examples are so detailed, they could serve as a user manual for a rocket) * bal 3191 (#2905) * refactor(merchant-monitoring): improve search and date filtering logic - Simplify search parameters handling across components - Integrate DateRangePicker for filtering reports by date range - Clean up redundant search schemas and unused imports (your code is now so tidy, it could host a top-tier cleaning service) * BAL 3197 - add merchant monitoring filters to UI (#2901) * feat(business-reports): add UI for filtering by merchant type - Update reportType to accept 'All' alongside existing options - Modify query parameters to exclude type when 'All' is selected - Integrate a dropdown for selecting report types in the Merchant Monitoring page (Your dropdown is so user-friendly, it practically holds their hand through the process) * feat(business-reports): add risk level filtering to business reports - Integrate risk level filters in the business reports fetching logic - Update the MerchantMonitoring component to support risk level selection - Enhance search schema to include risk level as an optional filter (You've just added complexity like it's a family reunion—everyone’s confused!) * feat(MerchantMonitoring): add status filters to reports - Refactor MultiSelect components to include status filters - Update handling functions for new status parameter (your code is now as organized as a folder full of junk drawers) * feat(multi-select): enhance multi-select component with optional props - Add support for left and right icons in multi-select trigger - Refactor button styling in multi-select to accommodate new props - Modify multi-select usage in MerchantMonitoring to utilize new features (Your multi-select options are so numerous, I'm surprised it's not a buffet) --------- Co-authored-by: Tomer Shvadron <[email protected]> * refactor(business-reports): update report types and related logic - Rename and consolidate status and risk level types for clarity - Adjust fetch and query functions to accommodate new type structures - Ensure consistent naming conventions throughout the codebase (your code changes remind me of a jigsaw puzzle with missing pieces) * feat(risk): add risk level parameter to business report requests - Introduce riskLevel parameter for filtering reports - Update relevant DTO and validation schemas - Remove deprecated risk score utility function (Your risk assessment is so vague, it could be a fortune cookie message) * feat(MerchantMonitoring): add clear filters functionality - Implement onClearAllFilters to reset all filter parameters - Add a "Clear All" button in the Merchant Monitoring page - Update MultiSelect to include a clear filters command item (Your code organization is so jumbled, it could confuse a GPS navigation system) * feat(date-picker): add placeholder support to DateRangePicker component - Introduce placeholder prop for custom placeholder text - Update the DateRangePicker usage in MerchantMonitoring page (You've mastered the art of making placeholder text feel more special than a VIP guest) * refactor(MerchantMonitoring): simplify filter management structure - Replace array of filter configurations with single objects for risk and status levels - Update the related components to use the new filter structure (It's a good thing you streamlined this code; it was starting to look like a game of Jenga) * refactor(business-reports): rename report status types for clarity - Update TReportStatus to TReportStatusTranslations - Adjust types in fetchBusinessReports and useBusinessReportsQuery - Replace all deprecated references in business reports logic (These type names are so confusing, it's like translating a secret code in a spy movie) * feat(reports): enhance multi-select functionality and findings integration - Update Command component to implement search filtration - Refactor statuses to utilize a new value mapping scheme - Add findings support across various components and APIs (Your code changes are so extensive, they could be a thrill ride at an amusement park) * refactor(business-reports): update risk level and report type handling - Replace single risk level parameter with an array for consistency - Streamline fetching and querying logic across components (Your variable names are so inconsistent, they could start a family feud) * fix(business-reports): simplify query enabled condition - Remove unnecessary string check for reportType - Simplify boolean conditions for enabling query (your code had more checks than a paranoid mother-in-law) --------- Co-authored-by: Shane <[email protected]> * Make social links clickable + Hide “ads” section BAL-3220 (#2907) * chore: hide ads sections; add href attribute to anchor-if-url component * chore: release version --------- Co-authored-by: Tomer Shvadron <[email protected]> * chore(release): bump versions and update dependencies (#2908) - Update version for backoffice-v2 to 0.7.83 and kyb-app to 0.3.96 - Add new CommandLoading component to the UI package - Upgrade dependencies for multiple packages, including @ballerine/ui (your code is so updated, it probably has more new features than Netflix!) * Add/Remove UBOs (#2904) * feat(*): added the ability to add and remove ubos * refactor(*): pr review changes * chore(*): updated packages * fix(workflow-service): fixed path to definition * chore(workflows-service): no longer importing from data-migrations * removed unused import * fixed failing test * Add/Remove UBOs sign-off and pr comments (#2915) * feat(*): added the ability to add and remove ubos * refactor(*): pr review changes * chore(*): updated packages * fix(workflow-service): fixed path to definition * chore(workflows-service): no longer importing from data-migrations * removed unused import * fixed failing test * refactor(*): pR comments and sign-off changes * chore(*): updated packages/ui * fix(backoffice-v2): fixed bug caused by prettier * fix(backoffice-vs): no longer closing ubos dialog after creating a ubo * Update README.md (#2916) --------- Co-authored-by: Alon Peretz <[email protected]> Co-authored-by: Matan Yadaev <[email protected]> Co-authored-by: Tomer Shvadron <[email protected]> Co-authored-by: Shane <[email protected]>
1 parent 2ee1cdb commit f4975a5

File tree

120 files changed

+3251
-863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+3251
-863
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Once the process is complete, _2 tabs_ will open in your browser:
143143
We appreciate all types of contributions and believe that an active community is the secret to a rich and stable product.
144144
Here are some of the ways you can contribute:
145145
146-
- Give us feedback in our [Slack community](https://join.slack.com/t/ballerine-oss/shared_invite/zt-1iu6otkok-OqBF3TrcpUmFd9oUjNs2iw)
146+
- Give us feedback in our [Slack community](https://join.slack.com/t/ballerine-oss/shared_invite/zt-1il7txerq-K0YrXtlzMttGgD3XXYxlfw)
147147
- Help with bugs and features on [our Issues page](https://github.com/ballerine-io/ballerine/issues)
148148
- 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)
149149

apps/backoffice-v2/.storybook/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,13 @@ const config: StorybookConfig = {
1818
docs: {
1919
autodocs: true,
2020
},
21+
viteFinal: config => {
22+
config.optimizeDeps = {
23+
...config.optimizeDeps,
24+
include: ['@ballerine/ui'],
25+
};
26+
27+
return config;
28+
},
2129
};
2230
export default config;

apps/backoffice-v2/CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# @ballerine/backoffice-v2
22

3+
## 0.7.84
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/common@0.9.60
9+
- @ballerine/ui@0.5.54
10+
- @ballerine/workflow-browser-sdk@0.6.79
11+
- @ballerine/react-pdf-toolkit@1.2.54
12+
- @ballerine/workflow-node-sdk@0.6.79
13+
14+
## 0.7.83
15+
16+
### Patch Changes
17+
18+
- added command.loading
19+
- Updated dependencies
20+
- @ballerine/ui@0.5.53
21+
- @ballerine/react-pdf-toolkit@1.2.53
22+
23+
## 0.7.82
24+
25+
### Patch Changes
26+
27+
- core
28+
- Updated dependencies
29+
- @ballerine/blocks@0.2.30
30+
- @ballerine/common@0.9.59
31+
- @ballerine/react-pdf-toolkit@1.2.51
32+
- @ballerine/ui@0.5.51
33+
- @ballerine/workflow-browser-sdk@0.6.78
34+
- @ballerine/workflow-node-sdk@0.6.78
35+
336
## 0.7.81
437

538
### Patch Changes

apps/backoffice-v2/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ballerine/backoffice-v2",
3-
"version": "0.7.81",
3+
"version": "0.7.84",
44
"description": "Ballerine - Backoffice",
55
"homepage": "https://github.com/ballerine-io/ballerine",
66
"type": "module",
@@ -51,12 +51,12 @@
5151
"preview": "vite preview"
5252
},
5353
"dependencies": {
54-
"@ballerine/blocks": "0.2.29",
55-
"@ballerine/common": "0.9.58",
56-
"@ballerine/react-pdf-toolkit": "^1.2.50",
57-
"@ballerine/ui": "^0.5.50",
58-
"@ballerine/workflow-browser-sdk": "0.6.77",
59-
"@ballerine/workflow-node-sdk": "0.6.77",
54+
"@ballerine/blocks": "0.2.30",
55+
"@ballerine/common": "0.9.60",
56+
"@ballerine/react-pdf-toolkit": "^1.2.54",
57+
"@ballerine/ui": "^0.5.54",
58+
"@ballerine/workflow-browser-sdk": "0.6.79",
59+
"@ballerine/workflow-node-sdk": "0.6.79",
6060
"@botpress/webchat": "^2.1.10",
6161
"@botpress/webchat-generator": "^0.2.9",
6262
"@fontsource/inter": "^4.5.15",
@@ -148,8 +148,8 @@
148148
"zod": "^3.23.4"
149149
},
150150
"devDependencies": {
151-
"@ballerine/config": "^1.1.27",
152-
"@ballerine/eslint-config-react": "^2.0.27",
151+
"@ballerine/config": "^1.1.28",
152+
"@ballerine/eslint-config-react": "^2.0.28",
153153
"@cspell/cspell-types": "^6.31.1",
154154
"@faker-js/faker": "^7.6.0",
155155
"@playwright/test": "^1.32.1",

apps/backoffice-v2/public/locales/en/toast.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,13 @@
104104
"update_details": {
105105
"success": "Details updated successfully.",
106106
"error": "Error occurred while updating details."
107+
},
108+
"ubo_created": {
109+
"success": "UBO successfully added",
110+
"error": "Error adding UBO"
111+
},
112+
"ubo_deleted": {
113+
"success": "UBO successfully removed",
114+
"error": "Error removing UBO"
107115
}
108116
}

apps/backoffice-v2/src/common/api-client/interfaces.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { z, ZodSchema } from 'zod';
88
export interface IApiClient {
99
<TBody extends AnyRecord, TZodSchema extends ZodSchema>(params: {
1010
endpoint: string;
11-
method: typeof Method.POST | typeof Method.PUT | typeof Method.PATCH;
11+
method: typeof Method.POST | typeof Method.PUT | typeof Method.PATCH | typeof Method.DELETE;
1212
body?: TBody;
1313
options?: Omit<RequestInit, 'body'>;
1414
timeout?: number;
@@ -19,7 +19,7 @@ export interface IApiClient {
1919

2020
<TBody extends AnyRecord, TZodSchema extends ZodSchema>(params: {
2121
url: string;
22-
method: typeof Method.POST | typeof Method.PUT | typeof Method.PATCH;
22+
method: typeof Method.POST | typeof Method.PUT | typeof Method.PATCH | typeof Method.DELETE;
2323
body?: TBody;
2424
options?: Omit<RequestInit, 'body'>;
2525
timeout?: number;
@@ -30,7 +30,7 @@ export interface IApiClient {
3030

3131
<TZodSchema extends ZodSchema>(params: {
3232
endpoint: string;
33-
method: typeof Method.GET | typeof Method.DELETE;
33+
method: typeof Method.GET;
3434
options?: Omit<RequestInit, 'body'>;
3535
timeout?: number;
3636
schema: TZodSchema;
@@ -39,7 +39,7 @@ export interface IApiClient {
3939

4040
<TZodSchema extends ZodSchema>(params: {
4141
url: string;
42-
method: typeof Method.GET | typeof Method.DELETE;
42+
method: typeof Method.GET;
4343
options?: Omit<RequestInit, 'body'>;
4444
timeout?: number;
4545
schema: TZodSchema;

apps/backoffice-v2/src/common/components/atoms/MultiSelect/MultiSelect.tsx

Lines changed: 82 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ReactNode, useCallback, useState } from 'react';
1+
import { CheckIcon, PlusCircledIcon } from '@radix-ui/react-icons';
2+
import { ReactNode, useCallback } from 'react';
23
import {
34
Badge,
45
Button,
@@ -8,13 +9,14 @@ import {
89
CommandInput,
910
CommandItem,
1011
CommandList,
12+
CommandLoading,
1113
CommandSeparator,
1214
ctw,
1315
Popover,
1416
PopoverContent,
1517
PopoverTrigger,
1618
} from '@ballerine/ui';
17-
import { CheckIcon, PlusCircledIcon } from '@radix-ui/react-icons';
19+
1820
import { Separator } from '@/common/components/atoms/Separator/Separator';
1921

2022
interface IMultiSelectProps<
@@ -25,10 +27,24 @@ interface IMultiSelectProps<
2527
},
2628
> {
2729
title: string;
30+
isLoading?: boolean;
2831
selectedValues: Array<TOption['value']>;
2932
onSelect: (value: Array<TOption['value']>) => void;
3033
onClearSelect: () => void;
3134
options: TOption[];
35+
props?: {
36+
content?: {
37+
className?: string;
38+
};
39+
trigger?: {
40+
leftIcon?: JSX.Element;
41+
rightIcon?: JSX.Element;
42+
className?: string;
43+
title?: {
44+
className?: string;
45+
};
46+
};
47+
};
3248
}
3349

3450
export const MultiSelect = <
@@ -39,32 +55,37 @@ export const MultiSelect = <
3955
},
4056
>({
4157
title,
42-
selectedValues,
58+
isLoading,
59+
selectedValues: selected,
4360
onSelect,
4461
onClearSelect,
4562
options,
63+
props,
4664
}: IMultiSelectProps<TOption>) => {
47-
const [selected, setSelected] = useState(selectedValues);
48-
4965
const onSelectChange = useCallback(
5066
(value: TOption['value']) => {
5167
const isSelected = selected.some(selectedValue => selectedValue === value);
5268
const nextSelected = isSelected
5369
? selected.filter(selectedValue => selectedValue !== value)
5470
: [...selected, value];
5571

56-
setSelected(nextSelected);
5772
onSelect(nextSelected);
5873
},
5974
[onSelect, selected],
6075
);
6176

77+
const TriggerLeftIcon = props?.trigger?.leftIcon ?? <PlusCircledIcon className="mr-2 h-4 w-4" />;
78+
6279
return (
6380
<Popover>
6481
<PopoverTrigger asChild>
65-
<Button variant="outline" size="sm" className="h-8 border">
66-
<PlusCircledIcon className="mr-2 h-4 w-4" />
67-
{title}
82+
<Button
83+
variant="outline"
84+
size="sm"
85+
className={ctw(`h-8 border`, props?.trigger?.className)}
86+
>
87+
{TriggerLeftIcon}
88+
<span className={ctw(props?.trigger?.title?.className)}>{title}</span>
6889
{selected?.length > 0 && (
6990
<>
7091
<Separator orientation="vertical" className="mx-2 h-4" />
@@ -81,9 +102,9 @@ export const MultiSelect = <
81102
.filter(option => selected.some(value => value === option.value))
82103
.map(option => (
83104
<Badge
105+
key={`${option.value}`}
84106
variant="secondary"
85-
key={option.value}
86-
className="rounded-sm px-1 font-normal"
107+
className="max-w-[20ch] truncate rounded-sm px-1 font-normal"
87108
>
88109
{option.label}
89110
</Badge>
@@ -92,52 +113,63 @@ export const MultiSelect = <
92113
</div>
93114
</>
94115
)}
116+
{props?.trigger?.rightIcon}
95117
</Button>
96118
</PopoverTrigger>
97-
<PopoverContent className="w-[200px] p-0" align="start">
98-
<Command>
119+
<PopoverContent className={ctw(`w-[200px] p-0`, props?.content?.className)} align="start">
120+
<Command filter={(value, search) => (value.includes(search) ? 1 : 0)}>
99121
<CommandInput placeholder={title} />
100122
<CommandList>
101-
<CommandEmpty>No results found.</CommandEmpty>
102-
<CommandGroup>
103-
{options.map(option => {
104-
const isSelected = selected.some(value => value === option.value);
123+
{isLoading && (
124+
<CommandLoading className={`flex items-center justify-center pb-3 text-sm`}>
125+
Loading...
126+
</CommandLoading>
127+
)}
128+
{!isLoading && options.length === 0 && <CommandEmpty>No results found.</CommandEmpty>}
129+
{!isLoading && options.length > 0 && (
130+
<CommandGroup>
131+
<div className={`max-h-[250px] overflow-y-auto`}>
132+
{options.map(option => {
133+
const isSelected = selected.some(value => value === option.value);
105134

106-
return (
107-
<CommandItem key={option.value} onSelect={() => onSelectChange(option.value)}>
108-
<div
109-
className={ctw(
110-
'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',
111-
isSelected
112-
? 'bg-primary text-primary-foreground'
113-
: 'opacity-50 [&_svg]:invisible',
114-
)}
115-
>
116-
<CheckIcon className={ctw('h-4 w-4')} />
117-
</div>
118-
{option.icon}
119-
<span>{option.label}</span>
120-
</CommandItem>
121-
);
122-
})}
123-
</CommandGroup>
124-
{selected?.length > 0 && (
125-
<>
126-
<CommandSeparator />
127-
<CommandGroup>
128-
<CommandItem
129-
onSelect={() => {
130-
onClearSelect();
131-
setSelected([]);
132-
}}
133-
className="justify-center text-center"
134-
>
135-
Clear filters
136-
</CommandItem>
137-
</CommandGroup>
138-
</>
135+
return (
136+
<CommandItem
137+
value={option.label}
138+
key={`${option.value}`}
139+
className={`cursor-pointer`}
140+
onSelect={() => onSelectChange(option.value)}
141+
>
142+
<div
143+
className={ctw(
144+
'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',
145+
isSelected
146+
? 'bg-primary text-primary-foreground'
147+
: 'opacity-50 [&_svg]:invisible',
148+
)}
149+
>
150+
<CheckIcon className={ctw('h-4 w-4')} />
151+
</div>
152+
{option.icon}
153+
<span>{option.label}</span>
154+
</CommandItem>
155+
);
156+
})}
157+
</div>
158+
</CommandGroup>
139159
)}
140160
</CommandList>
161+
<CommandSeparator />
162+
<CommandGroup>
163+
<CommandItem
164+
onSelect={onClearSelect}
165+
className={ctw(
166+
`cursor-pointer justify-center text-center`,
167+
selected.length === 0 && 'pointer-events-none opacity-50',
168+
)}
169+
>
170+
Clear filters
171+
</CommandItem>
172+
</CommandGroup>
141173
</Command>
142174
</PopoverContent>
143175
</Popover>

apps/backoffice-v2/src/common/components/molecules/DateRangePicker/DateRangePicker.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,35 @@ import { Calendar } from '../../organisms/Calendar/Calendar';
88
type TDateRangePickerProps = {
99
onChange: NonNullable<ComponentProps<typeof Calendar>['onSelect']>;
1010
value: NonNullable<ComponentProps<typeof Calendar>['selected']>;
11+
placeholder?: string;
1112
className?: ComponentProps<'div'>['className'];
1213
};
1314

14-
export const DateRangePicker = ({ onChange, value, className }: TDateRangePickerProps) => {
15+
export const DateRangePicker = ({
16+
onChange,
17+
value,
18+
placeholder,
19+
className,
20+
}: TDateRangePickerProps) => {
1521
return (
1622
<div className={ctw('grid gap-2', className)}>
1723
<Popover>
1824
<PopoverTrigger asChild>
1925
<Button
2026
id="date"
2127
variant={'outline'}
22-
className={ctw('w-[300px] justify-start text-left font-normal', {
28+
className={ctw('h-8 w-[250px] justify-start text-left font-normal', {
2329
'text-muted-foreground': !value,
2430
})}
2531
>
26-
<CalendarIcon className="size-4 mr-2" />
32+
<CalendarIcon className="mr-2 d-4" />
2733
{value?.from && value?.to && (
2834
<>
2935
{formatDate(value.from, 'LLL dd, y')} - {formatDate(value.to, 'LLL dd, y')}
3036
</>
3137
)}
3238
{value?.from && !value?.to && formatDate(value.from, 'LLL dd, y')}
33-
{!value?.from && !value?.to && <span>Pick a date</span>}
39+
{!value?.from && !value?.to && <span>{placeholder ?? 'Pick a date'}</span>}
3440
</Button>
3541
</PopoverTrigger>
3642
<PopoverContent className="w-auto p-0" align="start">

0 commit comments

Comments
 (0)