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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

js3110
Copy link
Collaborator

@js3110 js3110 commented Jan 3, 2025

Issue

Closes #143

Description

When user has not mapped the data (define column names and accepted) it should not be able to go through other tabs (NCA or Outputs) as it can be confusing for them to see errror messages afterwards. Instead, those tabs should remain disable and perhpaps even show a notification

Definition of Done

  • User cannot use other tabs until data is mapped
  • Once data is mapped, other tabs are enables

@js3110 js3110 linked an issue Jan 3, 2025 that may be closed by this pull request
Copy link
Collaborator

@m-kolomanski m-kolomanski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you! I have added two nitpicks/suggestions to consider, but the change is fine as is.

fluid = TRUE,
tab_visuals_ui("visuals")
),
# New TLG tab
nav_panel("TLG",
nav_panel("TLG", value = "tlgs",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Since every other element (title, module name, module id) refers to this tab as tlg and not tlgs, I would keep that consistent and give it the same value.

Comment on lines +281 to +283
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]")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: In repetitive calls like this you can utilize some functional programming with purrr:

Suggested change
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]")
purrr::walk(c("nca", "visualisation", "tlgs"), \(tab) {
shinyjs::disable(selector = paste0("#page li a[data-value=", tab, "]"))
})

but in this case, considering not much code repetition, it is absolutely fine.

Copy link
Collaborator

@Gero1999 Gero1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey good job! I think this solution is clean and simple 👌🏽

In terms of feature I will also add a nitpick request! Could you also include a message in Review Data that until the dataframe is uploaded says something like: "Please, remember to submit your variables mapping in Mapping and Filters"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Disallow user to check NCA / Outputs tabs without mapping data
3 participants