Skip to content

Commit

Permalink
Testing out defining parent package for functions to stop lintr compl…
Browse files Browse the repository at this point in the history
…aining about object defs
  • Loading branch information
rmbielby committed Feb 13, 2024
1 parent 2085897 commit 1c65605
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions R/cookies.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#' dfe_cookie_script
#'
#' @return tags$head()
#' @return shiny$agshead()
#' @export
#'
#' @examples
#' dfe_cookie_script()
dfe_cookie_script <- function() {
tags$head(
tags$script(
shiny$agshead(

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'
shiny$agsscript(
src = paste0(
"https://cdn.jsdelivr.net/npm/js-cookie@rc/",
"dist/js.cookie.min.js"
)
),
tags$script(src = "cookie-consent.js") # Tried using a copy in the repo
shiny$agsscript(src = "cookie-consent.js") # Tried using a copy in the repo
# here, but it all stopped working at that point.
)
}
Expand Down Expand Up @@ -47,43 +47,43 @@ dfe_cookie_script <- function() {
#' @param name Name of the dashboard on which the cookie authorisation is being
#' applied
#'
#' @return tags$div()
#' @return shiny$agsdiv()
#' @export
#'
#' @examples
#' cookieBannerUI("cookies", name = "My DfE R-Shiny data dashboard")
cookieBannerUI <- function(id, name = "DfE R-Shiny dashboard template") {

Check notice

Code scanning / lintr

Variable and function name style should match snake_case or symbols. Note

Variable and function name style should match snake_case or symbols.
tags$div(
shiny::tags$div(
id = NS(id, "cookieDiv"),

Check warning

Code scanning / lintr

no visible global function definition for 'NS' Warning

no visible global function definition for 'NS'

Check warning

Code scanning / lintr

no visible global function definition for 'NS' Warning

no visible global function definition for 'NS'

Check warning

Code scanning / lintr

no visible global function definition for 'NS' Warning

no visible global function definition for 'NS'

Check warning

Code scanning / lintr

no visible global function definition for 'NS' Warning

no visible global function definition for 'NS'

Check warning

Code scanning / lintr

no visible global function definition for 'NS' Warning

no visible global function definition for 'NS'
class = "govuk-cookie-banner",
`data-nosnippet role` = "region",
`aria-label` = "Cookies on name",
tags$div(
shiny::tags$div(
id = NS(id, "cookieMain"),
class = "govuk-cookie-banner__message govuk-width-container",
tags$div(
shiny$agsdiv(

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'

Check warning

Code scanning / lintr

no visible binding for global variable 'shiny' Warning

no visible binding for global variable 'shiny'
class = "govuk-grid-row",
tags$div(
shiny$agsdiv(
class = "govuk-grid-column-two-thirds",
tags$h2(
shiny$agsh2(
class = "govuk-cookie-banner__heading govuk-heading-m",
name
),
tags$div(
shiny$agsdiv(
class = "govuk-cookie-banner__content",
tags$p(
shiny$agsp(
class = "govuk-body",
"We use some essential cookies to make this service work."
),
tags$p(
shiny$agsp(
class = "govuk-body",
"We'd also like to use analytics cookies so we can understand
how you use the service and make improvements."
)
)
)
),
tags$div(
shiny$agsdiv(
class = "govuk-button-group",
button_Input(NS(id, "cookieAccept"), "Accept analytics cookies"),

Check warning

Code scanning / lintr

no visible global function definition for 'button_Input' Warning

no visible global function definition for 'button_Input'

Check warning

Code scanning / lintr

no visible global function definition for 'button_Input' Warning

no visible global function definition for 'button_Input'
button_Input(NS(id, "cookieReject"), "Reject analytics cookies"),
Expand Down

0 comments on commit 1c65605

Please sign in to comment.