@@ -886,9 +886,6 @@ ui_mmrm <- function(id, ...) {
886886 )
887887 )
888888 )
889- ),
890- forms = tagList(
891- teal.widgets :: verbatim_popup_ui(ns(" rcode" ), " Show R code" )
892889 )
893890 ),
894891 pre_output = a $ pre_output ,
@@ -921,9 +918,6 @@ srv_mmrm <- function(id,
921918
922919 moduleServer(id , function (input , output , session ) {
923920 teal.logger :: log_shiny_input_changes(input , namespace = " teal.modules.clinical" )
924- # Reactive responsible for sending a disable/enable signal
925- # to show R code and debug info buttons
926- disable_r_code <- reactiveVal(FALSE )
927921
928922 observeEvent(input [[extract_input(" cov_var" , dataname )]], {
929923 # update covariates as actual variables
@@ -1155,26 +1149,22 @@ srv_mmrm <- function(id,
11551149 })
11561150
11571151 # Event handler:
1158- # When the "Fit Model" button is clicked, hide initial message, show title, disable model fit and enable
1159- # show R code buttons.
1152+ # When the "Fit Model" button is clicked, hide initial message, show title, disable model fit button.
11601153 shinyjs :: onclick(" button_start" , {
11611154 state $ input <- mmrm_inputs_reactive()
11621155 shinyjs :: hide(" null_input_msg" )
11631156 shinyjs :: disable(" button_start" )
11641157 success <- try(mmrm_fit(), silent = TRUE )
11651158 if (! inherits(success , " try-error" )) {
11661159 shinyjs :: show(" mmrm_title" )
1167- disable_r_code(FALSE )
11681160 } else {
11691161 shinyjs :: hide(" mmrm_title" )
1170- # show R code and debug info buttons will have already been hidden by disable_r_code
11711162 }
11721163 })
11731164
11741165 # all the inputs and data that can be out of sync with the fitted model
11751166 mmrm_inputs_reactive <- reactive({
11761167 shinyjs :: disable(" button_start" )
1177- disable_r_code(TRUE )
11781168 teal :: validate_inputs(iv_r())
11791169 encoding_inputs <- lapply(
11801170 sync_inputs ,
@@ -1243,9 +1233,7 @@ srv_mmrm <- function(id,
12431233 # disable the show R code button and show warning message
12441234 observeEvent(mmrm_inputs_reactive(), {
12451235 shinyjs :: enable(" button_start" )
1246- disable_r_code(TRUE )
12471236 if (! state_has_changed()) {
1248- disable_r_code(FALSE )
12491237 shinyjs :: disable(" button_start" )
12501238 }
12511239 })
@@ -1562,19 +1550,9 @@ srv_mmrm <- function(id,
15621550 show_hide_signal = reactive(! show_plot_rv())
15631551 )
15641552
1565- # Show R code once button is pressed.
1566- source_code_r <- reactive(
1567- teal.code :: get_code(req(decorated_objs_q [[obj_ix_r()]]()))
1568- )
1569- teal.widgets :: verbatim_popup_srv(
1570- id = " rcode" ,
1571- verbatim_content = source_code_r ,
1572- disabled = disable_r_code ,
1573- title = label
1574- )
1575-
15761553 set_chunk_dims(pws , reactive({
15771554 decorated_objs_q [[obj_ix_r()]]()
15781555 }))
1556+
15791557 })
15801558}
0 commit comments