Skip to content

Commit

Permalink
hotfix: fix footer
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig committed Nov 13, 2024
1 parent 30e7f62 commit e82374c
Show file tree
Hide file tree
Showing 29 changed files with 98 additions and 83 deletions.
20 changes: 5 additions & 15 deletions R/mod_footer.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ mod_footer_ui <- function(
id = NULL,
align = "center",
class = "footer",
app_info = gmhdatahub::app_info,
client_info = client_info,
developer_info = developer_info,
app_info = getFromNamespace("app_info", envir = rlang::pkg_env("gmhdatahub")),
client_info = getFromNamespace("client_info", envir = rlang::pkg_env("gmhdatahub")),
developer_info = getFromNamespace("developer_info", envir = rlang::pkg_env("gmhdatahub")),
copyright_holder = "No Clocks, LLC",
year = format(Sys.Date(), "%Y"),
...
Expand All @@ -114,15 +114,6 @@ mod_footer_ui <- function(
stop("The 'www' directory was not found in the 'gmhdatahub' package.")
}

# Include the CSS file from the package's 'www' directory
css_file <- system.file("www/styles/css/footer.css", package = "gmhdatahub")
if (file.exists(css_file)) {
css_content <- shiny::includeCSS(css_file)
} else {
warning("CSS file 'footer.css' not found in the 'gmhdatahub' package.")
css_content <- NULL
}

# Set default copyright holder if not provided
if (is.null(copyright_holder)) {
copyright_holder <- developer_info$name
Expand All @@ -137,12 +128,11 @@ mod_footer_ui <- function(
developer_info$symbol <- validate_image(developer_info$symbol)

# Entrata
entrata_info <- .entrata_info
entrata_info <- getFromNamespace("entrata_info", envir = rlang::pkg_env("gmhdatahub"))
entrata_info$logo <- validate_image(entrata_info$logo)

bslib::card_footer(
class = class,
css_content,
htmltools::tags$footer(
style = paste0("text-align: ", align, ";"),
htmltools::tags$hr(),
Expand Down Expand Up @@ -383,7 +373,7 @@ validate_image <- function(img_path) {
return(img_path)
} else {
warning(paste("Image not found:", img_path, "- using placeholder image."))
return("www/img/placeholders/default-image.png")
return("www/images/shared/placeholders/default-image.png")
}
}

Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
44 changes: 22 additions & 22 deletions data-raw/assets.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

files <- fs::dir_ls("inst/www", recurse = TRUE, type = "file")

img_files <- fs::dir_ls("inst/www/img", recurse = TRUE, type = "file")
img_files <- fs::dir_ls("inst/www/images", recurse = TRUE, type = "file")
style_files <- fs::dir_ls("inst/www/styles", recurse = TRUE, type = "file")
js_files <- fs::dir_ls("inst/www/scripts", recurse = TRUE, type = "file")
font_files <- fs::dir_ls("inst/www/fonts", recurse = TRUE, type = "file")
Expand All @@ -35,18 +35,18 @@ registry <- list(
noclocks = list(
logos = list(
primary = list(
default = "noclocks/logos/logo.svg",
dark = "noclocks/logos/logo-dark.svg",
light = "noclocks/logos/logo-light.svg"
default = "noclocks/logos/noclocks-logo-black.svg",
dark = "noclocks/logos/noclocks-logo-white.svg",
light = "noclocks/logos/noclocks-logo-black.svg"
)
)
),
entrata = list(
logos = list(
primary = list(
default = "entrata/logos/logo.svg",
dark = "entrata/logos/logo-dark.svg",
light = "entrata/logos/logo-light.svg"
default = "entrata/logos/entrata-logo-square-red.svg",
dark = "entrata/logos/entrata-logo-dark.svg",
light = "entrata/logos/entrata-logo-light.svg"
)
)
),
Expand All @@ -71,31 +71,31 @@ registry <- list(
favicon = "shared/favicons/favicon.ico"
)
)
)
),
images = list(
entrata = list(
banner = "img/entrata/entrata-banner.jpeg",
banner = "images/entrata/entrata-banner.jpeg",
logo = list(
dark = "img/entrata/entrata-logo-dark.png",
light = "img/entrata/entrata-logo-light.png",
square = "img/entrata/entrata-logo-square-red.jpg",
white = "img/entrata/entrata-logo-white.svg",
default = "img/entrata/entrata.png"
dark = "images/entrata/entrata-logo-dark.png",
light = "images/entrata/entrata-logo-light.png",
square = "images/entrata/entrata-logo-square-red.jpg",
white = "images/entrata/entrata-logo-white.svg",
default = "images/entrata/entrata.png"
)
),
icons = list(
app = "img/icons/app-icon.webp",
gmh = "img/icons/gmh-icon.png",
noclocks = "img/icons/noclocks-icon-circular.png"
app = "images/icons/app-icon.webp",
gmh = "images/icons/gmh-icon.png",
noclocks = "images/icons/noclocks-icon-circular.png"
),
logos = list(
app = "img/logos/app-logo.svg",
entrata = "img/logos/entrata-logo.png",
gmh = "img/logos/gmh-logo.svg",
noclocks = "img/logos/noclocks-logo.svg"
app = "images/logos/app-logo.svg",
entrata = "images/logos/entrata-logo.png",
gmh = "images/logos/gmh-logo.svg",
noclocks = "images/logos/noclocks-logo.svg"
),
placeholders = list(
default = "img/placeholders/default-image.png"
default = "images/placeholders/default-image.png"
)
),
scripts = list(
Expand Down
25 changes: 16 additions & 9 deletions data-raw/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
app_info <- list(
name = "GMH Data Hub",
version = "1.0",
logo = "www/img/logos/app-logo.svg",
symbol = "www/img/icons/app-icon.webp",
logo = "www/images/shared/app/logos/app-logo.svg",
symbol = "www/images/shared/app/icons/app-icon.webp",
repo_url = "https://github.com/noclocks/gmhdatahub",
docs_url = "https://docs.noclocks.dev/gmhdatahub"
)
Expand All @@ -40,33 +40,40 @@ app_info <- list(
client_info <- list(
name = "GMH Communities",
url = "https://gmhcommunities.com",
logo = "www/img/logos/gmh-logo.svg",
symbol = "www/img/icons/gmh-icon.png"
logo = "www/images/gmh/logos/gmh-logo.svg",
symbol = "www/images/gmh/icons/gmh-icon.png"
)

# noclocks_info -----------------------------------------------------------

developer_info <- list(
name = "No Clocks, LLC",
url = "https://noclocks.dev",
logo = "www/img/logos/noclocks-logo.svg",
symbol = "www/img/icons/noclocks-icon-circular.png"
logo = "www/images/noclocks/logos/noclocks-logo-black.svg",
symbol = "www/images/noclocks/icons/noclocks-icon-circular.png"
)

# entrata_info ------------------------------------------------------------

entrata_info <- list(
name = "Entrata",
url = "https://gmhcommunities.entrata.com/api/v1/documentation",
logo = "www/img/logos/entrata-logo.png",
logo = "www/images/entrata/logos/entrata-logo-light.png",
symbol = NULL
)

# input_choices -------------------------------------------------------------

portfolios <- readr::read_csv("data-raw/working/investment_partners.csv")
portfolio_choices <- portfolios$investment_partner

properties <- readr::read_csv("data-raw/working/properties_ids_names.csv")
property_choices <- properties$property_id
names(property_choices) <- properties$entrata_name

app_choices <- list(
portfolios = c("All", "CBRE"),
properties = c()
portfolios = portfolio_choices,
properties = property_choices
)

usethis::use_data(
Expand Down
21 changes: 21 additions & 0 deletions data-raw/working/properties_ids_names.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
property_id,entrata_id,property_name,entrata_name
739076,739076,Campustown 1008 S. 4th,1008 S. 4th
739085,739085,1047 Commonwealth Avenue,1047 Commonwealth Avenue
739079,739079,Campustown 307 E. Daniel,307 E. Daniel
739080,739080,Campustown 501 S. 6th,501 S. 6th
739084,739084,Campustown 908 S. 1st,908 S. 1st
641240,641240,Academy 65,Academy 65
676055,676055,Academy Lincoln,Academy Lincoln
1115679,1115679,ANOVA uCity Square,ANOVA uCity Square
1161867,1161867,NA,Courts at Spring Mill Station
518044,518044,Shortbread Lofts,Shortbread Lofts
952515,952515,SOVA,SOVA
577897,577897,Station Nine,Station Nine
518041,518041,The Academy at Frisco,The Academy at Frisco
518042,518042,The Academy on Charles,The Academy on Charles
1197886,1197886,The Caswell at Runnymeade,The Caswell at Runnymeade
833617,833617,The Dean Campustown,The Dean Campustown
1197887,1197887,The Dean Reno,The Dean Reno
518046,518046,The Rise at Northgate,The Rise at Northgate
1143679,1143679,Torre,Torre
1311849,1311849,The Venue at North Campus,Venue at North Campus
Binary file removed data/app_choices.rda
Binary file not shown.
Binary file removed data/app_info.rda
Binary file not shown.
Binary file removed data/client_info.rda
Binary file not shown.
Binary file removed data/developer_info.rda
Binary file not shown.
Binary file removed data/entrata_default_methods_tbl.rda
Binary file not shown.
Binary file removed data/entrata_endpoints.rda
Binary file not shown.
Binary file removed data/entrata_info.rda
Binary file not shown.
Binary file removed data/entrata_method_versions.rda
Binary file not shown.
Binary file removed data/entrata_methods_tbl.rda
Binary file not shown.
Binary file removed data/entrata_params_tbl.rda
Binary file not shown.
Binary file removed data/entrata_used_methods_tbl.rda
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes
8 changes: 8 additions & 0 deletions inst/www/images/noclocks/logos/noclocks-logo-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions inst/www/images/noclocks/logos/noclocks-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion inst/www/img/.gitignore

This file was deleted.

Binary file removed inst/www/img/entrata/entrata-logo-dark.png
Binary file not shown.
Binary file removed inst/www/img/entrata/entrata-logo-light.png
Binary file not shown.
Binary file removed inst/www/img/entrata/entrata-logo-square-red.jpg
Binary file not shown.
15 changes: 0 additions & 15 deletions inst/www/img/entrata/entrata-logo-white.svg

This file was deleted.

Binary file removed inst/www/img/entrata/entrata.png
Binary file not shown.
30 changes: 15 additions & 15 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@

library(httr2, warn.conflicts = FALSE)
library(httptest2, warn.conflicts = FALSE)
library(withr, warn.conflicts = FALSE)
# library(withr, warn.conflicts = FALSE)

Sys.setlocale("LC_COLLATE", "C")

options(warn = 1)

test_config <- list(
username = "testuser",
password = "testpass",
base_url = "https://api.entrata.com"
)
# test_config <- list(
# username = "testuser",
# password = "testpass",
# base_url = "https://api.entrata.com"
# )

test_prop_ids <- c(
"739084",
Expand All @@ -34,12 +34,12 @@ test_prop_ids <- c(
"1311849"
)

if (is_github()) {
withr::defer(
{
file.remove(cfg_decrypted)
Sys.unsetenv("R_CONFIG_FILE")
},
testthat::teardown_env()
)
}
# if (is_github()) {
# withr::defer(
# {
# file.remove(cfg_decrypted)
# Sys.unsetenv("R_CONFIG_FILE")
# },
# testthat::teardown_env()
# )
# }
Loading

0 comments on commit e82374c

Please sign in to comment.