Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions global.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ options(shiny.stacktraceon = TRUE)
options(BRANDR_BRAND_YML = here::here("_brand.yml"))
set_collapse(na.rm = TRUE, verbose = FALSE, sort = FALSE)

source(here("hardcodes.R")) # hard-coded variables and data frames
source(here("helper_functions.R")) # functions used throughout the app
source(here('tab_instructions.R')) # static HTML text elements
source(here("eva_chart_colors.R"))
# source files in /util that end with .R or .r
for(f in dir("./util")[grepl(".R$|.r$", dir("./util"))]) { source(here("util", f)) }

if(dir.exists(METADATA_PATH)) {
capture.output("All good", file = stderr())
Expand All @@ -58,8 +56,10 @@ mirai::everywhere({
options(shiny.fullstacktrace = TRUE)
options(shiny.stacktraceon = TRUE)

source(here("hardcodes.R"))
source(here("helper_functions.R"))
# source non-ui R files in /util
source(here("util","hardcodes.R"))
source(here("util","helper_functions.R"))

set_collapse(na.rm = TRUE, verbose = FALSE) # suppress join printouts
})
onStop(function() daemons(0))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion demo_management.R → rcode/server_00_demo_management.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ observeEvent(input$continue_live_btn, {
toggle_demo <- function(in_demo_mode) {

if(in_demo_mode == TRUE){
process_upload("demo.zip", here("demo.zip"))
process_upload("demo.zip", here("util","demo.zip"))
removeModal()
accordion_panel_open(id = 'accordion_home', values = 'home_demo_instructions')
} else {
Expand Down
File renamed without changes.
36 changes: 18 additions & 18 deletions upload_server.R → rcode/server_01_upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ process_upload <- function(upload_filename, upload_filepath) {

}

# 00 -------------------
setProgress(message = "Processing...", value = .01)

setProgress(detail = "Checking initial validity ", value = .05)

err <- source_trycatch("00_initially_valid_import.R")
err <- source_trycatch(here("rcode","00_initially_valid_import.R"))
if(!is.null(err)) return(NULL)

if(session$userData$initially_valid_import() == 0)
Expand All @@ -37,28 +37,28 @@ process_upload <- function(upload_filename, upload_filepath) {
files = paste0(unique(cols_and_data_types$File), ".csv"),
exdir = tempdir()
)

# 01 -------------------
setProgress(detail = "Reading your files..", value = .2)

err <- source_trycatch("01_get_Export.R")
err <- source_trycatch(here("rcode","01_get_export.R"))
if(!is.null(err)) return(NULL)

err <- source_trycatch("02_export_dates.R")
# 02 -------------------
err <- source_trycatch(here("rcode","02_export_dates.R"))
if(!is.null(err)) return(NULL)

# 03 -------------------
setProgress(detail = "Checking file structure", value = .35)

err <- source_trycatch("03_file_structure_analysis.R")
err <- source_trycatch(here("rcode","03_file_structure_analysis.R"))
if(!is.null(err)) return(NULL)

if(session$userData$valid_file() == 0)
return(NULL)

# 04 -------------------
setProgress(detail = "Prepping initial data..", value = .4)

err <- source_trycatch("04_initial_data_prep.R")
err <- source_trycatch(here("rcode","04_initial_data_prep.R"))
if(!is.null(err)) return(NULL)

# 05 & 06 (MIRAI) -------------------
setProgress(detail = "Assessing your data quality..", value = .7)
dq_and_pdde_dependencies <- mget(unique(c(dq_mirai_dependencies, pdde_mirai_dependencies)))
dq_and_pdde_dependencies[["session"]] <- list(
Expand All @@ -73,11 +73,11 @@ process_upload <- function(upload_filename, upload_filepath) {
)
dq_pdde_mirai <- mirai({
logToConsole(session, "About to run dq_mirai")
source("05_DataQuality.R", local = TRUE)

source(here("rcode", "05_data_quality.R"), local = TRUE)
logToConsole(session, "About to run pdde_mirai")
source("06_PDDE_Checker.R", local = TRUE)

source(here("rcode", "06_PDDE_checker.R"), local = TRUE)
list(
dq_main = dq_main,
overlap_details = overlap_details,
Expand All @@ -101,14 +101,14 @@ process_upload <- function(upload_filename, upload_filepath) {
show_trycatch_popup("05_DataQuality.R / 06_PDDE_Checker.R")
if(IN_DEV_MODE) browser()
}

# 07 -------------------
## if only project type is HP (12), skip System Overview script and hide Sys Perf tab
if(all(EnrollmentAdjust$ProjectType == 12)){
logToConsole(session, "Only HP enrollments found - skipping System Performance")
nav_hide(id = 'pageid', target = 'menuSysPerf', session = session)
} else {

err <- source_trycatch("07_system_overview.R")
err <- source_trycatch(here("rcode", "07_system_performance.R"))
if(!is.null(err)) {
nav_hide(id = 'pageid', target = "menuSysPerf", session = session)
} else {
Expand Down Expand Up @@ -183,7 +183,7 @@ process_upload <- function(upload_filename, upload_filepath) {
$('#imported')
.closest('.input-group-btn')
.next()
.val('demo.zip');
.val('./util/demo.zip');
"))
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ sys_perf_ppt_export <- function(file,
fp_bold <- update(fp_normal, bold = TRUE)
fp_red <- update(fp_normal, color = "red")

ppt <- read_pptx(here("system_pptx_template.pptx"))
ppt <- read_pptx(here("www","system_pptx_template.pptx"))

add_footer <- function(.ppt) {
return(
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ observe({
windowSize(input$dimension)
})

source("client_level_export_server.R", local=TRUE)

# Get period report_dates --------------------------------------------
get_months_in_report_period <- function(reportStart = session$userData$ReportStart,
reportEnd = session$userData$ReportEnd) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 19 additions & 22 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ function(input, output, session) {

# while these seem like they could be "globalized" they have output UI elements
# and are therefore session based
source(here("glossary.R"), local = TRUE)
source(here("changelog.R"), local = TRUE)
source(here("demo_management.R"), local = TRUE)

source(here("rcode", "server_00_glossary.R"), local = TRUE)
source(here("rcode", "server_00_changelog.R"), local = TRUE)
source(here("rcode", "server_00_demo_management.R"), local = TRUE)

logMetadata(session, "Session started")

Expand Down Expand Up @@ -128,29 +129,25 @@ function(input, output, session) {
session$reload()
})

source("upload_server.R", local=TRUE)

source("client_counts_server.R", local = TRUE)

source("fsa_server.R", local = TRUE)
source(here("rcode", "server_01_upload.R"), local=TRUE)

source("data_quality_server.R", local = TRUE)
source(here("rcode", "server_03_file_structure_analysis.R"), local = TRUE)

source("system_performance_functions.R", local = TRUE)
source(here("rcode", "server_05_data_quality.R"), local = TRUE)

source("system_overview_server.R", local = TRUE)

source("system_inflow_outflow_server.R", local = TRUE)

source("system_composition_server.R", local = TRUE)

source("system_status_server.R", local = TRUE)
source(here("rcode", "server_06_project_dashboard.R"), local = TRUE)

source("system_exits_server.R", local = TRUE)
source("syse_types_server.R", local = TRUE)
source("syse_time_server.R", local = TRUE)
source("syse_subpop_server.R", local = TRUE)
source("syse_phd_server.R", local = TRUE)
source(here("rcode", "server_07.0_system_performance.R"), local = TRUE)
source(here("rcode", "server_07.0_system_performance_export.R"), local=TRUE)
source(here("rcode", "server_07.1_system_overview.R"), local = TRUE)
source(here("rcode", "server_07.1.1_system_status.R"), local = TRUE)
source(here("rcode", "server_07.1.2_system_inflow_outflow.R"), local = TRUE)
source(here("rcode", "server_07.1.3_system_composition.R"), local = TRUE)
source(here("rcode", "server_07.2_system_exits.R"), local = TRUE)
source(here("rcode", "server_07.2.1_syse_types.R"), local = TRUE)
source(here("rcode", "server_07.2.2_syse_time.R"), local = TRUE)
source(here("rcode", "server_07.2.3_syse_subpop.R"), local = TRUE)
source(here("rcode", "server_07.2.4_syse_phd.R"), local = TRUE)

# Handle session end --------------------------------------------------------
session$onSessionEnded(function(){
Expand Down
4 changes: 2 additions & 2 deletions tests/create_test_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ library(tidyverse)
library(zip)
library(here)
library(collapse)
source(here("hardcodes.R"), local = TRUE)
source(here("helper_functions.R"), local = TRUE)
source(here("util","hardcodes.R"), local = TRUE)
source(here("util","helper_functions.R"), local = TRUE)

# unzip main test data to temp directory.
# this will allow us to overwrite individual csv files
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading