Skip to content

Commit

Permalink
Merge pull request #7 from noclocks/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jimbrig authored Aug 21, 2024
2 parents ffe373f + 865bca7 commit e4d49aa
Show file tree
Hide file tree
Showing 40 changed files with 1,616 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
.quarto
inst/doc
_config.yml
config.yml
docs
18 changes: 18 additions & 0 deletions R/app_logo.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# ------------------------------------------------------------------------
#
# Title : Shiny App Logo
# By : Jimmy Briggs
# Date : 2024-08-19
#
# ------------------------------------------------------------------------

app_logo <- function() {
logo_html <- htmltools::tags$span(
class = "logo",
htmltools::tags$img(
src = "www/logo.png",
alt = "Logo"
)
)
}
30 changes: 30 additions & 0 deletions R/app_meta.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# ------------------------------------------------------------------------
#
# Title : App <meta>
# By : Jimmy Briggs
# Date : 2024-08-19
#
# ------------------------------------------------------------------------


# favicon
# style sheets
# scripts
# shinyjs
# shinyFeedback
# shinybusy
# introjs
# waiter
# shinyWidgets


# exported ---------------------------------------------------------------


# app_meta <- function(
# main_favicon = system.file("www/images/favicons/favicon.ico", package = "gmhleasr"),
# favicon_dir = system.file("www/images/favicons", package = "gmhleasr"),
#
#
# )
21 changes: 21 additions & 0 deletions R/app_run.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# ------------------------------------------------------------------------
#
# Title : Run Shiny App
# By : Jimmy Briggs
# Date : 2024-08-19
#
# ------------------------------------------------------------------------

run_app <- function(
ui = app_ui,
server = app_server,
options = list(
port = 5000,
host = "0.0.0.0",
launch.browser = TRUE
),
...
) {
shiny::shinyApp(ui = ui, server = server, options = options)
}
5 changes: 5 additions & 0 deletions R/app_server.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
app_server <- function(input, output, session) {

mod_header_server("header")
mod_sidebar_server(id = "sidebar")
}
Empty file added R/app_theme.R
Empty file.
53 changes: 53 additions & 0 deletions R/app_ui.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ------------------------------------------------------------------------
#
# Title : Shiny App User Interface
# By : Jimmy Briggs
# Date : 2024-08-13
#
# ------------------------------------------------------------------------

app_ui <- function(req) {

ui <- force(req)

bs4Dash::bs4DashPage(
title = "GMH Leasing Dashboard",
header = mod_header_ui("header"),
sidebar = mod_sidebar_ui(id = "sidebar"),
controlbar = dashboardControlbar(
skin = "light",
sliderInput(
inputId = "controller",
label = "Update the first tabset",
min = 1,
max = 6,
value = 2
)
),
footer = bs4DashFooter(),
body = bs4Dash::bs4DashBody(
shiny::tags$head(
# favicon
htmltools::tags$link(
rel = "icon",
type = "image/x-icon",
href = "www/images/favicons/favicon.ico"
),
# styles
shiny::tags$link(rel = "stylesheet", type = "text/css", href = "styles/css/custom.css")
)
),
options = list(
sidebarExpandOnHover = TRUE
),
fullscreen = TRUE,
help = TRUE,
dark = FALSE,
scrollToTop = TRUE#,
# freshTheme = app_ui_theme(),
# preloader = app_ui_preloader(),
# body = app_body(),
# controlbar = app_controlbar(),
# footer = app_footer()
)
}
17 changes: 17 additions & 0 deletions R/db_connect.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
db_connect <- function(
db_config = config::get("db"),
host = NULL,
port = NULL,
dbname = NULL,
user = NULL,
password = NULL,
url = NULL,
sslmode = NULL,
pool = FALSE,
...
) {




}
34 changes: 34 additions & 0 deletions R/entrata_api_properties.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# ------------------------------------------------------------------------
#
# Title : Entrata Properties Endpoint Requests
# By : Jimmy Briggs
# Date : 2024-08-17
#
# ------------------------------------------------------------------------


