Merge branch 'staging' into preprod
This commit is contained in:
commit
efab82b5bf
@ -44,7 +44,7 @@ export const FormContext = React.createContext<IFormContext>({
|
|||||||
|
|
||||||
export default class Form extends React.Component<IProps, IState> {
|
export default class Form extends React.Component<IProps, IState> {
|
||||||
protected fields: IFields = {};
|
protected fields: IFields = {};
|
||||||
private formRef: React.RefObject<HTMLFormElement>;
|
public formRef: React.RefObject<HTMLFormElement>;
|
||||||
|
|
||||||
constructor(props: IProps) {
|
constructor(props: IProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -59,7 +59,7 @@ export default function DepositDocumentComponent(props: IProps) {
|
|||||||
if (!refused_reason) return;
|
if (!refused_reason) return;
|
||||||
setRefusedReason(refused_reason);
|
setRefusedReason(refused_reason);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
}, []);
|
}, [document.document_history]);
|
||||||
|
|
||||||
const closeModal = useCallback(() => {
|
const closeModal = useCallback(() => {
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
|
@ -85,7 +85,7 @@ export default function ReceivedDocuments() {
|
|||||||
DocumentsNotary.getInstance()
|
DocumentsNotary.getInstance()
|
||||||
.get({ where: { folder: { uid: folderUid }, customer: { uid: customerUid } }, include: { files: true } })
|
.get({ where: { folder: { uid: folderUid }, customer: { uid: customerUid } }, include: { files: true } })
|
||||||
.then((documentsNotary) => setDocumentsNotary(documentsNotary));
|
.then((documentsNotary) => setDocumentsNotary(documentsNotary));
|
||||||
}, [folderUid, customer]);
|
}, [folderUid, customer, fetchFolderAndCustomer]);
|
||||||
|
|
||||||
const onDownload = useCallback((doc: DocumentNotary) => {
|
const onDownload = useCallback((doc: DocumentNotary) => {
|
||||||
const file = doc.files?.[0];
|
const file = doc.files?.[0];
|
||||||
|
@ -144,7 +144,7 @@ export default function ClientDashboard(props: IProps) {
|
|||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}, [customer, folderUid, isAddDocumentModalVisible, onCloseModalAddDocument]);
|
}, [customer, folderUid, isAddDocumentModalVisible, onCloseModalAddDocument, folder]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DefaultCustomerDashboard>
|
<DefaultCustomerDashboard>
|
||||||
|
@ -40,12 +40,11 @@ export default function AskDocuments() {
|
|||||||
const formElement = formRef.current.formRef.current;
|
const formElement = formRef.current.formRef.current;
|
||||||
if (!formElement) return [];
|
if (!formElement) return [];
|
||||||
|
|
||||||
const checkboxes = Array.from(formElement.elements)
|
const checkboxes = Array.from(formElement.elements).filter(
|
||||||
.filter(elem => elem.getAttribute("type") === "checkbox" && elem.getAttribute("name") === "document_types") as HTMLInputElement[];
|
(elem) => elem.getAttribute("type") === "checkbox" && elem.getAttribute("name") === "document_types",
|
||||||
|
) as HTMLInputElement[];
|
||||||
|
|
||||||
return checkboxes
|
return checkboxes.filter((checkbox) => checkbox.checked).map((checkbox) => checkbox.value);
|
||||||
.filter(checkbox => checkbox.checked)
|
|
||||||
.map(checkbox => checkbox.value);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFormSubmit = useCallback(
|
const onFormSubmit = useCallback(
|
||||||
@ -152,14 +151,15 @@ export default function AskDocuments() {
|
|||||||
if (!formElement) return;
|
if (!formElement) return;
|
||||||
|
|
||||||
// Check all checkboxes that were previously selected
|
// Check all checkboxes that were previously selected
|
||||||
const checkboxes = Array.from(formElement.elements)
|
const checkboxes = Array.from(formElement.elements).filter(
|
||||||
.filter(elem => elem.getAttribute("type") === "checkbox" && elem.getAttribute("name") === "document_types") as HTMLInputElement[];
|
(elem) => elem.getAttribute("type") === "checkbox" && elem.getAttribute("name") === "document_types",
|
||||||
|
) as HTMLInputElement[];
|
||||||
|
|
||||||
checkboxes.forEach(checkbox => {
|
checkboxes.forEach((checkbox) => {
|
||||||
if (selectedDocumentTypes.includes(checkbox.value)) {
|
if (selectedDocumentTypes.includes(checkbox.value)) {
|
||||||
checkbox.checked = true;
|
checkbox.checked = true;
|
||||||
// Trigger change to update the internal state of CheckBox component
|
// 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);
|
checkbox.dispatchEvent(event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -189,7 +189,7 @@ export default function AskDocuments() {
|
|||||||
setDocumentTypes([...documentTypes, ...newDocumentTypes]);
|
setDocumentTypes([...documentTypes, ...newDocumentTypes]);
|
||||||
|
|
||||||
// Set these as selected
|
// Set these as selected
|
||||||
setSelectedDocumentTypes([...existingSelections, ...newDocumentTypes.map(dt => dt.value as string)]);
|
setSelectedDocumentTypes([...existingSelections, ...newDocumentTypes.map((dt) => dt.value as string)]);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -74,7 +74,7 @@ export default function DocumentsReminderHistory(props: IProps) {
|
|||||||
setTotalPages(totalPages);
|
setTotalPages(totalPages);
|
||||||
})
|
})
|
||||||
.catch((e) => console.warn(e));
|
.catch((e) => console.warn(e));
|
||||||
}, [pageSize]);
|
}, [pageSize, folderUid]);
|
||||||
|
|
||||||
const fetchReminders = useCallback(() => {
|
const fetchReminders = useCallback(() => {
|
||||||
DocumentReminders.getInstance()
|
DocumentReminders.getInstance()
|
||||||
@ -109,7 +109,7 @@ export default function DocumentsReminderHistory(props: IProps) {
|
|||||||
setReminders(response); // Set the reminders
|
setReminders(response); // Set the reminders
|
||||||
})
|
})
|
||||||
.catch((e) => console.warn(e));
|
.catch((e) => console.warn(e));
|
||||||
}, [customerOption, page, pageSize]); // Update on page change
|
}, [customerOption, page, pageSize, folderUid]); // Update on page change
|
||||||
|
|
||||||
const fetchCustomers = useCallback(async () => {
|
const fetchCustomers = useCallback(async () => {
|
||||||
if (!folderUid) return;
|
if (!folderUid) return;
|
||||||
|
@ -41,7 +41,7 @@ export default function ClientBox(props: IProps) {
|
|||||||
}
|
}
|
||||||
props.onDelete(customerUid);
|
props.onDelete(customerUid);
|
||||||
},
|
},
|
||||||
[closeDeleteModal, customer.documents, openErrorModal, props],
|
[closeDeleteModal, customer.documents, openErrorModal, props, customer, folderUid],
|
||||||
);
|
);
|
||||||
|
|
||||||
let createOrUpdateNotePath = Module.getInstance()
|
let createOrUpdateNotePath = Module.getInstance()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user