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

@@ -0,0 +1,25 @@
#' @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.
check_for_empty_data <- function(value_to_check) {
# for any 0-length
if (length(value_to_check) == 0) return(TRUE)
# for NA
if (is.logical(value_to_check) && is.na(value_to_check)) return(TRUE)
# for NULL
if (is.null(value_to_check)) return(TRUE)
# for non-empty Date (RETURN FALSE)
if (inherits(value_to_check, "Date") && length(value_to_check) != 0) return(FALSE)
# for empty strings (stands before checking non-empty data for avoid mistakes)
if (value_to_check == "") return(TRUE)
FALSE
}