# internal ----------------------------------------------------------------




# exportetd ---------------------------------------------------------------

entrata_api_request_properties <- function(
property_ids = c(NULL),
property_lookup_codes = NULL,
show_all_status = FALSE,
...
) {


# validate parameters -----------------------------------------------------
prop_ids <- if (is.null(property_ids)) {
paste()
}




}
21 changes: 20 additions & 1 deletion R/entrata_api_request.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#'
#' @keywords internal
#'
#' @noRd
#'
#' @importFrom httr2 resp_body_json
#' @importFrom purrr pluck
#' @importFrom glue glue
Expand Down Expand Up @@ -51,6 +53,8 @@
#'
#' @keywords internal
#'
#' @noRd
#'
#' @importFrom purrr pluck_exists
#' @importFrom httr2 resp_body_json
.err_func <- function(resp) {
Expand All @@ -61,6 +65,21 @@
return(FALSE)
}

#' Should Retry
#'
#' @description
#' Function to determine if a request should be retried.
#'
#' @param resp [httr2::response()] object
#'
#' @return Logical value indicating whether the request should be retried.
#'
#' @keywords internal
#'
#' @noRd
#'
#' @importFrom httr2 resp_body_json
#' @importFrom purrr pluck
.should_retry <- function(resp) {
retry_codes <- c(401, 403, 429, 500, 501, 502, 503, 504)
resp_body <- httr2::resp_body_json(resp)
Expand All @@ -71,7 +90,7 @@

# exported ----------------------------------------------------------------

#' Entrtata API Request
#' Entrata API Request
#'
#' @description
#' This function sends an `HTTP` request to the Entrata API.
Expand Down
86 changes: 86 additions & 0 deletions R/mod_footer.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# app_ui_footer <- function() {
#
# left_content <- htmltools::tags$div(
# class = "container",
# htmltools::tags$div(
# class = "row",
# htmltools::tags$div(
# class = "col-md-8 col-sm-6 col-xs-12",
# htmltools::tags$p(
# class = "left-footer-content",
# "Developed and Maintained by ",
# htmltools::tags$a(
# href = "https://website.noclocks.dev",
# target = "_blank",
# "No Clocks, LLC"
# ),
# "&nbsp;|&nbsp;&copy; 2024."
# )
# )
# )
# )
#
# right_content <- htmltools::tags$div(
# class="col-md-4 col-sm-6 col-xs-12",
# htmltools::tags$ul(
# class = "social-icons",
# htmltools::tags$li(
# htmltools::tags$a(
# href = "https://github.com/noclocks",
# target = "_blank",
# htmltools::tags$i(
# class = "fab fa-github"
# )
# )
# ),
# htmltools::tags$li(
# htmltools::tags$a(
# href = "https://twitter.com/noclocksdev",
# target = "_blank",
# htmltools::tags$i(
# class = "fab fa-twitter"
# )
# )
# ),
# htmltools::tags$li(
# htmltools::tags$a(
# href = "https://www.linkedin.com/company/noclocks",
# target = "_blank",
# htmltools::tags$i(
# class = "fab fa-linkedin"
# )
# )
# )
# )
# )
#
# htmltools::tags$footer(
# class = "site-footer",
# htmltools::tags$div(
# class = "container",
# htmltools::tags$hr(),
# htmltools::tags$div(
# class = "row",
# left_content,
# right_content
# )
# )
# )
# }
#
# # footer_left <- htmltools::tags$footer(
# # id = "noclocks-footer",
# # class = "main-footer",
# # htmltools::tags$div(
# # class = "float-right d-none d-sm-inline",
# # htmltools::tags$strong("Version"),
# # utils::packageVersion("gmhleasr")
# # ),
# # )
# # )
# #
# # bs4Dash::bs4DashFooter(
# #
# # )
# #
# # }
Loading

0 comments on commit e4d49aa

Please sign in to comment.