diff --git a/public/assets/css/core-extend.css b/public/assets/css/core-extend.css index 2e9e51ef..1ecc882c 100644 --- a/public/assets/css/core-extend.css +++ b/public/assets/css/core-extend.css @@ -10,7 +10,21 @@ .table_header_border { border-bottom:2px solid var(--bs-table-border-color) ; } +.text-gary-80 { +color:var(--bs-gray-500) +} +.text-royalblue{ +color: #1796e3; +} + +.text-md { +font-size: 2rem; +} + +.text-md-b { +font-weight: normal; +} .text-xxs { font-size: 0.55rem; } /* 8px */ .text-xs { font-size: 0.75rem; } /* 12px */ diff --git a/src/components/Expenses/PreviewDocument.jsx b/src/components/Expenses/PreviewDocument.jsx index 9c0f5c49..786cdf64 100644 --- a/src/components/Expenses/PreviewDocument.jsx +++ b/src/components/Expenses/PreviewDocument.jsx @@ -1,15 +1,18 @@ import { useState } from 'react'; + const PreviewDocument = ({ imageUrl }) => { const [loading, setLoading] = useState(true); + const [rotation, setRotation] = useState(0); // Rotation angle return ( -
+
{loading && (
Loading...
)} + Full View { maxHeight: "100vh", objectFit: "contain", display: loading ? "none" : "block", + transform: `rotate(${rotation}deg)`, + transition: "transform 0.3s ease", }} onLoad={() => setLoading(false)} /> + + {/* Rotate Button */} +
); }; export default PreviewDocument; + diff --git a/src/components/collections/ManageCollection.jsx b/src/components/collections/ManageCollection.jsx index 62ad91f8..68667d61 100644 --- a/src/components/collections/ManageCollection.jsx +++ b/src/components/collections/ManageCollection.jsx @@ -138,7 +138,6 @@ const ManageCollection = ({ collectionId, onClose }) => { taxAmount: data?.taxAmount, basicAmount: data?.basicAmount, description: data?.description, - attachments: data?.attachments, attachments: data.attachments ? data.attachments.map((doc) => ({ fileName: doc.fileName, diff --git a/src/components/common/AccessDenied.jsx b/src/components/common/AccessDenied.jsx new file mode 100644 index 00000000..62cc5f4e --- /dev/null +++ b/src/components/common/AccessDenied.jsx @@ -0,0 +1,22 @@ +import React from "react"; +import Breadcrumb from "./Breadcrumb"; + +const AccessDenied = ({data}) => { + return ( +
+ + +
+ +

+ Access Denied: You don't have permission to perform this action ! +

+
+ +
+ ); +}; + +export default AccessDenied; diff --git a/src/pages/collections/CollectionPage.jsx b/src/pages/collections/CollectionPage.jsx index 4d3455e5..aac80d26 100644 --- a/src/pages/collections/CollectionPage.jsx +++ b/src/pages/collections/CollectionPage.jsx @@ -23,6 +23,7 @@ import { EDIT_COLLECTION, VIEW_COLLECTION, } from "../../utils/constants"; +import AccessDenied from "../../components/common/AccessDenied"; const CollectionContext = createContext(); export const useCollectionContext = () => { @@ -81,155 +82,140 @@ const CollectionPage = () => { const handleMarkedPayment = (payload) => { MarkedReceived(payload); }; + if (isAdmin === undefined || + canAddPayment === undefined || + canEditCollection === undefined || + canViewCollection === undefined || + canCreate === undefined +) { + return
Checking access...
; +} + +if (!isAdmin && !canAddPayment && !canEditCollection && !canViewCollection && !canCreate) { + return ; +} return ( - {isAdmin || - canAddPayment || - canEditCollection || - canViewCollection || - canCreate ? ( -
- +
+ -
-
-
- - - -
-
-
- setShowPending(e.target.checked)} - /> - -
-
- -
-
- {" "} - setSearchText(e.target.value)} - placeholder="search Collection" - className="form-control form-control-sm" - /> -
- {isAdmin || - (isCanCreate && ( - - ))} +
+
+
+ + + +
+
+
+ setShowPending(e.target.checked)} + /> +
-
- +
+
+ {" "} + setSearchText(e.target.value)} + placeholder="search Collection" + className="form-control form-control-sm" + /> +
+ { (canCreate || isAdmin) && ( + +)} - {makeCollection.isOpen && ( - - setCollection({ isOpen: false, invoiceId: null }) - } - > - - setCollection({ isOpen: false, invoiceId: null }) - } - /> - - )} - - {addPayment.isOpen && ( - - setAddPayment({ isOpen: false, invoiceId: null }) - } - > - - setAddPayment({ isOpen: false, invoiceId: null }) - } - /> - - )} - - {viewCollection && ( - setViewCollection(null)} - > - setViewCollection(null)} /> - - )} - - {ViewDocument.IsOpen && ( - setDocumentView({ IsOpen: false, Image: null })} - > - - - )} - - handleMarkedPayment(processedPayment?.invoiceId)} - onClose={() => setProcessedPayment(null)} - /> -
- ) : ( -
-
- -

- Access Denied: You don't have permission to perform this action ! -

+
- )} + + + + {makeCollection.isOpen && ( + setCollection({ isOpen: false, invoiceId: null })} + > + setCollection({ isOpen: false, invoiceId: null })} + /> + + )} + + {addPayment.isOpen && ( + setAddPayment({ isOpen: false, invoiceId: null })} + > + setAddPayment({ isOpen: false, invoiceId: null })} + /> + + )} + + {viewCollection && ( + setViewCollection(null)} + > + setViewCollection(null)} /> + + )} + + {ViewDocument.IsOpen && ( + setDocumentView({ IsOpen: false, Image: null })} + > + + + )} + + handleMarkedPayment(processedPayment?.invoiceId)} + onClose={() => setProcessedPayment(null)} + /> +
); };