46 lines
1.4 KiB
R
46 lines
1.4 KiB
R
#' Core UserFrosting (basic AdminLTE themed) R shiny application
|
|
#'
|
|
#' @export
|
|
# nolint next: object_name_linter. R6Class
|
|
UFApplication <- R6::R6Class(
|
|
"UFApplication",
|
|
inherit = AdminLTEApplication,
|
|
public = list(
|
|
#' @description Sets up the UserFrosting configuration for the application
|
|
#' @param uri <character> The URI for the UserFrosting API instance
|
|
#' @param with_users <logical> Enable UF user API interaction
|
|
#' @param user_optional <logical> Are users optional?
|
|
#' @param app_name <character> The shiny application name for the UF API
|
|
configureUF = function(
|
|
uri, with_users = TRUE, user_optional = FALSE, app_name = NULL
|
|
) {
|
|
private$ufURI <- uri
|
|
if (is.logical(with_users)) {
|
|
private$with_users <- with_users
|
|
}
|
|
if (is.logical(user_optional)) {
|
|
private$user_optional <- user_optional
|
|
}
|
|
if (!is.null(app_name)) {
|
|
private$app_name <- app_name
|
|
}
|
|
invisible(self)
|
|
},
|
|
#' @description Instantiates an R Shiny application with UserFrosting
|
|
#' support.
|
|
#' @returns An R Shiny application suitable for \link[shiny]{runApp}
|
|
app = function() {
|
|
AVSDevR.UserFrosting::ufWrapApplication(
|
|
super$app(), private$ufURI, private$with_users,
|
|
private$user_optional, private$app_name
|
|
)
|
|
}
|
|
),
|
|
private = list(
|
|
ufURI = NULL,
|
|
with_users = TRUE,
|
|
user_optional = FALSE,
|
|
app_name = NULL
|
|
)
|
|
)
|