Skip to content

Commit a4e1e74

Browse files
Notes (#2812)
* feat: notes * feat: type fixes for note repository * feat: started notes in the backoffice * feat: more work on ui notes * feat: visual work * feat: more work * feat: added pretty editor * feat: more work * feat: boyscouting nad moved sidebar to components directory * feat: small fixes * feat: changes for nitzan * feat: small fixes * feat: version bump * feat: pr comments fix * feat: version bump * feat: pr comments fix * feat: tests fix * feat: test fix
1 parent 69cd6b9 commit a4e1e74

File tree

165 files changed

+7127
-737
lines changed

Some content is hidden

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

165 files changed

+7127
-737
lines changed

apps/backoffice-v2/CHANGELOG.md

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

3+
## 0.7.65
4+
5+
### Patch Changes
6+
7+
- bump
8+
- Updated dependencies
9+
- @ballerine/ui@0.5.43
10+
- @ballerine/react-pdf-toolkit@1.2.43
11+
312
## 0.7.64
413

514
### Patch Changes

apps/backoffice-v2/package.json

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "@ballerine/backoffice-v2",
3-
"version": "0.7.64",
3+
"version": "0.7.65",
44
"description": "Ballerine - Backoffice",
55
"homepage": "https://github.com/ballerine-io/ballerine",
6+
"type": "module",
67
"repository": {
78
"type": "git",
89
"url": "git+https://github.com:ballerine-io/backoffice-vanilla.git"
@@ -52,8 +53,8 @@
5253
"dependencies": {
5354
"@ballerine/blocks": "0.2.25",
5455
"@ballerine/common": "0.9.48",
55-
"@ballerine/react-pdf-toolkit": "^1.2.42",
56-
"@ballerine/ui": "^0.5.42",
56+
"@ballerine/react-pdf-toolkit": "^1.2.43",
57+
"@ballerine/ui": "^0.5.43",
5758
"@ballerine/workflow-browser-sdk": "0.6.61",
5859
"@ballerine/workflow-node-sdk": "0.6.61",
5960
"@botpress/webchat": "^2.1.10",
@@ -77,13 +78,28 @@
7778
"@radix-ui/react-slot": "^1.0.1",
7879
"@radix-ui/react-switch": "^1.0.3",
7980
"@radix-ui/react-tabs": "^1.0.4",
81+
"@radix-ui/react-toggle": "^1.1.0",
82+
"@radix-ui/react-toggle-group": "^1.1.0",
8083
"@radix-ui/react-tooltip": "^1.0.7",
8184
"@react-pdf/renderer": "^3.1.14",
8285
"@rjsf/utils": "^5.9.0",
8386
"@saola.ai/browser": "^1.1.7",
8487
"@sentry/react": "^7.77.0",
8588
"@tanstack/react-query": "^4.19.1",
8689
"@tanstack/react-table": "^8.9.2",
90+
"@tiptap/core": "^2.9.1",
91+
"@tiptap/extension-code-block-lowlight": "^2.9.1",
92+
"@tiptap/extension-color": "^2.9.1",
93+
"@tiptap/extension-heading": "^2.9.1",
94+
"@tiptap/extension-horizontal-rule": "^2.9.1",
95+
"@tiptap/extension-image": "^2.9.1",
96+
"@tiptap/extension-link": "^2.9.1",
97+
"@tiptap/extension-placeholder": "^2.9.1",
98+
"@tiptap/extension-text-style": "^2.9.1",
99+
"@tiptap/extension-typography": "^2.9.1",
100+
"@tiptap/pm": "^2.9.1",
101+
"@tiptap/react": "^2.9.1",
102+
"@tiptap/starter-kit": "^2.9.1",
87103
"@xyflow/react": "^12.3.0",
88104
"ballerine-daisyui": "^2.49.6",
89105
"broadcast-channel": "^7.0.0",
@@ -92,6 +108,7 @@
92108
"d3-hierarchy": "^3.1.2",
93109
"date-fns": "^3.0.6",
94110
"dayjs": "^1.11.6",
111+
"dompurify": "^3.0.6",
95112
"eslint-plugin-tailwindcss": "^3.8.0",
96113
"face-api.js": "^0.22.2",
97114
"framer-motion": "^8.3.4",
@@ -100,6 +117,7 @@
100117
"i18next-http-backend": "^2.1.1",
101118
"leaflet": "^1.9.4",
102119
"libphonenumber-js": "^1.10.49",
120+
"lowlight": "^3.1.0",
103121
"lucide-react": "0.445.0",
104122
"match-sorter": "^6.3.1",
105123
"msw": "^1.0.0",
@@ -115,6 +133,7 @@
115133
"react-image-crop": "^10.0.9",
116134
"react-json-view": "^1.21.3",
117135
"react-leaflet": "^4.2.1",
136+
"react-medium-image-zoom": "^5.2.10",
118137
"react-router-dom": "^6.11.2",
119138
"react-zoom-pan-pinch": "^3.0.8",
120139
"recharts": "^2.7.2",
@@ -146,6 +165,7 @@
146165
"@testing-library/react": "^13.3.0",
147166
"@total-typescript/ts-reset": "^0.5.1",
148167
"@types/d3-hierarchy": "^3.1.7",
168+
"@types/dompurify": "^3.0.5",
149169
"@types/leaflet": "^1.9.3",
150170
"@types/node": "^18.11.13",
151171
"@types/qs": "^6.9.7",
@@ -175,7 +195,7 @@
175195
"typescript": "^5.5.4",
176196
"vite": "^5.3.5",
177197
"vite-plugin-mkcert": "^1.16.0",
178-
"vite-tsconfig-paths": "^4.0.7",
198+
"vite-tsconfig-paths": "^5.0.1",
179199
"vitest": "^0.29.8"
180200
},
181201
"peerDependencies": {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,9 @@
9696
"success": "Merchant checks created successfully.",
9797
"error": "Error occurred while creating merchant checks.",
9898
"is_example": "Please contact Ballerine at [email protected] for access to this feature."
99+
},
100+
"note_created": {
101+
"success": "Note added successfully.",
102+
"error": "Error occurred while adding note."
99103
}
100104
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import * as React from 'react';
2+
import * as TogglePrimitive from '@radix-ui/react-toggle';
3+
import { cva, type VariantProps } from 'class-variance-authority';
4+
import { ctw } from '@ballerine/ui';
5+
6+
const toggleVariants = cva(
7+
'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',
8+
{
9+
variants: {
10+
variant: {
11+
default: 'bg-transparent',
12+
outline: 'border border-input bg-transparent hover:bg-accent hover:text-accent-foreground',
13+
},
14+
size: {
15+
default: 'h-10 px-3',
16+
sm: 'h-9 px-2.5',
17+
lg: 'h-11 px-5',
18+
},
19+
},
20+
defaultVariants: {
21+
variant: 'default',
22+
size: 'default',
23+
},
24+
},
25+
);
26+
27+
const Toggle = React.forwardRef<
28+
React.ElementRef<typeof TogglePrimitive.Root>,
29+
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>
30+
>(({ className, variant, size, ...props }, ref) => (
31+
<TogglePrimitive.Root
32+
ref={ref}
33+
className={ctw(toggleVariants({ variant, size, className }))}
34+
{...props}
35+
/>
36+
));
37+
38+
Toggle.displayName = TogglePrimitive.Root.displayName;
39+
40+
export { Toggle, toggleVariants };
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import * as React from 'react';
2+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
3+
import { type VariantProps } from 'class-variance-authority';
4+
import { toggleVariants } from '@/common/components/atoms/Toggle/Toggle';
5+
import { ctw } from '@ballerine/ui';
6+
7+
const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({
8+
size: 'default',
9+
variant: 'default',
10+
});
11+
12+
const ToggleGroup = React.forwardRef<
13+
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
14+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
15+
VariantProps<typeof toggleVariants>
16+
>(({ className, variant, size, children, ...props }, ref) => (
17+
<ToggleGroupPrimitive.Root
18+
ref={ref}
19+
className={ctw('flex items-center justify-center gap-1', className)}
20+
{...props}
21+
>
22+
<ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>
23+
</ToggleGroupPrimitive.Root>
24+
));
25+
26+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
27+
28+
const ToggleGroupItem = React.forwardRef<
29+
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
30+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
31+
VariantProps<typeof toggleVariants>
32+
>(({ className, children, variant, size, ...props }, ref) => {
33+
const context = React.useContext(ToggleGroupContext);
34+
35+
return (
36+
<ToggleGroupPrimitive.Item
37+
ref={ref}
38+
className={ctw(
39+
toggleVariants({
40+
variant: context.variant || variant,
41+
size: context.size || size,
42+
}),
43+
className,
44+
)}
45+
{...props}
46+
>
47+
{children}
48+
</ToggleGroupPrimitive.Item>
49+
);
50+
});
51+
52+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
53+
54+
export { ToggleGroup, ToggleGroupItem };
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Link } from 'react-router-dom';
2+
import { SquarePen } from 'lucide-react';
3+
4+
import { ctw } from '@/common/utils/ctw/ctw';
5+
import { useUpdateIsNotesOpen } from '@/common/hooks/useUpdateIsNotesOpen/useUpdateIsNotesOpen';
6+
7+
interface INotesButtonProps {
8+
numberOfNotes: number | undefined;
9+
}
10+
11+
export const NotesButton = ({ numberOfNotes = 0 }: INotesButtonProps) => {
12+
const updateIsNotesOpen = useUpdateIsNotesOpen();
13+
14+
return (
15+
<div className={`flex items-center space-x-2`}>
16+
<span className={`me-2 text-sm leading-6`}>Notes</span>
17+
<Link
18+
className={`relative`}
19+
to={{
20+
search: updateIsNotesOpen(),
21+
}}
22+
>
23+
<SquarePen className={`d-5`} />
24+
{numberOfNotes > 0 && (
25+
<div
26+
className={ctw(
27+
`absolute left-3 top-3 rounded-full bg-slate-600 text-center text-[10px] font-bold text-white`,
28+
{ 'd-[14px]': numberOfNotes < 10, 'h-3.5 w-5 ps-[3px]': numberOfNotes >= 10 },
29+
)}
30+
>
31+
{numberOfNotes > 9 ? '9+' : numberOfNotes}
32+
</div>
33+
)}
34+
</Link>
35+
</div>
36+
);
37+
};

apps/backoffice-v2/src/common/components/organisms/Header/Header.Logo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FunctionComponent } from 'react';
22
import { BallerineLogo } from '../../atoms/icons';
33
import { Link } from 'react-router-dom';
44
import { env } from '../../../env/env';
5-
import { useCustomerQuery } from '@/domains/customer/hook/queries/useCustomerQuery/useCustomerQuery';
5+
import { useCustomerQuery } from '@/domains/customer/hooks/queries/useCustomerQuery/useCustomerQuery';
66
import { AspectRatio } from '../../atoms/AspectRatio/AspectRatio';
77
import { useRedirectToRootUrl } from '@/common/hooks/useRedirectToRootUrl/useRedirectToRootUrl';
88
import { Skeleton } from '@ballerine/ui';

apps/backoffice-v2/src/common/components/organisms/Header/hooks/useNavbarLogic/useNavbarLogic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useCallback, useMemo } from 'react';
44
import { Building, Goal, Home, Users } from 'lucide-react';
55
import { TRoutes, TRouteWithChildren } from '@/Router/types';
66
import { useLocation } from 'react-router-dom';
7-
import { useCustomerQuery } from '@/domains/customer/hook/queries/useCustomerQuery/useCustomerQuery';
7+
import { useCustomerQuery } from '@/domains/customer/hooks/queries/useCustomerQuery/useCustomerQuery';
88
import { useLocale } from '@/common/hooks/useLocale/useLocale';
99

1010
export const useNavbarLogic = () => {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from 'react';
2+
import { ctw } from '@ballerine/ui';
3+
4+
export const SidebarContent = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(
5+
({ className, ...props }, ref) => {
6+
return (
7+
<div
8+
ref={ref}
9+
data-sidebar="content"
10+
className={ctw(
11+
'flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden',
12+
className,
13+
)}
14+
{...props}
15+
/>
16+
);
17+
},
18+
);
19+
20+
SidebarContent.displayName = 'SidebarContent';

0 commit comments

Comments
 (0)