Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.3.3 #367

Merged
merged 9 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 2.2.1
Date: 2022-12-19 15:51:44 UTC
SHA: 1119ebead95ee388e684a36791707ad63b6e2785
Version: 2.3.0
Date: 2023-06-15 20:15:12 UTC
SHA: f0452c4292e86a20aeabe440ec587c263e1811b4
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: bs4Dash
Type: Package
Title: A 'Bootstrap 4' Version of 'shinydashboard'
Version: 2.3.0
Version: 2.3.3
Authors@R: c(
person("David", "Granjon", email = "[email protected]", role = c("aut", "cre")),
person(family = "RinteRface", role = "cph"),
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# bs4Dash 2.3.3

## Breaking change (potential)

- Fix #302: both `dashboardSidebar()` and `dashboardControlbar()` default __skin__ value is NULL.
This allows them to inherit from the parent `dashboardPage()` __dark__ parameter and have either
a full light or full dark skin. If not NULL, the corresponding skin is applied, regardless of the
parent `dashboardPage()`.

## Bug fixes
- Remove unused `headTitles` parameter from `bs4Table()`.
- Fix #315: alert title is not added to alert body and if Alert is not closable the header contains "undefined" key word. Thanks @MohammedFCIS.

# bs4Dash 2.3.0

## New feature
Expand Down
7 changes: 5 additions & 2 deletions R/dashboardControlbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#' in pixels, or a string that specifies the width in CSS units. 250 px by default.
#' @param collapsed Whether the control bar on the right side is collapsed or not at start. TRUE by default.
#' @param overlay Whether the sidebar covers the content when expanded. Default to TRUE.
#' @param skin Controlbar skin. "dark" or "light".
#' @param skin Controlbar skin. "dark" or "light". Matches the \link{dashboardPage} dark parameter
#' value.
#' @param pinned Whether to block the controlbar state (TRUE or FALSE). Default to NULL.
#'
#' @author David Granjon, \email{dgranjon@@ymail.com}
Expand All @@ -19,9 +20,11 @@
#'
#' @export
bs4DashControlbar <- function(..., id = NULL, disable = FALSE, width = 250,
collapsed = TRUE, overlay = TRUE, skin = "dark",
collapsed = TRUE, overlay = TRUE, skin = NULL,
pinned = NULL) {
if (is.null(id)) id <- "controlbarId"

skin <- set_sidebar_skin(skin)

controlbarTag <- shiny::tags$aside(
class = paste0("control-sidebar control-sidebar-", skin),
Expand Down
17 changes: 15 additions & 2 deletions R/dashboardSidebar.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#' @param width The width of the sidebar. This must either be a number which
#' specifies the width in pixels, or a string that specifies the width in CSS
#' units.
#' @param skin Sidebar skin. "dark" or "light".
#' @param skin Sidebar skin. "dark" or "light". Matches the \link{dashboardPage} dark parameter
#' value.
#' @param status Sidebar status. Valid statuses are defined as follows:
#' \itemize{
#' \item \code{primary}: \Sexpr[results=rd, stage=render]{bs4Dash:::rd_color_tag("#007bff")}.
Expand Down Expand Up @@ -47,10 +48,14 @@
#'
#' @export
bs4DashSidebar <- function(..., disable = FALSE, width = NULL,
skin = "dark", status = "primary",
skin = NULL, status = "primary",
elevation = 4, collapsed = FALSE,
minified = TRUE, expandOnHover = TRUE,
fixed = TRUE, id = NULL, customArea = NULL) {
# When no skin is specified, sidebar color must match the dashboard skin color
# by default which is set in the dashboardPage function.
skin <- set_sidebar_skin(skin)

if (is.null(id)) id <- "sidebarId"
# If we're restoring a bookmarked app, this holds the value of whether or not the
# sidebar was collapsed. If this is not the case, the default is whatever the user
Expand Down Expand Up @@ -151,6 +156,14 @@ bs4DashSidebar <- function(..., disable = FALSE, width = NULL,
}


#' @keywords internal
set_sidebar_skin <- function(skin) {
is_dark_skin <- get_parent_args()$dark
if (is.null(skin)) {
skin <- if (!is_dark_skin) "light" else "dark"
}
skin
}


#' Toggle sidebar state
Expand Down
2 changes: 0 additions & 2 deletions R/useful-items.R
Original file line number Diff line number Diff line change
Expand Up @@ -2667,8 +2667,6 @@ bs4Sortable <- function(..., width = 12) {
#'
#' @param data Expect dataframe, tibble or list of shiny tags... See examples.
#' @param cardWrap Whether to wrap the table in a card. FALSE by default.
#' @param headTitles Table header names. Must have the same length as the number of
#' \link{bs4TableItem} in \link{bs4TableItems}. Set "" to have an empty title field.
#' @param bordered Whether to display border between elements. FALSE by default.
#' @param striped Whether to displayed striped in elements. FALSE by default.
#' @param width Table width. 12 by default.
Expand Down
8 changes: 8 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -742,3 +742,11 @@ app_container <- function(url, deps = FALSE) {
}
}
}

# Get parent function arguments
get_parent_args <- function() {
cl <- sys.call(-3)
f <- get(as.character(cl[[1]]), mode = "function", sys.frame(-2))
cl <- match.call(definition = f, call = cl)
as.list(cl)[-1]
}
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ articles:

news:
releases:
- text: "bs4Dash 2.3.0"
- text: "bs4Dash 2.4.0.9000"
- text: "bs4Dash 2.2.1"
- text: "bs4Dash 2.1.0"
- text: "bs4Dash 2.0.3"
Expand Down
5 changes: 2 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Test environments
* local OS X install, R 4.1.3.
* local OS X install, R 4.3.1.
* RStudio Server on linux Ubuntu 20.04.3 LTS R 4.2.1.
* `rhub::check_for_cran`.
* Github actions.
Expand All @@ -9,5 +9,4 @@
There were no ERRORs or WARNINGs or NOTEs.

## Note
I remove the svg file from /man and replaced it by a smaller png, which fixes the NOTES
on https://cran.r-project.org/web/checks/check_results_bs4Dash.html.
This release will fixe the NOTES on https://cran.r-project.org/web/checks/check_results_bs4Dash.html.
2 changes: 0 additions & 2 deletions inst/bs4Dash-2.3.0/bs4Dash.min.js

This file was deleted.

1 change: 0 additions & 1 deletion inst/bs4Dash-2.3.0/bs4Dash.min.js.map

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -932,12 +932,14 @@ $(function () {
break;
default: console.warn(`${config.status} does not belong to allowed statuses!`)
}

closeButton = '';

if (config.closable) {
closeButton = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>'
}

titleTag = `<h5><i class="icon fa fa-${iconType}"></i></h5>`
titleTag = `<h5><i class="icon fa fa-${iconType}"></i>${config.title}</h5>`
contentTag = config.content;

alertTag = `<div
Expand Down
2 changes: 2 additions & 0 deletions inst/bs4Dash-2.3.3/bs4Dash.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions inst/bs4Dash-2.3.3/bs4Dash.min.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions man/dashboardControlbar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/dashboardSidebar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions man/table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ $(function () {
default: console.warn(`${config.status} does not belong to allowed statuses!`)
}

closeButton = '';

if (config.closable) {
closeButton = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">x</button>'
}

titleTag = `<h5><i class="icon fa fa-${iconType}"></i></h5>`
titleTag = `<h5><i class="icon fa fa-${iconType}"></i>${config.title}</h5>`
contentTag = config.content;

alertTag = `<div
Expand Down
File renamed without changes.
File renamed without changes.