Skip to content

Commit

Permalink
UPDATE UI
Browse files Browse the repository at this point in the history
- create menu bar and action button in Columns module
  • Loading branch information
Hypertyz committed Jun 19, 2020
1 parent 2e5a532 commit 99ad828
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
31 changes: 21 additions & 10 deletions R/mod_Columns.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ mod_Columns_ui <- function(id){
tags$form(class = "well",
`style`="background-color:#2c3e50;",
uiOutput(ns("input_choice")),
tags$div(style = "text-align:right",
actionButton(ns("create_input"), "Create input object")
),
tags$br(),
mod_upload_ui(ns("upload_ui_1"))
),
),
Expand All @@ -40,22 +44,29 @@ mod_Columns_server <- function(input, output, session, con){
ns <- session$ns

upload_ui_1 <- callModule(mod_upload_server, "upload_ui_1", con = con)
observeEvent(upload_ui_1$module, {
MODifieR_module <- upload_ui_1$module

observeEvent(upload_ui_1$input_object, {
MODifieR_module <- upload_ui_1$input_object
}
)

output$input_choice <- renderUI({
input_objects <- unlist(MODifieRDB::get_available_input_objects(con)$input_name)
selectInput(ns("input_object"), label = "Input object", choices = input_objects, selected = NULL) #Problem with selected input that triggers the second column.
selectInput(ns("input_object"), label = "Input object", choices = input_objects)
})



# Action button for creating input
observeEvent(input$create_input, {
upload_ui_1$input_object <- input$input_object
})


upload_algorithm <- reactive({
req(upload_ui_1$module | input$input_object) #Can't trigger the OR operator due to input_object not logical or numerical

if (is.null(upload_ui_1$module)){

return(NULL)
req(upload_ui_1$input_object)

if (is.null(upload_ui_1$input_object)){
return(NULL)
}
})

Expand All @@ -72,7 +83,7 @@ mod_Columns_server <- function(input, output, session, con){

# Module conatiners
output$algorithm1 <- renderUI({
algoirthm_matrix <- upload_algorithm()
upload_algorithm()
tags$div(`class`="col-sm-4",
tags$form(class = "well",
`style`="background-color:#2c3e50;",
Expand Down
2 changes: 1 addition & 1 deletion R/mod_Description1.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod_Description1_ui <- function(id){
tagList(
tags$div(id = "Inference_method",
selectInput(ns("Inference_method"), label = "Inference method", choices = c("Clique Sum", "WGCNA", "DIAMoND", "DiffCoEx", "MCODE", "MODA", "Module Discoverer", "Correlation Clique"),
tooltip = F)
tooltip = T)
),
htmlOutput(ns("description")),
tags$br(),
Expand Down
2 changes: 1 addition & 1 deletion R/mod_upload.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ mod_upload_server <- function(input, output, session, input_object, con){
con = con)


MODifieR_module$module <- input_object
MODifieR_module$input_object <- input_object
})


Expand Down

0 comments on commit 99ad828

Please sign in to comment.