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

Bugfix/cookies panels vignette #86

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

cjrace
Copy link
Contributor

@cjrace cjrace commented Jan 10, 2025

Brief overview of changes

Still a WIP... Latest notes to myself (this PR is not ready to review!):

Updated the tests/test_dashboard to use bslib, all seems fine there.

However, when trying to add code for a bslib example, I've gotten stuck. There's two example apps that should work, but I'm not sure do (or at least I may have missed something...). @rmbielby could you take a look?

  1. shiny::runApp("tests/example_testing_plain.R")
  • cookies link works fine
  • accept / reject aren't closing the banner (probably a simple mistake, as I know this should work)
  1. shiny::runApp("tests/example_testing_bslib.R")
  • cookies link is not responding at all
  • accept / reject aren't closing the banner

(tried all combinations of custom ids and default ids and can't seem to get it working, it works in the tests/test_dashboard though!)


Rest of notes...

  • Styling issues mostly fixed and attached into function

Can use bslib::nav_select(), though bslib tab sets seem to work fine with shiny::updateTabsetPanel too, so that isn't the issue and is a nice thing for us meaning we can support bslib and not from the existing function in theory.

Clean up tasks to do before publishing / getting review

  1. Vignette will need updating at the end of this
  2. Would also be good to update the cookie panel to clearly show the current cookie status
  3. Need to clean out all the excess testing files at the end
  4. Header styling to add to shinyGovstyle

Why are these changes being made?

I tried to follow along with the existing vignette on the apps provider dashboard and couldn't successfully add cookies tracking into it.

Detailed description of changes

Coming soon

Additional information for reviewers

Coming soon

Issue ticket number/s and link

Resolves #53

@cjrace cjrace linked an issue Jan 10, 2025 that may be closed by this pull request
5 tasks
@@ -72,7 +72,7 @@
expect_gt(
grep(
paste0(
"<a href=\"https://shiny.posit.co/\" target=\"_blank\" rel=\"noopener no",
"<a href=\"https://shiny.posit.co/\" class=\"govuk-link\" target=\"_blank\" rel=\"noopener no",

Check notice

Code scanning / lintr

Lines should not be more than 100 characters. This line is 103 characters. Note test

Lines should not be more than 100 characters. This line is 103 characters.
# Left navigation =========================================================
shinyGovstyle::gov_box(

# fill = FALSE

Check notice

Code scanning / lintr

Commented code should be removed. Note test

Commented code should be removed.
tests/example_testing.R Fixed Show fixed Hide fixed
)

# shiny::observeEvent(input$`cookies_banner-cookies_link`, {
# bslib::nav_select("left_nav", selected = "cookies_panel")

Check notice

Code scanning / lintr

Commented code should be removed. Note test

Commented code should be removed.
@rmbielby
Copy link
Contributor

Looks like you haven't run init_cookies()?

I've just run that and then moved the resulting www/ folder containing the javascript code to tests/www/ and the buttons work fine after that.

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.

Cookies panel issues
2 participants