Skip to content

Commit

Permalink
Update tests and global vars
Browse files Browse the repository at this point in the history
  • Loading branch information
skvrnami committed May 18, 2024
1 parent 84e005c commit a9ca8ae
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 12 deletions.
4 changes: 2 additions & 2 deletions R/mod_about.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
mod_about_ui <- function(id) {
ns <- NS(id)
# Citation info ----
rql_citation <- citation("requal")
rql_citation <- utils::citation("requal")
# Extract authors
authors <- sapply(as.character(rql_citation$author), function(x) strsplit(x, " ")) # Split the author names into first and last names
# Format the authors as "Last name, Initial."
Expand Down Expand Up @@ -68,7 +68,7 @@ mod_about_ui <- function(id) {
p("To cite package", tags$code("requal"), "in publications use:"),
HTML(apa_citation), p(),
p("A BibTeX entry for LaTeX users:"),
tags$pre(paste(toBibtex(citation("requal")), collapse = "\n"))
tags$pre(paste(utils::toBibtex(utils::citation("requal")), collapse = "\n"))
)
}

Expand Down
4 changes: 2 additions & 2 deletions R/mod_codebook.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ mod_codebook_server <- function(id, glob) {

output$export_codebook <- downloadHandler(
filename = function() {
"requal_codebook_export.csv"
"requal_codebook.csv"
},
content = function(file) {
codebook <- get_codebook_export_table(glob)
write.csv(codebook, file)
utils::write.csv(codebook, file)
}
)

Expand Down
2 changes: 1 addition & 1 deletion R/mod_memo.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ mod_memo_server <- function(id, glob) {
},
content = function(file) {
memos <- export_memos(glob$pool, glob$active_project)
write.csv(memos, file)
utils::write.csv(memos, file)
}
)

Expand Down
2 changes: 2 additions & 0 deletions R/mod_memo_utils_memo.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
utils::globalVariables(c("memo_title"))

# list existing memos ------
list_memo_records <- function(pool, project) {
dplyr::tbl(pool, "memos") %>%
Expand Down
2 changes: 2 additions & 0 deletions R/mod_project.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
utils::globalVariables(c("project_description"))

#' project UI Function
#'
#' @description A shiny Module.
Expand Down
4 changes: 2 additions & 2 deletions R/mod_user_manager.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ mod_user_manager_server <- function(id, glob) {

modified_permissions_df <- loc$users_permissions_df %>%
dplyr::filter(user_id %in% input$members_permissions) %>%
dplyr::mutate(across(matches("modify|view"), .fns = function(x) {
dplyr::mutate(dplyr::across(dplyr::matches("modify|view"), .fns = function(x) {
x <- 0 # reset permissions
})) %>%
dplyr::mutate(across(all_of(input$permissions_list), .fns = function(x) {
dplyr::mutate(dplyr::across(dplyr::all_of(input$permissions_list), .fns = function(x) {
x <- 1 # apply new permissions
}))

Expand Down
2 changes: 1 addition & 1 deletion R/mod_user_manager_utils_user_manager.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
utils::globalVariables(c("user", "user_mail", "value_old"))
utils::globalVariables(c("user", "user_mail", "value_old", "user_login"))

# disabled_checkbox <- function(inputId, label, value = FALSE, width = NULL){
# value <- shiny::restoreInput(id = inputId, default = value)
Expand Down
2 changes: 1 addition & 1 deletion R/mod_user_utils_user.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ permission_button <- function(class, color, title) {

transform_user_table <- function(user_table) {
user_table %>%
dplyr::mutate(across(-c(user_id, created_at, user_mail, user_name, user_login),
dplyr::mutate(dplyr::across(-c(user_id, created_at, user_mail, user_name, user_login),
.fn = function(x) {
dplyr::case_when(
x == 1 & stringr::str_detect(dplyr::cur_column(), "other_modify") ~ permission_button("fas fa-users", "black", "Can modify others"),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ website](https://requal.fsv.cuni.cz/).
> de-identification. This will allow you to perform de-identification
> locally and collaboratively analyze the de-identified dataset online.
## Acknowledgement
## Acknowledgment

The application development has been supported by The Technology Agency
of the Czech Republic, project n. TL05000054, and CLS INFRA Fellowship
Expand Down
22 changes: 21 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
Acknowledgement
CLS
CMD
Coelostegus
DESC
DEV
GDPR
Lifecycle
Reproducibility
Programme
RQDA
TLS
Thuringothyris
UI
caselinkage
codebook
codebooks
codecat
colours
de
freecode
golem
magrittr
md
reproducibility
shinymanager
shinytest
2 changes: 1 addition & 1 deletion inst/test_app/tests/testthat/_snaps/app-create-codes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# {shinytest2} testing create codebook

"requal_codebook_export.csv"
"requal_codebook.csv"

Binary file modified tests/test_basic.requal
Binary file not shown.
1 change: 1 addition & 0 deletions tests/testthat/test-inst-app.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ test_that("test_app works", {
# Don't run these tests on the CRAN build servers
skip_on_cran()
skip_on_ci()
# skip_if_not(interactive())

appdir <- system.file("test_app", package = "requal")
test_app(appdir, check_setup = FALSE)
Expand Down

0 comments on commit a9ca8ae

Please sign in to comment.