Skip to content

🔥 The free & Open Source DocuSign alternative

feat: add document logs in in-progress report

prafull-opensignlabs4188caed33ff
diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json
index b60915032..d30c4a328 100644
--- a/apps/OpenSign/public/locales/en/translation.json
+++ b/apps/OpenSign/public/locales/en/translation.json
@@ -151,7 +151,8 @@
"Name": "Name",
"Status": "Status",
"created-date": "Created Date",
- "Type": "Type"
+ "Type": "Type",
+ "Logs": "Logs"
},
"report-help": {
"Draft Documents": "These are documents you have started but have not finalized for sending.",
@@ -648,5 +649,7 @@
"p4": "Please choose the option that best suits your document signing requirements."
},
"advanced-options":"Advanced options",
- "hide-advanced-options":"Hide Advanced options"
+ "hide-advanced-options":"Hide Advanced options",
+ "document-logs":"Document logs"
+
}
diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json
index f2e40a37d..5ee3d6599 100644
--- a/apps/OpenSign/public/locales/fr/translation.json
+++ b/apps/OpenSign/public/locales/fr/translation.json
@@ -136,7 +136,8 @@
"Name": "Nom",
"Status": "Statut",
"created-date": "Date de création",
- "Type": "Saisir"
+ "Type": "Saisir",
+ "Logs": "Journaux"
},
"btnLabel": {
"sign": "Signer",
@@ -647,6 +648,7 @@
"p4": "Veuillez choisir l'option qui correspond le mieux à vos exigences en matière de signature de documents."
},
"advanced-options":"Options avancées",
- "hide-advanced-options": "Masquer les options avancées"
+ "hide-advanced-options": "Masquer les options avancées",
+ "document-logs":"Journaux de documents"
}
diff --git a/apps/OpenSign/src/json/ReportJson.js b/apps/OpenSign/src/json/ReportJson.js
index 8100f5477..c1d5cc0d6 100644
--- a/apps/OpenSign/src/json/ReportJson.js
+++ b/apps/OpenSign/src/json/ReportJson.js
@@ -10,6 +10,15 @@ export default function reportJson(id) {
"Owner",
"Signers"
];
+ const iphead = [
+ "Sr.No",
+ "Title",
+ "Note",
+ "Folder",
+ "File",
+ "Logs",
+ "Signers"
+ ];
const contactbook = ["Sr.No", "Name", "Email", "Phone"];
const dashboardReportHead = ["Title", "File", "Owner", "Signers"];
const templateReport = ["Sr.No", "Title", "File", "Owner", "Signers"];
@@ -63,7 +72,7 @@ export default function reportJson(id) {
case "1MwEuxLEkF":
return {
reportName: "In-progress documents",
- heading: head,
+ heading: iphead,
actions: [
{
btnId: "8901",
diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js
index 5f7dd97e1..1da433681 100644
--- a/apps/OpenSign/src/primitives/GetReportDisplay.js
+++ b/apps/OpenSign/src/primitives/GetReportDisplay.js
@@ -69,6 +69,7 @@ const ReportTable = (props) => {
const [publicUserName, setIsPublicUserName] = useState("");
const [isViewShare, setIsViewShare] = useState({});
const [isSubscribe, setIsSubscribe] = useState(true);
+ const [isModal, setIsModal] = useState({});
const [reason, setReason] = useState("");
const Extand_Class = localStorage.getItem("Extand_Class");
const extClass = Extand_Class && JSON.parse(Extand_Class);
@@ -1288,9 +1289,55 @@ const ReportTable = (props) => {
{item?.URL ? t("download") : "-"}
</button>
</td>
- <td className="px-4 py-2">
- {formatRow(item?.ExtUserPtr)}
- </td>
+ {props.ReportName === "In-progress documents" ? (
+ <td className="px-4 py-2">
+ <button
+ onClick={() =>
+ item?.AuditTrail?.length > 0 &&
+ setIsModal({ [item?.objectId]: true })
+ }
+ className={`${
+ item?.AuditTrail?.length
+ ? "border-green-400"
+ : "cursor-default op-border-primary"
+ } focus:outline-none w-[60px] border-[2px] text-[12px] rounded-full md:self-center`}
+ >
+ {item?.AuditTrail?.length ? "VIEWED" : "SENT"}
+ </button>
+ {isModal[item.objectId] && (
+ <ModalUi
+ isOpen
+ title={t("document-logs")}
+ handleClose={() => setIsModal({})}
+ >
+ {item?.AuditTrail?.map((x, i) => (
+ <div
+ key={i}
+ className="pl-3 first:mt-2 text-sm font-medium flex flex-col md:flex-row items-start md:gap-4 border-t-[1px] border-gray-600"
+ >
+ <div className="py-2 break-all font-bold md:text-[12px] md:col-span-2 w-full md:w-[210px]">
+ {x?.UserPtr?.Email || "-"}
+ </div>
+ <button className="px-2 cursor-default border-[2px] text-[12px] border-green-400 rounded-full md:self-center">
+ {x?.Activity?.toUpperCase() || "-"}
+ </button>
+ <div className=" text-[12px] py-2">
+ {x?.Activity === "Signed"
+ ? new Date(x?.SignedOn)?.toUTCString()
+ : new Date(
+ x?.ViewedOn
+ )?.toUTCString() || "-"}
+ </div>
+ </div>
+ ))}
+ </ModalUi>
+ )}
+ </td>
+ ) : (
+ <td className="px-4 py-2">
+ {formatRow(item?.ExtUserPtr)}
+ </td>
+ )}
<td className="px-4 py-2">
{!item?.IsSignyourself && item?.Placeholders ? (
<button
@@ -1308,11 +1355,7 @@ const ReportTable = (props) => {
<td className=" pl-[20px] py-2">
{props.ReportName === "Templates" && (
<div className="flex flex-row">
- <label
- className={
- "cursor-pointer relative inline-flex items-center mb-0"
- }
- >
+ <label className="cursor-pointer relative inline-flex items-center mb-0">
<input
checked={props.isPublic?.[item.objectId]}
onChange={(e) =>
diff --git a/apps/OpenSign/src/script/locales/en/translation.json b/apps/OpenSign/src/script/locales/en/translation.json
index b60915032..d30c4a328 100644
--- a/apps/OpenSign/src/script/locales/en/translation.json
+++ b/apps/OpenSign/src/script/locales/en/translation.json
@@ -151,7 +151,8 @@
"Name": "Name",
"Status": "Status",
"created-date": "Created Date",
- "Type": "Type"
+ "Type": "Type",
+ "Logs": "Logs"
},
"report-help": {
"Draft Documents": "These are documents you have started but have not finalized for sending.",
@@ -648,5 +649,7 @@
"p4": "Please choose the option that best suits your document signing requirements."
},
"advanced-options":"Advanced options",
- "hide-advanced-options":"Hide Advanced options"
+ "hide-advanced-options":"Hide Advanced options",
+ "document-logs":"Document logs"
+
}
diff --git a/apps/OpenSign/src/script/locales/fr/translation.json b/apps/OpenSign/src/script/locales/fr/translation.json
index f2e40a37d..5ee3d6599 100644
--- a/apps/OpenSign/src/script/locales/fr/translation.json
+++ b/apps/OpenSign/src/script/locales/fr/translation.json
@@ -136,7 +136,8 @@
"Name": "Nom",
"Status": "Statut",
"created-date": "Date de création",
- "Type": "Saisir"
+ "Type": "Saisir",
+ "Logs": "Journaux"
},
"btnLabel": {
"sign": "Signer",
@@ -647,6 +648,7 @@
"p4": "Veuillez choisir l'option qui correspond le mieux à vos exigences en matière de signature de documents."
},
"advanced-options":"Options avancées",
- "hide-advanced-options": "Masquer les options avancées"
+ "hide-advanced-options": "Masquer les options avancées",
+ "document-logs":"Journaux de documents"
}