Skip to content

Commit

Permalink
another cran resubmission
Browse files Browse the repository at this point in the history
- remove internal function .Rd files
- add return value documentation to runExample
- some other minor doc improvements
  • Loading branch information
PaulC91 committed Jul 19, 2021
1 parent 243dd64 commit bc9496e
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 128 deletions.
4 changes: 2 additions & 2 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This package was submitted to CRAN on 2021-07-14.
Once it is accepted, delete this file and tag the release (commit 084ad4b).
This package was submitted to CRAN on 2021-07-16.
Once it is accepted, delete this file and tag the release (commit 243dd64).
19 changes: 9 additions & 10 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @param n length of string
#'
#' @return A random character string.
#' @keywords internal
#' @noRd
randomString <- function(n = 64) {
paste(
sample(x = c(letters, LETTERS, 0:9), size = n, replace = TRUE),
Expand All @@ -21,7 +21,7 @@ randomString <- function(n = 64) {
#' get and set the user and session ids in a database.
#'
#' @name cookie_placeholders
#' @keywords internal
#' @noRd
#'
#' @param user character string representing the user id
#' @param session character string representing the session id
Expand All @@ -30,7 +30,7 @@ randomString <- function(n = 64) {
NULL

#' @rdname cookie_placeholders
#' @keywords internal
#' @noRd
default_cookie_getter <- function(user_string, session_string) {
df <- data.frame(user = character(0), session = character(0))
names(df) <- c(user_string, session_string)
Expand All @@ -41,7 +41,7 @@ default_cookie_getter <- function(user_string, session_string) {


#' @rdname cookie_placeholders
#' @keywords internal
#' @noRd
default_cookie_setter <- function(user, session) {
invisible(NULL)
}
Expand All @@ -55,8 +55,8 @@ default_cookie_setter <- function(user, session) {
#' @param id name of input object to hold the cookie value
#' @param expire_days number of days to ask browser to retain cookie
#'
#' @return Character string of Javascript code
#' @keywords internal
#' @return Character string of Javascript code.
#' @noRd
#'
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -90,8 +90,8 @@ js_cookie_to_r_code <- function(id, expire_days = 7) {
#'
#' @param idpassword name of password input, with correct namespace
#' @param idbutton name of action button, with correct namespace
#'
#' @keywords internal
#' @return Character string of Javascript code.
#' @noRd
js_return_click <- function(idpassword, idbutton) {
glue::glue(.open = "{{{", .close = "}}}", '
$(document).keyup(function(event) {
Expand All @@ -105,8 +105,7 @@ js_return_click <- function(idpassword, idbutton) {
#'
#' This code is minified from the GitHub project js-cookie/js-cookie. We include it here
#' to make the shinyauthr package more self-contained
#'
#' @keywords internal
#' @noRd
jscookie_script <- function() {
shiny::includeScript(system.file("js-cookie/js-cookie.js", package = "shinyauthr"))
}
8 changes: 4 additions & 4 deletions R/login.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#' login UI module
#'
#' Shiny UI Module for use with \link{login}
#' Shiny UI Module for use with \link{loginServer}
#'
#' @param id An ID string that corresponds with the ID used to call the module's server function
#' @param title header title for the login panel
#' @param user_title label for the user name text input
#' @param pass_title label for the password text input
#' @param login_title label for the login button
#' @param error_message message to display after failed login
#' @param additional_ui additional shiny UI element to add below login button. Wrap multiple inside \code{shiny::tagList()}
#' @param additional_ui additional shiny UI element(s) to add below login button. Wrap multiple inside \code{shiny::tagList()}
#' @param cookie_expiry number of days to request browser to retain login cookie
#'
#' @return Shiny UI
#' @return Shiny UI login panel with user name text input, password text input and login action button.
#' @example inst/shiny-examples/basic/app.R
#' @export
loginUI <- function(id,
Expand All @@ -31,7 +31,7 @@ loginUI <- function(id,
shiny::wellPanel(
shinyjs::useShinyjs(),
jscookie_script(),
shinyjs::extendShinyjs(text = js_cookie_to_r_code(ns("jscookie")), functions = c("getcookie", "setcookie", "rmcookie")),
shinyjs::extendShinyjs(text = js_cookie_to_r_code(ns("jscookie"), expire_days = cookie_expiry), functions = c("getcookie", "setcookie", "rmcookie")),
shinyjs::extendShinyjs(text = js_return_click(ns("password"), ns("button")), functions = c()),
shiny::tags$h2(title, class = "text-center", style = "padding-top: 0;"),
shiny::textInput(ns("user_name"), shiny::tagList(shiny::icon("user"), user_title)),
Expand Down
2 changes: 1 addition & 1 deletion R/logout.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' logout UI module
#'
#' Shiny UI Module for use with \link{logout}
#' Shiny UI Module for use with \link{logoutServer}
#'
#' @param id An ID string that corresponds with the ID used to call the module's server function
#' @param label label for the logout button
Expand Down
1 change: 1 addition & 0 deletions R/runExample.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' Use user1 pass1 or user2 pass2 to login.
#'
#' @param example The app to launch. Options are "basic", "shinydashboard" or "navbarPage"
#' @return No return value, a shiny app is launched.
#' @examples
#' ## Only run this example in interactive R sessions
#' if (interactive()) {
Expand Down
8 changes: 6 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## Resubmission
* Updated an outdated URL
* Added return value documentation to exported `runExample` function (no return value)
* Removed .Rd files for internal functions

## Notes on previous submissions
* Updated an outdated URL
* Ensured any code related to tests that should not be run on CRAN servers is not run.

## Test environments
Expand All @@ -24,4 +26,6 @@

## R CMD check results

0 errors ✓ | 0 warnings ✓ | 0 notes ✓
New submission

0 errors ✓ | 0 warnings ✓ | 1 note x
27 changes: 0 additions & 27 deletions man/cookie_placeholders.Rd

This file was deleted.

30 changes: 0 additions & 30 deletions man/js_cookie_to_r_code.Rd

This file was deleted.

17 changes: 0 additions & 17 deletions man/js_return_click.Rd

This file was deleted.

13 changes: 0 additions & 13 deletions man/jscookie_script.Rd

This file was deleted.

6 changes: 3 additions & 3 deletions man/loginUI.Rd

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

2 changes: 1 addition & 1 deletion man/logoutUI.Rd

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

18 changes: 0 additions & 18 deletions man/randomString.Rd

This file was deleted.

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

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

0 comments on commit bc9496e

Please sign in to comment.