From d27bebecb34977b143eefed050e2f9769cc44cc8 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Thu, 14 Dec 2023 16:08:52 +0100 Subject: [PATCH] :sparkles: Can download anchoring proof when archived --- .../FolderInformation/classes.module.scss | 8 +++--- .../FolderInformation/index.tsx | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/classes.module.scss b/src/front/Components/Layouts/FolderArchived/FolderInformation/classes.module.scss index d3eba151..7b91758b 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/classes.module.scss +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/classes.module.scss @@ -59,7 +59,7 @@ display: flex; text-align: center; justify-content: center; - + gap: 16px; .delete-folder { display: flex; margin-left: 12px; @@ -72,12 +72,12 @@ margin-left: 0; margin-top: 12px; - >* { + > * { flex: 1; } } - >* { + > * { width: 100%; } } @@ -98,4 +98,4 @@ width: 40px; height: 40px; } -} \ No newline at end of file +} diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index 453b86ea..c11a8732 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -116,6 +116,13 @@ class FolderInformationClass extends BasePage { + {this.props.isAnchored === AnchorStatus.VERIFIED_ON_CHAIN && ( + + )} ) : ( @@ -171,6 +178,25 @@ class FolderInformationClass extends BasePage { this.setState({ isArchivedModalOpen: false }); } + private async downloadAnchoringProof(uid?: string) { + if (!uid) return; + + try { + const file: Blob = await OfficeFolderAnchors.getInstance().download(uid); + const url = window.URL.createObjectURL(file); + const a = document.createElement("a"); + a.style.display = "none"; + a.href = url; + // the filename you want + a.download = `anchoring_proof_${this.props.selectedFolder?.folder_number}_${this.props.selectedFolder?.name}.zip`; + document.body.appendChild(a); + a.click(); + window.URL.revokeObjectURL(url); + } catch (e) { + console.error(e); + } + } + private async getFolder(): Promise { const query = { q: {