Skip to content

Commit

Permalink
Some fixes for a11y_panel based on PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbielby committed Dec 12, 2024
1 parent ab265f9 commit 846cbc3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
27 changes: 19 additions & 8 deletions R/a11y_panel.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#' "26th April 2024",
#' "2nd November 2024",
#' issues_contact = "https://github.com/dfe-analytical-services/shiny-template",
#' publication_slug = "la-and-school-expenditure",
#' publication_name = "LA and school expenditure"
#' )
a11y_panel <- function(
dashboard_title,
Expand Down Expand Up @@ -157,14 +159,23 @@ a11y_panel <- function(
},
shiny::tags$h2("Feedback and contact information"),
if (!is.null(publication_slug)) {
shiny::tags$p(
"If you need information on this website in a different format please see the parent ",
external_link(href = publication_slug, link_text = publication_name),
"publication."
)
shiny::tags$p(
"More details are available on that service for alternative formats of this ",
"data."
shiny::tagList(
shiny::tags$p(
"If you need information on this website in a different format please see the",
" parent publication, ",
external_link(
href = paste0(
"https://explore-education-statistics.service.gov.uk/find-statistics/",
publication_slug
),
link_text = publication_name
),
"."
),
shiny::tags$p(
"More details are available on that service for alternative formats of this ",
"data."
)
)
},
shiny::tags$p("We're always looking to improve the accessibility of this website.
Expand Down
2 changes: 1 addition & 1 deletion R/header.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' }
header <- function(header) {
shinyGovstyle::header(
logo = "/dfeshiny/DfE_logo_landscape.png",
logo = "dfeshiny/DfE_logo_landscape.png",
main_text = "",
secondary_text = header,
main_link = "https://www.gov.uk/government/organisations/department-for-education",
Expand Down
2 changes: 1 addition & 1 deletion R/validation.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ validate_date <- function(date) {
date_template <- lubridate::stamp("1 January 2020", orders = "dmy", quiet = TRUE)
if (is.na(date_ld)) {
valid <- FALSE
validation_message <- "is not in a valid date format, e.g. 8th Auguest 2024 or 08/08/2024."
validation_message <- "is not in a valid date format, e.g. 8th August 2024 or 08/08/2024."
} else if (date_ld > Sys.time()) {
valid <- FALSE
validation_message <- "is in the future."
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-a11y_panel.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ test_that("Accessibility dates are required", {
date_reviewed = "12th November 2024",
issues_contact = "https://github.com/dfe-analytical-services/shiny-template/issues"
),
"\"Geoff\" is not in a valid date format, e.g. 8th Auguest 2024 or 08/08/2024."
"\"Geoff\" is not in a valid date format, e.g. 8th August 2024 or 08/08/2024."
)
expect_error(
a11y_panel(
Expand Down

0 comments on commit 846cbc3

Please sign in to comment.