diff --git a/app/main.R b/app/main.R index fa8350e..afaf852 100644 --- a/app/main.R +++ b/app/main.R @@ -32,9 +32,7 @@ server <- function(id) { overviewModule$yieldTabServer("tab1") - levelData <- setupModule$incomeTabServer("tab2") - - dashboardBody$mainBodyServer("submit_portfolio") + levelData <- setupModule$incomeTabServer("tab2", parent = session) dashboardModule$shopAnalysisServer("tab3", data = levelData) }) diff --git a/app/view/components/cardBox.R b/app/view/components/cardBox.R deleted file mode 100644 index 005d2c6..0000000 --- a/app/view/components/cardBox.R +++ /dev/null @@ -1,3 +0,0 @@ -generate_info_box <- function(...) { - bs4Dash::infoBox(...) -} diff --git a/app/view/dashboardBody.R b/app/view/dashboardBody.R index 0d7c541..49b4102 100644 --- a/app/view/dashboardBody.R +++ b/app/view/dashboardBody.R @@ -15,21 +15,7 @@ mainBody <- function(ns) { "portfolio_setup", shiny::br(), shiny::br(), - setupModule$incomeTabUI(ns("tab2")), - - shiny::fixedRow( - shiny::column( - width = 6, - offset = 3, - shinyWidgets::actionBttn( - inputId = "submit_portfolio", - label = "Calculate Results", - style = "material-flat", - color = "primary" - ) |> - htmltools::tagAppendAttributes(style = "width: inherit;") - )) - + setupModule$incomeTabUI(ns("tab2")) ), bs4Dash::tabItem( @@ -40,13 +26,3 @@ mainBody <- function(ns) { ) ) } - -#' @export -mainBodyServer <- function(id) { - shiny::moduleServer(id, function(input, output, server){ - shiny::observeEvent(input$submit_portfolio, { - bs4Dash::updateTabItems(session = server, inputId = "sidebar-tabs", - selected = "dashboard") - }) - }) -} diff --git a/app/view/setupModule.R b/app/view/setupModule.R index 7a6570f..9a2cba8 100644 --- a/app/view/setupModule.R +++ b/app/view/setupModule.R @@ -27,28 +27,29 @@ incomeTabUI <- function(id){ style = "justify-content: space-between;") ), - # shiny::fixedRow( - # shiny::column( - # width = 6, - # offset = 3, - # shinyWidgets::actionBttn( - # inputId = "submit_portfolio", - # label = "Calculate Results", - # style = "material-flat", - # color = "primary" - # ) |> - # htmltools::tagAppendAttributes(style = "width: inherit;") - # )) + shiny::fixedRow( + shiny::column( + width = 6, + offset = 3, + shinyWidgets::actionBttn( + inputId = ns("submit_portfolio"), + label = "Calculate Results", + style = "material-flat", + color = "primary" + ) |> + htmltools::tagAppendAttributes(style = "width: inherit;") + )) ) } #' @export -incomeTabServer <- function(id){ +incomeTabServer <- function(id, parent){ shiny::moduleServer(id, function(input, output, server){ shiny::observeEvent(input$submit_portfolio, { - shiny::updateTabsetPanel(inputId = "sidebar-tabs", - selected = "dashboard") + shiny::updateTabsetPanel(session = parent, + inputId = "sidebar-tabs", + selected = "dashboard") }) return(