feat: вместо встроенных таблиц - вложенные формы, перемещение кода в отдельные модули, инициация таблиц для вложенных форм

This commit is contained in:
2026-03-29 18:40:49 +03:00
parent cdf92a81a3
commit 339f2b9127
9 changed files with 318 additions and 173 deletions

View File

@@ -1,32 +1,11 @@
get_dummy_data <- function(type) {
if (type %in% c("text", "select_one", "select_multiple")) return("dummy")
if (type %in% c("radio", "checkbox")) return("dummy")
if (type %in% c("date")) return(as.Date("1990-01-01"))
if (type %in% c("number")) return(as.double(999))
}
# get_empty_data <- function(type) {
# if (type %in% c("text", "select_one", "select_multiple")) return(as.character(NA))
# if (type %in% c("radio", "checkbox")) return(as.character(NA))
# if (type %in% c("date")) return(as.Date(NA))
# if (type %in% c("number")) return(as.character(NA))
# }
get_dummy_df <- function() {
purrr::map(
.x = inputs_simple_list,
.f = get_empty_data
) %>%
as_tibble()
}
#' @description Function check if variable contains some sort of empty data
#' (NULL, NA, "", other 0-length data) and return `TRUE` (`FALSE` if data is
#' not 'empty').
#'
#' Needed for proper data validation.
#' (ДУБЛИРУЕТ МОДУЛЬ `data_manipulation`)
check_for_empty_data <- function(value_to_check) {
# for any 0-length