From 224438ec17fb6e167e49468f5503f4a4c7e5cc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Salamon?= Date: Wed, 4 Sep 2024 09:20:14 +0200 Subject: [PATCH] cleaning structure, better naming of files/modules --- .../disease_outbreaks/disease_app/disease_app.R | 2 +- .../disease_outbreaks/disease_app/disease_map.R | 14 +++++++------- ...reaks_contributors.R => disease_contributors.R} | 4 ++-- .../disease_outbreaks/disease_outbreaks_main.R | 14 +++++++------- app/view/disease_outbreaks/info/disease_info.R | 9 ++++----- 5 files changed, 21 insertions(+), 22 deletions(-) rename app/view/disease_outbreaks/{disease_outbreaks_contributors.R => disease_contributors.R} (87%) diff --git a/app/view/disease_outbreaks/disease_app/disease_app.R b/app/view/disease_outbreaks/disease_app/disease_app.R index 1b22b40..a1e1495 100644 --- a/app/view/disease_outbreaks/disease_app/disease_app.R +++ b/app/view/disease_outbreaks/disease_app/disease_app.R @@ -18,7 +18,7 @@ disease_app_ui <- function(id, i18n) { fill = FALSE, style = css(grid_template_columns = "3fr 1fr"), disease_map_ui( - ns("map"), i18n + ns("disease_map"), i18n ), tags$h3(i18n$translate("Location")), ), diff --git a/app/view/disease_outbreaks/disease_app/disease_map.R b/app/view/disease_outbreaks/disease_app/disease_map.R index 82d9f1c..0cc0615 100644 --- a/app/view/disease_outbreaks/disease_app/disease_map.R +++ b/app/view/disease_outbreaks/disease_app/disease_map.R @@ -8,7 +8,7 @@ box::use( disease_map_ui <- function(id, i18n) { ns <- NS(id) card( - id = ns("map"), + id = ns("map_wrapper"), class = "ms-md-3 card-shadow mt-2", full_screen = TRUE, card_header( @@ -37,12 +37,12 @@ disease_map_server <- function(id, coordinates) { min_zoom = 3 ) ) |> - addTiles() |> - setView( - lng = 12.0, - lat = 51.0, - zoom = 10 - ) + addTiles() # |> + # setView( + # lng = 12.0, + # lat = 51.0, + # zoom = 10 + # ) }) }) } \ No newline at end of file diff --git a/app/view/disease_outbreaks/disease_outbreaks_contributors.R b/app/view/disease_outbreaks/disease_contributors.R similarity index 87% rename from app/view/disease_outbreaks/disease_outbreaks_contributors.R rename to app/view/disease_outbreaks/disease_contributors.R index 39c1e4f..d4e1bd9 100644 --- a/app/view/disease_outbreaks/disease_outbreaks_contributors.R +++ b/app/view/disease_outbreaks/disease_contributors.R @@ -3,7 +3,7 @@ box::use( ) #' @export -disease_outbreaks_contributors_ui <- function(id, i18n) { # nolint +disease_contributors_ui <- function(id, i18n) { # nolint ns <- NS(id) fluidRow( class = "align-items-center justify-content-center m-0 p-0", @@ -36,7 +36,7 @@ disease_outbreaks_contributors_ui <- function(id, i18n) { # nolint } #' @export -disease_outbreaks_contributors_server <- function(id, r) { # nolint +disease_contributors_server <- function(id, r) { # nolint moduleServer(id, function(input, output, session) { ns <- session$ns }) diff --git a/app/view/disease_outbreaks/disease_outbreaks_main.R b/app/view/disease_outbreaks/disease_outbreaks_main.R index 9c627d0..a8dc2ed 100644 --- a/app/view/disease_outbreaks/disease_outbreaks_main.R +++ b/app/view/disease_outbreaks/disease_outbreaks_main.R @@ -4,9 +4,9 @@ box::use( ) box::use( - app/view/disease_outbreaks/info/disease_info[disease_info_ui, disease_info_server], + app/view/disease_outbreaks/info/disease_info[disease_info_ui], app/view/disease_outbreaks/disease_app/disease_app[disease_app_ui, disease_app_server], - app/view/disease_outbreaks/disease_outbreaks_contributors[disease_outbreaks_contributors_ui], + app/view/disease_outbreaks/disease_contributors[disease_contributors_ui], ) #' @export @@ -16,10 +16,10 @@ disease_outbreaks_main_ui <- function(id, i18n) { # Info Page --- nav_panel( title = i18n$translate("Info"), - value = "Info", + value = "Info (called from 1st navpanel in disease_outbreaks_main.R)", icon = icon("circle-info"), disease_info_ui( - ns("disease_info_ui"), i18n + ns("disease_info"), i18n ) ), nav_panel( @@ -33,8 +33,8 @@ disease_outbreaks_main_ui <- function(id, i18n) { title = i18n$translate("Contributors"), value = "Contributors", icon = icon("sitemap"), - disease_outbreaks_contributors_ui( - ns("disease_outbreaks_contributors"), + disease_contributors_ui( + ns("disease_contributors"), i18n ) ) @@ -46,6 +46,6 @@ disease_outbreaks_main_server <- function(id) { moduleServer(id, function(input, output, session) { ns <- session$ns - # disease_info_server("disease_info_server") + disease_app_server("disease_app") }) } diff --git a/app/view/disease_outbreaks/info/disease_info.R b/app/view/disease_outbreaks/info/disease_info.R index 4a2d87f..856e860 100644 --- a/app/view/disease_outbreaks/info/disease_info.R +++ b/app/view/disease_outbreaks/info/disease_info.R @@ -41,9 +41,8 @@ disease_info_ui <- function(id, i18n) { ) } -#' @export -disease_info_server <- function(id) { - moduleServer(id, function(input, output, session) { +# disease_info_server <- function(id) { +# moduleServer(id, function(input, output, session) { - }) -} +# }) +# }