Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
asegun-cod committed Nov 8, 2023
1 parent 02f8137 commit b1a6bfa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/golem_utils_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ get_sentiment_text <- function(value) {
value == 3 ~ "Neutral/Mixed",
value == 4 ~ "Negative",
value == 5 ~ "Negative",
TRUE ~ NA
TRUE ~ NA_character_
)
}

Expand Down
4 changes: 2 additions & 2 deletions R/mod_header_message.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ mod_header_message_server <- function(id, pool, db_data, data_exists) {
isolate({
last_upload_date <- DBI::dbGetQuery(pool, paste0("SELECT MAX(last_upload_date) FROM ",
get_golem_config('trust_name')))$`MAX(last_upload_date)`
last_upload_date <- if (is.na(last_upload_date)) "No edit yet" else paste(strptime(last_upload_date, format = "%Y-%m-%d %H:%M"), "GMT")
last_upload_date <- if (is.na(last_upload_date)) "No edit yet" else paste(strptime(as.POSIXct(last_upload_date), format = "%Y-%m-%d %H:%M"))

last_date_edit <- DBI::dbGetQuery(pool, paste0("SELECT MAX(last_edit_date) FROM ",
get_golem_config('trust_name')))$`MAX(last_edit_date)`
last_date_edit <- if (is.na(last_date_edit)) "No edit yet" else paste(strptime(last_date_edit, format = "%Y-%m-%d %H:%M"), "GMT")
last_date_edit <- if (is.na(last_date_edit)) "No edit yet" else paste(strptime(as.POSIXct(last_date_edit), format = "%Y-%m-%d %H:%M"))

total_users <- db_data %>%
dplyr::pull(pt_id) %>%
Expand Down
4 changes: 0 additions & 4 deletions R/mod_search_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ mod_search_text_server <- function(id, filter_data) {
filter_text = text_search(),
comment_type_filter = NULL, search_type = "and"
) |>
dplyr::mutate(across(c(category, super_category), ~ purrr::map(.x, jsonlite::fromJSON)),
super_category = lapply(super_category, unique), # to remove the duplicate values from each super category row
across(c(category, super_category), ~ purrr::map(.x, to_string))
) |>
prep_data_for_comment_table(in_tidy_format = FALSE)
})

Expand Down

0 comments on commit b1a6bfa

Please sign in to comment.