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

Add dfeshiny package #66

Merged
merged 11 commits into from
Nov 7, 2023
8 changes: 4 additions & 4 deletions .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ cat("Sourcing .Rprofile.", fill = TRUE)

source("renv/activate.R")

# Tidy code function
cjrace marked this conversation as resolved.
Show resolved Hide resolved
tidy_code <- function() {
source("global.r")
tidy_code_function()
if (system.file(package = "dfeshiny") != "") {
library(dfeshiny)
} else {
warning("dfeshiny package is not installed, please run renv::restore() to set up the necessary package environment")
}

# Function to run tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tidyCode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
source("global.R")

codeChecks <- tidy_code_function()
codeChecks <- tidy_code()

if(any(is.na(codeChecks))) {
stop("There is a breaking error in the code.")
Expand Down
2 changes: 1 addition & 1 deletion R/dfe_resources.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
# 2023-09-21: update made to change hex codes to AF colours package
# guidance here: https://best-practice-and-impact.github.io/afcolours/

gss_colour_pallette <- afcolours::af_colours("categorical", colour_format = "hex", n = 6)
suppressMessages(gss_colour_pallette <- afcolours::af_colours("categorical", colour_format = "hex", n = 6))
49 changes: 0 additions & 49 deletions R/standard_panels.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,52 +37,3 @@ a11y_panel <- function() {
)
)
}

support_links <- function() {
tabPanel(
"Support and feedback",
gov_main_layout(
gov_row(
column(
width = 12,
h1("Support and feedback"),
h2("Give us feedback"),
p(
"This dashboard is a new service that we are developing. If you have any feedback or suggestions for improvements, please submit them using our ",
a(
href = "https://forms.office.com",
"feedback form", .noWS = c("after")
), "."
),
p(
"If you spot any errors or bugs while using this dashboard, please screenshot and email them to ",
a(href = "mailto:[email protected]", "[email protected]", .noWS = c("after")), "."
),
h2("Find more information on the data"),
p(
"The data used to produce the dashboard, along with methodological information can be found on ",
a(href = "https://explore-education-statistics.service.gov.uk/", "Explore Education Statistics", .noWS = c("after")),
"."
),
h2("Contact us"),
p(
"If you have questions about the dashboard or data within it, please contact us at ",
a(href = "mailto:[email protected]", "[email protected]", .noWS = c("after"))
),
h2("See the source code"),
p(
"The source code for this dashboard is available in our ",
a(href = "https://github.com/dfe-analytical-services/shiny-template", "GitHub repository", .noWS = c("after")),
"."
)
),
column(
12,
h2("Use of cookies"),
textOutput("cookie_status"),
actionButton("remove", "Reset cookie consent"),
)
)
)
)
}
21 changes: 2 additions & 19 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ shhh(library(metathis))
shhh(library(shinyalert))
shhh(library(shinytest2))
shhh(library(rstudioapi))
shhh(library(bslib))
shhh(library(dfeshiny))
# shhh(library(shinya11y))

# Functions ---------------------------------------------------------------------------------
Expand All @@ -45,25 +47,6 @@ cs_num <- function(value) {
format(value, big.mark = ",", trim = TRUE)
}

# tidy_code_function -------------------------------------------------------------------------------
# Code to tidy up the scripts.

tidy_code_function <- function() {
message("----------------------------------------")
message("App scripts")
message("----------------------------------------")
app_scripts <- eval(styler::style_dir(recursive = FALSE)$changed)
message("R scripts")
message("----------------------------------------")
r_scripts <- eval(styler::style_dir("R/")$changed)
message("Test scripts")
message("----------------------------------------")
test_scripts <- eval(styler::style_dir("tests/", filetype = "r")$changed)
script_changes <- c(app_scripts, r_scripts, test_scripts)
return(script_changes)
}


# Source scripts ---------------------------------------------------------------------------------

# Source any scripts here. Scripts may be needed to process data before it gets to the server file.
Expand Down
Loading
Loading