Added a signature legal agreement warning and integrated the resource file (resx) as a JavaScript object into the _Layout.cshtml file. This enables the agreement warning to support multiple languages.

This commit is contained in:
Developer 02
2024-05-31 09:39:31 +02:00
parent 21934928c2
commit c31f081208
7 changed files with 128 additions and 53 deletions

View File

@@ -177,52 +177,68 @@ class App {
icon: 'warning',
})
return false
}
// Save changes before doing anything
try {
await this.Instance.save()
} catch (e) {
Swal.fire({
title: 'Fehler',
text: 'Umschlag konnte nicht signiert werden!',
icon: 'error',
})
return false
}
return Swal.fire({
title: localized.Confirmation,
html: `<div class="text-start fs-6 p-0 m-0">${localized.SigAgree}</div>`,
icon: "question",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: localized.Finalize,
cancelButtonText: localized.Review
}).then(async (result) => {
if (result.isConfirmed) {
//---
// Save changes before doing anything
try {
await this.Instance.save()
} catch (e) {
Swal.fire({
title: 'Fehler',
text: 'Umschlag konnte nicht signiert werden!',
icon: 'error',
})
return false
}
// Export annotation data and save to database
try {
const json = await this.Instance.exportInstantJSON()
const postEnvelopeResult = await this.Network.postEnvelope(
this.envelopeKey,
this.currentDocument.id,
json
)
// Export annotation data and save to database
try {
const json = await this.Instance.exportInstantJSON()
const postEnvelopeResult = await this.Network.postEnvelope(
this.envelopeKey,
this.currentDocument.id,
json
)
if (postEnvelopeResult.fatal) {
Swal.fire({
title: 'Fehler',
text: 'Umschlag konnte nicht signiert werden!',
icon: 'error',
})
return false
if (postEnvelopeResult.fatal) {
Swal.fire({
title: 'Fehler',
text: 'Umschlag konnte nicht signiert werden!',
icon: 'error',
})
return false
}
if (postEnvelopeResult.error) {
Swal.fire({
title: 'Warnung',
text: 'Umschlag ist nicht mehr verfügbar.',
icon: 'warning',
})
return false
}
return true
} catch (e) {
return false
}
//---
}
if (postEnvelopeResult.error) {
Swal.fire({
title: 'Warnung',
text: 'Umschlag ist nicht mehr verfügbar.',
icon: 'warning',
})
return false
}
return true
} catch (e) {
return false
}
else
return false;
});
}