Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Signature Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Electronic Signature Service
Signature Frontend
Commits
153ff9b5
Commit
153ff9b5
authored
Jul 6, 2021
by
Steinwender, Tamara
Browse files
Options
Downloads
Patches
Plain Diff
Add an Error Message to pdf preview if pdf is invalid
parent
332cb1e1
No related branches found
No related tags found
No related merge requests found
Pipeline
#51293
failed
Jul 6, 2021
Stage: test
Stage: deploy
Stage: e2e
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/dbp-pdf-preview.js
+15
-1
15 additions, 1 deletion
src/dbp-pdf-preview.js
src/i18n/de/translation.json
+2
-1
2 additions, 1 deletion
src/i18n/de/translation.json
src/i18n/en/translation.json
+2
-1
2 additions, 1 deletion
src/i18n/en/translation.json
with
19 additions
and
3 deletions
src/dbp-pdf-preview.js
+
15
−
1
View file @
153ff9b5
...
...
@@ -25,6 +25,7 @@ export class PdfPreview extends ScopedElementsMixin(DBPLitElement) {
this
.
totalPages
=
0
;
this
.
isShowPage
=
false
;
this
.
isPageLoaded
=
false
;
this
.
showErrorMessage
=
false
;
this
.
isPageRenderingInProgress
=
false
;
this
.
isShowPlacement
=
true
;
this
.
canvas
=
null
;
...
...
@@ -60,6 +61,7 @@ export class PdfPreview extends ScopedElementsMixin(DBPLitElement) {
isShowPage
:
{
type
:
Boolean
,
attribute
:
false
},
isPageRenderingInProgress
:
{
type
:
Boolean
,
attribute
:
false
},
isPageLoaded
:
{
type
:
Boolean
,
attribute
:
false
},
showErrorMessage
:
{
type
:
Boolean
,
attribute
:
false
},
isShowPlacement
:
{
type
:
Boolean
,
attribute
:
false
},
placeholder
:
{
type
:
String
,
attribute
:
'
signature-placeholder-image-src
'
},
signature_width
:
{
type
:
Number
,
attribute
:
'
signature-width
'
},
...
...
@@ -195,6 +197,7 @@ export class PdfPreview extends ScopedElementsMixin(DBPLitElement) {
async
showPDF
(
file
,
isShowPlacement
=
false
,
placementData
=
{})
{
let
item
=
this
.
getSignatureRect
();
this
.
isPageLoaded
=
false
;
// prevent redisplay of previous pdf
this
.
showErrorMessage
=
false
;
// move signature if placementData was set
if
(
item
!==
undefined
)
{
...
...
@@ -225,6 +228,7 @@ export class PdfPreview extends ScopedElementsMixin(DBPLitElement) {
this
.
pdfDoc
=
await
pdfjs
.
getDocument
({
data
:
data
}).
promise
;
}
catch
(
error
)
{
console
.
error
(
error
);
this
.
showErrorMessage
=
true
;
return
;
}
...
...
@@ -561,6 +565,13 @@ export class PdfPreview extends ScopedElementsMixin(DBPLitElement) {
.button.is-cancel {
color: #e4154b;
}
.error-message{
text-align: center;
border: 1px solid black;
border-top: 0px;
padding: 15px;
}
`
;
}
...
...
@@ -575,7 +586,10 @@ export class PdfPreview extends ScopedElementsMixin(DBPLitElement) {
</form>
-->
<div id="pdf-main-container" class="
${
classMap
({
hidden
:
!
this
.
isShowPage
})}
">
<dbp-mini-spinner class="
${
classMap
({
hidden
:
this
.
isPageLoaded
})}
"></dbp-mini-spinner>
<dbp-mini-spinner class="
${
classMap
({
hidden
:
this
.
isPageLoaded
||
this
.
showErrorMessage
})}
"></dbp-mini-spinner>
<div class="error-message
${
classMap
({
hidden
:
!
this
.
showErrorMessage
||
this
.
isPageLoaded
})}
">
${
i18n
.
t
(
'
pdf-preview.error-message
'
)}
</div>
<div class="
${
classMap
({
hidden
:
!
this
.
isPageLoaded
})}
">
<div id="pdf-meta">
<div class="buttons
${
classMap
({
hidden
:
!
this
.
isPageLoaded
})}
">
...
...
This diff is collapsed.
Click to expand it.
src/i18n/de/translation.json
+
2
−
1
View file @
153ff9b5
...
...
@@ -114,7 +114,8 @@
"page-count"
:
"von {{totalPages}}"
,
"rotate-signature"
:
"Signatur im Uhrzeigersinn rotieren"
,
"rotate"
:
"Signatur rotieren"
,
"continue"
:
"Platzierung bestätigen"
"continue"
:
"Platzierung bestätigen"
,
"error-message"
:
"Fehler: Dieses Dokument ist beschädigt."
},
"annotation-view"
:
{
"delete-all-button-text"
:
"Alle entfernen"
,
...
...
This diff is collapsed.
Click to expand it.
src/i18n/en/translation.json
+
2
−
1
View file @
153ff9b5
...
...
@@ -114,7 +114,8 @@
"page-count"
:
"of {{totalPages}}"
,
"rotate-signature"
:
"Rotate signature clockwise"
,
"rotate"
:
"Rotate signature"
,
"continue"
:
"Confirm placement"
"continue"
:
"Confirm placement"
,
"error-message"
:
"Error: This document is incorrect."
},
"annotation-view"
:
{
"delete-all-button-text"
:
"Clear all"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment