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 1c65605 commit 34f610c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions R/cookies.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#' dfe_cookie_script
#'
#' @return shiny$agshead()
#' @return shiny::tags$head()
#' @export
#'
#' @examples
#' dfe_cookie_script()
dfe_cookie_script <- function() {
shiny$agshead(
shiny$agsscript(
shiny::tags$head(
shiny::tags$script(
src = paste0(
"https://cdn.jsdelivr.net/npm/js-cookie@rc/",
"dist/js.cookie.min.js"
)
),
shiny$agsscript(src = "cookie-consent.js") # Tried using a copy in the repo
shiny::tags$script(src = "cookie-consent.js") # Tried using a copy in the repo

Check notice

Code scanning / lintr

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

Lines should not be more than 80 characters. This line is 82 characters.
# here, but it all stopped working at that point.
)
}
Expand Down Expand Up @@ -47,7 +47,7 @@ dfe_cookie_script <- function() {
#' @param name Name of the dashboard on which the cookie authorisation is being
#' applied
#'
#' @return shiny$agsdiv()
#' @return shiny::tags$div()
#' @export
#'
#' @examples
Expand All @@ -61,29 +61,29 @@ cookieBannerUI <- function(id, name = "DfE R-Shiny dashboard template") {
shiny::tags$div(
id = NS(id, "cookieMain"),
class = "govuk-cookie-banner__message govuk-width-container",
shiny$agsdiv(
shiny::tags$div(
class = "govuk-grid-row",
shiny$agsdiv(
shiny::tags$div(
class = "govuk-grid-column-two-thirds",
shiny$agsh2(
shiny::tags$h2(
class = "govuk-cookie-banner__heading govuk-heading-m",
name
),
shiny$agsdiv(
shiny::tags$div(
class = "govuk-cookie-banner__content",
shiny$agsp(
shiny::tags$p(
class = "govuk-body",
"We use some essential cookies to make this service work."
),
shiny$agsp(
shiny::tags$p(
class = "govuk-body",
"We'd also like to use analytics cookies so we can understand
how you use the service and make improvements."
)
)
)
),
shiny$agsdiv(
shiny::tags$div(
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 34f610c

Please sign in to comment.