-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(*): now passing file name from the collection flow and until the…
… download button
- Loading branch information
Showing
13 changed files
with
130 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@ballerine/common': patch | ||
--- | ||
|
||
added xlsx and xls to file type schema |
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
15 changes: 15 additions & 0 deletions
15
apps/backoffice-v2/src/common/components/molecules/DownloadFile/DownloadFile.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,15 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { DownloadFile } from './DownloadFile'; | ||
|
||
const meta: Meta<typeof DownloadFile> = { | ||
component: DownloadFile, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof DownloadFile>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
heading: 'Bank statement aug 10 2023.xlsx', | ||
}, | ||
}; |
21 changes: 21 additions & 0 deletions
21
apps/backoffice-v2/src/common/components/molecules/DownloadFile/DownloadFile.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,21 @@ | ||
import { ctw } from '@/common/utils/ctw/ctw'; | ||
import React, { ComponentProps, FunctionComponent } from 'react'; | ||
import { DownloadFileSvg } from '@/common/components/atoms/icons'; | ||
|
||
export interface IDownloadFile extends ComponentProps<'div'> { | ||
heading: string; | ||
} | ||
|
||
export const DownloadFile: FunctionComponent<IDownloadFile> = ({ | ||
heading, | ||
className, | ||
...props | ||
}) => ( | ||
<div | ||
{...props} | ||
className={ctw(`d-full flex flex-col items-center rounded-lg bg-gray-50 px-4 py-6`, className)} | ||
> | ||
<DownloadFileSvg /> | ||
<h4 className={`mb-3.5 font-bold`}> {heading}</h4> | ||
</div> | ||
); |
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,7 @@ | ||
export const DOWNLOAD_ONLY_MIME_TYPES = [ | ||
'text/csv', | ||
// xls | ||
'application/vnd.ms-excel', | ||
// xlsx | ||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', | ||
] as const; |
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
6 changes: 6 additions & 0 deletions
6
.../UIRenderer/elements/JSONForm/components/DocumentField/helpers/getDocumentFileNamePath.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,6 @@ | ||
import { UIElement } from '@/domains/collection-flow'; | ||
|
||
export const getDocumentFileNamePath = (definition: UIElement) => | ||
definition.valueDestination | ||
?.replace(/documents\[\d+\]\./g, '') | ||
.replace('ballerineFileId', 'fileName'); |
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