Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Disallow user to check NCA / Outputs tabs without mapping data #152

Merged
merged 7 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions inst/shiny/modules/column_mapping.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ column_mapping_server <- function(id, data, manual_units, on_submit) {
observeEvent(input$submit_columns, {
Sys.sleep(1) # Make this artificially slow to show the loading spinner

# Enable other tabs
shinyjs::enable(selector = "#page li a[data-value=nca]")
shinyjs::enable(selector = "#page li a[data-value=visualisation]")
shinyjs::enable(selector = "#page li a[data-value=tlgs]")
js3110 marked this conversation as resolved.
Show resolved Hide resolved

req(data())
dataset <- data()

Expand Down Expand Up @@ -348,6 +353,7 @@ column_mapping_server <- function(id, data, manual_units, on_submit) {

# Execute the callback function to change the tab
on_submit()

})

list(
Expand Down
5 changes: 5 additions & 0 deletions inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
function(input, output, session) {
log_info("Startup")

# Initially disable all tabs except the 'Data' tab
shinyjs::disable(selector = "#page li a[data-value=nca]")
shinyjs::disable(selector = "#page li a[data-value=visualisation]")
shinyjs::disable(selector = "#page li a[data-value=tlgs]")

# DATA ----
data_module <- tab_data_server("data")
# Data set for analysis
Expand Down
7 changes: 4 additions & 3 deletions inst/shiny/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ fluidPage(
# DATA ----
nav_panel(
"Data",
value = "data",
fluid = TRUE,
tab_data_ui("data")
),
# NCA ----
nav_panel("NCA", fluid = TRUE,
nav_panel("NCA", value = "nca", fluid = TRUE,
fluidPage(
actionButton("nca", "Run NCA", class = "run-nca-btn"),

Expand Down Expand Up @@ -221,12 +222,12 @@ fluidPage(
),

# VISUALISATION ----
nav_panel("Visualisation",
nav_panel("Visualisation", value = "visualisation",
fluid = TRUE,
tab_visuals_ui("visuals")
),
# New TLG tab
nav_panel("TLG",
nav_panel("TLG", value = "tlgs",
js3110 marked this conversation as resolved.
Show resolved Hide resolved
tab_tlg_ui("tlg")
)
),
Expand Down
Loading