Fixed build

This commit is contained in:
Vins 2025-04-15 09:23:10 +02:00
parent f54797493a
commit 1b98adc052
7 changed files with 33 additions and 33 deletions

View File

@ -44,7 +44,7 @@ export const FormContext = React.createContext<IFormContext>({
export default class Form extends React.Component<IProps, IState> {
protected fields: IFields = {};
private formRef: React.RefObject<HTMLFormElement>;
public formRef: React.RefObject<HTMLFormElement>;
constructor(props: IProps) {
super(props);

View File

@ -59,7 +59,7 @@ export default function DepositDocumentComponent(props: IProps) {
if (!refused_reason) return;
setRefusedReason(refused_reason);
setIsModalOpen(true);
}, []);
}, [document.document_history]);
const closeModal = useCallback(() => {
setIsModalOpen(false);

View File

@ -85,7 +85,7 @@ export default function ReceivedDocuments() {
DocumentsNotary.getInstance()
.get({ where: { folder: { uid: folderUid }, customer: { uid: customerUid } }, include: { files: true } })
.then((documentsNotary) => setDocumentsNotary(documentsNotary));
}, [folderUid, customer]);
}, [folderUid, customer, fetchFolderAndCustomer]);
const onDownload = useCallback((doc: DocumentNotary) => {
const file = doc.files?.[0];

View File

@ -144,7 +144,7 @@ export default function ClientDashboard(props: IProps) {
})}
/>
);
}, [customer, folderUid, isAddDocumentModalVisible, onCloseModalAddDocument]);
}, [customer, folderUid, isAddDocumentModalVisible, onCloseModalAddDocument, folder]);
return (
<DefaultCustomerDashboard>

View File

@ -40,12 +40,11 @@ export default function AskDocuments() {
const formElement = formRef.current.formRef.current;
if (!formElement) return [];
const checkboxes = Array.from(formElement.elements)
.filter(elem => elem.getAttribute("type") === "checkbox" && elem.getAttribute("name") === "document_types") as HTMLInputElement[];
const checkboxes = Array.from(formElement.elements).filter(
(elem) => elem.getAttribute("type") === "checkbox" && elem.getAttribute("name") === "document_types",
) as HTMLInputElement[];
return checkboxes
.filter(checkbox => checkbox.checked)
.map(checkbox => checkbox.value);
return checkboxes.filter((checkbox) => checkbox.checked).map((checkbox) => checkbox.value);
};
const onFormSubmit = useCallback(
@ -152,14 +151,15 @@ export default function AskDocuments() {
if (!formElement) return;
// Check all checkboxes that were previously selected
const checkboxes = Array.from(formElement.elements)
.filter(elem => elem.getAttribute("type") === "checkbox" && elem.getAttribute("name") === "document_types") as HTMLInputElement[];
const checkboxes = Array.from(formElement.elements).filter(
(elem) => elem.getAttribute("type") === "checkbox" && elem.getAttribute("name") === "document_types",
) as HTMLInputElement[];
checkboxes.forEach(checkbox => {
checkboxes.forEach((checkbox) => {
if (selectedDocumentTypes.includes(checkbox.value)) {
checkbox.checked = true;
// Trigger change to update the internal state of CheckBox component
const event = new Event('change', { bubbles: true });
const event = new Event("change", { bubbles: true });
checkbox.dispatchEvent(event);
}
});
@ -189,7 +189,7 @@ export default function AskDocuments() {
setDocumentTypes([...documentTypes, ...newDocumentTypes]);
// Set these as selected
setSelectedDocumentTypes([...existingSelections, ...newDocumentTypes.map(dt => dt.value as string)]);
setSelectedDocumentTypes([...existingSelections, ...newDocumentTypes.map((dt) => dt.value as string)]);
};
return (

View File

@ -74,7 +74,7 @@ export default function DocumentsReminderHistory(props: IProps) {
setTotalPages(totalPages);
})
.catch((e) => console.warn(e));
}, [pageSize]);
}, [pageSize, folderUid]);
const fetchReminders = useCallback(() => {
DocumentReminders.getInstance()
@ -109,7 +109,7 @@ export default function DocumentsReminderHistory(props: IProps) {
setReminders(response); // Set the reminders
})
.catch((e) => console.warn(e));
}, [customerOption, page, pageSize]); // Update on page change
}, [customerOption, page, pageSize, folderUid]); // Update on page change
const fetchCustomers = useCallback(async () => {
if (!folderUid) return;

View File

@ -41,7 +41,7 @@ export default function ClientBox(props: IProps) {
}
props.onDelete(customerUid);
},
[closeDeleteModal, customer.documents, openErrorModal, props],
[closeDeleteModal, customer.documents, openErrorModal, props, customer, folderUid],
);
let createOrUpdateNotePath = Module.getInstance()