UserFrosting API, Database, widgets and server code all added

This commit is contained in:
2026-02-03 13:01:07 +00:00
parent ff52d48095
commit 771ea0b5f5
24 changed files with 1579 additions and 5 deletions

8
man/UFApi.Rd Normal file
View File

@@ -0,0 +1,8 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/UFApi.R
\name{UFApi}
\alias{UFApi}
\title{UFApi}
\description{
UserFrosting API class
}

123
man/UFDatabase.Rd Normal file
View File

@@ -0,0 +1,123 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/UFDatabase.R
\name{UFDatabase}
\alias{UFDatabase}
\title{UFDatabase}
\value{
\if{html}{\out{<complex>}} The query object or data table of the user
\if{html}{\out{<character>}} The name related to user_id
\if{html}{\out{<complex>}} The query object or the user roles
}
\description{
UserFrosting Database class
}
\section{Methods}{
\subsection{Public methods}{
\itemize{
\item \href{#method-UFDatabase-new}{\code{UFDatabase$new()}}
\item \href{#method-UFDatabase-getUser}{\code{UFDatabase$getUser()}}
\item \href{#method-UFDatabase-getUserName}{\code{UFDatabase$getUserName()}}
\item \href{#method-UFDatabase-getUserRoles}{\code{UFDatabase$getUserRoles()}}
\item \href{#method-UFDatabase-clone}{\code{UFDatabase$clone()}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-UFDatabase-new"></a>}}
\if{latex}{\out{\hypertarget{method-UFDatabase-new}{}}}
\subsection{Method \code{new()}}{
Initialises the UFDatabase class
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{UFDatabase$new(db_client)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{db_client}}{An instance of AVSDevR.DBClient::DBClient}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-UFDatabase-getUser"></a>}}
\if{latex}{\out{\hypertarget{method-UFDatabase-getUser}{}}}
\subsection{Method \code{getUser()}}{
Retreives the details of a user from the UserFrosting
database tables
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{UFDatabase$getUser(user_id, collect = TRUE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{user_id}}{The ID of the user to retrieve (usually the current
session user)}
\item{\code{collect}}{When TRUE, calls dplyr::collect() on the query, when
FALSE returns the query object unfetched}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-UFDatabase-getUserName"></a>}}
\if{latex}{\out{\hypertarget{method-UFDatabase-getUserName}{}}}
\subsection{Method \code{getUserName()}}{
Retrieves the user name (first_name last_name) of a user
from the UserFrosting database tables
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{UFDatabase$getUserName(user_id)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{user_id}}{The ID of the user to retrieve (usually the current
session user)}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-UFDatabase-getUserRoles"></a>}}
\if{latex}{\out{\hypertarget{method-UFDatabase-getUserRoles}{}}}
\subsection{Method \code{getUserRoles()}}{
Retrieves the user's roles from the UserFrosting database
tables
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{UFDatabase$getUserRoles(user_id, collect = TRUE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{user_id}}{The ID of the user to retrieve (usually the current
session user)}
\item{\code{collect}}{When TRUE, calls dplyr::collect() on the query, when
FALSE returns the query object unfetched}
}
\if{html}{\out{</div>}}
}
}
\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-UFDatabase-clone"></a>}}
\if{latex}{\out{\hypertarget{method-UFDatabase-clone}{}}}
\subsection{Method \code{clone()}}{
The objects of this class are cloneable with this method.
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{UFDatabase$clone(deep = FALSE)}\if{html}{\out{</div>}}
}
\subsection{Arguments}{
\if{html}{\out{<div class="arguments">}}
\describe{
\item{\code{deep}}{Whether to make a deep clone.}
}
\if{html}{\out{</div>}}
}
}
}

24
man/ufServer.Rd Normal file
View File

@@ -0,0 +1,24 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/widgets.R
\name{ufServer}
\alias{ufServer}
\title{Populates the UserFrosting UI elements with the authenticated UF user for
this session}
\usage{
ufServer(input, output, session, ufApi, ...)
}
\arguments{
\item{input}{Shiny inputs}
\item{output}{Shiny outputs}
\item{session}{Shiny session}
\item{ufApi}{UserFrosting API instance}
\item{...}{Masks any additional parameters not used by this server instance}
}
\description{
Populates the UserFrosting UI elements with the authenticated UF user for
this session
}

11
man/ufUiSidebar.Rd Normal file
View File

@@ -0,0 +1,11 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/widgets.R
\name{ufUiSidebar}
\alias{ufUiSidebar}
\title{UI placeholder for the UserFrosting styled side navigation bar}
\usage{
ufUiSidebar()
}
\description{
UI placeholder for the UserFrosting styled side navigation bar
}

11
man/ufUiTopbar.Rd Normal file
View File

@@ -0,0 +1,11 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/widgets.R
\name{ufUiTopbar}
\alias{ufUiTopbar}
\title{UI placeholder for the UserFrosting styled top navigation bar}
\usage{
ufUiTopbar()
}
\description{
UI placeholder for the UserFrosting styled top navigation bar
}

29
man/ufWrapApplication.Rd Normal file
View File

@@ -0,0 +1,29 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ufWrapApplication.R
\name{ufWrapApplication}
\alias{ufWrapApplication}
\title{Wraps an application with UserFrosting user & session authentication}
\usage{
ufWrapApplication(
app,
ufURI,
with_users = TRUE,
user_optional = FALSE,
app_name = NULL
)
}
\arguments{
\item{app}{The application to wrap}
\item{ufURI}{The UserFrosting API instance}
\item{with_users}{Wether to enable user authentication}
\item{user_optional}{Inidicates wether authenticated users are optional. If
FALSE then any un-authenticated user can still access the application}
\item{app_name}{The name of the application (used in the UFApi calls)}
}
\description{
Wraps an application with UserFrosting user & session authentication
}