diff --git a/web_tool_script_3.R b/web_tool_script_3.R index b695f68b..32a3cafb 100644 --- a/web_tool_script_3.R +++ b/web_tool_script_3.R @@ -173,21 +173,10 @@ js_translations <- jsonlite::fromJSON( txt = path(template_path, "data/translation/js_labels.json") ) -sector_order <- function(path) { - # TODO: Remove following create_interactive_report#313 - if (!fs::file_exists(path)) { - rlang::warn(glue::glue( - "This file doesn't exit: {path}. - Have you already merged create_interactive_report#313?" - )) - return(NULL) - } - - readr::read_csv( - path(template_path, "data", "sector_order", "sector_order.csv"), - col_types = cols() - ) -} +sector_order <- readr::read_csv( + path(template_path, "data","sector_order","sector_order.csv"), + col_types = cols() +) # Needed for testing only shock <- shock_year # this should come directly from the stress test.. 2030 based on current discussions in CHPA2020 case @@ -198,7 +187,7 @@ twodi_sectors = sector_list repo_path = template_path file_name = "template.Rmd" -arguments <- list( +create_interactive_report( repo_path = template_path, template_dir = template_dir, output_dir = output_dir, @@ -244,15 +233,10 @@ arguments <- list( ipr_results_stress_test = ipr_results_stress_test, display_currency = display_currency, currency_exchange_value = currency_exchange_value, - header_dictionary = header_dictionary + header_dictionary = header_dictionary, + sector_order = sector_order ) -has_arg <- utils::hasName(formals(create_executive_summary), "sector_order") -if (has_arg) { - arg <- list(sector_order = sector_order()) - arguments <- append(arguments, arg) -} -purrr::invoke(create_interactive_report, arguments) create_executive_summary( file_name = "template.Rmd",