USEPA/TADAShiny

when you edit ranks in organization table, sorting the table will undo the changes

Closed this issue · 1 comments

Describe the bug

  1. Go to org table
  2. Edit ordering
  3. ctrl-enter to save changes
  4. then try to sort ordering column by new rank - table resets and loses all of user's changes

To Reproduce

Steps to reproduce the behavior:

1. Go to '...'

2. Click on '....'

3. Scroll down to '....'

4. See error

Please include your Water Quality Portal data query inputs from the Load
data tab:

If applicable, include code to reproduce the behavior:

library(TADAShiny)
TADAShiny::run_app()

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Session Info

Please include your session info:

sessionInfo()
#OR preferred:
devtools::session_info()

Additional context

Add any other context about the problem here.

Reminders for TADA contributors addressing this issue

New features should include all of the following work:

  • Create the function/code.

  • Document all code using comments to describe what is does.

  • Create tests in tests folder.

  • Create help file using roxygen2 above code.

  • Create working examples in help file (via roxygen2).

  • Add to appropriate vignette (or create new one).

This is the issue in the mod_overview.R page:

observeEvent(input$overview_orgtable_cell_edit, {
org_rank = data.frame(OrganizationIdentifier = mapdat$orgs$OrganizationIdentifier, Rank = as.numeric(input$overview_orgtable_cell_edit$value)) %>% dplyr::arrange(Rank)
tadat$orgs = org_rank$OrganizationIdentifier
})

The input$overview_orgtable_cell_edit needs to refresh the table: mapdat$orgs