Skip to contents

Create the HTML overlay panel to appear when a user loses connection to a dashboard.

Usage

custom_disconnect_message(
  refresh = "Refresh page",
  dashboard_title = NULL,
  links = NULL,
  publication_name = NULL,
  publication_link = NULL
)

Arguments

refresh

the text to appear that will refresh the page when clicked

dashboard_title

Title of the dashboard

A vector of possible URLs for the public site. Should mostly just be a single URL, but can be two URLs if an overflow site has been set up

publication_name

The parent publication name

The link to the publication on Explore Education Statistics

Value

A HTML overlay panel that appears when a user loses connection to a DfE R Shiny dashboard.

Examples

custom_disconnect_message(
  dashboard_title = "DfE Shiny Template",
  refresh = "Refresh page",
  links = c(
    "https://department-for-education.shinyapps.io/dfe-shiny-template",
    "https://department-for-education.shinyapps.io/dfe-shiny-template-overflow/"
  ),
  publication_name = "Explore Education Statistics Publication",
  publication_link =
    "https://explore-education-statistics.service.gov.uk/find-statistics/apprenticeships"
)
#> <script>$(function() {  $(document).on('shiny:disconnected', function(event) {    $('#custom-disconnect-dialog').show();    $('#ss-overlay').show();  })});</script>
#> <div id="custom-disconnect-dialog" style="display: none !important;">
#>   <div id="ss-connect-refresh" role="alert">
#>     <p>
#>       Sorry, you have lost connection to the
#>       DfE Shiny Template
#>       dashboard at the moment, please 
#>       <a id="ss-reload-link" href="#" onclick="window.location.reload(true);">refresh the page</a>.
#>     </p>
#>     <p>
#>       If you are still experiencing issues, please try our
#>       <a href="https://department-for-education.shinyapps.io/dfe-shiny-template-overflow/">alternative site</a>. Apologies for the inconvenience.
#>     </p>
#>     <p>
#>       All the data used in this dashboard can also be viewed or downloaded via the <a href="https://explore-education-statistics.service.gov.uk/find-statistics/apprenticeships" target="_blank" rel="noopener noreferrer">Explore Education Statistics Publication (opens in new tab)</a> on Explore Education Statistics.
#>     </p>
#>     <p>
#>       Feel free to contact <a href="mailto:explore.statistics@education.gov.uk" target="_blank" rel="noopener noreferrer">explore.statistics@education.gov.uk<span class="sr-only"> (opens in new tab)</span></a> if you require further support.
#>     </p>
#>   </div>
#> </div>
#> <div id="ss-overlay" style="display: none;"></div>

custom_disconnect_message(
  dashboard_title = "DfE Shiny Template",
  refresh = "Refresh page",
  links = c(
    "https://department-for-education.shinyapps.io/dfe-shiny-template"
  )
)
#> <script>$(function() {  $(document).on('shiny:disconnected', function(event) {    $('#custom-disconnect-dialog').show();    $('#ss-overlay').show();  })});</script>
#> <div id="custom-disconnect-dialog" style="display: none !important;">
#>   <div id="ss-connect-refresh" role="alert">
#>     <p>
#>       Sorry, you have lost connection to the
#>       DfE Shiny Template
#>       dashboard at the moment, please 
#>       <a id="ss-reload-link" href="#" onclick="window.location.reload(true);">refresh the page</a>.
#>     </p>
#>     <p>
#>       Feel free to contact <a href="mailto:explore.statistics@education.gov.uk" target="_blank" rel="noopener noreferrer">explore.statistics@education.gov.uk<span class="sr-only"> (opens in new tab)</span></a> if you require further support.
#>     </p>
#>   </div>
#> </div>
#> <div id="ss-overlay" style="display: none;"></div>