Compare commits

...

8 Commits

Author SHA1 Message Date
Carson
561625b270 soft-deprecate bootstrapPage() and basicPage(). Fixes #2594 2019-09-10 17:48:13 -05:00
Carson Sievert
2e0221ecfd Merge pull request #2592 from rstudio/set-min-max
Exit early if date parsing fails
2019-09-09 13:55:08 -07:00
Carson
aeded79544 yarn build 2019-09-09 15:43:41 -05:00
Carson
c0a7958e77 update news 2019-09-09 15:18:41 -05:00
Carson
431b194ec2 Exit early if date parsing fails in _setMin() and _setMax(), closes #2591 2019-09-09 13:48:18 -05:00
Joe Cheng
29d24d7e08 Merge pull request #2586 from rstudio/resourcePathChangesOption
Suppress resource path changes by default
2019-09-06 13:20:35 -07:00
Carson
6f9c621774 Always suppress for now 2019-09-05 17:22:56 -05:00
Carson
1c8071a96f Add shiny.resourcePathChanges option to get more information about resource path changes for a given prefix.
Closes #2584
2019-09-05 13:44:21 -05:00
10 changed files with 86 additions and 87 deletions

View File

@@ -46,7 +46,9 @@ shiny 1.3.2.9001
* Fixed [#2233](https://github.com/rstudio/shiny/issues/2233): `verbatimTextOutput()` produced wrapped text on Safari, but the text should not be wrapped. ([#2353](https://github.com/rstudio/shiny/pull/2353))
* Fixed [#2335](https://github.com/rstudio/shiny/issues/2335): When `dateInput()`'s `value` was unspecified, and `max` and/or `min` was set to `Sys.Date()`, the value was not being set properly. ([#2526](https://github.com/rstudio/shiny/pull/2526))
* Fixed [#2335](https://github.com/rstudio/shiny/issues/2335): When `dateInput()`'s `value` was unspecified, and `max` and/or `min` was set to `Sys.Date()`, the value was not being set properly. ([#2526](https://github.com/rstudio/shiny/pull/2526))
* Fixed [#2591](https://github.com/rstudio/shiny/issues/2591): Providing malformed date-strings to `min` or `max` no longer results in JS errors for `dateInput()` and `dateRangeInput()`. ([#2592](https://github.com/rstudio/shiny/pull/2592))
* Fixed [rstudio/reactlog#36](https://github.com/rstudio/reactlog/issues/36): Changes to reactive values not displaying accurately in reactlog. ([#2424](https://github.com/rstudio/shiny/pull/2424))

View File

@@ -45,3 +45,47 @@ headerPanel <- function(title, windowTitle=title) {
)
)
}
#' Create a Bootstrap page
#'
#' **DEPRECATED**: use [fluidPage()] instead.
#'
#' @param ... The contents of the document body.
#' @param title The browser window title (defaults to the host URL of the page)
#' @param responsive This option is deprecated; it is no longer optional with
#' Bootstrap 3.
#' @param theme Alternative Bootstrap stylesheet (normally a css file within the
#' www directory, e.g. `www/bootstrap.css`)
#'
#' @return A UI defintion that can be passed to the [shinyUI] function.
#'
#' @keywords internal
#' @seealso [fluidPage()], [fixedPage()]
#' @export
bootstrapPage <- function(..., title = NULL, responsive = NULL, theme = NULL) {
if (!is.null(responsive)) {
shinyDeprecated("The 'responsive' argument is no longer used with Bootstrap 3.")
}
attachDependencies(
tagList(
if (!is.null(title)) tags$head(tags$title(title)),
if (!is.null(theme)) {
tags$head(tags$link(rel="stylesheet", type="text/css", href = theme))
},
# remainder of tags passed to the function
list(...)
),
bootstrapLib()
)
}
#' @rdname bootstrapPage
#' @export
basicPage <- function(...) {
bootstrapPage(div(class="container-fluid", list(...)))
}

View File

@@ -1,51 +1,6 @@
#' @include utils.R
NULL
#' Create a Bootstrap page
#'
#' Create a Shiny UI page that loads the CSS and JavaScript for
#' [Bootstrap](http://getbootstrap.com/), and has no content in the page
#' body (other than what you provide).
#'
#' This function is primarily intended for users who are proficient in HTML/CSS,
#' and know how to lay out pages in Bootstrap. Most applications should use
#' [fluidPage()] along with layout functions like
#' [fluidRow()] and [sidebarLayout()].
#'
#' @param ... The contents of the document body.
#' @param title The browser window title (defaults to the host URL of the page)
#' @param responsive This option is deprecated; it is no longer optional with
#' Bootstrap 3.
#' @param theme Alternative Bootstrap stylesheet (normally a css file within the
#' www directory, e.g. `www/bootstrap.css`)
#'
#' @return A UI defintion that can be passed to the [shinyUI] function.
#'
#' @note The `basicPage` function is deprecated, you should use the
#' [fluidPage()] function instead.
#'
#' @seealso [fluidPage()], [fixedPage()]
#' @export
bootstrapPage <- function(..., title = NULL, responsive = NULL, theme = NULL) {
if (!is.null(responsive)) {
shinyDeprecated("The 'responsive' argument is no longer used with Bootstrap 3.")
}
attachDependencies(
tagList(
if (!is.null(title)) tags$head(tags$title(title)),
if (!is.null(theme)) {
tags$head(tags$link(rel="stylesheet", type="text/css", href = theme))
},
# remainder of tags passed to the function
list(...)
),
bootstrapLib()
)
}
#' Bootstrap libraries
#'
#' This function returns a set of web dependencies necessary for using Bootstrap
@@ -76,12 +31,6 @@ bootstrapLib <- function(theme = NULL) {
)
}
#' @rdname bootstrapPage
#' @export
basicPage <- function(...) {
bootstrapPage(div(class="container-fluid", list(...)))
}
#' Create a page that fills the window
#'

View File

@@ -85,24 +85,25 @@ addResourcePath <- function(prefix, directoryPath) {
}
)
# Often times overwriting a resource path is "what you want",
# but sometimes it can lead to difficult to diagnose issues
# (e.g. an implict dependency might set a resource path that
# conflicts with what you, the app author, are trying to register)
# Note that previous versions of shiny used to warn about this case,
# but it was eventually removed since it caused confusion (#567).
# It seems a good comprimise is to throw a more information message.
if (prefix %in% names(.globals$resourcePaths)) {
existingPath <- .globals$resourcePaths[[prefix]]$path
if (normalizedPath != existingPath) {
message(
"The resource path '", prefix, "' used to point to ",
existingPath, ", but it now points to ", normalizedPath, ". ",
"If your app doesn't work as expected, you may want to ",
"choose a different prefix name."
)
}
}
# # Often times overwriting a resource path is "what you want",
# # but sometimes it can lead to difficult to diagnose issues
# # (e.g. an implict dependency might set a resource path that
# # conflicts with what you, the app author, are trying to register)
# # Note that previous versions of shiny used to warn about this case,
# # but it was eventually removed since it caused confusion (#567).
# # It seems a good compromise is to throw a more information message.
# if (getOption("shiny.resourcePathChanges", FALSE) &&
# prefix %in% names(.globals$resourcePaths)) {
# existingPath <- .globals$resourcePaths[[prefix]]$path
# if (normalizedPath != existingPath) {
# message(
# "The resource path '", prefix, "' used to point to ",
# existingPath, ", but it now points to ", normalizedPath, ". ",
# "If your app doesn't work as expected, you may want to ",
# "choose a different prefix name."
# )
# }
# }
# If a shiny app is currently running, dynamically register this path with
# the corresponding httpuv server object.

View File

@@ -4924,6 +4924,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
}
date = this._newDate(date);
// If date parsing fails, do nothing
if (date === null) return;
date = this._UTCDateAsLocal(date);
if (isNaN(date)) return;
// Workaround for https://github.com/eternicode/bootstrap-datepicker/issues/2010
@@ -4956,6 +4959,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
}
date = this._newDate(date);
// If date parsing fails, do nothing
if (date === null) return;
date = this._UTCDateAsLocal(date);
if (isNaN(date)) return;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bootstrap.R
% Please edit documentation in R/bootstrap-deprecated.R
\name{bootstrapPage}
\alias{bootstrapPage}
\alias{basicPage}
@@ -24,20 +24,9 @@ www directory, e.g. \code{www/bootstrap.css})}
A UI defintion that can be passed to the \link{shinyUI} function.
}
\description{
Create a Shiny UI page that loads the CSS and JavaScript for
\href{http://getbootstrap.com/}{Bootstrap}, and has no content in the page
body (other than what you provide).
}
\details{
This function is primarily intended for users who are proficient in HTML/CSS,
and know how to lay out pages in Bootstrap. Most applications should use
\code{\link[=fluidPage]{fluidPage()}} along with layout functions like
\code{\link[=fluidRow]{fluidRow()}} and \code{\link[=sidebarLayout]{sidebarLayout()}}.
}
\note{
The \code{basicPage} function is deprecated, you should use the
\code{\link[=fluidPage]{fluidPage()}} function instead.
\strong{DEPRECATED}: use \code{\link[=fluidPage]{fluidPage()}} instead.
}
\seealso{
\code{\link[=fluidPage]{fluidPage()}}, \code{\link[=fixedPage]{fixedPage()}}
}
\keyword{internal}

View File

@@ -143,6 +143,10 @@ $.extend(dateInputBinding, {
}
date = this._newDate(date);
// If date parsing fails, do nothing
if (date === null)
return;
date = this._UTCDateAsLocal(date);
if (isNaN(date))
return;
@@ -177,6 +181,10 @@ $.extend(dateInputBinding, {
}
date = this._newDate(date);
// If date parsing fails, do nothing
if (date === null)
return;
date = this._UTCDateAsLocal(date);
if (isNaN(date))
return;