-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into epic/feat/admin-tools2
- Loading branch information
Showing
243 changed files
with
6,670 additions
and
1,181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,16 @@ runs: | |
|
||
- name: Test | ||
shell: bash | ||
run: pnpm test | ||
run: pnpm test -- --verbose false | ||
env: | ||
ENVIRONMENT_NAME: test | ||
JEST_HTML_REPORTER_PAGE_TITLE: ${{ github.ref_name }} | ||
|
||
- name: Store test result | ||
uses: actions/[email protected] | ||
id: artifact-upload-step | ||
with: | ||
name: test-report.html | ||
path: services/workflows-service/ci/test-report.html | ||
retention-days: 7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ env: | |
IMAGE_NAME: ${{ github.repository_owner }}/workflows-service | ||
|
||
jobs: | ||
|
||
determine_branch: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
|
@@ -47,7 +48,7 @@ jobs: | |
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
needs: determine_branch | ||
needs: [determine_branch] | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
@@ -296,7 +297,10 @@ jobs: | |
cd services/workflows-service/prisma/data-migrations | ||
git fetch --no-tags --depth=1 origin +refs/heads/dev:refs/remotes/origin/${{ needs.determine_branch.outputs.branch }} | ||
git checkout -b ${{ needs.determine_branch.outputs.branch }} origin/${{ needs.determine_branch.outputs.branch }} | ||
git pull origin ${{ needs.determine_branch.outputs.branch }} | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git reset --hard HEAD | ||
git pull origin ${{ needs.determine_branch.outputs.branch }} --rebase | ||
is_exists=$(git ls-remote --exit-code --heads -t --ref -q origin "${{ needs.determine_branch.outputs.branch }}" | wc -l) | ||
|
@@ -345,7 +349,10 @@ jobs: | |
cd services/workflows-service/prisma/data-migrations | ||
git fetch --no-tags --depth=1 origin +refs/heads/dev:refs/remotes/origin/${{ needs.determine_branch.outputs.branch }} | ||
git checkout -b ${{ needs.determine_branch.outputs.branch }} origin/${{ needs.determine_branch.outputs.branch }} | ||
git pull origin ${{ needs.determine_branch.outputs.branch }} | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git reset --hard HEAD | ||
git pull origin ${{ needs.determine_branch.outputs.branch }} --rebase | ||
WF_M_SHORT_SHA=$(git rev-parse --short HEAD) | ||
echo "sha_short=$WF_M_SHORT_SHA" | ||
echo "wf_m_sha_short=$WF_M_SHORT_SHA" >> $GITHUB_OUTPUT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,5 +77,10 @@ | |
"revert_decision_alerts": { | ||
"success": "The alerts decision have been reverted successfully.", | ||
"error": "Error occurred while reverting the alerts decision." | ||
}, | ||
"business_report_creation": { | ||
"success": "Merchant check created successfully.", | ||
"error": "Error occurred while creating a merchant check.", | ||
"is_example": "Please contact Ballerine at [email protected] for access to this feature." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
apps/backoffice-v2/src/common/components/atoms/AnchorIfUrl/AnchorIfUrl.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { ComponentProps, ElementType, forwardRef, ReactNode } from 'react'; | ||
import { | ||
PolymorphicComponentProps, | ||
PolymorphicComponentPropsWithRef, | ||
PolymorphicRef, | ||
} from '@/common/types'; | ||
import { checkIsUrl } from '@/common/utils/check-is-url/check-is-url'; | ||
import { BallerineLink } from '@/common/components/atoms/BallerineLink/BallerineLink'; | ||
|
||
export type TAnchorIfUrl = <TElement extends ElementType = 'span'>( | ||
props: PolymorphicComponentPropsWithRef<TElement> & ComponentProps<'a'>, | ||
) => ReactNode; | ||
|
||
export const AnchorIfUrl: TAnchorIfUrl = forwardRef( | ||
<TElement extends ElementType = 'span'>( | ||
{ as, children, ...props }: PolymorphicComponentProps<TElement> & ComponentProps<'a'>, | ||
ref?: PolymorphicRef<TElement>, | ||
) => { | ||
const Component = as ?? 'span'; | ||
|
||
if (checkIsUrl(children)) { | ||
return ( | ||
<BallerineLink ref={ref} {...props}> | ||
{children} | ||
</BallerineLink> | ||
); | ||
} | ||
|
||
return ( | ||
<Component ref={ref} {...props}> | ||
{children} | ||
</Component> | ||
); | ||
}, | ||
); | ||
|
||
// @ts-ignore | ||
AnchorIfUrl.displayName = 'AnchorIfUrl'; |
27 changes: 27 additions & 0 deletions
27
apps/backoffice-v2/src/common/components/atoms/BallerineLink/BallerineLink.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { buttonVariants } from '@/common/components/atoms/Button/Button'; | ||
import React, { ComponentProps, FunctionComponent } from 'react'; | ||
import { ctw } from '@/common/utils/ctw/ctw'; | ||
|
||
export const BallerineLink: FunctionComponent<ComponentProps<'a'>> = ({ | ||
className, | ||
href, | ||
children, | ||
...props | ||
}) => { | ||
return ( | ||
<a | ||
className={ctw( | ||
buttonVariants({ | ||
variant: 'link', | ||
}), | ||
'h-[unset] cursor-pointer !p-0 !text-blue-500', | ||
className, | ||
)} | ||
target={'_blank'} | ||
rel={'noopener noreferrer'} | ||
href={href} | ||
> | ||
{children} | ||
</a> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apps/backoffice-v2/src/common/components/atoms/Image/BaseImage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ElementRef, forwardRef } from 'react'; | ||
import { ImageProps } from '@/common/components/atoms/Image/interfaces'; | ||
import { useImage } from 'react-image'; | ||
import { ctw } from '@/common/utils/ctw/ctw'; | ||
|
||
export const BaseImage = forwardRef<ElementRef<'img'>, ImageProps>( | ||
({ className, alt, width, height, src: srcList, useImageProps, ...props }, ref) => { | ||
const { src } = useImage({ | ||
...useImageProps, | ||
srcList, | ||
}); | ||
|
||
return ( | ||
<img | ||
alt={alt} | ||
src={src} | ||
width={width} | ||
height={height} | ||
className={ctw(`rounded-md object-contain`, className)} | ||
{...props} | ||
ref={ref} | ||
/> | ||
); | ||
}, | ||
); | ||
|
||
BaseImage.displayName = 'BaseImage'; |
17 changes: 17 additions & 0 deletions
17
apps/backoffice-v2/src/common/components/atoms/Image/Image.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Image } from './Image'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
type Story = StoryObj<typeof Image>; | ||
|
||
export default { | ||
component: Image, | ||
} satisfies Meta<typeof Image>; | ||
|
||
export const Default = { | ||
args: { | ||
src: 'https://picsum.photos/150', | ||
alt: 'Placeholder', | ||
width: '150px', | ||
height: '150px', | ||
}, | ||
} satisfies Story; |
39 changes: 39 additions & 0 deletions
39
apps/backoffice-v2/src/common/components/atoms/Image/Image.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { ImageIcon } from 'lucide-react'; | ||
import { Skeleton } from '@/common/components/atoms/Skeleton/Skeleton'; | ||
import { BaseImage } from '@/common/components/atoms/Image/BaseImage'; | ||
import { ComponentProps, ElementRef, forwardRef, Suspense } from 'react'; | ||
import { ErrorBoundary } from 'react-error-boundary'; | ||
|
||
export const Image = forwardRef<ElementRef<'img'>, ComponentProps<typeof BaseImage>>( | ||
({ width, height, ...props }, ref) => { | ||
return ( | ||
<ErrorBoundary | ||
fallback={ | ||
<figure | ||
className={`flex flex-col items-center justify-center space-y-2 rounded-md border border-destructive p-1`} | ||
style={{ width, height }} | ||
aria-live={`polite`} | ||
> | ||
<ImageIcon className={`h-[calc(1rem+15%)] w-[calc(1rem+15%)] stroke-destructive`} /> | ||
<figcaption className={`text-destructive`}> | ||
An error occurred while loading the image | ||
</figcaption> | ||
</figure> | ||
} | ||
> | ||
<Suspense | ||
fallback={ | ||
<figure aria-live={`polite`} style={{ width, height }}> | ||
<Skeleton className={`h-full w-full`} /> | ||
<figcaption className={`sr-only`}>Loading image...</figcaption> | ||
</figure> | ||
} | ||
> | ||
<BaseImage width={width} height={height} {...props} ref={ref} /> | ||
</Suspense> | ||
</ErrorBoundary> | ||
); | ||
}, | ||
); | ||
|
||
Image.displayName = 'Image'; |
2 changes: 2 additions & 0 deletions
2
apps/backoffice-v2/src/common/components/atoms/Image/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './Image'; | ||
export * from './interfaces'; |
9 changes: 9 additions & 0 deletions
9
apps/backoffice-v2/src/common/components/atoms/Image/interfaces.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { CSSProperties, ImgHTMLAttributes } from 'react'; | ||
import { useImageProps } from 'react-image'; | ||
|
||
export interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src'> { | ||
src: useImageProps['srcList']; | ||
useImageProps?: Omit<useImageProps, 'srcList'>; | ||
width: CSSProperties['width']; | ||
height: CSSProperties['height']; | ||
} |
Oops, something went wrong.