Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request overview
Started out with aim to modularise the cookie logic in shiny-template. Turns out this has already been done and is available in the
{dfeshiny}
package. I have now included this into theui.R
andserver.R
scripts and cleared out the old code.I did make some minor improvements - namely creating a helper function to simply add the
.css
file to theui.R
script.Pull request checklist
Please check if your PR fulfills the following:
shinytest2::test_app()
)styler::style_dir()
andlintr::lint_dir()
)What is the current behaviour?
Cookie logic is verbose in the
server.R
andui.R
.What is the new behaviour?
This has been replaced with the
dfeshiny::cookies_
functions in theserver.R
andui.R
. I also added a function to simply add the.css
file into theui.R
, this is calledset_css_style_sheet()
.Anything else
NOTE: New updates are coming to
{dfeshiny}
which may break code (due to function name changes). Also a test should be written for the newset_css_style_sheet()
function. (Plus check if this is okay practice.)