Compare commits

..

No commits in common. "b22f577cc2de21bb1f8370c84a1d263f09fd7eb6" and "7d3daa8d13827fa8dc1b51ed8d3572efb187be88" have entirely different histories.

3 changed files with 7 additions and 13 deletions

View File

@ -14,8 +14,6 @@ import styles from './style.module.scss'
import { CurrentUserFile } from '../../types/file.ts' import { CurrentUserFile } from '../../types/file.ts'
import FileList from '../FileList' import FileList from '../FileList'
import { StickySideColumns } from '../../layouts/StickySideColumns.tsx' import { StickySideColumns } from '../../layouts/StickySideColumns.tsx'
import { UsersDetails } from '../UsersDetails.tsx'
import { Meta } from '../../types'
interface PdfMarkingProps { interface PdfMarkingProps {
files: CurrentUserFile[] files: CurrentUserFile[]
@ -24,7 +22,6 @@ interface PdfMarkingProps {
setCurrentUserMarks: (currentUserMarks: CurrentUserMark[]) => void setCurrentUserMarks: (currentUserMarks: CurrentUserMark[]) => void
setUpdatedMarks: (markToUpdate: Mark) => void setUpdatedMarks: (markToUpdate: Mark) => void
handleDownload: () => void handleDownload: () => void
meta: Meta | null
} }
/** /**
@ -40,8 +37,7 @@ const PdfMarking = (props: PdfMarkingProps) => {
setIsReadyToSign, setIsReadyToSign,
setCurrentUserMarks, setCurrentUserMarks,
setUpdatedMarks, setUpdatedMarks,
handleDownload, handleDownload
meta
} = props } = props
const [selectedMark, setSelectedMark] = useState<CurrentUserMark | null>(null) const [selectedMark, setSelectedMark] = useState<CurrentUserMark | null>(null)
const [selectedMarkValue, setSelectedMarkValue] = useState<string>('') const [selectedMarkValue, setSelectedMarkValue] = useState<string>('')
@ -85,8 +81,8 @@ const PdfMarking = (props: PdfMarkingProps) => {
} }
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => { const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault() event.preventDefault();
if (!selectedMarkValue || !selectedMark) return if (!selectedMarkValue || !selectedMark) return;
const updatedMark: CurrentUserMark = getUpdatedMark( const updatedMark: CurrentUserMark = getUpdatedMark(
selectedMark, selectedMark,
@ -130,7 +126,6 @@ const PdfMarking = (props: PdfMarkingProps) => {
)} )}
</div> </div>
} }
right={meta !== null && <UsersDetails meta={meta} />}
> >
<div className={styles.container}> <div className={styles.container}>
{currentUserMarks?.length > 0 && ( {currentUserMarks?.length > 0 && (

View File

@ -35,10 +35,10 @@ const PdfView = ({
}, [currentFile]) }, [currentFile])
const filterByFile = ( const filterByFile = (
currentUserMarks: CurrentUserMark[], currentUserMarks: CurrentUserMark[],
hash: string fileName: string
): CurrentUserMark[] => { ): CurrentUserMark[] => {
return currentUserMarks.filter( return currentUserMarks.filter(
(currentUserMark) => currentUserMark.mark.pdfFileHash === hash (currentUserMark) => currentUserMark.mark.fileName === fileName
) )
} }
const isNotLastPdfFile = (index: number, files: CurrentUserFile[]): boolean => const isNotLastPdfFile = (index: number, files: CurrentUserFile[]): boolean =>
@ -46,7 +46,7 @@ const PdfView = ({
return ( return (
<> <>
{files.map((currentUserFile, index, arr) => { {files.map((currentUserFile, index, arr) => {
const { hash, pdfFile, id } = currentUserFile const { hash, pdfFile, filename, id } = currentUserFile
if (!hash) return if (!hash) return
return ( return (
<div <div
@ -56,7 +56,7 @@ const PdfView = ({
> >
<PdfItem <PdfItem
pdfFile={pdfFile} pdfFile={pdfFile}
currentUserMarks={filterByFile(currentUserMarks, hash)} currentUserMarks={filterByFile(currentUserMarks, filename)}
selectedMark={selectedMark} selectedMark={selectedMark}
handleMarkClick={handleMarkClick} handleMarkClick={handleMarkClick}
selectedMarkValue={selectedMarkValue} selectedMarkValue={selectedMarkValue}

View File

@ -958,7 +958,6 @@ export const SignPage = () => {
setCurrentUserMarks={setCurrentUserMarks} setCurrentUserMarks={setCurrentUserMarks}
setUpdatedMarks={setUpdatedMarks} setUpdatedMarks={setUpdatedMarks}
handleDownload={handleDownload} handleDownload={handleDownload}
meta={meta}
/> />
) )
} }