Compare commits

...

6 Commits

Author SHA1 Message Date
3d3b8ba6e1 chore(git): merge branch 'staging' into 148-create-page
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 32s
2024-08-20 14:05:07 +02:00
b6e739bc14 chore(git): merge pull request 'feat(verify-page): new verify page design' (#151) from 136-verify-page-after-merges into staging
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m12s
Reviewed-on: #151
2024-08-20 11:57:40 +00:00
17c91b5507 chore(git): merge branch 'staging' into 136-verify-page-after-merges
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 32s
2024-08-20 13:55:07 +02:00
f162baadbb Merge pull request 'Signing Page - New Design' (#152) from sigit-info-signing-page into staging
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m12s
Reviewed-on: #152
2024-08-20 11:29:11 +00:00
3a6c5ae8e3 chore: formatting
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 32s
2024-08-20 14:27:35 +03:00
55bf90e93c chore: linting
Some checks failed
Open PR on Staging / audit_and_check (pull_request) Failing after 32s
2024-08-20 14:21:45 +03:00
3 changed files with 22 additions and 22 deletions

View File

@ -37,7 +37,7 @@ interface Props {
}
export const DrawPDFFields = (props: Props) => {
const { selectedFiles, selectedTool } = props
const { selectedFiles, selectedTool, onDrawFieldsChange, users } = props
const [pdfFiles, setPdfFiles] = useState<PdfFile[]>([])
const [parsingPdf, setParsingPdf] = useState<boolean>(false)
@ -67,8 +67,8 @@ export const DrawPDFFields = (props: Props) => {
}, [selectedFiles])
useEffect(() => {
if (pdfFiles) props.onDrawFieldsChange(pdfFiles)
}, [pdfFiles, props])
if (pdfFiles) onDrawFieldsChange(pdfFiles)
}, [onDrawFieldsChange, pdfFiles])
/**
* Drawing events
@ -96,7 +96,7 @@ export const DrawPDFFields = (props: Props) => {
* @param page PdfPage where press happened
*/
const onMouseDown = (
event: React.MouseEvent<HTMLDivElement, MouseEvent>,
event: React.MouseEvent<HTMLDivElement>,
page: PdfPage
) => {
// Proceed only if left click
@ -149,7 +149,7 @@ export const DrawPDFFields = (props: Props) => {
* @param page PdfPage where moving is happening
*/
const onMouseMove = (
event: React.MouseEvent<HTMLDivElement, MouseEvent>,
event: React.MouseEvent<HTMLDivElement>,
page: PdfPage
) => {
if (mouseState.clicked && selectedTool) {
@ -188,9 +188,7 @@ export const DrawPDFFields = (props: Props) => {
* @param event Mouse event
* @param drawnField Which we are moving
*/
const onDrawnFieldMouseDown = (
event: React.MouseEvent<HTMLDivElement, MouseEvent>
) => {
const onDrawnFieldMouseDown = (event: React.MouseEvent<HTMLDivElement>) => {
event.stopPropagation()
// Proceed only if left click
@ -214,7 +212,7 @@ export const DrawPDFFields = (props: Props) => {
* @param drawnField which we are moving
*/
const onDrawnFieldMouseMove = (
event: React.MouseEvent<HTMLDivElement, MouseEvent>,
event: React.MouseEvent<HTMLDivElement>,
drawnField: DrawnField
) => {
if (mouseState.dragging) {
@ -250,7 +248,7 @@ export const DrawPDFFields = (props: Props) => {
* @param drawnField which we are resizing
*/
const onResizeHandleMouseDown = (
event: React.MouseEvent<HTMLSpanElement, MouseEvent>
event: React.MouseEvent<HTMLSpanElement>
) => {
// Proceed only if left click
if (event.button !== 0) return
@ -268,7 +266,7 @@ export const DrawPDFFields = (props: Props) => {
* @param drawnField which we are resizing
*/
const onResizeHandleMouseMove = (
event: React.MouseEvent<HTMLSpanElement, MouseEvent>,
event: React.MouseEvent<HTMLSpanElement>,
drawnField: DrawnField
) => {
if (mouseState.resizing) {
@ -298,7 +296,7 @@ export const DrawPDFFields = (props: Props) => {
* @param drawnFileIndex drawn file index
*/
const onRemoveHandleMouseDown = (
event: React.MouseEvent<HTMLSpanElement, MouseEvent>,
event: React.MouseEvent<HTMLSpanElement>,
pdfFileIndex: number,
pdfPageIndex: number,
drawnFileIndex: number
@ -317,7 +315,7 @@ export const DrawPDFFields = (props: Props) => {
* @param event Mouse event
*/
const onUserSelectHandleMouseDown = (
event: React.MouseEvent<HTMLDivElement, MouseEvent>
event: React.MouseEvent<HTMLDivElement>
) => {
event.stopPropagation()
}
@ -329,8 +327,8 @@ export const DrawPDFFields = (props: Props) => {
* event.target will be used
*/
const getMouseCoordinates = (
event: React.MouseEvent<HTMLElement, MouseEvent>,
customTarget?: HTMLElement | null
event: React.MouseEvent<HTMLElement>,
customTarget?: HTMLElement
) => {
const target = customTarget ? customTarget : event.currentTarget
const rect = target.getBoundingClientRect()
@ -419,7 +417,7 @@ export const DrawPDFFields = (props: Props) => {
labelId="counterparts"
label="Counterparts"
>
{props.users
{users
.filter((u) => u.role === UserRole.signer)
.map((user, index) => {
let displayValue = truncate(

View File

@ -7,15 +7,17 @@ import {
isCurrentUserMarksComplete,
isCurrentValueLast
} from '../../utils'
import { useState } from 'react'
import React, { useState } from 'react'
interface MarkFormFieldProps {
handleSubmit: (event: any) => void
handleSelectedMarkValueChange: (event: any) => void
selectedMark: CurrentUserMark
selectedMarkValue: string
currentUserMarks: CurrentUserMark[]
handleCurrentUserMarkChange: (mark: CurrentUserMark) => void
handleSelectedMarkValueChange: (
event: React.ChangeEvent<HTMLInputElement>
) => void
handleSubmit: (event: React.FormEvent<HTMLFormElement>) => void
selectedMark: CurrentUserMark
selectedMarkValue: string
}
/**

View File

@ -1,4 +1,4 @@
import { MarkType } from "./drawing";
import { MarkType } from './drawing'
export interface CurrentUserMark {
id: number