Skip to content

Commit

Permalink
reset dataset name and description to empty values when wizard resets
Browse files Browse the repository at this point in the history
  • Loading branch information
mauromiguelm committed Apr 11, 2024
1 parent 3789e85 commit 6021293
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 9 additions & 2 deletions components/board.upload/R/upload_module_computepgx.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ upload_module_computepgx_server <- function(
upload_description,
upload_datatype,
upload_organism,
process_counter
process_counter,
reset_upload_text_input
) {
shiny::moduleServer(
id,
Expand Down Expand Up @@ -297,7 +298,13 @@ upload_module_computepgx_server <- function(
computedPGX(NULL)
}
)


# reset dataset name and description
observeEvent(reset_upload_text_input(), {
shiny::updateTextInput(session, "selected_name", value = "")
shiny::updateTextAreaInput(session, "selected_description", value = "")
})

# change upload_datatype to selected_datatype

observeEvent(input$selected_datatype, {
Expand Down
7 changes: 6 additions & 1 deletion components/board.upload/R/upload_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ UploadBoard <- function(id,
process_counter <- reactiveVal(0)
show_comparison_builder <- shiny::reactiveVal(FALSE)
selected_contrast_input <- shiny::reactiveVal(FALSE)
reset_upload_text_input <- shiny::reactiveVal(0)

output$navheader <- shiny::renderUI({
fillRow(
Expand Down Expand Up @@ -527,7 +528,8 @@ UploadBoard <- function(id,
upload_datatype = upload_datatype,
upload_name = upload_name,
upload_description = upload_description,
process_counter = process_counter
process_counter = process_counter,
reset_upload_text_input = reset_upload_text_input
)

uploaded_pgx <- shiny::reactive({
Expand Down Expand Up @@ -695,6 +697,9 @@ UploadBoard <- function(id,
show_comparison_builder(FALSE)
selected_contrast_input(FALSE)
})

reset_upload_text_input(reset_upload_text_input()+1)

wizardR::reset("upload_wizard")

# skip upload trigger at first startup
Expand Down

0 comments on commit 6021293

Please sign in to comment.