Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/noclocks/gmhleasr into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
jimbrig committed Aug 28, 2024
2 parents a193309 + 67c456c commit 18f1d70
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 63 deletions.
5 changes: 1 addition & 4 deletions R/utils_css.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : CSS Utilities
Expand Down Expand Up @@ -29,7 +28,6 @@
#' @importFrom glue glue
#' @importFrom shiny isolate
verify_css <- function(selector, css) {

css_props <- jsonlite::toJSON(css, auto_unbox = TRUE)

js <- glue::glue("
Expand All @@ -51,8 +49,7 @@ verify_css <- function(selector, css) {
}}
}}
return true;
}})();"
)
}})();")

result <- shiny::isolate(shinyjs::runjs(js))

Expand Down
12 changes: 2 additions & 10 deletions R/utils_html.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : HTML Utilities
Expand Down Expand Up @@ -44,12 +43,11 @@ centered <- function(...) {
#' @importFrom htmltools tags HTML
#' @importFrom shiny icon
help_mark <- function(help_txt) {

htmltools::tagList(
htmltools::tags$head(
htmltools::tags$style(
htmltools::HTML(
".helper {
".helper {
display: inline-block;
position: relative;
margin-left: 0.5em;
Expand Down Expand Up @@ -78,7 +76,7 @@ help_mark <- function(help_txt) {
.helper:hover::after {
display: block;
}"
)
)
)
),
htmltools::tags$div(
Expand All @@ -87,7 +85,6 @@ help_mark <- function(help_txt) {
`data-help` = help_txt
)
)

}

#' @rdname utils_html
Expand All @@ -100,8 +97,3 @@ help_label <- function(label_text, help_text) {
help_mark(help_text)
)
}





1 change: 0 additions & 1 deletion R/utils_js.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : JavaScript Utilities
Expand Down
3 changes: 0 additions & 3 deletions R/utils_reactivity.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : Reactivity Utilities
Expand Down Expand Up @@ -32,7 +31,6 @@
#' # create a reactive trigger
#' trigger <- make_reactive_trigger(dev = TRUE, label = "my_trigger")
make_reactive_trigger <- function(dev = FALSE, label = "") {

rv <- shiny::reactiveValues(a = 0)

list(
Expand All @@ -46,5 +44,4 @@ make_reactive_trigger <- function(dev = FALSE, label = "") {
rv$a <- shiny::isolate(rv$a + 1)
}
)

}
10 changes: 2 additions & 8 deletions R/utils_schemas.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : Schema (JSON/YAML) Utilities
Expand All @@ -9,7 +8,6 @@


write_json_schema <- function(schema, path) {

json <- jsonlite::toJSON(schema, auto_unbox = TRUE) |>
jsonlite::prettify()

Expand All @@ -21,23 +19,19 @@ write_json_schema <- function(schema, path) {
write(json, file = path)

return(invisible(path))

}

yaml_to_json <- function(yaml) {

yaml <- yaml_to_list(yaml)

json <- jsonlite::toJSON(yaml, auto_unbox = TRUE) |>
jsonlite::prettify()

return(json)

}

yaml_to_list <- function(yaml) {

if (!ymlthis:::is_yml(yaml))
if (!ymlthis:::is_yml(yaml)) {
return(yaml)

}
}
1 change: 0 additions & 1 deletion R/utils_text.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : Text Utilities
Expand Down
1 change: 0 additions & 1 deletion R/utils_urls.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : URL Utilities
Expand Down
1 change: 0 additions & 1 deletion data-raw/entrata.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : Entrata Data Preparation
Expand Down
19 changes: 8 additions & 11 deletions data-raw/entrata/entrata_endpoints.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : Entrata Endpoints Data Preparation
Expand Down Expand Up @@ -250,19 +249,17 @@ entrata_api_request_endpoint_methods <- tibble::enframe(
tidyr::unnest(cols = c(method)) |>
dplyr::left_join(
y = tibble::enframe(
important_entrata_request_endpoint_methods,
name = "endpoint",
value = "method"
) |>
tidyr::unnest(cols = c(method)) |>
dplyr::mutate(
important = TRUE
),
important_entrata_request_endpoint_methods,
name = "endpoint",
value = "method"
) |>
tidyr::unnest(cols = c(method)) |>
dplyr::mutate(
important = TRUE
),
by = c("endpoint", "method")
) |>
dplyr::mutate(
important = dplyr::coalesce(important, FALSE)
) |>
dplyr::arrange(dplyr::desc(important))


1 change: 0 additions & 1 deletion data-raw/internal.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : Internal Package Data Preparations
Expand Down
24 changes: 10 additions & 14 deletions data-raw/schemas.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# ------------------------------------------------------------------------
#
# Title : Schemas Data Preparation
Expand All @@ -14,19 +13,16 @@
# db config ---------------------------------------------------------------

db_config_schema <- list(
host = "",
port = 5432,
dbname = "",
user = "",
password = "",
url = "",
sslmode = ""
host = "",
port = 5432,
dbname = "",
user = "",
password = "",
url = "",
sslmode = ""
)

db_config_schema |> jsonlite::toJSON(auto_unbox = TRUE) |>



jsonlite::toJSON(db_config_schema, pretty = TRUE) |>
db_config_schema |>
jsonlite::toJSON(auto_unbox = TRUE) |>
jsonlite::toJSON(db_config_schema, pretty = TRUE) |>
cat(file = "data-raw/meta/schemas/config.db.schema.json")

9 changes: 6 additions & 3 deletions tests/spelling.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
if(requireNamespace('spelling', quietly = TRUE))
spelling::spell_check_test(vignettes = TRUE, error = FALSE,
skip_on_cran = TRUE)
if (requireNamespace("spelling", quietly = TRUE)) {
spelling::spell_check_test(
vignettes = TRUE, error = FALSE,
skip_on_cran = TRUE
)
}
1 change: 0 additions & 1 deletion tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# setup -------------------------------------------------------------------

library(httr2)
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-entrata_request.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

httptest2::with_mock_dir(
dir = "status",
test_that("Can ping API status endpoint", {
Expand All @@ -23,4 +22,3 @@ httptest2::with_mock_api({
expect_equal(res$status_code, 200)
})
})

5 changes: 3 additions & 2 deletions tests/testthat/test-verify_css.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
mock_runjs <- function(js_code) { TRUE }
mock_runjs <- function(js_code) {
TRUE
}

# Tests for verify_css function
test_that("verify_css function works as implemented", {
Expand All @@ -20,4 +22,3 @@ test_that("verify_css function works as implemented", {
verify_css(".helper", list("margin-left" = "2px", "margin-right" = "2px", "color" = "red"))
)
})

0 comments on commit 18f1d70

Please sign in to comment.