devel #1
9
app.R
9
app.R
@@ -22,7 +22,6 @@ box::use(
|
||||
global_options$set_global_options(
|
||||
shiny.host = "0.0.0.0"
|
||||
)
|
||||
|
||||
global_options$check_and_init_scheme()
|
||||
|
||||
# global vars
|
||||
@@ -37,9 +36,11 @@ box::use(app/tasks)
|
||||
# SETTINGS ================================
|
||||
HEADER_TEXT <- config::get("form_name")
|
||||
|
||||
# sadasdasdasdasdas
|
||||
options(box.path = config::get("form_app_configure_path"))
|
||||
box::use(configs/enabled_schemes[enabled_schemes])
|
||||
# refactor LATER ---------
|
||||
vv <- unlist(config::get()$form_schemes)
|
||||
enabled_schemes <- names(vv)
|
||||
vvvv <- unname(vv)
|
||||
names(enabled_schemes) <- vvvv
|
||||
|
||||
# CHECK FOR PANDOC
|
||||
# TEMP ! NEED TO HANDLE
|
||||
|
||||
@@ -6,8 +6,12 @@ default:
|
||||
prod:
|
||||
form_app_configure_path: "."
|
||||
form_auth_enabled: false
|
||||
form_schemes:
|
||||
example_of_scheme: Тестовая база данных
|
||||
|
||||
devel:
|
||||
form_app_configure_path: _devel/antifib
|
||||
form_auth_enabled: false
|
||||
form_app_version: 0.16.0 dev
|
||||
form_app_version: 0.16.0 dev
|
||||
form_schemes:
|
||||
antifib: антифибротическая
|
||||
@@ -1,4 +0,0 @@
|
||||
#' @export
|
||||
enabled_schemes <- c(
|
||||
`Тестовая база данных` = "example_of_scheme"
|
||||
)
|
||||
@@ -43,19 +43,16 @@ check_and_init_scheme = function() {
|
||||
options(box.path = here::here())
|
||||
box::use(modules/db[local_db_backup])
|
||||
|
||||
options(box.path = config::get("form_app_configure_path"))
|
||||
box::use(configs/enabled_schemes[enabled_schemes])
|
||||
|
||||
# список файлов, изменение которых, приведут к переинициализиации схемы
|
||||
files_to_watch <- c(
|
||||
fs::path(config::get("form_app_configure_path"), "configs", "enabled_schemes.R"),
|
||||
"config.yml",
|
||||
"modules/scheme_generator.R",
|
||||
"modules/utils.R"
|
||||
)
|
||||
|
||||
scheme_names <- enabled_schemes
|
||||
scheme_file <- paste0(config::get("form_app_configure_path"), "/configs/schemas/", scheme_names, ".xlsx")
|
||||
scheme_file <- stats::setNames(scheme_file, scheme_names)
|
||||
scheme_names <- names(config::get()$form_schemes)
|
||||
scheme_file <- paste0(config::get("form_app_configure_path"), "/configs/schemas/", scheme_names, ".xlsx")
|
||||
scheme_file <- stats::setNames(scheme_file, scheme_names)
|
||||
|
||||
if (!all(file.exists(scheme_file))) {
|
||||
cli::cli_abort(c("Отсутствуют файлы схем для следующих наименований:", paste("-", names(scheme_file)[!file.exists(scheme_file)])))
|
||||
|
||||
Reference in New Issue
Block a user