✨ Can download anchoring proof when archived
This commit is contained in:
parent
be78f7216c
commit
d27bebecb3
@ -59,7 +59,7 @@
|
||||
display: flex;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
|
||||
gap: 16px;
|
||||
.delete-folder {
|
||||
display: flex;
|
||||
margin-left: 12px;
|
||||
|
@ -116,6 +116,13 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
<Button variant={EButtonVariant.GHOST} onClick={this.restoreFolder}>
|
||||
Restaurer le dossier
|
||||
</Button>
|
||||
{this.props.isAnchored === AnchorStatus.VERIFIED_ON_CHAIN && (
|
||||
<Button
|
||||
variant={EButtonVariant.PRIMARY}
|
||||
onClick={() => this.downloadAnchoringProof(this.props.selectedFolder?.uid)}>
|
||||
Télécharger la preuve d'ancrage
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@ -171,6 +178,25 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
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<OfficeFolder> {
|
||||
const query = {
|
||||
q: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user