Skip to content

Commit

Permalink
German term 'kompakt' substituted against 'compact'.
Browse files Browse the repository at this point in the history
  • Loading branch information
janlisec committed Apr 18, 2024
1 parent f6487f2 commit 0b53fbc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions R/app_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ get_UF_cols <- function(mt = NULL, type = c("U", "F", "U_round")[1]) {
#' @param rv rv.
#' @param type type.
#' @param excl_file excl_file.
#' @return Input data frame in either full or kompakt version.
#' @return Input data frame in either full or compact version.
#' @keywords internal
#' @noRd
#' @examples
Expand All @@ -331,13 +331,13 @@ get_UF_cols <- function(mt = NULL, type = c("U", "F", "U_round")[1]) {
#' isolate(get_input_data(rv = rv, excl_file = TRUE))
#' isolate(get_input_data(rv = rv, type = "s"))
#' isolate(get_input_data(rv = rv, type = "s", excl_file = TRUE))
get_input_data <- function(rv, type = c("kompakt", "standard"), excl_file = FALSE) {
get_input_data <- function(rv, type = c("compact", "standard"), excl_file = FALSE) {
type <- match.arg(type)
df <- getValue(rv, c("Certification", "data"))
an <- rv$cur_an
df <- df[df[, "analyte"] == an, ]
if (!"File" %in% colnames(df)) df <- cbind(df, "File" = "")
if (type == "kompakt") {
if (type == "compact") {
# ensure that "Lab" is a factor
if (!is.factor(df[, "Lab"])) df[, "Lab"] <- factor(df[, "Lab"], levels = unique(df[, "Lab"]))
fn <- rv$c_lab_codes()
Expand Down Expand Up @@ -399,7 +399,7 @@ color_temperature_levels <- function(x) {
#' @param means means.
#' @param alpha alpha.
#' @param pmat pmat.
#' @return Input data frame in either full or kompakt version.
#' @return Input data frame in either full or compact version.
#' @keywords internal
#' @noRd
#' @examples
Expand Down
8 changes: 4 additions & 4 deletions R/fnc_styleTabC0.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
#' @description Prepare Tab C0 for HTML.
#' @param x Object `overview_stats_pre()`.
#' @param ap Analyte specific parameter list.
#' @param type Either 'kompakt' or 'standard'.
#' @param type Either 'compact' or 'standard'.
#' @examples
#' rv <- eCerto:::test_rv(type = "SR3")
#' fd <- rv$c_fltData()
#' ap <- shiny::isolate(eCerto::getValue(rv, c("General", "apm"))[[fd[1, "analyte"]]])
#' eCerto:::styleTabC0(x = fd, ap = ap, type = c("kompakt", "standard")[1])
#' eCerto:::styleTabC0(x = fd, ap = ap, type = c("compact", "standard")[1])
#' @return A data table object.
#' @keywords internal
#' @noRd
styleTabC0 <- function(x, ap, type = c("kompakt", "standard")) {
styleTabC0 <- function(x, ap, type = c("compact", "standard")) {
type <- match.arg(type)
if (type == "kompakt") {
if (type == "compact") {
idx <- attr(x, "id_idx")
if (!("File" %in% colnames(x))) x <- cbind(x, data.frame(" " = " ", check.names = FALSE))
dt <- DT::datatable(
Expand Down
2 changes: 1 addition & 1 deletion R/m_dataView.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ m_DataViewUI <- function(id) {
shiny::strong("Tab.C0 - Imported data from collaborative trial"),
shiny::div(
shiny::div(style = "float: right; margin-left: 15px; text-align: right;", shiny::checkboxInput(width = 140, inputId = ns("data_view_file"), label = "Show Filenames", value = TRUE)),
shiny::div(style = "float: right; margin-left: 15px;", shiny::selectInput(width = 140, inputId = ns("data_view_select"), label = NULL, choices = c("kompakt", "standard")))
shiny::div(style = "float: right; margin-left: 15px;", shiny::selectInput(width = 140, inputId = ns("data_view_select"), label = NULL, choices = c("compact", "standard")))
)
),
bslib::card_body(
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-fnc_styleTabC0.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ testthat::test_that("styleTabC0 works", {
x3 <- shiny::isolate(eCerto:::get_input_data(rv = rv, type="s"))
x4 <- shiny::isolate(eCerto:::get_input_data(rv = rv, type="s", excl_file=TRUE))
ap <- shiny::isolate(eCerto::getValue(rv, c("General", "apm"))[[rv$cur_an]])
xs1 <- eCerto:::styleTabC0(x = x1, ap = ap, type=c("kompakt", "standard")[1])$x$data
xs2 <- eCerto:::styleTabC0(x = x2, ap = ap, type=c("kompakt", "standard")[1])$x$data
xs3 <- eCerto:::styleTabC0(x = x3, ap = ap, type=c("kompakt", "standard")[2])$x$data
xs4 <- eCerto:::styleTabC0(x = x4, ap = ap, type=c("kompakt", "standard")[2])$x$data
xs1 <- eCerto:::styleTabC0(x = x1, ap = ap, type=c("compact", "standard")[1])$x$data
xs2 <- eCerto:::styleTabC0(x = x2, ap = ap, type=c("compact", "standard")[1])$x$data
xs3 <- eCerto:::styleTabC0(x = x3, ap = ap, type=c("compact", "standard")[2])$x$data
xs4 <- eCerto:::styleTabC0(x = x4, ap = ap, type=c("compact", "standard")[2])$x$data
ap[["sample_filter"]] <- 1
ap[["lab_filter"]] <- "L01"
xs5 <- eCerto:::styleTabC0(x = x1, ap = ap, type=c("kompakt", "standard")[1])
xs5 <- eCerto:::styleTabC0(x = x1, ap = ap, type=c("compact", "standard")[1])
})
testthat::expect_true(all(c("Lab", "R1", "mean", "File") %in% colnames(xs1)))
testthat::expect_true(!all(c("File") %in% colnames(xs2)))
Expand Down

0 comments on commit 0b53fbc

Please sign in to comment.