Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-instated cookie control #101

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Conversation

rmbielby
Copy link
Contributor

Pull request overview

We spotted that someone had broken the cookie control on the dashboard, so I've made a quick fix and highlighted the code that shouldn't be removed.

Pull request checklist

Please check if your PR fulfils the following:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Tests have been run locally and are passing (run_tests_locally())
  • Code is styled according to tidyverse styling (checked locally with tidy_code())

What is the current behaviour?

Cookie control was broke, clicking the accept / decline cookies button wasn't having any effect because the code to respond to those buttons had been removed from server.R

What is the new behaviour?

The code for the cookies has been reinstated (and upgraded to the latest version of dfeshiny). The cookie buttons should now trigger cookie consent behaviours and hide the cookie banner from the user.

As part of this, I've done a full package update, including upgrading dfeshiny to v0.4.3. I've also added in the standard dfeshiny support panel using dfeshiny::support_panel().

@rmbielby rmbielby requested a review from t-surtees October 17, 2024 08:49
@rmbielby rmbielby self-assigned this Oct 17, 2024
# renv::install("dfe-analytical-services/dfeshiny")

# Run renv::restore()
# If it doesn't work first time, maybe try renv::activate() and then renv::restore()

Check notice

Code scanning / lintr

Lines should not be more than 80 characters. This line is 84 characters. Note

Lines should not be more than 80 characters. This line is 84 characters.
@@ -25,6 +25,21 @@
hide(id = "loading-content", anim = TRUE, animType = "fade")
show("app-content")

# Code for controlling cookie consent - do not delete. See dfeshiny guidance for how this works:

Check notice

Code scanning / lintr

Lines should not be more than 80 characters. This line is 98 characters. Note

Lines should not be more than 80 characters. This line is 98 characters.
@@ -25,6 +25,21 @@
hide(id = "loading-content", anim = TRUE, animType = "fade")
show("app-content")

# Code for controlling cookie consent - do not delete. See dfeshiny guidance for how this works:
# https://dfe-analytical-services.github.io/dfeshiny/articles/implementing-cookies.html

Check notice

Code scanning / lintr

Lines should not be more than 80 characters. This line is 89 characters. Note

Lines should not be more than 80 characters. This line is 89 characters.
@@ -25,6 +25,21 @@
hide(id = "loading-content", anim = TRUE, animType = "fade")
show("app-content")

# Code for controlling cookie consent - do not delete. See dfeshiny guidance for how this works:
# https://dfe-analytical-services.github.io/dfeshiny/articles/implementing-cookies.html
# ==============================================================================================

Check notice

Code scanning / lintr

Lines should not be more than 80 characters. This line is 98 characters. Note

Lines should not be more than 80 characters. This line is 98 characters.
output$cookies_status <- dfeshiny::cookies_banner_server(
input_cookies = shiny::reactive(input$cookies),
parent_session = session,
google_analytics_key = google_analytics_key

Check warning

Code scanning / lintr

no visible binding for global variable 'google_analytics_key' Warning

no visible binding for global variable 'google_analytics_key'
value = "cookies_panel_ui",
"Cookies",
gov_main_layout(
cookies_panel_ui(google_analytics_key = google_analytics_key)

Check warning

Code scanning / lintr

no visible global function definition for 'cookies_panel_ui' Warning

no visible global function definition for 'cookies_panel_ui'
value = "cookies_panel_ui",
"Cookies",
gov_main_layout(
cookies_panel_ui(google_analytics_key = google_analytics_key)

Check warning

Code scanning / lintr

no visible binding for global variable 'google_analytics_key' Warning

no visible binding for global variable 'google_analytics_key'
value = "support_panel",
"Support and feedback",
gov_main_layout(
support_panel(

Check warning

Code scanning / lintr

no visible global function definition for 'support_panel' Warning

no visible global function definition for 'support_panel'
gov_main_layout(
support_panel(
team_email = "[email protected]",
repo_name = "https://github.com/dfe-analytical-services/attendance-data-dashboard",

Check notice

Code scanning / lintr

Lines should not be more than 80 characters. This line is 95 characters. Note

Lines should not be more than 80 characters. This line is 95 characters.
repo_name = "https://github.com/dfe-analytical-services/attendance-data-dashboard",
publication_name = "Pupil attendance in schools",
publication_slug = "pupil-attendance-in-schools",
form_url = "https://forms.office.com/Pages/ResponsePage.aspx?id=yXfS-grGoU2187O4s0qC-U4ie_t5E21MlsudeT67Fb5UQ0s1NFoxMUo4RjRYT080SFRMUUxVNUg5Uy4u"

Check notice

Code scanning / lintr

Lines should not be more than 80 characters. This line is 157 characters. Note

Lines should not be more than 80 characters. This line is 157 characters.
@t-surtees t-surtees merged commit 2d724a5 into main Oct 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants