From 62533f4724323c3a58d1ffc5f69d73a124c86308 Mon Sep 17 00:00:00 2001 From: Rich Bielby Date: Fri, 7 Jun 2024 11:24:37 +0100 Subject: [PATCH] Added cookie panel, updated beta banner and minor updates to workflows --- .github/workflows/deploy-shiny.yaml | 2 +- .github/workflows/shiny-tests.yaml | 2 +- .github/workflows/tidyCode.yaml | 7 ++--- server.R | 6 ++++ ui.R | 43 +++++++++++++++++++---------- 5 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy-shiny.yaml b/.github/workflows/deploy-shiny.yaml index 8672c26..387d394 100644 --- a/.github/workflows/deploy-shiny.yaml +++ b/.github/workflows/deploy-shiny.yaml @@ -24,7 +24,7 @@ jobs: RENV_PATHS_ROOT: ~/.local/share/renv steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/shiny-tests.yaml b/.github/workflows/shiny-tests.yaml index 765d06b..0e204a6 100644 --- a/.github/workflows/shiny-tests.yaml +++ b/.github/workflows/shiny-tests.yaml @@ -25,7 +25,7 @@ jobs: RENV_PATHS_ROOT: ~/.local/share/renv steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: diff --git a/.github/workflows/tidyCode.yaml b/.github/workflows/tidyCode.yaml index 9f17a85..fa2c6e2 100644 --- a/.github/workflows/tidyCode.yaml +++ b/.github/workflows/tidyCode.yaml @@ -10,7 +10,7 @@ jobs: tidyCode: runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + name: tidyCode strategy: fail-fast: false @@ -25,11 +25,10 @@ jobs: RENV_PATHS_ROOT: ~/.local/share/renv steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: - r-version: ${{matrix.config.r}} use-public-rspm: true - name: Cache R packages @@ -59,7 +58,7 @@ jobs: run: | source("global.R") - codeChecks <- tidy_code_function() + codeChecks <- tidy_code() if(any(is.na(codeChecks))) { stop("There is a breaking error in the code.") diff --git a/server.R b/server.R index 35c3444..010eda3 100644 --- a/server.R +++ b/server.R @@ -12,6 +12,12 @@ server <- function(input, output, session) { cookie_link_panel = "cookies_panel_ui" ) + cookies_panel_server( + id = "cookies_panel", + input_cookies = shiny::reactive(input$cookies), + google_analytics_key = google_analytics_key # # nolint: [object_usage_linter] + ) + # Links to tabs -------------------------------------------- observeEvent(input$link_to_industryFlow_tab, { diff --git a/ui.R b/ui.R index 452c2de..8f5904e 100644 --- a/ui.R +++ b/ui.R @@ -29,9 +29,16 @@ fluidPage( HTML(".navbar-nav { float: none !important; } - .navbar-nav > li:nth-child(9) { + .navbar-nav > li:nth-child(9) { float: right; - }") + } + .navbar-nav > li:nth-child(8) { + float: right; + } + .navbar-nav > li:nth-child(7) { + float: right; + } +") ) ) ), @@ -39,18 +46,22 @@ fluidPage( "cookie-banner", "Your dashboard name" ), + tags$head(includeHTML(("google-analytics.html"))), + dfe_cookie_script(), navbarPage("", id = "navbar", - tags$head(includeHTML(("google-analytics.html"))), - dfe_cookie_script(), shinyGovstyle::banner( "beta banner", "beta", paste0( - "We're looking for volunteers! We've developed several new dashboards ", - "in the last 12 months and we'd really like to know what you think of them. ", - "If you're interested in helping us improve our products, please sign up ", - "using our user-testing volunteer form.
" + "This dashboard is a new service that we are developing. If you have + any feedback or suggestions for improvements, please submit them using + our ", + a( + href = "https://forms.office.com/Pages/ResponsePage.aspx?id=yXfS-grGoU2187O4s0qC-c6JT6ONG3lJtlg-5hU4A6xURUpQME1OUVZIMEFMUUdNMEVONkhEN0g1VSQlQCN0PWcu", + "feedback form", .noWS = c("after") + ), + ".
" ) ), @@ -748,18 +759,22 @@ fluidPage( ), ), # end of industry by subject tab - # Accessibility =========================================================== + # Support links =========================================================== tabPanel( - "Accessibility", - accessibility_statement() # defined in R/accessibility_statement.R + "Support and feedback", + support_links() # defined in R/supporting_links.R + ), + cookies_panel_ui( + id = "cookies_panel", + google_analytics_key = google_analytics_key ), - # Support links =========================================================== + # Accessibility =========================================================== tabPanel( - "Support and feedback", - support_links() # defined in R/supporting_links.R + "Accessibility", + accessibility_statement() # defined in R/accessibility_statement.R ) ), # end of navbar page