From d2b2397be024860a4c280f538d74679fbe3cb06c Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 14 Oct 2021 13:50:44 +0200 Subject: [PATCH] add progress indicator starting #88 --- R/email.R | 32 ++++++++++++++++++++++++-------- inst/i18n/translation.json | 12 ++++++++++-- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/R/email.R b/R/email.R index 5c7fffb5..905ca66e 100644 --- a/R/email.R +++ b/R/email.R @@ -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. " + ) + ) + ) } }) } diff --git a/inst/i18n/translation.json b/inst/i18n/translation.json index 5e530ac0..a715f4e7 100644 --- a/inst/i18n/translation.json +++ b/inst/i18n/translation.json @@ -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. " @@ -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",