Merge branch 'dev' into staging
This commit is contained in:
commit
778702dcf4
@ -48,6 +48,7 @@ type IState = {
|
||||
hasValidateAnchoring: boolean;
|
||||
isVerifDeleteModalVisible: boolean;
|
||||
isPreventArchiveModalOpen: boolean;
|
||||
loadingAnchoring: boolean;
|
||||
};
|
||||
class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
public constructor(props: IPropsClass) {
|
||||
@ -59,6 +60,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
hasValidateAnchoring: false,
|
||||
isVerifDeleteModalVisible: false,
|
||||
isPreventArchiveModalOpen: false,
|
||||
loadingAnchoring: false,
|
||||
};
|
||||
this.openArchivedModal = this.openArchivedModal.bind(this);
|
||||
this.closeArchivedModal = this.closeArchivedModal.bind(this);
|
||||
@ -159,8 +161,16 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
{this.props.isAnchored === AnchorStatus.VERIFIED_ON_CHAIN && (
|
||||
<Button
|
||||
variant={EButtonVariant.PRIMARY}
|
||||
onClick={() => this.downloadAnchoringProof(this.props.selectedFolder?.uid)}>
|
||||
onClick={() => this.downloadAnchoringProof(this.props.selectedFolder?.uid)}
|
||||
disabled={this.state.loadingAnchoring}>
|
||||
Télécharger la preuve d'ancrage
|
||||
{this.state.loadingAnchoring && (
|
||||
<div className={classes["loader-container"]}>
|
||||
<div className={classes["loader"]}>
|
||||
<Loader />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
@ -339,7 +349,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
|
||||
private async downloadAnchoringProof(uid?: string) {
|
||||
if (!uid) return;
|
||||
|
||||
this.setState({ loadingAnchoring: true });
|
||||
try {
|
||||
const file: Blob = await OfficeFolderAnchors.getInstance().download(uid);
|
||||
const url = window.URL.createObjectURL(file);
|
||||
@ -351,7 +361,9 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
this.setState({ loadingAnchoring: false });
|
||||
} catch (e) {
|
||||
this.setState({ loadingAnchoring: false });
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
.loader {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ type IPropsClass = IProps & {
|
||||
type IState = {
|
||||
selectedFolder: OfficeFolder | null;
|
||||
isArchivedModalOpen: boolean;
|
||||
loadingAnchoring: boolean;
|
||||
};
|
||||
class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
public constructor(props: IPropsClass) {
|
||||
@ -39,6 +40,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
this.state = {
|
||||
selectedFolder: null,
|
||||
isArchivedModalOpen: false,
|
||||
loadingAnchoring: false,
|
||||
};
|
||||
this.onSelectedFolder = this.onSelectedFolder.bind(this);
|
||||
this.openArchivedModal = this.openArchivedModal.bind(this);
|
||||
@ -119,8 +121,16 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
{this.props.isAnchored === AnchorStatus.VERIFIED_ON_CHAIN && (
|
||||
<Button
|
||||
variant={EButtonVariant.PRIMARY}
|
||||
onClick={() => this.downloadAnchoringProof(this.props.selectedFolder?.uid)}>
|
||||
onClick={() => this.downloadAnchoringProof(this.props.selectedFolder?.uid)}
|
||||
disabled={this.state.loadingAnchoring}>
|
||||
Télécharger la preuve d'ancrage
|
||||
{this.state.loadingAnchoring && (
|
||||
<div className={classes["loader-container"]}>
|
||||
<div className={classes["loader"]}>
|
||||
<Loader />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
@ -180,7 +190,7 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
|
||||
private async downloadAnchoringProof(uid?: string) {
|
||||
if (!uid) return;
|
||||
|
||||
this.setState({ loadingAnchoring: true });
|
||||
try {
|
||||
const file: Blob = await OfficeFolderAnchors.getInstance().download(uid);
|
||||
const url = window.URL.createObjectURL(file);
|
||||
@ -192,7 +202,9 @@ class FolderInformationClass extends BasePage<IPropsClass, IState> {
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
this.setState({ loadingAnchoring: false });
|
||||
} catch (e) {
|
||||
this.setState({ loadingAnchoring: false });
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user