@@ -26,22 +26,22 @@ safetyGraphicsServer <- function(input, output, session,
2626 filterDomain ,
2727 config
2828) {
29- # Initialize the Home tab
29+ # --- Home tab ---#
3030 callModule(
3131 homeTab ,
3232 " home" ,
3333 config
3434 )
3535
36- # Initialize the Mapping tab - returns the current mapping as a reactive
36+ # --- Mapping tab ---#
3737 current_mapping <- callModule(
3838 mappingTab ,
3939 " mapping" ,
4040 meta ,
4141 domainData
4242 )
4343
44- # Initialize the Filter tab - returns list of filtered data as a reactive
44+ # --- Filter tab ---#
4545 filtered_data <- callModule(
4646 filterTab ,
4747 " filter" ,
@@ -50,16 +50,35 @@ safetyGraphicsServer <- function(input, output, session,
5050 current_mapping = current_mapping
5151 )
5252
53- # Initialize Charts tab
54- # Initialize Chart UI - adds subtabs to chart menu and initializes the chart UIs
55- # charts %>% purrr::map(
56- # ~chartsNav(
57- # .x,
58- # session$ns
59- # )
60- # )
53+ # --- Profile tab ---#
54+ if (isNamespaceLoaded(" safetyProfile" )){
55+ callModule(
56+ profileTab ,
57+ " profile" ,
58+ params = reactive({
59+ list (
60+ data = filtered_data(),
61+ settings = safetyGraphics :: generateMappingList(current_mapping())
62+ )
63+ })
64+ )
65+
66+ observeEvent(input $ participants_selected , {
67+ cli :: cli_alert_info(' Selected participant ID: {input$participants_selected}' )
6168
62- # Initialize Chart Servers
69+ # Update selected participant.
70+ updateSelectizeInput(
71+ session ,
72+ inputId = ' profile-profile-idSelect' ,
73+ selected = input $ participants_selected
74+ )
75+ })
76+ } else {
77+ shinyjs :: hide(selector = paste0(" .navbar li a[data-value='profile']" ))
78+ shinyjs :: hide(selector = paste0(" .navbar #pt-header" ))
79+ }
80+
81+ # --- Charts tab ---#
6382 charts %> % purrr :: walk(
6483 ~ callModule(
6584 module = chartsNav ,
@@ -70,7 +89,7 @@ safetyGraphicsServer <- function(input, output, session,
7089 )
7190 )
7291
73- # Initialize the Setting tab
92+ # --- Settings tab ---#
7493 callModule(
7594 settingsTab ,
7695 " settings" ,
0 commit comments