Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade {fontawesome} #400

Merged
merged 5 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/R-CMD-check-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,4 @@ jobs:
use-public-rspm: true
extra-packages: rcmdcheck


# install packages needed
- name: install required fontawesome version
run: Rscript -e "remotes::install_version('fontawesome', version = '0.3.0', repos = 'http://cran.us.r-project.org')"

- uses: r-lib/actions/check-r-package@v2
6 changes: 1 addition & 5 deletions .github/workflows/R-CMD-check-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,5 @@ jobs:
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
extra-packages: rcmdcheck

# install packages needed
- name: install required fontawesome version
run: Rscript -e "remotes::install_version('fontawesome', version = '0.3.0', repos = 'http://cran.us.r-project.org')"


- uses: r-lib/actions/check-r-package@v2
4 changes: 0 additions & 4 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ jobs:
with:
extra-packages: covr

# install packages needed
- name: Install required fontawesome version
run: Rscript -e "remotes::install_version('fontawesome', version = '0.3.0', repos = 'http://cran.us.r-project.org')"

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Imports:
shinyWidgets,
stringr
Suggests:
fontawesome,
knitr,
rstudioapi,
shinytest2,
Expand Down
15 changes: 6 additions & 9 deletions R/mod_downloadHandler.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,17 @@ mod_downloadHandler_server <- function(id, pkgs, user, metric_weights){
my_tempdir <- tempdir()
if (input$report_format == "html") {

# TODO: Remove temporary warning once bug in fa v0.4.0 is fixed.
# https://github.com/rstudio/fontawesome/issues/99
# Here, we make sure user has a functional version of fontawesome
fa_v <- packageVersion("fontawesome")
if(fa_v != '0.3.0') {
msg1 <- "HTML reports require {fontawesome} v0.3.0 to render."
msg2 <- glue::glue("You currently have v{fa_v} installed. If the report download failed, please install correct version using code:")
code <- "remotes::install_version('fontawesome', version = '0.3.0', repos = 'http://cran.us.r-project.org')"
warning(paste(msg1, msg2, code))
if(fa_v == '0.4.0') {
msg1 <- "HTML reports will not render with {fontawesome} v0.4.0."
msg2 <- glue::glue("You currently have v{fa_v} installed. If the report download failed, please install a stable version. We recommend v0.5.0 or higher.")
warning(paste(msg1, msg2))
showModal(modalDialog(
size = "l",
title = h3("HTML report requires {fontawesome} v0.3.0", class = "mb-0 mt-0 txt-color"),
h5(msg2),
wellPanel(code)
title = h3(msg1, class = "mb-0 mt-0 txt-color"),
h5(msg2)
))
}

Expand Down
5 changes: 2 additions & 3 deletions R/run_app.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ run_app <- function(
if(is.null(assessment_db_name)) assessment_db_name <- "database.sqlite"
if(is.null(credentials_db_name)) credentials_db_name <- "credentials.sqlite"
if(is.null(login_note)) {
# TODO: Remove temporary warning once bug in fa v0.4.0 is fixed.
# https://github.com/rstudio/fontawesome/issues/99
# Here, we make sure user has a functional version of fontawesome
fa_v <- packageVersion("fontawesome") #TODO: Remove once bug is fixed
if(!file.exists(credentials_db_name)) {
login_note <- HTML('<em>Note:</em> To log in for the first time, use the admin user:
<u>admin</u> with password <u>QWERTY1</u>.')
} else if(fa_v != '0.3.0') { #TODO: Remove once bug is fixed
login_note <- HTML(glue::glue("<em>Note:</em> HTML reports may require fontawesome v0.3.0 to render. You currently have v{fa_v} installed. If the report download fails, please run: `remotes::install_version('fontawesome', version = '0.3.0', repos = 'http://cran.us.r-project.org')`"))
} else if(fa_v == '0.4.0') { #TODO: Remove once bug is fixed
login_note <- HTML(glue::glue("<em>Note:</em> HTML reports will not render with {fontawesome} v0.4.0. You currently have v{fa_v} installed. If the report download fails, please install a more stable version. We recommend v.0.5.0 or higher."))
}
}

Expand Down
3 changes: 1 addition & 2 deletions R/utils_startup.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ initialize_raa <- function(assess_db, cred_db) {
# Start logging info.
if (isRunning()) loggit::set_logfile("loggit.json")

# TODO: Remove temporary warning once bug in fa v0.4.0 is fixed.
# https://github.com/rstudio/fontawesome/issues/99
# Here, we make sure user has a functional version of fontawesome
fa_v <- packageVersion("fontawesome")
if(fa_v != '0.3.0') warning(glue::glue("HTML reports may require fontawesome 0.3.0 to render. You currently have v{fa_v} installed. If the report download failed, please install correct version using code: remotes::install_version('fontawesome', version = '0.3.0', repos = 'http://cran.us.r-project.org')"))
if(fa_v == '0.3.0') warning(glue::glue("HTML reports will not render with {fontawesome} v0.4.0. You currently have v{fa_v} installed. If the report download failed, please install a stable version. We recommend v0.5.0 or higher."))

# TODO: Erase when pushing to master
if (!get_golem_config("app_prod") && !is.null(golem::get_golem_options('pre_auth_user')) && !file.exists(credentials_db)) create_credentials_dev_db(credentials_db)
Expand Down
1 change: 1 addition & 0 deletions dev/02_dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ usethis::use_mit_license()
# # usethis::use_package("data.table")
# usethis::use_package("gt")
# # usethis::use_package("shinyBS")
usethis::use_package("fontawesome", type = "Suggests")
# usethis::use_package("knitr", type = "Suggests")
# usethis::use_package("tinytex", type = "Suggests")
# usethis::use_package("pkgdown", type = "Suggests")#, min_version = "1.6.1")
Expand Down
32 changes: 16 additions & 16 deletions renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.1.2",
"Version": "4.2.2",
"Repositories": [
{
"Name": "CRAN",
Expand Down Expand Up @@ -337,7 +337,7 @@
"RemoteUsername": "thinkr-open",
"RemoteRef": "HEAD",
"RemoteSha": "d2e4fcada1b094d7af06324f6c54301c7586ffee",
"Hash": "694eebe322e5cbdf101c152ad0a67d28",
"Hash": "8d87a3819d6169dbcbcf236c16a84c89",
"Requirements": [
"cli",
"desc",
Expand Down Expand Up @@ -470,7 +470,7 @@
"RemoteUsername": "r-lib",
"RemoteRef": "HEAD",
"RemoteSha": "7ea4e479bdf780adadd1bd421a5ca23e5f951697",
"Hash": "795b8389734f11481fdcdf9cdde3002f",
"Hash": "9d300343b59a7fa8803429f575874f64",
"Requirements": [
"callr",
"cranlike",
Expand All @@ -487,7 +487,7 @@
"Package": "cranlike",
"Version": "1.0.2",
"Source": "Repository",
"Repository": "CRAN",
"Repository": "RSPM",
"Hash": "2a531c8d1d45799fe2e880708dfc1097",
"Requirements": [
"DBI",
Expand Down Expand Up @@ -586,7 +586,7 @@
"Package": "debugme",
"Version": "1.1.0",
"Source": "Repository",
"Repository": "CRAN",
"Repository": "RSPM",
"Hash": "2d8a9e4f08f3dd669cb8ddd1eb575959",
"Requirements": [
"crayon"
Expand Down Expand Up @@ -751,10 +751,10 @@
},
"fontawesome": {
"Package": "fontawesome",
"Version": "0.2.2",
"Version": "0.5.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "55624ed409e46c5f358b2c060be87f67",
"Repository": "RSPM",
"Hash": "e80750aec5717dedc019ad7ee40e4a7c",
"Requirements": [
"htmltools",
"rlang"
Expand Down Expand Up @@ -888,7 +888,7 @@
"Package": "gmailr",
"Version": "1.0.1",
"Source": "Repository",
"Repository": "CRAN",
"Repository": "RSPM",
"Hash": "185e047cb2392acf320b8bc657a55c92",
"Requirements": [
"base64enc",
Expand Down Expand Up @@ -1652,14 +1652,14 @@
"Package": "revdepcheck",
"Version": "1.0.0.9001",
"Source": "GitHub",
"Remotes": "r-lib/crancache",
"RemoteType": "github",
"Remotes": "r-lib/crancache",
"RemoteHost": "api.github.com",
"RemoteRepo": "revdepcheck",
"RemoteUsername": "r-lib",
"RemoteRef": "HEAD",
"RemoteSha": "73933982d9bb34244902b80fa95d8a5fd965470e",
"Hash": "0840f4cc4619466fe424153d8426c0be",
"Hash": "3c7a98adfcec2ae0b10515a76bbc01dd",
"Requirements": [
"DBI",
"RSQLite",
Expand Down Expand Up @@ -1808,10 +1808,10 @@
},
"rlang": {
"Package": "rlang",
"Version": "1.0.2",
"Version": "1.0.6",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "04884d9a75d778aca22c7154b8333ec9",
"Hash": "4ed1f8336c8d52c3e750adcdc57228a7",
"Requirements": []
},
"rmarkdown": {
Expand Down Expand Up @@ -2458,10 +2458,10 @@
},
"xfun": {
"Package": "xfun",
"Version": "0.31",
"Version": "0.36",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "a318c6f752b8dcfe9fb74d897418ab2b",
"Repository": "RSPM",
"Hash": "f5baec54606751aa53ac9c0e05848ed6",
"Requirements": []
},
"xml2": {
Expand Down