Skip to content

Commit

Permalink
Switch to Font Awesome 6 icon names
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Werner committed Jul 28, 2022
1 parent ca8322d commit caf05ea
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion R/fab_button.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fab_button <- function(...,
`data-mfb-label` = label,
class = "mfb-component__button--main action-button",
icon("plus", class = "mfb-component__main-icon--resting"),
icon("times", class = "mfb-component__main-icon--active")
icon("xmark", class = "mfb-component__main-icon--active")
),
tags$ul(
class = "mfb-component__list",
Expand Down
18 changes: 9 additions & 9 deletions R/module-admin.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ admin_ui <- function(id, lan = NULL) {
label = "",
class = "btn-secondary pull-right",
style = "margin-left: 5px",
icon = icon("check-square")
icon = icon("square-check")
),

actionButton(
inputId = ns("edit_selected_users"),
label = lan$get("Edit selected users"),
class = "btn-primary pull-right disabled",
style = "margin-left: 5px",
icon = icon("edit")
icon = icon("pen-to-square")
),

actionButton(
inputId = ns("remove_selected_users"),
label = lan$get("Remove selected users"),
class = "btn-danger pull-right disabled",
icon = icon("trash-alt")
icon = icon("trash-can")
),

tags$br(),
Expand Down Expand Up @@ -90,7 +90,7 @@ admin_ui <- function(id, lan = NULL) {
label = "",
class = "btn-secondary pull-right",
style = "margin-left: 5px",
icon = icon("check-square")
icon = icon("square-check")
),

actionButton(
Expand Down Expand Up @@ -194,8 +194,8 @@ admin <- function(input, output, session, sqlite_path, passphrase, lan,

users <- users()
users <- users[, setdiff(names(users), c("password", "is_hashed_password")), drop = FALSE]
users$Edit <- input_btns(ns("edit_user"), users$user, "Edit user", icon("edit"), status = "primary", lan = lan())
users$Remove <- input_btns(ns("remove_user"), users$user, "Delete user", icon("trash-alt"), status = "danger", lan = lan())
users$Edit <- input_btns(ns("edit_user"), users$user, "Edit user", icon("pen-to-square"), status = "primary", lan = lan())
users$Remove <- input_btns(ns("remove_user"), users$user, "Delete user", icon("trash-can"), status = "danger", lan = lan())
users$Select <- input_checkbox_ui(ns("select_mult_users"), users$user, session = session)
names_lan <- sapply(names(users), function(x) lan()$get(x))
change <- as.logical(users$admin)
Expand Down Expand Up @@ -257,7 +257,7 @@ admin <- function(input, output, session, sqlite_path, passphrase, lan,
}

pwds$`Change password` <- input_btns(ns("change_pwd"), pwds$user, "Ask to change password", icon("key"), status = "primary", lan = lan())
pwds$`Reset password` <- input_btns(ns("reset_pwd"), pwds$user, "Reset password", icon("undo"), status = "warning", lan = lan())
pwds$`Reset password` <- input_btns(ns("reset_pwd"), pwds$user, "Reset password", icon("arrow-rotate-left"), status = "warning", lan = lan())
pwds$Select <- input_checkbox_ui(ns("change_mult_pwds"), pwds$user, session = session)
names_lan <- sapply(names(pwds), function(x) lan()$get(x))
change <- as.logical(pwds$must_change)
Expand Down Expand Up @@ -398,7 +398,7 @@ admin <- function(input, output, session, sqlite_path, passphrase, lan,
ui = tags$div(
id = ns("alert-edituser-exist"),
class = "alert alert-warning",
icon("exclamation-triangle"),
icon("triangle-exclamation"),
lan()$get("User already exist!")
),
immediate = TRUE
Expand Down Expand Up @@ -521,7 +521,7 @@ admin <- function(input, output, session, sqlite_path, passphrase, lan,
ui = tags$div(
id = ns("alert-user-exist"),
class = "alert alert-warning",
icon("exclamation-triangle"),
icon("triangle-exclamation"),
lan()$get("User already exist!")
),
immediate = TRUE
Expand Down
12 changes: 6 additions & 6 deletions R/module-auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ auth_server <- function(input, output, session,
selector = jns("result_auth"),
ui = tags$div(
id = ns("msg_auth"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("Your account is locked")
icon("triangle-exclamation"), lan()$get("Your account is locked")
)
)

Expand All @@ -272,7 +272,7 @@ auth_server <- function(input, output, session,
selector = jns("result_auth"),
ui = tags$div(
id = ns("msg_auth"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("Username or password are incorrect")
icon("triangle-exclamation"), lan()$get("Username or password are incorrect")
)
)
} else if (isTRUE(res_auth$expired)) {
Expand All @@ -281,7 +281,7 @@ auth_server <- function(input, output, session,
selector = jns("result_auth"),
ui = tags$div(
id = ns("msg_auth"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("Your account has expired")
icon("triangle-exclamation"), lan()$get("Your account has expired")
)
)
} else {
Expand All @@ -291,7 +291,7 @@ auth_server <- function(input, output, session,
selector = jns("result_auth"),
ui = tags$div(
id = ns("msg_auth"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("You are not authorized for this application")
icon("triangle-exclamation"), lan()$get("You are not authorized for this application")
)
)
} else {
Expand All @@ -303,15 +303,15 @@ auth_server <- function(input, output, session,
selector = jns("result_auth"),
ui = tags$div(
id = ns("msg_auth"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("Username or password are incorrect")
icon("triangle-exclamation"), lan()$get("Username or password are incorrect")
)
)
} else {
insertUI(
selector = jns("result_auth"),
ui = tags$div(
id = ns("msg_auth"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("Your account is locked")
icon("triangle-exclamation"), lan()$get("Your account is locked")
)
)
}
Expand Down
10 changes: 5 additions & 5 deletions R/module-pwd.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pwd_ui <- function(id, tag_img = NULL, status = "primary", lan = NULL) {
),
tags$span(
class = "help-block",
icon("info-circle"),
icon("circle-info"),
lan$get("Password must contain at least one number, one lowercase, one uppercase and must be at least length 6.")
),
tags$br(),
Expand Down Expand Up @@ -133,15 +133,15 @@ pwd_server <- function(input, output, session, user, update_pwd, validate_pwd =
selector = jns("result_pwd"),
ui = tags$div(
id = ns("msg_pwd"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("The two passwords are different")
icon("triangle-exclamation"), lan()$get("The two passwords are different")
)
)
} else if (!check_new_pwd(user$user, input$pwd_one)) {
insertUI(
selector = jns("result_pwd"),
ui = tags$div(
id = ns("msg_pwd"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("New password cannot be the same as old")
icon("triangle-exclamation"), lan()$get("New password cannot be the same as old")
)
)
} else {
Expand All @@ -150,7 +150,7 @@ pwd_server <- function(input, output, session, user, update_pwd, validate_pwd =
selector = jns("result_pwd"),
ui = tags$div(
id = ns("msg_pwd"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("Password does not respect safety requirements")
icon("triangle-exclamation"), lan()$get("Password does not respect safety requirements")
)
)
} else {
Expand Down Expand Up @@ -179,7 +179,7 @@ pwd_server <- function(input, output, session, user, update_pwd, validate_pwd =
selector = jns("result_pwd"),
ui = tags$div(
id = ns("msg_pwd"), class = "alert alert-danger",
icon("exclamation-triangle"), lan()$get("Failed to update password")
icon("triangle-exclamation"), lan()$get("Failed to update password")
)
)
}
Expand Down
10 changes: 5 additions & 5 deletions R/secure-app.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ secure_app <- function(ui,
actionButton(
inputId = ".shinymanager_logout",
label = lan$get("Logout"),
icon = icon("sign-out-alt")
icon = icon("right-from-bracket")
),
actionButton(
inputId = ".shinymanager_app",
Expand All @@ -91,7 +91,7 @@ secure_app <- function(ui,
shinymanager_where("admin")
),
tabPanel(
title = tagList(icon("home"), lan$get("Home")),
title = tagList(icon("house"), lan$get("Home")),
value = "home",
admin_ui("admin", lan),
shinymanager_language(lan$get_language())
Expand All @@ -109,12 +109,12 @@ secure_app <- function(ui,
actionButton(
inputId = ".shinymanager_logout",
label = lan$get("Logout"),
icon = icon("sign-out-alt")
icon = icon("right-from-bracket")
),
actionButton(
inputId = ".shinymanager_admin",
label = lan$get("Administrator mode"),
icon = icon("cogs")
icon = icon("gears")
)
)
} else {
Expand All @@ -126,7 +126,7 @@ secure_app <- function(ui,
actionButton(
inputId = ".shinymanager_logout",
label = lan$get("Logout"),
icon = icon("sign-out-alt")
icon = icon("right-from-bracket")
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion dev/shiny-classic-sqlite-bookmark/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ credentials <- data.frame(

#conn <- DBI::dbConnect(RSQLite::SQLite(), dbname = "dev/shiny-classic-sqlite/credentials.sqlite")
#read_db_decrypt(conn, passphrase = "supersecret")
#DBI::dbDisconnect(conn)
#DBI::dbDisconnect(conn)
2 changes: 1 addition & 1 deletion dev/shiny-classic-sqlite/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ credentials <- data.frame(

#conn <- DBI::dbConnect(RSQLite::SQLite(), dbname = "dev/shiny-classic-sqlite/credentials.sqlite")
#read_db_decrypt(conn, passphrase = "supersecret")
#DBI::dbDisconnect(conn)
#DBI::dbDisconnect(conn)
2 changes: 1 addition & 1 deletion dev/shinydashboard/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ui <- dashboardPage(
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Widgets", tabName = "widgets", icon = icon("th"))
menuItem("Widgets", tabName = "widgets", icon = icon("table-cells"))
)
),

Expand Down
2 changes: 1 addition & 1 deletion examples/fab_button.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ui <- fluidPage(
actionButton(
inputId = "logout",
label = "Logout",
icon = icon("sign-out")
icon = icon("arrow-right-from-bracket")
),
actionButton(
inputId = "info",
Expand Down
2 changes: 1 addition & 1 deletion inst/demo_app/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ create_db(
credentials_data = credentials,
sqlite_path = "database.sqlite", # elle sera crée
passphrase = "passphrase_wihtout_keyring"
)
)
2 changes: 1 addition & 1 deletion inst/demo_app/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ secure_app(ui,
# ui background ?
# https://developer.mozilla.org/fr/docs/Web/CSS/background
background = "center/20% url('figures/shinymanager.png');"
)
)
2 changes: 1 addition & 1 deletion tests/testthat/test-credentials-db.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ test_that("read_db_decrypt works", {

test_that("create_db duplicated users", {
expect_error(create_db(credentials_data = rbind(credentials, credentials), sqlite_path = tmp_sqlite_error, passphrase = "secret"))
})
})
2 changes: 1 addition & 1 deletion tests/testthat/test-language.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ test_that("other language", {
expect_true(length(l_all) > 0)

expect_error(lan_fr$set_language("bad"))
})
})
2 changes: 1 addition & 1 deletion tests/testthat/test-tokens.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ test_that("token remove", {
expect_true(.tok$is_valid_server(token_not_admin))
expect_silent(.tok$remove(token_not_admin))
expect_false(.tok$is_valid_server(token_not_admin))
})
})

0 comments on commit caf05ea

Please sign in to comment.