diff --git a/R/mod_datamapping.R b/R/mod_datamapping.R index b02e8d0..a328583 100644 --- a/R/mod_datamapping.R +++ b/R/mod_datamapping.R @@ -211,6 +211,11 @@ datamapping_server <- function(id, data, tfrmt_orig, mode){ observeEvent(input$save,{ save_counter(save_counter()+1) }) + observeEvent(mode(),{ + if (initial_valid()==TRUE){ + save_counter(save_counter()+1) + } + }) settings_out <- eventReactive(req(save_counter()>0),{ @@ -251,6 +256,7 @@ datamapping_server <- function(id, data, tfrmt_orig, mode){ original= initial_valid() ) }) + return(settings_out) }) diff --git a/R/mod_load.R b/R/mod_load.R index fd3e702..2341c5b 100644 --- a/R/mod_load.R +++ b/R/mod_load.R @@ -162,10 +162,10 @@ load_server <- function(id, tfrmt_in = reactive(NULL), data_in = reactive(NULL), # keep track of mode for downstream functionality mode <- reactive({ if (mockmode() == TRUE){ - if (input$data_source=="Auto"){ - "mock_no_data" - } else { + if (!is.null(data_in()) || !input$data_source=="Auto"){ "mock_with_data" + } else { + "mock_no_data" } } else if (mockmode() == FALSE){ "reporting" diff --git a/R/mod_table_outer.R b/R/mod_table_outer.R index 917102d..d71eb01 100644 --- a/R/mod_table_outer.R +++ b/R/mod_table_outer.R @@ -16,10 +16,10 @@ table_outer_ui <- function(id){ #' @param subtab Name of selected tab in the Edit pane tabPanel #' @param data data for the table #' @param tfrmt_app_out final tfrmt for the table -#' @param settings mock mode w/ no data, w/ data, reporting +#' @param mode mock mode w/ no data, w/ data, reporting #' #' @noRd -table_outer_server <- function(id, cur_tab, subtab, data, tfrmt_app_out, settings){ +table_outer_server <- function(id, cur_tab, subtab, data, tfrmt_app_out, mode){ moduleServer( id, @@ -78,7 +78,7 @@ table_outer_server <- function(id, cur_tab, subtab, data, tfrmt_app_out, setting tbl_needs_refresh(FALSE) }) - table_inner_server("tbl", data, tfrmt_app_out, reactive(settings()$mode), tbl_auto_refresh) + table_inner_server("tbl", data, tfrmt_app_out, mode, tbl_auto_refresh) } ) diff --git a/R/tfrmtbuilder_server.R b/R/tfrmtbuilder_server.R index 11ed2ab..fec24ed 100644 --- a/R/tfrmtbuilder_server.R +++ b/R/tfrmtbuilder_server.R @@ -87,7 +87,7 @@ tfrmtbuilder_server <- function(id, tfrmt, data) { subtab = reactive(input$tabs), data = reactive(settings()$data) , tfrmt_app_out = tfrmt_app_out, - settings = settings + mode = reactive(settings()$mode) ) # export module