-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: updated styles for link elements (#2959) * feat: added csv document rendering (#2958) * fix(monitoring): changes the block ordering in website credibility view (#2963) * feat(monitoring): adds loading state for a single merchant record (BAL-3359) (#2960) * feat(monitoring): adjusts merchant risk summary text (BAL-3373) (#2961) * refactor(websiteCredibility): fix CardContent height for no data (#2966) * refactor(websiteCredibility): fix CardContent height for no data - Remove unused Tooltip import from recharts - Update CardContent class to ensure full height (your code is like a tidy room: looks clean but still has hidden messes) * empty * fix: UI fixes for statistics and merchant monitoring report pages (#2965) * feat(monitoring): adds exhaustive check for action before deboarding a merchant (BAL-3343) (#2964) * feat(monitoring): preserves scroll position on a data table (BAL-3248) (#2962) * fix: chart graph cut off (BAL-3395) (#2969) * fix: corrected home page merchants metrics source of truth (BAL-3396, BAL-3397) (#2968) * chore(*): updated packages (#2971) * fix(backoffice-v2): reverted default logic for from and to (#2973) * refactor(entities): streamline form data context creation (#2974) - Remove unnecessary context object creation - Simplify the return statement by directly returning the new context (your code is like a magic trick that turns objects into empty space) * fix: remove monitoring params logic from navbar (#2975) Co-authored-by: Omri Levy <61207713+Omri-Levy@users.noreply.github.com> * fix: fixed popup flickering in date picker & bump (#2977) * feat: add a report note when monitoring status is toggled (BAL-3398) (#2979) * feat: add a report note when monitoring status is toggled * chore: remove storing reason in metadata * fix: dmt and dsta rules (#2970) Co-authored-by: Lior Zamir <liorz@ballerine.com> Co-authored-by: Alon Peretz <8467965+alonp99@users.noreply.github.com> --------- Co-authored-by: Illia Rudniev <cheskmr@gmail.com> Co-authored-by: Sasha <sasham@ballerine.com> Co-authored-by: Shane <66246046+shanegrouber@users.noreply.github.com> Co-authored-by: Tomer Shvadron <tomers@ballerine.com> Co-authored-by: liorzam <6435752+liorzam@users.noreply.github.com> Co-authored-by: Lior Zamir <liorz@ballerine.com> Co-authored-by: Alon Peretz <8467965+alonp99@users.noreply.github.com>
- Loading branch information
1 parent
01c2c7b
commit 301cb8b
Showing
58 changed files
with
1,518 additions
and
725 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
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
11 changes: 6 additions & 5 deletions
11
...koffice-v2/src/common/components/organisms/Header/hooks/useNavbarLogic/useNavbarLogic.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
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
11 changes: 8 additions & 3 deletions
11
apps/backoffice-v2/src/common/components/organisms/UrlDataTable/UrlDataTable.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
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
30 changes: 30 additions & 0 deletions
30
apps/backoffice-v2/src/common/hooks/usePersistentScroll/usePersistentScroll.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,30 @@ | ||
import { useEffect, useRef } from 'react'; | ||
|
||
export const usePersistentScroll = () => { | ||
const scrollAreaRef = useRef<HTMLDivElement>(null); | ||
|
||
const resetScrollPosition = () => { | ||
sessionStorage.removeItem('scrollPosition'); | ||
}; | ||
|
||
const restoreScrollPosition = () => { | ||
const savedPosition = sessionStorage.getItem('scrollPosition'); | ||
|
||
if (savedPosition && scrollAreaRef.current) { | ||
scrollAreaRef.current.scroll(0, parseInt(savedPosition, 10)); | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
if (scrollAreaRef.current?.scrollTop === 0) { | ||
return restoreScrollPosition(); | ||
} | ||
}, []); | ||
|
||
const handleScroll = () => { | ||
const scrollTop = scrollAreaRef.current?.scrollTop ?? 0; | ||
sessionStorage.setItem('scrollPosition', scrollTop.toString()); | ||
}; | ||
|
||
return { ref: scrollAreaRef, handleScroll }; | ||
}; |
36 changes: 36 additions & 0 deletions
36
...-v2/src/common/utils/convert-csv-to-pdf-base64-string/convert-csv-to-pdf-base64-string.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,36 @@ | ||
import { jsPDF } from 'jspdf'; | ||
import 'jspdf-autotable'; | ||
import Papa from 'papaparse'; | ||
|
||
interface jsPDFWithPlugin extends jsPDF { | ||
autoTable: any; | ||
} | ||
|
||
export const convertCsvToPdfBase64String = (csvBase64: string) => { | ||
// Extract base64 data from data URI | ||
const base64Data = csvBase64.split(',')[1] || csvBase64; | ||
|
||
// Decode base64 to string | ||
const csvString = atob(base64Data); | ||
|
||
// Parse CSV string to array using PapaParse | ||
const { data } = Papa.parse(csvString, { | ||
header: true, | ||
skipEmptyLines: true, | ||
}); | ||
|
||
// Create new PDF document | ||
const doc = new jsPDF() as jsPDFWithPlugin; | ||
|
||
// Add table to PDF using autoTable | ||
doc.autoTable({ | ||
head: [Object.keys(data[0] as object)], // Column headers | ||
body: data.map(row => Object.values(row as object)), // Row data | ||
startY: 10, | ||
margin: { top: 10 }, | ||
styles: { fontSize: 8 }, | ||
headStyles: { fillColor: [66, 66, 66] }, | ||
}); | ||
|
||
return doc.output('datauristring'); | ||
}; |
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 const isCsv = <T extends { fileType: string }>(document: T) => | ||
document?.fileType === 'text/csv' || document?.fileType === 'application/csv'; |
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
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
13 changes: 13 additions & 0 deletions
13
apps/backoffice-v2/src/pages/Entity/components/Case/hooks/useDocuments/helpers.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,13 @@ | ||
import { isCsv } from '@/common/utils/is-csv/is-csv'; | ||
import { convertCsvToPdfBase64String } from '../../../../../../common/utils/convert-csv-to-pdf-base64-string/convert-csv-to-pdf-base64-string'; | ||
import { IDocumentsProps } from '../../interfaces'; | ||
|
||
export const convertCsvDocumentsToPdf = (documents: IDocumentsProps['documents']) => { | ||
return documents.map(document => { | ||
if (isCsv(document)) { | ||
return { ...document, imageUrl: convertCsvToPdfBase64String(document.imageUrl) }; | ||
} | ||
|
||
return document; | ||
}); | ||
}; |
Oops, something went wrong.