fix: correct data loading

This commit is contained in:
2026-04-13 19:30:27 +03:00
parent 4c3d339361
commit 2f62a94afa
8 changed files with 97 additions and 97 deletions

View File

@@ -3,7 +3,7 @@
init_val = function(scheme, ns) {
options(box.path = here::here())
box::use(modules/data_manipulations[check_for_empty_data])
box::use(modules/data_manipulations[is_this_empty_value])
iv <- shinyvalidate::InputValidator$new()
@@ -15,7 +15,7 @@ init_val = function(scheme, ns) {
# формируем список id - тип
inputs_simple_list <- scheme |>
dplyr::filter(!form_type %in% c("nested_forms","description", "description_header")) |>
dplyr::filter(!form_type %in% c("nested_forms", "description", "description_header")) |>
dplyr::distinct(form_id, form_type) |>
tibble::deframe()
@@ -39,7 +39,7 @@ init_val = function(scheme, ns) {
iv$add_rule(x_input_id, function(x) {
# exit if empty
if (check_for_empty_data(x)) {
if (is_this_empty_value(x)) {
return(NULL)
}
# хак для пропуска значений
@@ -64,7 +64,7 @@ init_val = function(scheme, ns) {
function(x) {
# exit if empty
if (check_for_empty_data(x)) {
if (is_this_empty_value(x)) {
return(NULL)
}
@@ -85,11 +85,11 @@ init_val = function(scheme, ns) {
}
}
if (form_type %in% c("select_multiple", "select_one")) {
if (form_type %in% c("select_multiple", "select_one", "radio", "checkbox")) {
iv$add_rule(x_input_id, function(x) {
if (length(x) == 1) {
if (check_for_empty_data(x)) return(NULL)
if (is_this_empty_value(x)) return(NULL)
}
# проверка на соответствие вариантов схеме ---------