diff --git a/.gitignore b/.gitignore index ba2ec833b..d33256211 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ inst/shiny/log/* .DS_Store # {shinytest2}: Ignore new debug snapshots for `$expect_values()` *_.new.png -desktop.ini \ No newline at end of file +desktop.ini +tests/testthat/Rplots.pdf diff --git a/NEWS.md b/NEWS.md index 9ac7adfd1..14fcb7dca 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,15 @@ # aNCA (development version) +## Code Quality + +* Removed debug `print()` statements from TLG module and replaced with proper logging (#1298) +* Removed unused `require(magrittr)` and `require(stats)` calls from `app.R` (#1298) +* Replaced deprecated HTML `align` attributes with inline CSS in TLG module (#1298) +* Standardized button CSS classes: removed redundant `btn` prefix where duplicate with `btn-*` (#1298) +* Added `aria-label` attributes to 15 icon-only buttons for accessibility (#1298) +* Removed redundant `disabled = FALSE` default from units table actionButton (#1298) +* Extracted inline hex colors to shared `colors.R` constants and SCSS variables (#1298) + ## Features ### Settings & Configuration diff --git a/R/g_pkcg.R b/R/g_pkcg.R index 4d94198e7..eef7b6ce4 100644 --- a/R/g_pkcg.R +++ b/R/g_pkcg.R @@ -393,6 +393,7 @@ g_pkcg02_log <- function(data, ...) { #' @importFrom stats setNames #' @examples +#' \donttest{ #' # Make an example small dataset #' adnca <- adnca_example #' adnca <- adnca[adnca$USUBJID %in% unique(adnca$USUBJID)[c(1, 2)],] @@ -403,7 +404,7 @@ g_pkcg02_log <- function(data, ...) { #' plots <- pkcg02(adnca) #' plots_log <- pkcg02(adnca, scale = "LOG") #' plotly::plotly_build(plots[[1]]) # View the first plot -#' +#' } #' @export #' @author Kezia Kobana pkcg02 <- function( diff --git a/inst/WORDLIST b/inst/WORDLIST index fd3495e3b..112e98fb2 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -115,6 +115,7 @@ RefParameter Req Roadmap SBS +SCSS SDTM SDTMIG SMS @@ -144,6 +145,7 @@ Walkthrough XPT YAML aNCA's +actionButton adnca analysing analyte diff --git a/inst/shiny/app.R b/inst/shiny/app.R index 55e5c4c96..0554411c4 100644 --- a/inst/shiny/app.R +++ b/inst/shiny/app.R @@ -5,7 +5,6 @@ require(dplyr) require(htmlwidgets) require(logger) require(formatters) -require(magrittr) require(plotly) require(purrr) require(reactable) @@ -15,7 +14,6 @@ require(shinycssloaders) require(shinyjs) require(shinyjqui) require(shinyWidgets) -require(stats) require(tidyr) require(tools) diff --git a/inst/shiny/functions/colors.R b/inst/shiny/functions/colors.R new file mode 100644 index 000000000..1db8b2b90 --- /dev/null +++ b/inst/shiny/functions/colors.R @@ -0,0 +1,26 @@ +# Color constants — keep in sync with inst/shiny/www/styles/modules/_colors.scss +# See https://github.com/pharmaverse/aNCA/issues/1298 + +# Backgrounds +BG_GREY_LIGHT <- "#eeeeee" +BG_GREY_HEADER <- "#e9e9e9" +BG_HIGHLIGHT_BLUE <- "#CCE5FF" +BG_BLUE_LIGHT <- "#e6f2ff" +ANCA_WHITE <- "#ffffff" + +# Text +TEXT_MUTED <- "#999999" +TEXT_DIM <- "#888888" +TEXT_SUBTLE <- "#777777" +TEXT_SECONDARY <- "#666666" +TEXT_HEADING <- "#555555" + +# Borders +BORDER_LIGHT <- "#dddddd" +BORDER_MUTED <- "#cccccc" +BORDER_PANEL <- "#dee2e6" + +# Accent +ACCENT_BLUE <- "#0d6efd" +ACCENT_ORANGE <- "#ffa62d" +ACCENT_DANGER <- "#dc3545" diff --git a/inst/shiny/functions/utils-exclusions.R b/inst/shiny/functions/utils-exclusions.R index e16946cff..97a3d7aee 100644 --- a/inst/shiny/functions/utils-exclusions.R +++ b/inst/shiny/functions/utils-exclusions.R @@ -9,9 +9,9 @@ EXCL_COLOR_PARAM <- "#FFF3CD" # yellow — parameter exclusion .legend_swatch <- function(color, label) { div( style = "display:flex; align-items:center; gap:6px;", - div(style = paste0( - "width:14px; height:14px; background:", color, - "; border:1px solid #ddd;" + div(style = glue::glue( + "width:14px; height:14px; background:{color}", + "; border:1px solid {BORDER_LIGHT};" )), span(label, style = "font-size:0.9em;") ) @@ -167,7 +167,8 @@ EXCL_COLOR_PARAM <- "#FFF3CD" # yellow — parameter exclusion ns(value), label = NULL, icon = shiny::icon("times"), - class = "btn btn-link btn-sm", + `aria-label` = "Remove exclusion", + class = "btn-link btn-sm", style = "padding:2px 6px;" ) ) @@ -196,7 +197,7 @@ EXCL_COLOR_PARAM <- "#FFF3CD" # yellow — parameter exclusion pagination = FALSE, defaultPageSize = nrow(df), theme = reactable::reactableTheme( - headerStyle = list(background = "#e9e9e9") + headerStyle = list(background = BG_GREY_HEADER) ), columns = cols ) diff --git a/inst/shiny/modules/tab_about.R b/inst/shiny/modules/tab_about.R index 4f371f758..568f6b463 100644 --- a/inst/shiny/modules/tab_about.R +++ b/inst/shiny/modules/tab_about.R @@ -154,7 +154,9 @@ tab_about_server <- function(id) { } ) tags$blockquote( - style = "border-left: 3px solid #ccc; padding-left: 1em; color: #555;", + style = glue::glue( + "border-left: 3px solid {BORDER_MUTED}; padding-left: 1em; color: {TEXT_HEADING};" + ), tags$p(cit_text) ) }) @@ -163,7 +165,9 @@ tab_about_server <- function(id) { cit <- utils::citation("PKNCA") cit_text <- paste(format(cit, style = "text"), collapse = "\n\n") tags$blockquote( - style = "border-left: 3px solid #ccc; padding-left: 1em; color: #555;", + style = glue::glue( + "border-left: 3px solid {BORDER_MUTED}; padding-left: 1em; color: {TEXT_HEADING};" + ), tags$p(cit_text) ) }) @@ -255,7 +259,7 @@ tab_about_server <- function(id) { style = "margin-bottom: 0.3em;", tags$a(href = url, target = "_blank", label), tags$span( - style = "color: #999; font-size: 0.85em; margin-left: 0.5em;", + style = glue::glue("color: {TEXT_MUTED}; font-size: 0.85em; margin-left: 0.5em;"), url ) ) diff --git a/inst/shiny/modules/tab_data/data_mapping.R b/inst/shiny/modules/tab_data/data_mapping.R index 14bd5d1f0..12eb873af 100644 --- a/inst/shiny/modules/tab_data/data_mapping.R +++ b/inst/shiny/modules/tab_data/data_mapping.R @@ -535,7 +535,7 @@ data_mapping_server <- function(id, adnca_data, imported_mapping, trigger) { if (dup_data[index, ".dup_group"] %% 2 == 0) { list(background = "white") } else { - list(background = "#e6f2ff") + list(background = BG_BLUE_LIGHT) } }, selection = "multiple", diff --git a/inst/shiny/modules/tab_data/data_upload.R b/inst/shiny/modules/tab_data/data_upload.R index a10a0a69d..46393053d 100644 --- a/inst/shiny/modules/tab_data/data_upload.R +++ b/inst/shiny/modules/tab_data/data_upload.R @@ -225,8 +225,8 @@ data_upload_server <- function(id) { defaultPageSize = 10, theme = reactableTheme( rowSelectedStyle = list( - backgroundColor = "#CCE5FF", - boxShadow = "inset 2px 0 0 0 #0d6efd" + backgroundColor = BG_HIGHLIGHT_BLUE, + boxShadow = paste0("inset 2px 0 0 0 ", ACCENT_BLUE) ) ), columns = list( diff --git a/inst/shiny/modules/tab_explore.R b/inst/shiny/modules/tab_explore.R index b175b5451..5cd9b478f 100644 --- a/inst/shiny/modules/tab_explore.R +++ b/inst/shiny/modules/tab_explore.R @@ -219,7 +219,7 @@ tab_explore_server <- function(id, pknca_data, extra_group_vars) { footer = tagList( modalButton("Cancel"), actionButton(ns("confirm_add_to_exports"), "Save", - class = "btn btn-primary") + class = "btn-primary") ), size = "s", easyClose = TRUE diff --git a/inst/shiny/modules/tab_explore/plot_sidebar.R b/inst/shiny/modules/tab_explore/plot_sidebar.R index bc25a4715..77c1a3dc1 100644 --- a/inst/shiny/modules/tab_explore/plot_sidebar.R +++ b/inst/shiny/modules/tab_explore/plot_sidebar.R @@ -17,7 +17,7 @@ plot_sidebar_ui <- function(id, is_mean_plot = FALSE, extra_ui = NULL) { ns("add_to_exports"), label = "Add to Exports", icon = icon("plus"), - class = "btn btn-primary btn-sm", + class = "btn-primary btn-sm", width = "100%" ), extra_ui, diff --git a/inst/shiny/modules/tab_explore/qc_plot.R b/inst/shiny/modules/tab_explore/qc_plot.R index 9e67be183..fd965bcbc 100644 --- a/inst/shiny/modules/tab_explore/qc_plot.R +++ b/inst/shiny/modules/tab_explore/qc_plot.R @@ -23,7 +23,7 @@ pk_dose_qc_plot_ui <- function(id, extra_ui = NULL) { ns("add_to_exports"), label = "Add to Exports", icon = icon("plus"), - class = "btn btn-primary btn-sm", + class = "btn-primary btn-sm", width = "100%" ), extra_ui, diff --git a/inst/shiny/modules/tab_explore/saved_outputs.R b/inst/shiny/modules/tab_explore/saved_outputs.R index 1db2e7779..186f13403 100644 --- a/inst/shiny/modules/tab_explore/saved_outputs.R +++ b/inst/shiny/modules/tab_explore/saved_outputs.R @@ -59,7 +59,7 @@ saved_outputs_ui <- function(id) { ns("view_exports"), label = "View Exports", icon = icon("eye"), - class = "btn btn-primary btn-sm", + class = "btn-primary btn-sm", width = "100%" ) } @@ -168,7 +168,7 @@ saved_outputs_server <- function(id, saved_plots_metadata, get_plot_obj, "No plots saved yet. Use ", tags$strong("Add to Exports"), " to save plots.", - style = "color: #888; font-style: italic; margin: 16px 0;" + style = glue::glue("color: {TEXT_DIM}; font-style: italic; margin: 16px 0;") )) } @@ -186,9 +186,9 @@ saved_outputs_server <- function(id, saved_plots_metadata, get_plot_obj, ) tags$div( - style = paste0( - "border: 1px solid #dee2e6; border-radius: 6px; ", - "padding: 12px; margin-bottom: 16px; background: #fff;" + style = glue::glue( + "border: 1px solid {BORDER_PANEL}; border-radius: 6px; ", + "padding: 12px; margin-bottom: 16px; background: {ANCA_WHITE};" ), tags$div( style = paste0( @@ -199,16 +199,17 @@ saved_outputs_server <- function(id, saved_plots_metadata, get_plot_obj, tags$strong(plot_name, style = "font-size: 1.1em;"), tags$span( paste0(" \u2014 ", plot_type, " \u00b7 ", plot_ts), - style = "color: #666; font-size: 0.9em;" + style = glue::glue("color: {TEXT_SECONDARY}; font-size: 0.9em;") ) ), tags$a( href = "#", onclick = paste0(remove_js, "return false;"), - style = paste0( - "color: #dc3545; font-size: 1.2em; ", + style = glue::glue( + "color: {ACCENT_DANGER}; font-size: 1.2em; ", "text-decoration: none;" ), + `aria-label` = "Remove from exports", title = "Remove from exports", icon("times") ) diff --git a/inst/shiny/modules/tab_nca.R b/inst/shiny/modules/tab_nca.R index bb0f8ae60..db08b66c4 100644 --- a/inst/shiny/modules/tab_nca.R +++ b/inst/shiny/modules/tab_nca.R @@ -32,7 +32,7 @@ tab_nca_ui <- function(id) { inputId = ns("run_nca"), label = "Run NCA", icon = icon("play"), - class = "btn btn-primary", + class = "btn-primary", width = "100%" ), nca_setup_ui(ns("nca_setup")), diff --git a/inst/shiny/modules/tab_nca/excretion_analysis.R b/inst/shiny/modules/tab_nca/excretion_analysis.R index d105badcc..d847b985a 100644 --- a/inst/shiny/modules/tab_nca/excretion_analysis.R +++ b/inst/shiny/modules/tab_nca/excretion_analysis.R @@ -273,7 +273,7 @@ excretion_help_ui <- function() { ) ), style = "unite", - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary" ) } diff --git a/inst/shiny/modules/tab_nca/nca_results.R b/inst/shiny/modules/tab_nca/nca_results.R index 65a6d7b8c..912f43c70 100644 --- a/inst/shiny/modules/tab_nca/nca_results.R +++ b/inst/shiny/modules/tab_nca/nca_results.R @@ -33,7 +33,9 @@ nca_results_ui <- function(id) { span("MISSING", style = "font-size:0.9em;") ), div(style = "display:flex; align-items:center; gap:6px;", - div(style = "width:14px; height:14px; background:#ffffff; border:1px solid #ddd;"), + div(style = glue::glue( + "width:14px; height:14px; background:{ANCA_WHITE}; border:1px solid {BORDER_LIGHT};" + )), span("ACCEPTED", style = "font-size:0.9em;") ) ), diff --git a/inst/shiny/modules/tab_nca/non_nca_ratios.R b/inst/shiny/modules/tab_nca/non_nca_ratios.R index 0d4ab9e16..b78fb3389 100644 --- a/inst/shiny/modules/tab_nca/non_nca_ratios.R +++ b/inst/shiny/modules/tab_nca/non_nca_ratios.R @@ -127,7 +127,10 @@ non_nca_ratio_server <- function(id, data, grouping_vars) { ), div( class = "ratio-remove-btn-wrapper", - actionButton(ns(paste0("remove_", count)), "", icon = icon("trash-alt")) + actionButton( + ns(paste0("remove_", count)), "", + `aria-label` = "Remove ratio pair", icon = icon("trash-alt") + ) ) ) @@ -243,7 +246,7 @@ non_nca_ratio_help_ui <- function(title) { ), style = "unite", placement = "left", - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary" ) } diff --git a/inst/shiny/modules/tab_nca/setup/data_imputation.R b/inst/shiny/modules/tab_nca/setup/data_imputation.R index eb5c5f6f9..e8b0f2a53 100644 --- a/inst/shiny/modules/tab_nca/setup/data_imputation.R +++ b/inst/shiny/modules/tab_nca/setup/data_imputation.R @@ -53,7 +53,7 @@ data_imputation_ui <- function(id) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary", width = "500px" ) @@ -123,7 +123,7 @@ data_imputation_ui <- function(id) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary", width = "500px" ) diff --git a/inst/shiny/modules/tab_nca/setup/general_exclusions.R b/inst/shiny/modules/tab_nca/setup/general_exclusions.R index 9a2fe9ce2..3d1b00c66 100644 --- a/inst/shiny/modules/tab_nca/setup/general_exclusions.R +++ b/inst/shiny/modules/tab_nca/setup/general_exclusions.R @@ -37,7 +37,7 @@ general_exclusions_ui <- function(id) { actionButton( ns("add_exclusion_reason"), label = "Add", - class = "btn btn-primary btn-sm" + class = "btn-primary btn-sm" ), # Help button (dropdown) dropdown( @@ -78,7 +78,7 @@ general_exclusions_ui <- function(id) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary" ) ), diff --git a/inst/shiny/modules/tab_nca/setup/manual_slopes_table.R b/inst/shiny/modules/tab_nca/setup/manual_slopes_table.R index 163215844..f38d6375b 100644 --- a/inst/shiny/modules/tab_nca/setup/manual_slopes_table.R +++ b/inst/shiny/modules/tab_nca/setup/manual_slopes_table.R @@ -182,8 +182,8 @@ manual_slopes_table_server <- function( borderless = TRUE, theme = reactableTheme( rowSelectedStyle = list( - backgroundColor = "#eee", - boxShadow = "inset 2px 0 0 0 #ffa62d" + backgroundColor = BG_GREY_LIGHT, + boxShadow = glue::glue("inset 2px 0 0 0 {ACCENT_ORANGE}") ) ) ) diff --git a/inst/shiny/modules/tab_nca/setup/parameter_exclusions.R b/inst/shiny/modules/tab_nca/setup/parameter_exclusions.R index 5cc954c22..a17979354 100644 --- a/inst/shiny/modules/tab_nca/setup/parameter_exclusions.R +++ b/inst/shiny/modules/tab_nca/setup/parameter_exclusions.R @@ -21,7 +21,7 @@ parameter_exclusions_ui <- function(id) { actionButton( ns("add_exclusion"), label = "Add", - class = "btn btn-primary btn-sm" + class = "btn-primary btn-sm" ), dropdown( div( @@ -45,7 +45,7 @@ parameter_exclusions_ui <- function(id) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary" ) ), diff --git a/inst/shiny/modules/tab_nca/setup/parameter_selection.R b/inst/shiny/modules/tab_nca/setup/parameter_selection.R index ea153562f..2fded7745 100644 --- a/inst/shiny/modules/tab_nca/setup/parameter_selection.R +++ b/inst/shiny/modules/tab_nca/setup/parameter_selection.R @@ -81,7 +81,7 @@ parameter_selection_ui <- function(id, ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary", width = "500px" ), @@ -428,7 +428,7 @@ parameter_selection_server <- function(id, processed_pknca_data, parameter_overr href = func_url, target = "_blank", style = paste0( - "color: #0d6efd;", + "color: ", ACCENT_BLUE, ";", "text-decoration: underline;" ), value diff --git a/inst/shiny/modules/tab_nca/setup/ratio_calculations_table.R b/inst/shiny/modules/tab_nca/setup/ratio_calculations_table.R index 3decad423..595e2f878 100644 --- a/inst/shiny/modules/tab_nca/setup/ratio_calculations_table.R +++ b/inst/shiny/modules/tab_nca/setup/ratio_calculations_table.R @@ -77,7 +77,7 @@ ratios_table_ui <- function(id) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary", width = "500px" ) diff --git a/inst/shiny/modules/tab_nca/setup/settings.R b/inst/shiny/modules/tab_nca/setup/settings.R index ceda5ae39..11c9f1006 100644 --- a/inst/shiny/modules/tab_nca/setup/settings.R +++ b/inst/shiny/modules/tab_nca/setup/settings.R @@ -81,7 +81,7 @@ partial_intervals_ui <- function(id) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary", width = "600px" ) @@ -186,7 +186,7 @@ settings_ui <- function(id) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary", width = "400px" ) @@ -403,8 +403,8 @@ settings_server <- function(id, data, adnca_data, settings_override) { borderless = TRUE, theme = reactableTheme( rowSelectedStyle = list( - backgroundColor = "#eee", - boxShadow = "inset 2px 0 0 0 #ffa62d" + backgroundColor = BG_GREY_LIGHT, + boxShadow = glue::glue("inset 2px 0 0 0 {ACCENT_ORANGE}") ) ) ) diff --git a/inst/shiny/modules/tab_nca/setup/slope_selector.R b/inst/shiny/modules/tab_nca/setup/slope_selector.R index 7f3cfe0f1..f2c3f728c 100644 --- a/inst/shiny/modules/tab_nca/setup/slope_selector.R +++ b/inst/shiny/modules/tab_nca/setup/slope_selector.R @@ -79,7 +79,7 @@ slope_selector_ui <- function(id) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary", width = "600px" ), diff --git a/inst/shiny/modules/tab_nca/units_table.R b/inst/shiny/modules/tab_nca/units_table.R index 58e4e75d2..1272ee8ed 100644 --- a/inst/shiny/modules/tab_nca/units_table.R +++ b/inst/shiny/modules/tab_nca/units_table.R @@ -18,8 +18,7 @@ units_table_ui <- function(id) { actionButton( ns("open_units_table"), icon = icon("scale-balanced"), - label = "Parameter Units", - disabled = FALSE + label = "Parameter Units" ) ) } diff --git a/inst/shiny/modules/tab_nca/zip.R b/inst/shiny/modules/tab_nca/zip.R index 5334e49ac..0b0fbc052 100644 --- a/inst/shiny/modules/tab_nca/zip.R +++ b/inst/shiny/modules/tab_nca/zip.R @@ -18,7 +18,7 @@ zip_ui <- function(id) { inputId = ns("open_zip_modal"), label = "Save", icon = icon("download"), - class = "btn btn-primary", + class = "btn-primary", style = paste( "margin-left: 10px;", "padding: 8px 18px;", @@ -149,8 +149,12 @@ zip_ui <- function(id) { width = 6, div( h4("PK Parameters", style = "margin-bottom: 0.25em;"), - p(style = "color: #777; font-size: 0.85em; margin-top: 0; margin-bottom: 0.75em;", - "Parameters included in the slide tables") + p( + style = glue::glue( + "color: {TEXT_SUBTLE}; font-size: 0.85em; margin-top: 0; margin-bottom: 0.75em;" + ), + "Parameters included in the slide tables" + ) ), div( id = ns("ind_params_container"), @@ -228,7 +232,7 @@ zip_ui <- function(id) { actionButton(ns("back_to_export"), "Back", icon = icon("arrow-left")), div( modalButton("Cancel"), - downloadButton(ns("download_zip_configured"), "Export", class = "btn btn-primary") + downloadButton(ns("download_zip_configured"), "Export", class = "btn-primary") ) ) ), @@ -308,14 +312,14 @@ zip_ui <- function(id) { "padding: 6px 0 2px;" ), span( - style = paste( - "display: inline-block;", - "background-color: #dc3545;", - "color: #fff;", - "border-radius: 20px;", - "padding: 5px 14px;", - "font-size: 0.85rem;", - "font-weight: 500;", + style = glue::glue( + "display: inline-block; ", + "background-color: {ACCENT_DANGER}; ", + "color: {ANCA_WHITE}; ", + "border-radius: 20px; ", + "padding: 5px 14px; ", + "font-size: 0.85rem; ", + "font-weight: 500; ", "line-height: 1.4;" ), icon("triangle-exclamation"), @@ -450,7 +454,7 @@ zip_ui <- function(id) { ns("confirm_export"), label = "Export ZIP with Results", icon = icon("download"), - class = "btn btn-primary" + class = "btn-primary" ) ), easyClose = FALSE, @@ -598,7 +602,7 @@ zip_server <- function(id, res_nca, adnca_data, settings, grouping_vars) { actionButton(ns("back_to_export"), "Back", icon = icon("arrow-left")), div( modalButton("Cancel"), - downloadButton(ns("download_zip"), "Export", class = "btn btn-primary") + downloadButton(ns("download_zip"), "Export", class = "btn-primary") ) ) ), diff --git a/inst/shiny/modules/tab_tlg.R b/inst/shiny/modules/tab_tlg.R index af331ae86..69790184f 100644 --- a/inst/shiny/modules/tab_tlg.R +++ b/inst/shiny/modules/tab_tlg.R @@ -232,7 +232,6 @@ tab_tlg_server <- function(id, data) { # Submit the TLG order, filter selected TLGs tlg_order_filtered <- reactive({ req(data()) - print(tlg_order()) tlg_order_filt <- tlg_order()[tlg_order()$Selection, ] log_debug("Submitted TLGs:\n", paste0("* ", tlg_order_filt$Description, collapse = "\n")) diff --git a/inst/shiny/modules/tab_tlg/tlg_module.R b/inst/shiny/modules/tab_tlg/tlg_module.R index 4a1f20030..8b0feac06 100644 --- a/inst/shiny/modules/tab_tlg/tlg_module.R +++ b/inst/shiny/modules/tab_tlg/tlg_module.R @@ -56,7 +56,7 @@ tlg_module_ui <- function(id, type, options) { ), style = "unite", right = TRUE, - icon = icon("question"), + icon = icon("question"), tooltip = tooltipOptions(title = "Help"), status = "primary" ), actionButton( @@ -69,7 +69,7 @@ tlg_module_ui <- function(id, type, options) { div( class = "tlg-widgets-container", div( - align = "left", + style = "text-align: left;", tags$span( class = "inline-select-input", style = "margin-right: 5em;", @@ -83,7 +83,7 @@ tlg_module_ui <- function(id, type, options) { shinyjs::disabled(actionButton(ns("previous_page"), "Previous Page", class = "btn-page")) ), div( - align = "center", + style = "text-align: center;", tags$span( class = "inline-select-input", tags$span("Page "), @@ -96,7 +96,10 @@ tlg_module_ui <- function(id, type, options) { uiOutput(ns("page_number"), inline = TRUE), ) ), - div(align = "right", actionButton(ns("next_page"), "Next Page", class = "btn-page")) + div( + style = "text-align: right;", + actionButton(ns("next_page"), "Next Page", class = "btn-page") + ) ), shinycssloaders::withSpinner( switch( @@ -183,8 +186,7 @@ tlg_module_server <- function(id, data, type, render_list, options = NULL) { do.call(render_list, purrr::list_modify(list(data = tlg_data), !!!list_options)) }, error = function(e) { - log_error("Error in list rendering:") - print(e) + log_error("Error in list rendering: ", e$message) "Error: list rendering failed with current options. Check the R console for more information." }) diff --git a/inst/shiny/modules/tab_tlg/tlg_option_table.R b/inst/shiny/modules/tab_tlg/tlg_option_table.R index 7cb985587..8385c4a90 100644 --- a/inst/shiny/modules/tab_tlg/tlg_option_table.R +++ b/inst/shiny/modules/tab_tlg/tlg_option_table.R @@ -90,7 +90,10 @@ tlg_option_table_server <- function(id, opt_def, data, reset_trigger) { pageSizeOptions = c(10, 25, 50, 100, nrow(edits_table())), defaultPageSize = 10, theme = reactableTheme( - rowSelectedStyle = list(backgroundColor = "#eee", boxShadow = "inset 2px 0 0 0 #ffa62d") + rowSelectedStyle = list( + backgroundColor = BG_GREY_LIGHT, + boxShadow = glue::glue("inset 2px 0 0 0 {ACCENT_ORANGE}") + ) ) ) }) %>% diff --git a/inst/shiny/www/styles/modules/_colors.scss b/inst/shiny/www/styles/modules/_colors.scss index 4c2dcb807..3203e6db3 100644 --- a/inst/shiny/www/styles/modules/_colors.scss +++ b/inst/shiny/www/styles/modules/_colors.scss @@ -1,3 +1,5 @@ +// Color constants — keep in sync with inst/shiny/functions/colors.R +// See https://github.com/pharmaverse/aNCA/issues/1298 $anca-white: #ffffff; $anca-black: #000000; $anca-black-2: #21201f; @@ -9,3 +11,14 @@ $grey-2: #b4b4b4; $grey-3: #c0c0c0; $grey-4: #cdcdcd; $grey-5: #dadada; +$grey-6: #dddddd; +$grey-7: #e9e9e9; +$grey-8: #eeeeee; + +// Accent colors +$accent-blue: #0d6efd; +$accent-orange: #ffa62d; +$accent-danger: #dc3545; + +// Border colors +$border-panel: #dee2e6; diff --git a/man/PKNCA_update_data_object.Rd b/man/PKNCA_update_data_object.Rd index 5d25cc246..0caf9b823 100644 --- a/man/PKNCA_update_data_object.Rd +++ b/man/PKNCA_update_data_object.Rd @@ -62,7 +62,7 @@ by study type (forwarded to \code{\link[=update_main_intervals]{update_main_inte (forwarded to \code{\link[=update_main_intervals]{update_main_intervals()}}).} \item{custom_units_table}{Optional data frame with PPSTRESU overrides. -When provided, applied via \code{\link[dplyr:rows]{dplyr::rows_update()}} on the PKNCAdata units table.} +When provided, applied via \code{\link[dplyr:rows_update]{dplyr::rows_update()}} on the PKNCAdata units table.} } \value{ A fully configured \code{PKNCAdata} object. diff --git a/man/pkcg02.Rd b/man/pkcg02.Rd index 3e43b12b6..0d4f48b6d 100644 --- a/man/pkcg02.Rd +++ b/man/pkcg02.Rd @@ -88,6 +88,7 @@ A list of ggplot or plotly objects for each unique group. This function generates a list of plotly objects PK concentration-time profiles by group } \examples{ +\donttest{ # Make an example small dataset adnca <- adnca_example adnca <- adnca[adnca$USUBJID \%in\% unique(adnca$USUBJID)[c(1, 2)],] @@ -98,7 +99,7 @@ attr(adnca[["AVAL"]], "label") <- "Analysis value" plots <- pkcg02(adnca) plots_log <- pkcg02(adnca, scale = "LOG") plotly::plotly_build(plots[[1]]) # View the first plot - +} } \author{ Kezia Kobana