Skip to content
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
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: requal
Title: Shiny Application for Computer-Assisted Qualitative Data Analysis
Version: 1.2.4.9008
Version: 1.2.4.9009
Authors@R:
c(
person(given = "Radim",
Expand Down Expand Up @@ -35,7 +35,7 @@ Imports:
DBI,
dbplyr,
dplyr (>= 1.1.4),
DT,
DT (>= 0.32.1),
fs,
ggplot2,
glue,
Expand All @@ -49,7 +49,7 @@ Imports:
rlang,
RPostgreSQL,
RSQLite,
shiny (>= 1.6.0),
shiny (>= 1.8.1),
shinydashboard,
shinydashboardPlus,
shinyFiles,
Expand Down Expand Up @@ -80,3 +80,4 @@ Language: en-US
URL: https://github.com/RE-QDA/requal
BugReports: https://github.com/RE-QDA/requal/issues
Config/roxygen2/version: 8.0.0
RoxygenNote: 7.3.2
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- more metadata included in displayed transcripts
- Contextual help
- functionality to display contextual help
- Codes-Documents summary
- improved table with export option
- Fixed bugs
- foreign keys now enforced in SQLite
- default document encoding is now processed explicitly
Expand Down
6 changes: 5 additions & 1 deletion R/mod_codebook.R
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,11 @@ mod_codebook_server <- function(id, glob) {

output$export_codebook <- downloadHandler(
filename = function() {
"requal_codebook.csv"
paste0(
"requal_codebook-",
format(Sys.time(), "%Y-%m-%d-%H%M%S"),
".csv"
)
},
content = function(file) {
codebook <- get_codebook_export_table(glob)
Expand Down
10 changes: 7 additions & 3 deletions R/mod_codebook_import.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ mod_codebook_import_server <- function(id, glob) {
title = "Specify imported codes",
create_column_selectors(),
"Preview",
DT::dataTableOutput(ns("preview")),
DT::DTOutput(ns("preview")),
footer = tagList(
modalButton("Cancel"),
shinyjs::disabled(actionButton(ns("confirm"), "Confirm"))
Expand Down Expand Up @@ -222,8 +222,12 @@ convert_to_rgb <- function(color) {
return(paste0("rgb(", paste(color, collapse = ", "), ")"))
}

if(color %in% grDevices::colors()){
return(paste0("rgb(", paste0(grDevices::col2rgb(color)[, 1], collapse = ", "), ")"))
if (color %in% grDevices::colors()) {
return(paste0(
"rgb(",
paste0(grDevices::col2rgb(color)[, 1], collapse = ", "),
")"
))
}

# Ensure color is a character string for regex operations
Expand Down
6 changes: 5 additions & 1 deletion R/mod_csv_handler.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ mod_download_csv_server <- function(id, glob) {

observeEvent(glob$segments_df, {
output$download_analysis <- handle_download(
paste0("requal_export-", format(Sys.time(), "%Y-%m-%d-%H%M%S"), ".csv"),
paste0(
"requal_segments-",
format(Sys.time(), "%Y-%m-%d-%H%M%S"),
".csv"
),
glob$segments_df
)
})
Expand Down
4 changes: 2 additions & 2 deletions R/mod_memo.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mod_memo_ui <- function(id) {
hr(),
fluidRow(
style = "margin-left: 30px;",
div(style = "width: 60vw;", DT::dataTableOutput(ns("memo")))
div(style = "width: 60vw;", DT::DTOutput(ns("memo")))
)
)
}
Expand Down Expand Up @@ -84,7 +84,7 @@ mod_memo_server <- function(id, glob) {
input$reload_memo_table
),
{
output$memo <- DT::renderDataTable({
output$memo <- DT::renderDT({
req(glob$active_project)
memo_table <- list_memo_records(glob$pool, glob$active_project)
if (glob$user$data$memo_other_view == 0) {
Expand Down
52 changes: 31 additions & 21 deletions R/mod_memo_free.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ mod_memo_free_ui <- function(id) {
ns <- NS(id)
div(
tags$b("Free memo"),
shinyjs::hidden(div(id = ns("free_memo_div"),
shinyjs::hidden(div(
id = ns("free_memo_div"),
mod_memo_editor_ui(ns("memo_free_editor"))
)),
hr(),
DT::dataTableOutput(ns("memo"))
DT::DTOutput(ns("memo"))
)
}

Expand All @@ -29,46 +30,55 @@ mod_memo_free_server <- function(id, glob) {
glob$free_memo_observer <- 0
mod_memo_editor_server("memo_free_editor", glob, type = "free_memo")
observeEvent(req(glob$active_project), {
glob$free_memo_observer <- glob$free_memo_observer + 1
shinyjs::show("free_memo_div")
glob$free_memo_observer <- glob$free_memo_observer + 1
shinyjs::show("free_memo_div")
})

output$memo <- DT::renderDataTable({loc$memos_table})
output$memo <- DT::renderDT({
loc$memos_table
})

## Observe free_memo_edit_click ----
observeEvent(req(input$text_memo_click), {
req(glob$free_memo_observer > 0)
golem::invoke_js("updateEditorInput",
list(ns_memo_id = paste0(ns("memo_free_editor"), "-memo_id"),
id = parse_memo_id(input$text_memo_click)))
golem::invoke_js("resetMemoClick",
list(ns_text_memo_click = ns("text_memo_click")))
golem::invoke_js(
"updateEditorInput",
list(
ns_memo_id = paste0(ns("memo_free_editor"), "-memo_id"),
id = parse_memo_id(input$text_memo_click)
)
)
golem::invoke_js(
"resetMemoClick",
list(ns_text_memo_click = ns("text_memo_click"))
)
})

observeEvent(glob$free_memo_observer, {
req(glob$free_memo_observer > 0)
loc$visible_memos <- list_memo_records(glob$pool, glob$active_project)
if(glob$user$data$memo_other_view == 0 && nrow(loc$visible_memos) > 0){
loc$visible_memos <- loc$visible_memos %>%
dplyr::filter(user_id == glob$user$user_id)
}
if (glob$user$data$memo_other_view == 0 && nrow(loc$visible_memos) > 0) {
loc$visible_memos <- loc$visible_memos %>%
dplyr::filter(user_id == glob$user$user_id)
}
memos_segments_map_vec <- dplyr::tbl(glob$pool, "memos_segments_map") %>%
dplyr::pull(memo_id)
dplyr::pull(memo_id)

loc$memos_table <- DT::datatable(loc$visible_memos %>%
dplyr::filter(!memo_id %in% memos_segments_map_vec) %>% # filter for free memos
loc$memos_table <- DT::datatable(
loc$visible_memos %>%
dplyr::filter(!memo_id %in% memos_segments_map_vec) %>% # filter for free memos
dplyr::arrange(dplyr::desc(memo_id)) %>%
dplyr::mutate(memo_name = memo_link(ns("text_memo_click"), memo_id, memo_name)) %>%
dplyr::mutate(
memo_name = memo_link(ns("text_memo_click"), memo_id, memo_name)
) %>%
dplyr::select(memo_name),
options = memo_table_options(),
class = "compact free_memo_table",
escape = FALSE,
rownames = FALSE,
colnames = NULL,
selection = "none"
)

)
})

})
}
Loading
Loading