Merge branch 'dev' into staging
This commit is contained in:
commit
6cf229ca25
@ -32,6 +32,7 @@
|
||||
display: flex;
|
||||
padding: var(--spacing-1, 8px);
|
||||
align-items: center;
|
||||
align-self: flex-start;
|
||||
|
||||
border-radius: var(--alerts-badge-radius, 360px);
|
||||
border: 1px solid var(--alerts-badge-border, rgba(0, 0, 0, 0));
|
||||
|
@ -11,6 +11,7 @@ import Module from "@Front/Config/Module";
|
||||
import { useCallback } from "react";
|
||||
import { Note } from "le-coffre-resources/dist/Customer";
|
||||
import ButtonWithSubMenu from "@Front/Components/Elements/ButtonWithSubMenu";
|
||||
import Modal from "@Front/Components/DesignSystem/Modal";
|
||||
|
||||
type IProps = {
|
||||
customer: ICustomer;
|
||||
@ -23,10 +24,16 @@ type IProps = {
|
||||
export default function ClientBox(props: IProps) {
|
||||
const { customer, anchorStatus, folderUid, customerNote } = props;
|
||||
|
||||
const { isOpen, open, close } = useOpenable();
|
||||
const { isOpen: isDeleteModalOpen, open: openDeleteModal, close: closeDeleteModal } = useOpenable();
|
||||
const { isOpen: isErrorModalOpen, open: openErrorModal, close: closeErrorModal } = useOpenable();
|
||||
|
||||
const handleDelete = useCallback(
|
||||
(customerUid: string) => {
|
||||
if (customer.documents && customer.documents.length > 0) {
|
||||
closeDeleteModal();
|
||||
openErrorModal();
|
||||
return;
|
||||
}
|
||||
props.onDelete(customerUid);
|
||||
},
|
||||
[props],
|
||||
@ -108,12 +115,27 @@ export default function ClientBox(props: IProps) {
|
||||
variant={EButtonVariant.ERROR}
|
||||
styletype={EButtonstyletype.TEXT}
|
||||
rightIcon={<TrashIcon />}
|
||||
onClick={open}>
|
||||
onClick={openDeleteModal}>
|
||||
Supprimer le client
|
||||
</Button>
|
||||
<DeleteCustomerModal isOpen={isOpen} onClose={close} customerUid={customer.uid ?? ""} onDelete={handleDelete} />
|
||||
<DeleteCustomerModal
|
||||
isOpen={isDeleteModalOpen}
|
||||
onClose={close}
|
||||
customerUid={customer.uid ?? ""}
|
||||
onDelete={handleDelete}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<Modal
|
||||
isOpen={isErrorModalOpen}
|
||||
onClose={closeErrorModal}
|
||||
title={"Suppression impossible"}
|
||||
secondButton={{ children: "Fermer", onClick: closeErrorModal, fullwidth: true }}>
|
||||
<Typography typo={ETypo.TEXT_MD_light}>
|
||||
Ce client ne peut pas être supprimé car des documents sont associés à son dossier. Veuillez d'abord gérer ou supprimer
|
||||
ces documents avant de tenter de supprimer le client.
|
||||
</Typography>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
import Alert, { EAlertVariant } from "@Front/Components/DesignSystem/Alert";
|
||||
import { ArrowPathIcon } from "@heroicons/react/24/outline";
|
||||
|
||||
export default function AnchoringProcessingNeutral() {
|
||||
export default function AnchoringProcessingInfo() {
|
||||
return (
|
||||
<Alert
|
||||
title="Ancrage en cours..."
|
||||
description="Vos documents sont en train d'être ancrés dans la blockchain. Cela peut prendre quelques instants. Merci de votre patience."
|
||||
variant={EAlertVariant.NEUTRAL}
|
||||
variant={EAlertVariant.INFO}
|
||||
icon={<ArrowPathIcon />}
|
||||
fullWidth
|
||||
/>
|
||||
);
|
@ -13,13 +13,13 @@ import ClientView from "./ClientView";
|
||||
import AnchoringAlertInfo from "./elements/AnchoringAlertInfo";
|
||||
import AnchoringAlertSuccess from "./elements/AnchoringAlertSuccess";
|
||||
import AnchoringModal from "./elements/AnchoringModal";
|
||||
import AnchoringProcessingNeutral from "./elements/AnchoringProcessingNeutral";
|
||||
import ArchiveAlertWarning from "./elements/ArchiveAlertWarning";
|
||||
import ArchiveModal from "./elements/ArchiveModal";
|
||||
import DownloadAnchoringProofModal from "./elements/DownloadAnchoringProofModal";
|
||||
import RequireAnchoringModal from "./elements/RequireAnchoringModal";
|
||||
import InformationSection from "./InformationSection";
|
||||
import NoClientView from "./NoClientView";
|
||||
import AnchoringProcessingInfo from "./elements/AnchoringProcessingInfo";
|
||||
|
||||
export enum AnchorStatus {
|
||||
"VERIFIED_ON_CHAIN" = "VERIFIED_ON_CHAIN",
|
||||
@ -148,7 +148,7 @@ export default function FolderInformation(props: IProps) {
|
||||
isArchived={isArchived}
|
||||
/>
|
||||
)}
|
||||
{!isArchived && anchorStatus === AnchorStatus.ANCHORING && <AnchoringProcessingNeutral />}
|
||||
{!isArchived && anchorStatus === AnchorStatus.ANCHORING && <AnchoringProcessingInfo />}
|
||||
{isArchived && folderUid && (
|
||||
<ArchiveAlertWarning folderUid={folderUid} onDownloadAnchoringProof={downloadAnchoringProofModal.open} />
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user