diff --git a/.github/workflows/automated-tests.yaml b/.github/workflows/automated-tests.yaml index 57d728d..3e02361 100644 --- a/.github/workflows/automated-tests.yaml +++ b/.github/workflows/automated-tests.yaml @@ -24,6 +24,15 @@ jobs: - name: Install git2r dependencies run: sudo apt-get install -y libgit2-dev + - name: Install proj library (terra depdencies) + run: sudo apt-get install libproj-dev + + - name: Install gdal library (terra dependencies) + run: sudo apt-get install libgdal-dev + + - name: Install udunits library (units dependencies) + run: sudo apt-get install libudunits2-dev + - name: Cache renv packages id: cache-renv uses: actions/cache@v4 diff --git a/.github/workflows/deploy-shiny.yaml b/.github/workflows/deploy-shiny.yaml index 6958ee7..653aeac 100644 --- a/.github/workflows/deploy-shiny.yaml +++ b/.github/workflows/deploy-shiny.yaml @@ -3,13 +3,17 @@ on: branches: - main - development + pull_request: + branches: + - main + - development name: shinyapps.io deploy jobs: deployShiny: runs-on: ubuntu-latest - + env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -18,6 +22,7 @@ jobs: - uses: r-lib/actions/setup-r@v2 with: + r-version: 4.4.1 use-public-rspm: true - name: Set env vars (dev) @@ -30,7 +35,7 @@ jobs: run: | echo "SHINYAPP_NAME='dfe-shiny-template'">> $GITHUB_ENV echo "SHINYAPP_OVERFLOW_NAME='dfe-shiny-template-overflow'">> $GITHUB_ENV - + - name: Restore renv snapshot shell: Rscript {0} run: | @@ -48,6 +53,7 @@ jobs: # Get in touch with the Explore education statistics platforms team if you need to add the below secrets to publish to shinyapps.io - name: Push to shiny.io + if: github.event_name != 'pull_request' run: > Rscript -e "rsconnect::setAccountInfo(name = 'department-for-education', token = '${{secrets.SHINYAPPS_TOKEN}}', secret = '${{secrets.SHINYAPPS_SECRET}}')" diff --git a/.github/workflows/tidyCode.yaml b/.github/workflows/tidyCode.yaml new file mode 100644 index 0000000..936bb25 --- /dev/null +++ b/.github/workflows/tidyCode.yaml @@ -0,0 +1,64 @@ +on: + push: + branches: + - main + pull_request: + +name: tidyCode + +jobs: + tidyCode: + runs-on: ubuntu-latest + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: 4.4.1 + use-public-rspm: true + + - name: Install git2r dependencies + run: sudo apt-get install -y libgit2-dev + + - name: Install proj library (terra depdencies) + run: sudo apt-get install libproj-dev + + - name: Install gdal library (terra dependencies) + run: sudo apt-get install libgdal-dev + + - name: Install udunits library (units dependencies) + run: sudo apt-get install libudunits2-dev + + - name: Restore renv snapshot + shell: Rscript {0} + run: | + if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv") + renv::restore() + + - name: Tidy code + shell: Rscript {0} + run: | + codeChecks <- dfeshiny::tidy_code() + + if(any(is.na(codeChecks))) { + stop("There is a breaking error in the code.") + } else { + if(TRUE %in% codeChecks) { + stop("The code is not styled correctly. Open the project in RStudio and use tidy_code() to restyle the code.") + } else { + message("----------------------------------------") + message("The code is beautiful, go you!") + message("----------------------------------------") + } + } + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@master + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-tests + path: tests diff --git a/R/ui_panels/accessibility_statement.R b/R/ui_panels/accessibility_statement.R deleted file mode 100644 index 5c12183..0000000 --- a/R/ui_panels/accessibility_statement.R +++ /dev/null @@ -1,156 +0,0 @@ -a11y_panel <- function() { - tabPanel( - "Accessibility", - gov_main_layout( - gov_row( - column( - width = 12, - h1("Accessibility statement for [service name]"), # TODO - p( - "This accessibility statement applies to the [raw service URL] website. This website is run by the", # TODO - a( - href = "https://www.gov.uk/government/organisations/department-for-education", - "Department for Education (DfE)", - .noWS = "after" - ), ".", - "This statement does not cover any other services run by the Department for Education (DfE) or GOV.UK." - ), - h2("How you should be able to use this website"), - p("We want as many people as possible to be able to use this website. You should be able to:"), - tags$div(tags$ul( - tags$li("change colours, contrast levels and fonts using browser or device settings"), - tags$li("zoom in up to 400% without the text spilling off the screen"), - tags$li("navigate most of the website using a keyboard or speech recognition software"), - tags$li("listen to most of the website using a screen reader - (including the most recent versions of JAWS, NVDA and VoiceOver)") - )), - p("We’ve also made the website text as simple as possible to understand."), - p( - a(href = "https://mcmw.abilitynet.org.uk/", "AbilityNet"), - " has advice on making your device easier to use if you have a disability." - ), - h2("How accessible this website is"), - p("We know some parts of this website are not fully accessible:"), - tags$div(tags$ul( - tags$li("list them here") # TODO - )), - h2("Feedback and contact information"), - p( - "If you need information on this website in a different format please see the ", - a( - href = "", # TODO - "[source publication] on Explore education statistics", # TODO - .noWS = "after" - ), - ". More details are available on that service for alternative formats of this data.", - ), - p("We’re always looking to improve the accessibility of this website. - If you find any problems not listed on this page or think we’re not meeting - accessibility requirements, contact us:"), - tags$ul(tags$li( - a( - href = "mailto:explore.statistics@education.gov.uk", - "explore.statistics@education.gov.uk" - ) - )), - h2("Enforcement procedure"), - p("The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies - (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 - (the ‘accessibility regulations’)."), - p( - "If you are not happy with how we respond to your complaint, ", - a( - href = "https://www.equalityadvisoryservice.com/", - "contact the Equality Advisory and Support Service (EASS)", - .noWS = "after" - ), - "." - ), - h2("Technical information about this website's accessibility"), - p("The Department for Education (DfE) is committed to making its website accessible, in accordance with the - Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018."), - h3("Compliance status"), - p( - "This website is partially compliant with the", # TODO - a( - href = "https://www.w3.org/TR/WCAG21/", - "Web Content Accessibility Guidelines version 2.1 AA standard", - .noWS = "after" - ), - " due to the non-compliances listed below." - ), - h3("Non accessible content"), - p("The content listed below is non-accessible for the following reasons. - We will address these issues to ensure our content is accessible."), - tags$div(tags$ul( - tags$li("list them here") # TODO - )), - h3("Disproportionate burden"), - p("Not applicable."), - h2("How we tested this website"), - p( - "The template used for this website was last tested on 12 March 2024 against", - a( - href = "https://www.w3.org/TR/WCAG22/", - "Accessibility Guidelines WCAG2.2", - .noWS = "after" - ), - ". The test was carried out by the", - a( - href = "https://digitalaccessibilitycentre.org/", - "Digital accessibility centre (DAC)", - .noWS = "after" - ), - "." - ), - p("DAC tested a sample of pages to cover the core functionality of the service including:"), - tags$div(tags$ul( - tags$li("navigation"), - tags$li("interactive dropdown selections"), - tags$li("charts, maps, and tables") - )), - p( - "This specific website was was last tested on [date] against", # TODO - a( - href = "https://www.w3.org/TR/WCAG22/", - "Accessibility Guidelines WCAG2.2", - .noWS = "after" - ), - ". The test was carried out by the", - a( - href = "https://www.gov.uk/government/organisations/department-for-education", - "Department for Education (DfE)", - .noWS = "after" - ), - "." - ), - h2("What we're doing to improve accessibility"), - p("We plan to continually test the service for accessibility issues, and are working through a prioritised - list of issues to resolve."), - p( - "Our current list of issues to be resolved is available on our ", - a( - href = "", # TODO - "[GitHub issues page]", # TODO - .noWS = "after" - ), - "." - ), - h2("Preparation of this accessibility statement"), - p("This statement was prepared on 1st July 2024. It was last reviewed on [date]."), # TODO - p( - "The template used for this website was last testing in March 2024 against the WCAG 2.2 AA standard. - This test of a representative sample of pages was carried out by the", - a( - href = "https://digitalaccessibilitycentre.org/", - "Digital accessibility centre (DAC)", - .noWS = "after" - ), - "." - ), - p("We also used findings from our own testing when preparing this accessibility statement.") - ) - ) - ) - ) -} diff --git a/renv.lock b/renv.lock index 865e533..2b1578d 100644 --- a/renv.lock +++ b/renv.lock @@ -16,13 +16,6 @@ "Repository": "CRAN", "Hash": "85bf3bd8fa58da21a22d84fd4f4ef0a8" }, - "BH": { - "Package": "BH", - "Version": "1.84.0-0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "a8235afbcd6316e6e91433ea47661013" - }, "DT": { "Package": "DT", "Version": "0.33", @@ -42,7 +35,7 @@ }, "MASS": { "Package": "MASS", - "Version": "7.3-61", + "Version": "7.3-63", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -53,11 +46,11 @@ "stats", "utils" ], - "Hash": "0cafd6f0500e5deba33be22c46bf6055" + "Hash": "192afb459696dc96ccb5adb5bef047de" }, "Matrix": { "Package": "Matrix", - "Version": "1.7-0", + "Version": "1.7-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -70,7 +63,7 @@ "stats", "utils" ], - "Hash": "1920b2f11133b12350024297d8a4ff4a" + "Hash": "5122bb14d8736372411f955e1b16bc8a" }, "R.cache": { "Package": "R.cache", @@ -100,16 +93,16 @@ }, "R.oo": { "Package": "R.oo", - "Version": "1.26.0", + "Version": "1.27.0", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R.methodsS3", "methods", "utils" ], - "Hash": "4fed809e53ddb5407b3da3d0f572e591" + "Hash": "6ac79ff194202248cf946fe3a5d6d498" }, "R.utils": { "Package": "R.utils", @@ -146,28 +139,16 @@ ], "Hash": "45f0398006e83a5b10b72a90663d8d8c" }, - "RCurl": { - "Package": "RCurl", - "Version": "1.98-1.16", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "bitops", - "methods" - ], - "Hash": "ddbdf53d15b47be4407ede6914f56fbb" - }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.13", + "Version": "1.0.13-1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods", "utils" ], - "Hash": "f27411eb6d9c3dada5edd444b8416675" + "Hash": "6b868847b365672d6c1677b1608da9ed" }, "afcolours": { "Package": "afcolours", @@ -181,27 +162,15 @@ ], "Hash": "2f2912ff398384ab8b2d7e1256019894" }, - "anytime": { - "Package": "anytime", - "Version": "0.3.9", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "BH", - "R", - "Rcpp" - ], - "Hash": "74a64813f17b492da9c6afda6b128e3d" - }, "askpass": { "Package": "askpass", - "Version": "1.2.0", + "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "sys" ], - "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" + "Hash": "c39f4155b3ceb1a9a2799d700fbd4b6a" }, "backports": { "Package": "backports", @@ -223,13 +192,6 @@ ], "Hash": "543776ae6848fde2f48ff3816d0628bc" }, - "bitops": { - "Package": "bitops", - "Version": "1.0-8", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "da69e6b6f8feebec0827205aad3fdbd8" - }, "brio": { "Package": "brio", "Version": "1.1.5", @@ -365,20 +327,20 @@ }, "commonmark": { "Package": "commonmark", - "Version": "1.9.1", + "Version": "1.9.2", "Source": "Repository", - "Repository": "RSPM", - "Hash": "5d8225445acb167abf7797de48b2ee3c" + "Repository": "CRAN", + "Hash": "14eb0596f987c71535d07c3aff814742" }, "cpp11": { "Package": "cpp11", - "Version": "0.5.0", + "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "91570bba75d0c9d3f1040c835cee8fba" + "Hash": "9df43854f1c84685d095ed6270b52387" }, "crayon": { "Package": "crayon", @@ -394,7 +356,7 @@ }, "credentials": { "Package": "credentials", - "Version": "2.0.1", + "Version": "2.0.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -404,13 +366,13 @@ "openssl", "sys" ], - "Hash": "c7844b32098dcbd1c59cbd8dddb4ecc6" + "Hash": "09fd631e607a236f8cc7f9604db32cb8" }, "crosstalk": { "Package": "crosstalk", "Version": "1.2.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R6", "htmltools", @@ -421,19 +383,19 @@ }, "curl": { "Package": "curl", - "Version": "5.2.2", + "Version": "6.0.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "8f27335f2bcff4d6035edcc82d7d46de" + "Hash": "e8ba62486230951fcd2b881c5be23f96" }, "desc": { "Package": "desc", "Version": "1.4.3", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "R6", @@ -444,13 +406,13 @@ }, "dfeR": { "Package": "dfeR", - "Version": "0.5.0", + "Version": "0.6.1.9000", "Source": "GitHub", "RemoteType": "github", "RemoteUsername": "dfe-analytical-services", "RemoteRepo": "dfeR", "RemoteRef": "main", - "RemoteSha": "45a6834af11d5cda77fe7bd6dc9b4a5e512ac13a", + "RemoteSha": "6695f5d8be563fc3891f02161706c496ca44be8e", "RemoteHost": "api.github.com", "Requirements": [ "R", @@ -467,24 +429,24 @@ "utils", "withr" ], - "Hash": "7a9f870f1da8cd192527b2b21447f0cd" + "Hash": "8b19e27d16bc8084d9e2d7033bfd63bc" }, "dfeshiny": { "Package": "dfeshiny", - "Version": "0.4.1.9000", + "Version": "0.5.3.9000", "Source": "GitHub", "RemoteType": "github", + "RemoteHost": "api.github.com", "RemoteUsername": "dfe-analytical-services", "RemoteRepo": "dfeshiny", "RemoteRef": "main", - "RemoteSha": "0de4922658c293ea31048a2e63a49c6111162c16", - "RemoteHost": "api.github.com", + "RemoteSha": "2de5915421cf2cdccceb9440ee694254f2f6af1c", "Requirements": [ "R", - "RCurl", "checkmate", "glue", "htmltools", + "lubridate", "magrittr", "shiny", "shinyGovstyle", @@ -492,7 +454,7 @@ "stringr", "styler" ], - "Hash": "f6a1fd4632a0a75d84b24a77cc098602" + "Hash": "b09d13e69d151ab2acc7bb0b4eb510c0" }, "diffobj": { "Package": "diffobj", @@ -545,7 +507,7 @@ }, "emoji": { "Package": "emoji", - "Version": "15.0", + "Version": "16.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -554,18 +516,17 @@ "stringr", "tibble" ], - "Hash": "961ccf8e88d1a8add09f9c811f4d7e29" + "Hash": "216140f0bbbe9c925ab348a67f2e58bd" }, "evaluate": { "Package": "evaluate", - "Version": "0.24.0", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ - "R", - "methods" + "R" ], - "Hash": "a1066cbc05caee9a4bf6d90f194ff4da" + "Hash": "3fd29944b231036ad67c3edb32e02201" }, "fansi": { "Package": "fansi", @@ -595,7 +556,7 @@ }, "fontawesome": { "Package": "fontawesome", - "Version": "0.5.2", + "Version": "0.5.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -603,18 +564,18 @@ "htmltools", "rlang" ], - "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" + "Hash": "bd1297f9b5b1fc1372d19e2c4cd82215" }, "fs": { "Package": "fs", - "Version": "1.6.4", + "Version": "1.6.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a" + "Hash": "7f48af39fa27711ea5fbd183b399920d" }, "generics": { "Package": "generics", @@ -629,7 +590,7 @@ }, "gert": { "Package": "gert", - "Version": "2.1.1", + "Version": "2.1.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -640,13 +601,13 @@ "sys", "zip" ], - "Hash": "ab2ca7d6bd706ed218d096b7b16d7233" + "Hash": "ae855ad6d7be20dd7b05d43d25700398" }, "ggiraph": { "Package": "ggiraph", - "Version": "0.8.10", + "Version": "0.8.11", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "Rcpp", "cli", @@ -661,7 +622,7 @@ "uuid", "vctrs" ], - "Hash": "15748f4335af873289fbdd31610c3f96" + "Hash": "14b3b3b923944afb9542dbef4c68bf4b" }, "ggplot2": { "Package": "ggplot2", @@ -692,7 +653,7 @@ "Package": "gh", "Version": "1.4.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "cli", @@ -729,29 +690,30 @@ }, "glue": { "Package": "glue", - "Version": "1.7.0", + "Version": "1.8.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "e0b3a53876554bd45879e596cdb10a52" + "Hash": "5899f1eaa825580172bb56c08266f37c" }, "gtable": { "Package": "gtable", - "Version": "0.3.5", + "Version": "0.3.6", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "cli", "glue", "grid", "lifecycle", - "rlang" + "rlang", + "stats" ], - "Hash": "e18861963cbc65a27736e02b3cd3c4a0" + "Hash": "de949855009e2d4d0e52a844e30617ae" }, "highr": { "Package": "highr", @@ -768,7 +730,7 @@ "Package": "htmltools", "Version": "0.5.8.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "base64enc", @@ -784,7 +746,7 @@ "Package": "htmlwidgets", "Version": "1.6.4", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "grDevices", "htmltools", @@ -827,7 +789,7 @@ }, "httr2": { "Package": "httr2", - "Version": "1.0.4", + "Version": "1.0.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -844,7 +806,7 @@ "vctrs", "withr" ], - "Hash": "836e9564fbeca3bb390bb429a53cd401" + "Hash": "5a76da345ed4f3e6430517e08441edaf" }, "ini": { "Package": "ini", @@ -876,17 +838,17 @@ }, "jsonlite": { "Package": "jsonlite", - "Version": "1.8.8", + "Version": "1.8.9", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "methods" ], - "Hash": "e1b9c55281c5adc4dd113652d9e26768" + "Hash": "4e993b65c2c3ffbffce7bb3e2c6f832b" }, "knitr": { "Package": "knitr", - "Version": "1.48", + "Version": "1.49", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -898,7 +860,7 @@ "xfun", "yaml" ], - "Hash": "acf380f300c721da9fde7df115a5f86f" + "Hash": "9fcb189926d93c636dea94fbe4f44480" }, "labeling": { "Package": "labeling", @@ -913,14 +875,14 @@ }, "later": { "Package": "later", - "Version": "1.3.2", + "Version": "1.4.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "Rcpp", "rlang" ], - "Hash": "a3e051d405326b8b0012377434c62b37" + "Hash": "501744395cac0bab0fbcfab9375ae92c" }, "lattice": { "Package": "lattice", @@ -960,6 +922,19 @@ ], "Hash": "b8552d117e1b808b09a832f589b79035" }, + "lubridate": { + "Package": "lubridate", + "Version": "1.9.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "generics", + "methods", + "timechange" + ], + "Hash": "be38bc740fc51783a78edb5a157e4104" + }, "magrittr": { "Package": "magrittr", "Version": "2.0.3", @@ -1025,7 +1000,7 @@ "Package": "munsell", "Version": "0.5.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "colorspace", "methods" @@ -1048,22 +1023,21 @@ }, "openssl": { "Package": "openssl", - "Version": "2.2.1", + "Version": "2.3.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "c62edf62de70cadf40553e10c739049d" + "Hash": "5bfe2927efa9f87766ca9605301ea48f" }, "pillar": { "Package": "pillar", - "Version": "1.9.0", + "Version": "1.10.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "cli", - "fansi", "glue", "lifecycle", "rlang", @@ -1071,11 +1045,11 @@ "utils", "vctrs" ], - "Hash": "15da5a8412f317beeee6175fbc76f4bb" + "Hash": "101ca350beea21261a15ba169d7a8513" }, "pingr": { "Package": "pingr", - "Version": "2.0.3", + "Version": "2.0.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1083,11 +1057,11 @@ "processx", "utils" ], - "Hash": "8d2db1d13f4198a00ebf2f066bf2ab67" + "Hash": "63d34946057b145d9e812ccbf3b36ea1" }, "pkgbuild": { "Package": "pkgbuild", - "Version": "1.4.4", + "Version": "1.4.5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1098,7 +1072,7 @@ "desc", "processx" ], - "Hash": "a29e8e134a460a01e0ca67a4763c595b" + "Hash": "30eaaab94db72652e72e3475c1b55278" }, "pkgconfig": { "Package": "pkgconfig", @@ -1170,14 +1144,14 @@ }, "ps": { "Package": "ps", - "Version": "1.8.0", + "Version": "1.8.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "4b9c8485b0c7eecdf0a9ba5132a45576" + "Hash": "b4404b1de13758dea1c0484ad0d48563" }, "purrr": { "Package": "purrr", @@ -1204,25 +1178,15 @@ ], "Hash": "5e3c5dc0b071b21fa128676560dbe94d" }, - "rematch2": { - "Package": "rematch2", - "Version": "2.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "tibble" - ], - "Hash": "76c9e04c712a05848ae7a23d2f170a40" - }, "renv": { "Package": "renv", - "Version": "1.0.7", + "Version": "1.0.11", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "utils" ], - "Hash": "397b7b2a265bc5a7a06852524dabae20" + "Hash": "47623f66b4e80b3b0587bc5d7b309888" }, "rlang": { "Package": "rlang", @@ -1237,7 +1201,7 @@ }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.28", + "Version": "2.29", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1256,7 +1220,7 @@ "xfun", "yaml" ], - "Hash": "062470668513dcda416927085ee9bdc7" + "Hash": "df99277f63d01c34e95e3d2f06a79736" }, "rprojroot": { "Package": "rprojroot", @@ -1270,16 +1234,16 @@ }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.16.0", + "Version": "0.17.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "96710351d642b70e8f02ddeb237c46a7" + "Hash": "5f90cd73946d706cfe26024294236113" }, "sass": { "Package": "sass", "Version": "0.4.9", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R6", "fs", @@ -1293,7 +1257,7 @@ "Package": "scales", "Version": "1.3.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "R6", @@ -1366,12 +1330,11 @@ }, "shinyWidgets": { "Package": "shinyWidgets", - "Version": "0.8.6", + "Version": "0.8.7", "Source": "Repository", "Repository": "RSPM", "Requirements": [ "R", - "anytime", "bslib", "grDevices", "htmltools", @@ -1380,7 +1343,7 @@ "sass", "shiny" ], - "Hash": "bc918b6911c4e928e24a9928295de834" + "Hash": "fd8239886f70daa85c36596214958451" }, "shinyalert": { "Package": "shinyalert", @@ -1518,10 +1481,10 @@ }, "sys": { "Package": "sys", - "Version": "3.4.2", + "Version": "3.4.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" + "Hash": "de342ebfebdbf40477d0758d05426646" }, "systemfonts": { "Package": "systemfonts", @@ -1537,9 +1500,9 @@ }, "testthat": { "Package": "testthat", - "Version": "3.2.1.1", + "Version": "3.2.2", "Source": "Repository", - "Repository": "RSPM", + "Repository": "CRAN", "Requirements": [ "R", "R6", @@ -1562,7 +1525,7 @@ "waldo", "withr" ], - "Hash": "3f6e7e5e2220856ff865e4834766bf2b" + "Hash": "6773967afbe2f74c87021e72c1bb05c0" }, "tibble": { "Package": "tibble", @@ -1599,19 +1562,30 @@ ], "Hash": "829f27b9c4919c16b593794a6344d6c0" }, + "timechange": { + "Package": "timechange", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "RSPM", + "Requirements": [ + "R", + "cpp11" + ], + "Hash": "c5f3c201b931cd6474d17d8700ccb1c8" + }, "tinytex": { "Package": "tinytex", - "Version": "0.53", + "Version": "0.54", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "xfun" ], - "Hash": "9db859e8aabbb474293dde3097839420" + "Hash": "3ec7e3ddcacc2d34a9046941222bf94d" }, "usethis": { "Package": "usethis", - "Version": "3.0.0", + "Version": "3.1.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1633,12 +1607,13 @@ "rprojroot", "rstudioapi", "stats", + "tools", "utils", "whisker", "withr", "yaml" ], - "Hash": "b2fbf93c2127bedd2cbe9b799530d5d2" + "Hash": "0d7f5ca181f9b1e68b217bd93b6cc703" }, "utf8": { "Package": "utf8", @@ -1686,7 +1661,7 @@ }, "waldo": { "Package": "waldo", - "Version": "0.5.3", + "Version": "0.6.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1695,11 +1670,9 @@ "diffobj", "glue", "methods", - "rematch2", - "rlang", - "tibble" + "rlang" ], - "Hash": "16aa934a49658677d8041df9017329b9" + "Hash": "52f574062a7b66e56926988c3fbdb3b7" }, "websocket": { "Package": "websocket", @@ -1723,7 +1696,7 @@ }, "withr": { "Package": "withr", - "Version": "3.0.1", + "Version": "3.0.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1731,11 +1704,11 @@ "grDevices", "graphics" ], - "Hash": "07909200e8bbe90426fbfeb73e1e27aa" + "Hash": "cc2d62c76458d425210d1eb1478b30b4" }, "xfun": { "Package": "xfun", - "Version": "0.47", + "Version": "0.49", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1744,7 +1717,7 @@ "stats", "tools" ], - "Hash": "36ab21660e2d095fef0d83f689e0477c" + "Hash": "8687398773806cfff9401a2feca96298" }, "xtable": { "Package": "xtable", diff --git a/renv/activate.R b/renv/activate.R index d13f993..0eb5108 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "1.0.7" + version <- "1.0.11" attr(version, "sha") <- NULL # the project directory @@ -98,6 +98,66 @@ local({ unloadNamespace("renv") # load bootstrap tools + ansify <- function(text) { + if (renv_ansify_enabled()) + renv_ansify_enhanced(text) + else + renv_ansify_default(text) + } + + renv_ansify_enabled <- function() { + + override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA) + if (!is.na(override)) + return(as.logical(override)) + + pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA) + if (identical(pane, "build")) + return(FALSE) + + testthat <- Sys.getenv("TESTTHAT", unset = "false") + if (tolower(testthat) %in% "true") + return(FALSE) + + iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false") + if (tolower(iderun) %in% "false") + return(FALSE) + + TRUE + + } + + renv_ansify_default <- function(text) { + text + } + + renv_ansify_enhanced <- function(text) { + + # R help links + pattern <- "`\\?(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:help:\\1\a?\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # runnable code + pattern <- "`(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:run:\\1\a\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # return ansified text + text + + } + + renv_ansify_init <- function() { + + envir <- renv_envir_self() + if (renv_ansify_enabled()) + assign("ansify", renv_ansify_enhanced, envir = envir) + else + assign("ansify", renv_ansify_default, envir = envir) + + } + `%||%` <- function(x, y) { if (is.null(x)) y else x } @@ -142,7 +202,10 @@ local({ # compute common indent indent <- regexpr("[^[:space:]]", lines) common <- min(setdiff(indent, -1L)) - leave - paste(substring(lines, common), collapse = "\n") + text <- paste(substring(lines, common), collapse = "\n") + + # substitute in ANSI links for executable renv code + ansify(text) } @@ -305,8 +368,11 @@ local({ quiet = TRUE ) - if ("headers" %in% names(formals(utils::download.file))) - args$headers <- renv_bootstrap_download_custom_headers(url) + if ("headers" %in% names(formals(utils::download.file))) { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } do.call(utils::download.file, args) @@ -385,10 +451,21 @@ local({ for (type in types) { for (repos in renv_bootstrap_repos()) { + # build arguments for utils::available.packages() call + args <- list(type = type, repos = repos) + + # add custom headers if available -- note that + # utils::available.packages() will pass this to download.file() + if ("headers" %in% names(formals(utils::download.file))) { + headers <- renv_bootstrap_download_custom_headers(repos) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + # retrieve package database db <- tryCatch( as.data.frame( - utils::available.packages(type = type, repos = repos), + do.call(utils::available.packages, args), stringsAsFactors = FALSE ), error = identity @@ -470,6 +547,14 @@ local({ } + renv_bootstrap_github_token <- function() { + for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(envval) + } + } + renv_bootstrap_download_github <- function(version) { enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") @@ -477,16 +562,16 @@ local({ return(FALSE) # prepare download options - pat <- Sys.getenv("GITHUB_PAT") - if (nzchar(Sys.which("curl")) && nzchar(pat)) { + token <- renv_bootstrap_github_token() + if (nzchar(Sys.which("curl")) && nzchar(token)) { fmt <- "--location --fail --header \"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "curl", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) - } else if (nzchar(Sys.which("wget")) && nzchar(pat)) { + } else if (nzchar(Sys.which("wget")) && nzchar(token)) { fmt <- "--header=\"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "wget", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) diff --git a/shiny-template.Rproj b/shiny-template.Rproj index 8e3c2eb..e02f86b 100644 --- a/shiny-template.Rproj +++ b/shiny-template.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 3ff89608-36fb-45c8-ba4e-d5904f05c408 RestoreWorkspace: Default SaveWorkspace: Default diff --git a/ui.R b/ui.R index ee7ce4a..6d98b66 100644 --- a/ui.R +++ b/ui.R @@ -72,13 +72,8 @@ ui <- function(input, output, session) { ), # Header ------------------------------------------------------------------ - shinyGovstyle::header( - main_text = "", - main_link = "https://www.gov.uk/government/organisations/department-for-education", - secondary_text = "Department for Education (DfE) Shiny Template", - logo = "images/DfE_logo_landscape.png", - logo_width = 150, - logo_height = 32 + dfeshiny::header( + header = "Department for Education (DfE) Shiny Template" ), # Beta banner ------------------------------------------------------------- @@ -105,7 +100,20 @@ ui <- function(input, output, session) { # Content for these panels is defined in the R/ui_panels/ folder example_tab_1_panel(), user_guide_panel(), - a11y_panel(), + shiny::tabPanel( + value = "a11y_panel", + "Accessibility", + dfeshiny::a11y_panel( + dashboard_title = site_title, + dashboard_url = site_primary, + date_tested = "12th March 2024", + date_prepared = "1st July 2024", + date_reviewed = "1st July 2024", + issues_contact = "explore.statistics@education.gov.uk", + non_accessible_components = c("List non-accessible components here"), + specific_issues = c("List specific issues here") + ) + ), shiny::tabPanel( value = "cookies_panel_ui", "Cookies", diff --git a/www/dfe_shiny_gov_style.css b/www/dfe_shiny_gov_style.css index ae9cbb1..d19d286 100644 --- a/www/dfe_shiny_gov_style.css +++ b/www/dfe_shiny_gov_style.css @@ -296,47 +296,6 @@ html { color: #fff; } -/* Custom disconnect CSS --------------------------------------------------- */ -#ss-connect-dialog { - display: none !important; -} - -#shiny-disconnected-overlay { - display: none !important; -} - -#ss-overlay { - background-color: #000000 !important; - opacity: 0.6 !important; - position: fixed !important; - top: 0 !important; - left: 0 !important; - bottom: 0 !important; - right: 0 !important; - z-index: 99998 !important; - overflow: hidden !important; - cursor: not-allowed !important; -} - -#custom-disconnect-dialog { - background: #000000 !important; - color: #FFFFFF !important; - width: full !important; - transform: translateX(-50%) translateY(-50%) !important; - font-size: 16px !important; - top: 50% !important; - position: fixed !important; - bottom: auto !important; - left: 50% !important; - padding: 0.8em 1.5em !important; - text-align: center !important; - height: auto !important; - opacity: 1 !important; - z-index: 99999 !important; - border-radius: 3px !important; - box-shadow: rgba(0, 0, 0, 0.3) 3px 3px 10px !important; -} - /* Custom value boxes CSS -------------------------------------------------- */ /* Set the font sizes */ #vboxhead-small {