Skip to content

Commit 2425766

Browse files
authored
Merge pull request #166 from RE-QDA/advanced-memos-v1
- refactored backend - new features - UI changes - important bug fixes See NEWS.md for more details
2 parents 28ac1ba + 1a3cd09 commit 2425766

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+8967
-3231
lines changed

.Rprofile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
source("renv/activate.R")
2+
options(shiny.port = 6090)
3+
options(tibble.print_max = 100)

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: requal
22
Title: Shiny Application for Computer-Assisted Qualitative Data Analysis
3-
Version: 1.1.5.9001
3+
Version: 1.2.3
44
Authors@R:
55
c(
66
person(given = "Radim",
@@ -34,7 +34,7 @@ Imports:
3434
config (>= 0.3.1),
3535
DBI,
3636
dbplyr,
37-
dplyr,
37+
dplyr (>= 1.1.4),
3838
DT,
3939
fs,
4040
ggplot2,

NEWS.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,26 @@
22

33
- Codebook import
44
- code names, descriptions, and colors can be imported via a CSV file
5+
- Segment memos
6+
- memos can be added to any transcript segment
7+
- UI changes
8+
- new tab for memo overview
9+
- new subtab for segment memos in annotation tab
10+
- selected memos can be pinned to screen
11+
- new universal memo editor
12+
- improved linking between memoed and coded segments and source documents
13+
- more information on codes accessible from the annotation tab
14+
- collapse/expand codes and categories boxes
15+
- Backend changes
16+
- more efficient and straightforward calculation of overlaps
17+
- refactored generation of valid html for transcript
18+
- more metadata included in displayed transcripts
519
- Contextual help
6-
- functionality to display contextual help
20+
- functionality to display contextual help
21+
- Fixed bugs
22+
- foreign keys now enforced in SQLite
23+
- default document encoding is now processed explicitly
24+
- other minor fixes
725

826
# requal 1.1.3 Rieppeleon
927

R/app_server.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ app_server <- function(input, output, session) {
3232

3333
observeEvent(glob$active_project, {
3434
updateControlbar("control_bar")
35-
shinyjs::show(id = "btn-memo")
35+
shinyjs::show(id = "btn-free_memo")
3636
shinyjs::show(selector = "div.tab-content")
3737
glob$users_observer <- 0
3838
glob$segments_observer <- 0
@@ -51,7 +51,7 @@ app_server <- function(input, output, session) {
5151
mod_data_server("data_1", glob)
5252

5353
# attributes ----
54-
mod_attributes_server("attributes_1", glob)
54+
mod_attributes_server("attributes_ui_1", glob)
5555

5656
# codebook ----
5757
# output: glob$codebook
@@ -77,6 +77,8 @@ app_server <- function(input, output, session) {
7777

7878
# memo
7979
mod_memo_server("memo_ui_1", glob)
80+
## free memo
81+
mod_memo_free_server("free_memo_ui_1", glob)
8082

8183
# show admin interface
8284
observeEvent(glob$user$is_admin, {
@@ -90,10 +92,9 @@ app_server <- function(input, output, session) {
9092
updateTabsetPanel(session, "tab_menu", input$analyze_link$tab_menu)
9193
glob$analyze_link <- list(
9294
doc_id = input$analyze_link$doc_id,
93-
segment_start = input$analyze_link$segment_start
95+
segment_id = input$analyze_link$segment_id
9496
)
9597
})
96-
9798
# Observers for the help system
9899
observeEvent(input$show_help, {
99100
item <- input$show_help$item

R/app_ui.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ app_ui <- function(request, mode = NULL, access = NULL) {
2222
), "requal"
2323
),
2424
controlbarIcon = icon("ellipsis-v", id = "launchpad_icon"),
25-
dropdownBlock2(
26-
id = "btn-memo",
25+
dropdownBlock(
26+
id = "btn-free_memo",
2727
badgeStatus = NULL,
2828
icon = shiny::icon("sticky-note", verify_fa = FALSE),
29-
mod_memo_ui("memo_ui_1")
30-
) %>% tagAppendAttributes(class = "memo", style = "display:none;", title = "Free memo"),
29+
mod_memo_free_ui("free_memo_ui_1")
30+
) %>% tagAppendAttributes(class = "free_memo", title = "Free memo"),
3131
tags$li(mod_user_ui("user_ui_1")) %>%
3232
tagAppendAttributes(class = "dropdown"),
3333
tags$li(actionLink(

R/db_startup.R

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ db_call_df_ordered <- tibble::tibble(
303303
"segments",
304304
"memos",
305305
"attributes",
306-
"attribute_values"
306+
"attribute_values",
307+
"memos_segments_map"
307308
))
308309

309310
db_call_df <- dplyr::full_join(
@@ -317,33 +318,6 @@ db_call_df_unordered <- tibble::tibble(
317318
sql = db_call
318319
)
319320

320-
# Arrange by priority as required by postgres
321-
db_call_df_ordered <- tibble::tibble(
322-
table = c(
323-
"projects",
324-
"requal_version",
325-
"users",
326-
"user_permissions",
327-
"logs",
328-
"documents",
329-
"codes",
330-
"categories",
331-
"categories_codes_map",
332-
"cases",
333-
"cases_documents_map",
334-
"segments",
335-
"memos",
336-
"attributes",
337-
"attribute_values"
338-
))
339-
340-
db_call_df <- dplyr::full_join(
341-
db_call_df_ordered,
342-
db_call_df_unordered,
343-
by = "table"
344-
)
345-
346-
347321

348322
create_db_schema <- function(pool) {
349323

R/mod_agreement.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ mod_agreement_server <- function(id, glob) {
107107
segments <- load_all_segments_db(
108108
pool = glob$pool,
109109
active_project = glob$active_project
110-
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
110+
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
111111

112112
if (length(unique(segments$user_id)) > 1) {
113113
overlap_df <- calculate_code_overlap_by_users(segments) %>%
@@ -133,7 +133,7 @@ mod_agreement_server <- function(id, glob) {
133133
segments <- load_all_segments_db(
134134
pool = glob$pool,
135135
active_project = glob$active_project
136-
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
136+
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
137137

138138
if (length(unique(segments$user_id)) > 1) {
139139
segment_summary <- segments %>%
@@ -167,7 +167,7 @@ mod_agreement_server <- function(id, glob) {
167167
segments <- load_all_segments_db(
168168
pool = glob$pool,
169169
active_project = glob$active_project
170-
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
170+
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
171171

172172
codes <- load_codes_names(
173173
active_project = glob$active_project,
@@ -212,7 +212,7 @@ mod_agreement_server <- function(id, glob) {
212212
segments <- load_all_segments_db(
213213
pool = glob$pool,
214214
active_project = glob$active_project
215-
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
215+
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
216216

217217
codes <- load_codes_names(
218218
active_project = glob$active_project,
@@ -262,7 +262,7 @@ mod_agreement_server <- function(id, glob) {
262262
segments <- load_all_segments_db(
263263
pool = glob$pool,
264264
active_project = glob$active_project
265-
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
265+
) %>% dplyr::filter(user_id %in% as.numeric(input$repro_coders))
266266

267267
users <- load_users_names(
268268
pool = glob$pool,

R/mod_agreement_utils_agreement.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ load_all_segments_db <- function(pool, active_project) {
3333

3434
segments <- dplyr::tbl(pool, "segments") %>%
3535
dplyr::filter(.data$project_id == as.integer(active_project)) %>%
36+
dplyr::filter(!is.na(.data$code_id)) %>% # remove memoed segments
3637
dplyr::select(user_id,
3738
code_id,
3839
doc_id,
3940
segment_id,
4041
segment_start,
4142
segment_end) %>%
4243
dplyr::left_join(., users, by = "user_id", suffix = c(".x", ".y")) %>%
43-
dplyr::collect()
44+
dplyr::collect()
4445

4546
return(segments)
4647
} else {""}

R/mod_analysis.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mod_analysis_ui <- function(id) {
2424
fluidRow(
2525
class = "module_content",
2626
uiOutput(ns("segments")) %>%
27-
tagAppendAttributes(class = "scrollable90")
27+
tagAppendAttributes(class = "scrollable80")
2828
)
2929
# ###########
3030
# column(
@@ -200,15 +200,15 @@ mod_rql_button_server(
200200
if (nrow(loc$segments_df) > 0) {
201201
loc$segments_taglist <- purrr::pmap(
202202
list(
203-
loc$segments_df$segment_start,
203+
loc$segments_df$segment_id,
204204
loc$segments_df$segment_text,
205205
loc$segments_df$doc_id,
206206
loc$segments_df$doc_name,
207207
loc$segments_df$code_name,
208208
loc$segments_df$code_color
209209
),
210210
~ format_segments(
211-
segment_start = ..1,
211+
segment_id = ..1,
212212
segment_text = ..2,
213213
segment_document_id = ..3,
214214
segment_document_name = ..4,

R/mod_analysis_utils_analysis.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ load_segments_analysis <- function(pool,
5050

5151

5252

53-
format_segments <- function(segment_start, segment_text, segment_document_id, segment_document_name, segment_code, segment_color) {
53+
format_segments <- function(segment_id, segment_text, segment_document_id, segment_document_name, segment_code, segment_color) {
5454

5555

5656
tags$div(
@@ -60,8 +60,8 @@ format_segments <- function(segment_start, segment_text, segment_document_id, se
6060

6161
tags$div(
6262
tags$div(class = "segment_badge",
63-
actionLink(paste0("segment_start-", segment_start), label = segment_document_name,
64-
onclick = paste0("Shiny.setInputValue('analyze_link', {tab_menu: 'Annotate', doc_id: ", segment_document_id,", segment_start: ", segment_start, "}, {priority: 'event'});")
63+
actionLink(paste0("segment_id-", segment_id), label = segment_document_name,
64+
onclick = paste0("Shiny.setInputValue('analyze_link', {tab_menu: 'Annotate', doc_id: ", segment_document_id,", segment_id: ", segment_id, "}, {priority: 'event'});")
6565
)
6666
),
6767

0 commit comments

Comments
 (0)