From aa3fc85ccc7e6dd24576139a7efbcc583adce974 Mon Sep 17 00:00:00 2001 From: DavidNojnarg Date: Sat, 1 Oct 2022 13:13:22 +0000 Subject: [PATCH] Will fix #306 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ R/dashboardSidebar.R | 7 +++++-- man/appButton.Rd | 2 +- man/box.Rd | 2 -- man/dashboardSidebar.Rd | 6 ++++-- man/dashboardUser.Rd | 4 ++-- man/infoBox.Rd | 2 +- man/renderMenu.Rd | 4 ++-- man/valueBox.Rd | 2 +- 10 files changed, 19 insertions(+), 14 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 929cc6e0..92de029f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -33,7 +33,7 @@ Suggests: DT, thematic (>= 0.1.2) Encoding: UTF-8 -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.1 VignetteBuilder: knitr Collate: 'feedbacks.R' diff --git a/NEWS.md b/NEWS.md index ad945618..11a7e966 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,8 @@ [pagination](https://getbootstrap.com/docs/4.0/components/pagination/). ## Bug fixes +- Fix #306: Dynamic menuSubItems with apply() adds some extra text. Added __.list__ +param to `menuItem()` to programatically pass `menuSubItem()` as list. - Fix #297: `tabsetPanel()` renders below the list of `tabPanels` when vertical = TRUE. Changed layout to `fluidRow`. Thanks @lucas-alcantara for reporting. - Fix #296: Documentation issue for `valueBox()` and `infoBox()` in the render function section. diff --git a/R/dashboardSidebar.R b/R/dashboardSidebar.R index e7c43272..a55e99ea 100644 --- a/R/dashboardSidebar.R +++ b/R/dashboardSidebar.R @@ -311,6 +311,9 @@ findSidebarItem <- function(items, regex) { #' @param startExpanded Whether to expand the \link{menuItem} at start. #' @param condition When using \link{menuItem} with \link[shiny]{conditionalPanel}, #' write the condition here (see \url{https://github.com/RinteRface/bs4Dash/issues/35}). +#' @param .list An optional list containing items to put in the menu Same as the +#' \code{...} arguments, but in list format. This can be useful when working +#' with programmatically generated items. #' #' @rdname dashboardSidebar #' @@ -360,8 +363,8 @@ bs4SidebarMenuItem <- function(text, ..., icon = NULL, badgeLabel = NULL, badgeC tabName = NULL, href = NULL, newTab = TRUE, selected = NULL, expandedName = as.character(gsub("[[:space:]]", "", text)), - startExpanded = FALSE, condition = NULL) { - subItems <- list(...) + startExpanded = FALSE, condition = NULL, .list = NULL) { + subItems <- c(list(...), .list) if (!is.null(icon)) { tagAssert(icon, type = "i") diff --git a/man/appButton.Rd b/man/appButton.Rd index 43ec3450..552cb53f 100644 --- a/man/appButton.Rd +++ b/man/appButton.Rd @@ -17,7 +17,7 @@ you could also use any other HTML, like an image.} \item{icon}{An optional \code{\link[shiny:icon]{icon()}} to appear on the button.} \item{width}{The width of the input, e.g. \code{'400px'}, or \code{'100\%'}; -see \code{\link[shiny:reexports]{validateCssUnit()}}.} +see \code{\link[shiny:validateCssUnit]{validateCssUnit()}}.} \item{color}{Button backgroun color. Valid statuses are defined as follows: \itemize{ diff --git a/man/box.Rd b/man/box.Rd index 087d565f..b7b9694b 100644 --- a/man/box.Rd +++ b/man/box.Rd @@ -552,8 +552,6 @@ Other cards: \code{\link{renderbs4ValueBox}()} } \author{ -David Granjon, \email{dgranjon@ymail.com} - David Granjon, \email{dgranjon@ymail.com} } \concept{boxWidgets} diff --git a/man/dashboardSidebar.Rd b/man/dashboardSidebar.Rd index 3ab5c30e..c629c617 100644 --- a/man/dashboardSidebar.Rd +++ b/man/dashboardSidebar.Rd @@ -58,7 +58,8 @@ bs4SidebarMenuItem( selected = NULL, expandedName = as.character(gsub("[[:space:]]", "", text)), startExpanded = FALSE, - condition = NULL + condition = NULL, + .list = NULL ) bs4SidebarMenuSubItem( @@ -123,7 +124,8 @@ menuItem( selected = NULL, expandedName = as.character(gsub("[[:space:]]", "", text)), startExpanded = FALSE, - condition = NULL + condition = NULL, + .list = NULL ) menuSubItem( diff --git a/man/dashboardUser.Rd b/man/dashboardUser.Rd index b2456903..f04e8bbf 100644 --- a/man/dashboardUser.Rd +++ b/man/dashboardUser.Rd @@ -79,7 +79,7 @@ dashboardUser( \item{tag}{A tag function, like \code{tags$li} or \code{tags$ul}.} -\item{expr}{An expression that returns a Shiny tag object, \code{\link[shiny:reexports]{HTML()}}, +\item{expr}{An expression that returns a Shiny tag object, \code{\link[shiny:HTML]{HTML()}}, or a list of such objects.} \item{env}{The parent environment for the reactive expression. By default, @@ -93,7 +93,7 @@ would like to use its expression as a value for \code{expr}, then you must set \code{quoted} to \code{TRUE}.} \item{outputArgs}{A list of arguments to be passed through to the implicit -call to \code{\link[shiny:htmlOutput]{uiOutput()}} when \code{renderUI} is used in an +call to \code{\link[shiny:uiOutput]{uiOutput()}} when \code{renderUI} is used in an interactive R Markdown document.} } \description{ diff --git a/man/infoBox.Rd b/man/infoBox.Rd index 1de2b6a2..d18b9780 100644 --- a/man/infoBox.Rd +++ b/man/infoBox.Rd @@ -48,7 +48,7 @@ infoBoxOutput(outputId, width = 4) renderInfoBox(expr, env = parent.frame(), quoted = FALSE) } \arguments{ -\item{expr}{An expression that returns a Shiny tag object, \code{\link[shiny:reexports]{HTML()}}, +\item{expr}{An expression that returns a Shiny tag object, \code{\link[shiny:HTML]{HTML()}}, or a list of such objects.} \item{env}{The parent environment for the reactive expression. By default, diff --git a/man/renderMenu.Rd b/man/renderMenu.Rd index 0089f07f..ee136f3e 100644 --- a/man/renderMenu.Rd +++ b/man/renderMenu.Rd @@ -7,7 +7,7 @@ renderMenu(expr, env = parent.frame(), quoted = FALSE, outputArgs = list()) } \arguments{ -\item{expr}{An expression that returns a Shiny tag object, \code{\link[shiny:reexports]{HTML()}}, +\item{expr}{An expression that returns a Shiny tag object, \code{\link[shiny:HTML]{HTML()}}, or a list of such objects.} \item{env}{The parent environment for the reactive expression. By default, @@ -21,7 +21,7 @@ would like to use its expression as a value for \code{expr}, then you must set \code{quoted} to \code{TRUE}.} \item{outputArgs}{A list of arguments to be passed through to the implicit -call to \code{\link[shiny:htmlOutput]{uiOutput()}} when \code{renderUI} is used in an +call to \code{\link[shiny:uiOutput]{uiOutput()}} when \code{renderUI} is used in an interactive R Markdown document.} } \description{ diff --git a/man/valueBox.Rd b/man/valueBox.Rd index a362e826..8decfb43 100644 --- a/man/valueBox.Rd +++ b/man/valueBox.Rd @@ -42,7 +42,7 @@ valueBoxOutput(outputId, width = 4) renderValueBox(expr, env = parent.frame(), quoted = FALSE) } \arguments{ -\item{expr}{An expression that returns a Shiny tag object, \code{\link[shiny:reexports]{HTML()}}, +\item{expr}{An expression that returns a Shiny tag object, \code{\link[shiny:HTML]{HTML()}}, or a list of such objects.} \item{env}{The parent environment for the reactive expression. By default,