Skip to content

Commit

Permalink
Dev -> Sb (#2917)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
5 people authored Dec 29, 2024
1 parent 2ee1cdb commit f4975a5
Show file tree
Hide file tree
Showing 120 changed files with 3,251 additions and 863 deletions.
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
8 changes: 8 additions & 0 deletions apps/backoffice-v2/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@ const config: StorybookConfig = {
docs: {
autodocs: true,
},
viteFinal: config => {
config.optimizeDeps = {
...config.optimizeDeps,
include: ['@ballerine/ui'],
};

return config;
},
};
export default config;
33 changes: 33 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# @ballerine/backoffice-v2

## 0.7.84

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.60
- @ballerine/ui@0.5.54
- @ballerine/workflow-browser-sdk@0.6.79
- @ballerine/react-pdf-toolkit@1.2.54
- @ballerine/workflow-node-sdk@0.6.79

## 0.7.83

### Patch Changes

- added command.loading
- Updated dependencies
- @ballerine/ui@0.5.53
- @ballerine/react-pdf-toolkit@1.2.53

## 0.7.82

### Patch Changes

- core
- Updated dependencies
- @ballerine/blocks@0.2.30
- @ballerine/common@0.9.59
- @ballerine/react-pdf-toolkit@1.2.51
- @ballerine/ui@0.5.51
- @ballerine/workflow-browser-sdk@0.6.78
- @ballerine/workflow-node-sdk@0.6.78

## 0.7.81

### Patch Changes
Expand Down
18 changes: 9 additions & 9 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.81",
"version": "0.7.84",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -51,12 +51,12 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/blocks": "0.2.29",
"@ballerine/common": "0.9.58",
"@ballerine/react-pdf-toolkit": "^1.2.50",
"@ballerine/ui": "^0.5.50",
"@ballerine/workflow-browser-sdk": "0.6.77",
"@ballerine/workflow-node-sdk": "0.6.77",
"@ballerine/blocks": "0.2.30",
"@ballerine/common": "0.9.60",
"@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",
"@botpress/webchat": "^2.1.10",
"@botpress/webchat-generator": "^0.2.9",
"@fontsource/inter": "^4.5.15",
Expand Down Expand Up @@ -148,8 +148,8 @@
"zod": "^3.23.4"
},
"devDependencies": {
"@ballerine/config": "^1.1.27",
"@ballerine/eslint-config-react": "^2.0.27",
"@ballerine/config": "^1.1.28",
"@ballerine/eslint-config-react": "^2.0.28",
"@cspell/cspell-types": "^6.31.1",
"@faker-js/faker": "^7.6.0",
"@playwright/test": "^1.32.1",
Expand Down
8 changes: 8 additions & 0 deletions apps/backoffice-v2/public/locales/en/toast.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,13 @@
"update_details": {
"success": "Details updated successfully.",
"error": "Error occurred while updating details."
},
"ubo_created": {
"success": "UBO successfully added",
"error": "Error adding UBO"
},
"ubo_deleted": {
"success": "UBO successfully removed",
"error": "Error removing UBO"
}
}
8 changes: 4 additions & 4 deletions apps/backoffice-v2/src/common/api-client/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { z, ZodSchema } from 'zod';
export interface IApiClient {
<TBody extends AnyRecord, TZodSchema extends ZodSchema>(params: {
endpoint: string;
method: typeof Method.POST | typeof Method.PUT | typeof Method.PATCH;
method: typeof Method.POST | typeof Method.PUT | typeof Method.PATCH | typeof Method.DELETE;
body?: TBody;
options?: Omit<RequestInit, 'body'>;
timeout?: number;
Expand All @@ -19,7 +19,7 @@ export interface IApiClient {

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

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

<TZodSchema extends ZodSchema>(params: {
url: string;
method: typeof Method.GET | typeof Method.DELETE;
method: typeof Method.GET;
options?: Omit<RequestInit, 'body'>;
timeout?: number;
schema: TZodSchema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ReactNode, useCallback, useState } from 'react';
import { CheckIcon, PlusCircledIcon } from '@radix-ui/react-icons';
import { ReactNode, useCallback } from 'react';
import {
Badge,
Button,
Expand All @@ -8,13 +9,14 @@ import {
CommandInput,
CommandItem,
CommandList,
CommandLoading,
CommandSeparator,
ctw,
Popover,
PopoverContent,
PopoverTrigger,
} from '@ballerine/ui';
import { CheckIcon, PlusCircledIcon } from '@radix-ui/react-icons';

import { Separator } from '@/common/components/atoms/Separator/Separator';

interface IMultiSelectProps<
Expand All @@ -25,10 +27,24 @@ interface IMultiSelectProps<
},
> {
title: string;
isLoading?: boolean;
selectedValues: Array<TOption['value']>;
onSelect: (value: Array<TOption['value']>) => void;
onClearSelect: () => void;
options: TOption[];
props?: {
content?: {
className?: string;
};
trigger?: {
leftIcon?: JSX.Element;
rightIcon?: JSX.Element;
className?: string;
title?: {
className?: string;
};
};
};
}

export const MultiSelect = <
Expand All @@ -39,32 +55,37 @@ export const MultiSelect = <
},
>({
title,
selectedValues,
isLoading,
selectedValues: selected,
onSelect,
onClearSelect,
options,
props,
}: IMultiSelectProps<TOption>) => {
const [selected, setSelected] = useState(selectedValues);

const onSelectChange = useCallback(
(value: TOption['value']) => {
const isSelected = selected.some(selectedValue => selectedValue === value);
const nextSelected = isSelected
? selected.filter(selectedValue => selectedValue !== value)
: [...selected, value];

setSelected(nextSelected);
onSelect(nextSelected);
},
[onSelect, selected],
);

const TriggerLeftIcon = props?.trigger?.leftIcon ?? <PlusCircledIcon className="mr-2 h-4 w-4" />;

return (
<Popover>
<PopoverTrigger asChild>
<Button variant="outline" size="sm" className="h-8 border">
<PlusCircledIcon className="mr-2 h-4 w-4" />
{title}
<Button
variant="outline"
size="sm"
className={ctw(`h-8 border`, props?.trigger?.className)}
>
{TriggerLeftIcon}
<span className={ctw(props?.trigger?.title?.className)}>{title}</span>
{selected?.length > 0 && (
<>
<Separator orientation="vertical" className="mx-2 h-4" />
Expand All @@ -81,9 +102,9 @@ export const MultiSelect = <
.filter(option => selected.some(value => value === option.value))
.map(option => (
<Badge
key={`${option.value}`}
variant="secondary"
key={option.value}
className="rounded-sm px-1 font-normal"
className="max-w-[20ch] truncate rounded-sm px-1 font-normal"
>
{option.label}
</Badge>
Expand All @@ -92,52 +113,63 @@ export const MultiSelect = <
</div>
</>
)}
{props?.trigger?.rightIcon}
</Button>
</PopoverTrigger>
<PopoverContent className="w-[200px] p-0" align="start">
<Command>
<PopoverContent className={ctw(`w-[200px] p-0`, props?.content?.className)} align="start">
<Command filter={(value, search) => (value.includes(search) ? 1 : 0)}>
<CommandInput placeholder={title} />
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup>
{options.map(option => {
const isSelected = selected.some(value => value === option.value);
{isLoading && (
<CommandLoading className={`flex items-center justify-center pb-3 text-sm`}>
Loading...
</CommandLoading>
)}
{!isLoading && options.length === 0 && <CommandEmpty>No results found.</CommandEmpty>}
{!isLoading && options.length > 0 && (
<CommandGroup>
<div className={`max-h-[250px] overflow-y-auto`}>
{options.map(option => {
const isSelected = selected.some(value => value === option.value);

return (
<CommandItem key={option.value} onSelect={() => onSelectChange(option.value)}>
<div
className={ctw(
'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',
isSelected
? 'bg-primary text-primary-foreground'
: 'opacity-50 [&_svg]:invisible',
)}
>
<CheckIcon className={ctw('h-4 w-4')} />
</div>
{option.icon}
<span>{option.label}</span>
</CommandItem>
);
})}
</CommandGroup>
{selected?.length > 0 && (
<>
<CommandSeparator />
<CommandGroup>
<CommandItem
onSelect={() => {
onClearSelect();
setSelected([]);
}}
className="justify-center text-center"
>
Clear filters
</CommandItem>
</CommandGroup>
</>
return (
<CommandItem
value={option.label}
key={`${option.value}`}
className={`cursor-pointer`}
onSelect={() => onSelectChange(option.value)}
>
<div
className={ctw(
'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',
isSelected
? 'bg-primary text-primary-foreground'
: 'opacity-50 [&_svg]:invisible',
)}
>
<CheckIcon className={ctw('h-4 w-4')} />
</div>
{option.icon}
<span>{option.label}</span>
</CommandItem>
);
})}
</div>
</CommandGroup>
)}
</CommandList>
<CommandSeparator />
<CommandGroup>
<CommandItem
onSelect={onClearSelect}
className={ctw(
`cursor-pointer justify-center text-center`,
selected.length === 0 && 'pointer-events-none opacity-50',
)}
>
Clear filters
</CommandItem>
</CommandGroup>
</Command>
</PopoverContent>
</Popover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,35 @@ import { Calendar } from '../../organisms/Calendar/Calendar';
type TDateRangePickerProps = {
onChange: NonNullable<ComponentProps<typeof Calendar>['onSelect']>;
value: NonNullable<ComponentProps<typeof Calendar>['selected']>;
placeholder?: string;
className?: ComponentProps<'div'>['className'];
};

export const DateRangePicker = ({ onChange, value, className }: TDateRangePickerProps) => {
export const DateRangePicker = ({
onChange,
value,
placeholder,
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', {
className={ctw('h-8 w-[250px] justify-start text-left font-normal', {
'text-muted-foreground': !value,
})}
>
<CalendarIcon className="size-4 mr-2" />
<CalendarIcon className="mr-2 d-4" />
{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>}
{!value?.from && !value?.to && <span>{placeholder ?? 'Pick a date'}</span>}
</Button>
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="start">
Expand Down
Loading

0 comments on commit f4975a5

Please sign in to comment.