Skip to content

Commit

Permalink
add progress indicator
Browse files Browse the repository at this point in the history
starting #88
  • Loading branch information
maxheld83 committed Oct 14, 2021
1 parent 988e3ee commit d2b2397
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
32 changes: 24 additions & 8 deletions R/email.R
Original file line number Diff line number Diff line change
Expand Up @@ -353,26 +353,42 @@ emailReportServer <- function(id,
})
shiny::observeEvent(input$send, {
if (iv$is_valid()) {
shiny::showModal(modalDialog(
title = translWithLang()$translate(
"You have successfully sent your DOIs"
pb_outer <- shiny::Progress$new()
pb_outer$set(
message = translWithLang()$translate(
"Your report is being prepared ...",
),
glue::glue(
detail = glue::glue(
translWithLang()$translate(
"You will receive an email with your report within the next 45 minutes. "
),
translWithLang()$translate(
"Please check your SPAM folder. "
),
translWithLang()$translate(
"You can close this window or wait for completion. "
)
),
easyClose = TRUE,
footer = NULL
))
)
)
Sys.sleep(5)
render_and_send_async(
to = input$recipient,
dois = dois(),
translator = translWithLang()
)
pb_outer$set(
message = translWithLang()$translate(
"Your report is in your email inbox."
),
detail = glue::glue(
translWithLang()$translate(
"Please check your SPAM folder. "
),
translWithLang()$translate(
"You can close this window or wait for completion. "
)
)
)
}
})
}
Expand Down
12 changes: 10 additions & 2 deletions inst/i18n/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
"en": "Send Compliance Report",
"de": "Metacheck Bericht Versenden"
},
{
"en": "Your report is being prepared ...",
"de": "Ihr Bericht wird erstellt ..."
},
{
"en": "You will receive an email with your report within the next 45 minutes. ",
"de": "Der Bericht wird Ihnen innerhalt von 45 Minuten per Email zugeschickt. "
Expand All @@ -89,8 +93,12 @@
"de": "Bitte prüfen Sie auch Ihren SPAM-Ordner. "
},
{
"en": "You have successfully sent your DOIs.",
"de": "Ihre DOIs wurden erfolgreich versendet."
"en": "You can close this window or wait for completion. ",
"de": "Sie können dieses Fenster schließen oder auf die Fertigstellung warten."
},
{
"en": "Your report is in your email inbox. ",
"de": "Ihr Bericht wartet in Ihrem Email Postfach. "
},
{
"en": "metacheck: Your Open Access Metadata Compliance Test Results",
Expand Down

0 comments on commit d2b2397

Please sign in to comment.