Skip to content

Commit

Permalink
Merge pull request #39 from A2-ai/terminology_options
Browse files Browse the repository at this point in the history
Custom options
  • Loading branch information
jenna-a2ai authored Nov 20, 2024
2 parents 2b0407c + def96be commit 0aa4fc5
Show file tree
Hide file tree
Showing 24 changed files with 233 additions and 262 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ghqc.app
Title: Create QC Checklists in Github Issues
Version: 0.2.0.9000
Version: 0.3.0.9000
Authors@R: c(
person("Jenna", "Johnson", email = "[email protected]", role = c("aut", "cre")),
person("Anne", "Zheng", email = "[email protected]", role = c("aut")),
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export(ghqc_assign_app)
export(ghqc_record_app)
export(ghqc_resolve_app)
export(ghqc_set_info_repo)
export(ghqc_set_config_repo)
import(shiny)
importFrom(dplyr,"%>%")
importFrom(dplyr,case_when)
Expand All @@ -16,6 +16,7 @@ importFrom(fs,is_file)
importFrom(gert,git_ahead_behind)
importFrom(gert,git_fetch)
importFrom(gert,git_status)
importFrom(gh,gh)
importFrom(glue,glue)
importFrom(jsTreeR,jstree)
importFrom(jsTreeR,jstreeOutput)
Expand Down
90 changes: 49 additions & 41 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,109 +1,117 @@
# ghqc.app 0.3.0

- Updated the custom configuration options repository (now `GHQC_OPTIONS_REPO`) check to reflect the following changes:
- The "note" file within the custom configuration repository is now `prepended_checklist_note` within "options.yaml"
- `checklist_display_name_var` in "options.yaml" provides option to change the name in which the QC checklists are referred to as.

# ghqc.app 0.2.0

Inclusive of 0.1.9, 0.1.10, 0.1.11 changes:

- Adding the branch and a link to the file contents at the start of QC to the Metadata section of Issues created by the Assign app. Also added links to the file contents at the previous and current commits in the metadata section of the resolve app comments.
- Adds "ghqc" label to all GitHub Issues created by ghqc. Only Issues with this label, and the Milestones containing them, will be viewable/selectable in the apps. This change is NOT backward compatible with Issues/Milestones created in previous versions
- Clarifies language in Warning and Error modals for all three apps
- Adding the branch and a link to the file contents at the start of QC to the Metadata section of Issues created by the Assign app. Also added links to the file contents at the previous and current commits in the metadata section of the resolve app comments.
- Adds "ghqc" label to all GitHub Issues created by ghqc. Only Issues with this label, and the Milestones containing them, will be viewable/selectable in the apps. This change is NOT backward compatible with Issues/Milestones created in previous versions
- Clarifies language in Warning and Error modals for all three apps

# ghqc.app 0.1.11

- Adding the branch and a link to the file contents at the start of QC to the Metadata section of Issues created by the Assign app. Also added links to the file contents at the previous and current commits in the metadata section of the resolve app comments.
- Adding the branch and a link to the file contents at the start of QC to the Metadata section of Issues created by the Assign app. Also added links to the file contents at the previous and current commits in the metadata section of the resolve app comments.

# ghqc.app 0.1.10

- Adds "ghqc" label to all GitHub Issues created by ghqc. Only Issues with this label, and the Milestones containing them, will be viewable/selectable in the apps. This change is NOT backward compatible with Issues/Milestones created in previous versions
- Adds "ghqc" label to all GitHub Issues created by ghqc. Only Issues with this label, and the Milestones containing them, will be viewable/selectable in the apps. This change is NOT backward compatible with Issues/Milestones created in previous versions

# ghqc.app 0.1.9

- Clarifies language in Warning and Error modals for all three apps
- Clarifies language in Warning and Error modals for all three apps

# ghqc.app 0.1.8
# ghqc.app 0.1.8

- Removes reset button in record app modal for users to click after closing milestones when no closed milestones exist (was buggy in viewer panel)
- Removes reset button in record app modal for users to click after closing milestones when no closed milestones exist (was buggy in viewer panel)

# ghqc.app 0.1.7

- Fixes bug in rendered reports in which a maximum height for logos wasn't set to prevent overlapping header lines and header text.
- Fixes bug in rendered reports in which a maximum height for logos wasn't set to prevent overlapping header lines and header text.

# ghqc.app 0.1.6

- Fixes bug in record app for previewing markdown files (same bug and solution as in 0.1.4)
- Fixes bug in record app for previewing markdown files (same bug and solution as in 0.1.4)

# ghqc.app 0.1.5

- Fixes bug in assign and resolve apps - error checking did not catch remote changes to the directory because checks did not git fetch first
- Fixes bug in assign and resolve apps - error checking did not catch remote changes to the directory because checks did not git fetch first

# ghqc.app 0.1.4

- Fixes bug in resolve app for previewing markdown files
- Fixes bug in resolve app for previewing markdown files

# ghqc.app 0.1.3

- Changes "No Existing Milestones"" to "No Open Milestones" in ghqc_assign_app() Existing Milestones dropdown menu
- Changes "No Existing Milestones"" to "No Open Milestones" in ghqc_assign_app() Existing Milestones dropdown menu

# ghqc.app 0.1.2

- Fixes bug in record app warning modal pop-up for unclosed milestones/issues/checklist items: Milestone link wasn't clickable
- Improves "No closed milestones" modal pop-up warning in record app. Language change to "It is recommended to close milestones" and adds a reset link to modal for users to click after closing milestones.
- Fixes bug in record app warning modal pop-up for unclosed milestones/issues/checklist items: Milestone link wasn't clickable
- Improves "No closed milestones" modal pop-up warning in record app. Language change to "It is recommended to close milestones" and adds a reset link to modal for users to click after closing milestones.

# ghqc.app 0.1.1

- In the case when someone sets the standard gh environment variable GITHUB_API_URL, each app checks if this URL matches the actual set remote URL. The function that gets the GITHUB_API_URL did not explicitly return a value.
- In the case when someone sets the standard gh environment variable GITHUB_API_URL, each app checks if this URL matches the actual set remote URL. The function that gets the GITHUB_API_URL did not explicitly return a value.

- Small grammar fix in error message from apps in the case that the checklists directory isn't in the cloned info repo.
- Small grammar fix in error message from apps in the case that the checklists directory isn't in the cloned info repo.

# ghqc.app 0.0.0.9011

- rename ghqc to ghqc.app and ghqc.launcher to ghqc
- rename ghqc to ghqc.app and ghqc.launcher to ghqc

# ghqc 0.0.0.9010

- terminology changed to match GitHub terminology like "Issue" and "Milestone"
- terminology changed to match GitHub terminology like "Issue" and "Milestone"

- git commit terminology changed from "reference" and "comparator" to "previous" and "current", respectively
- git commit terminology changed from "reference" and "comparator" to "previous" and "current", respectively

- current commit moved to top of metadata section
- current commit moved to top of metadata section

- metadata sections moved to top of issue/comment bodies
- metadata sections moved to top of issue/comment bodies

- "Create" app renamed to "Assign" app
- "Create" app renamed to "Assign" app

- "git sha" in metadata renamed to "initial qc commit" and moved to top of metadata section
- "git sha" in metadata renamed to "initial qc commit" and moved to top of metadata section

# ghqc 0.0.0.9009

## New features

- ghqc pulls client-specific information from a pre-existing repo using the environment variable `GIT_CLIENT_URL`, which is set equal to the https code link to the relevant github repo.
- ghqc pulls client-specific information from a pre-existing repo using the environment variable `GIT_CLIENT_URL`, which is set equal to the https code link to the relevant github repo.

# ghqc 0.0.0.9008

## New features

- ghqcLauncher is now ghqc.launcher to comply with standardized helper package naming conventions.
- ghqcLauncher is now ghqc.launcher to comply with standardized helper package naming conventions.

- The report function is now a shiny app that can run in ghqc.launcher

- The git credential authentication function is more robust in each case when

1) Git is already authenticated,
2) Git isn't already authenticated, and
3) Git is mis-authenticated.

- Error handling for the git repo and Rproject is now more robust

- The report function is now a shiny app that can run in ghqc.launcher
- The sidebar in `ghqc_create_app()` now scrolls for easy reading of long file and directory names

- The git credential authentication function is more robust in each case when
1) Git is already authenticated,
2) Git isn't already authenticated, and
3) Git is mis-authenticated.
- ghqc can function with multiple remotes set for a given repo, and the app selects the remote in the following hierarchy:

- Error handling for the git repo and Rproject is now more robust
1) If a single remote exists, it selects it

- The sidebar in `ghqc_create_app()` now scrolls for easy reading of long file and directory names
2) Else, if multiple remotes exist:

- ghqc can function with multiple remotes set for a given repo, and the app selects the remote in the following hierarchy:
1) If a single remote exists, it selects it

2) Else, if multiple remotes exist:

- if the environment variable GHQC_REMOTE_NAME exists, it selects the one with that name
- if the environment variable GHQC_REMOTE_NAME exists, it selects the one with that name

- else, if a remote named "origin" exists, it selects it
- else, if a remote named "origin" exists, it selects it

- else, it uses the first remote in the list of remotes
- else, it uses the first remote in the list of remotes

# ghqc 0.0.0.9007

Expand Down
3 changes: 2 additions & 1 deletion R/app_01_assign.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#' @import shiny
#' @export
ghqc_assign_app <- function() {
if (!exists("info_repo_path", .le)) ghqc_set_info_repo()
if (!exists("config_repo_path", .le)) ghqc_set_config_repo()
get_options()

# error handling before starting app
root_dir <- rproj_root_dir()
Expand Down
15 changes: 7 additions & 8 deletions R/app_01_assign_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ NULL
ghqc_assign_server <- function(id, remote, root_dir, checklists, org, repo, members, milestone_list) {
iv <- shinyvalidate::InputValidator$new()


observe({
req(remote, root_dir)
waiter_hide()
Expand Down Expand Up @@ -205,9 +204,9 @@ return "<div><strong>" + escape(item.username) + "</div>"
div(
style = "display: flex; justify-content: flex-end; padding-bottom: 20px;",
actionButton(ns("file_info"),
label = HTML("<span style='font-size:2.0em;'>Preview all available checklists</span>"),
label = HTML(glue::glue("<span style='font-size:2.0em;'>Preview all available {get_checklist_display_name_var(plural = TRUE)}</span>")),
class = "preview-button",
style = "min-width: auto; display: inline-block; text-align: center; line-height: 2em; height: 2em;"
style = "min-width: auto; display: inline-block; text-align: right; line-height: 2em; height: 2em;"
) #actionButton
) #div

Expand Down Expand Up @@ -354,7 +353,7 @@ return "<div><strong>" + escape(item.username) + "</div>"
}
success_note <- {
if (custom_checklist_selected()) {
HTML("Issue(s) created successfully.<br><b>Remember to manually edit Custom QC checklists on GitHub.</b>")
HTML(glue::glue("Issue(s) created successfully.<br><b>Remember to manually edit Custom {get_checklist_display_name_var(plural = TRUE)} on GitHub.</b>"))
}
else {
"Issue(s) created successfully."
Expand Down Expand Up @@ -382,7 +381,7 @@ return "<div><strong>" + escape(item.username) + "</div>"
title = tags$div(modalButton("Dismiss"), style = "text-align: right;"),
footer = NULL,
easyClose = TRUE,
"Each file input will require a checklist type. Each checklist type will have its own items associated with it.",
glue::glue("Each selected file will require a {get_checklist_display_name_var()} type. Each {get_checklist_display_name_var()} type will have its own items associated with it."),
"See below for a reference of all types and their items.",
br(),
br(),
Expand All @@ -402,7 +401,7 @@ return "<div><strong>" + escape(item.username) + "</div>"
title = tags$div(modalButton("Dismiss"), style = "text-align: right;"),
footer = NULL,
easyClose = TRUE,
"Each file input will require a checklist type. Each checklist type will have its own items associated with it.",
glue::glue("Each selected file will require a {get_checklist_display_name_var()} type. Each {get_checklist_display_name_var()} type will have its own items associated with it."),
"See below for a reference of all types and their items.",
br(),
br(),
Expand All @@ -416,12 +415,12 @@ return "<div><strong>" + escape(item.username) + "</div>"
output$file_info_panel <- renderUI({
req(checklists)
req(input$checklist_info)
debug(.le$logger, glue::glue("Checklist selected for review: {input$checklist_info}"))
debug(.le$logger, glue::glue("{get_checklist_display_name_var(capitalized = TRUE)} selected for review: {input$checklist_info}"))

info <- checklists[[input$checklist_info]]

log_string <- glue::glue_collapse(info, sep = "\n")
debug(.le$logger, glue::glue("Items found in the checklist: \n{log_string}"))
debug(.le$logger, glue::glue("Items found in the {get_checklist_display_name_var()}: \n{log_string}"))

list <- convert_list_to_ui(info) # checklists needs additional formatting for list of named elements

Expand Down
21 changes: 11 additions & 10 deletions R/app_01_assign_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ render_selected_list <- function(input, ns, iv, items = NULL, checklist_choices
)

checklist_input <- selectizeInput(
ns(checklist_input_id),
label = NULL,
choices = c("", checklist_choices), #select checklist (required)
width = "100%",
selected = NULL, # Ensures no default selection
options = list(placeholder = "Checklist")
ns(checklist_input_id),
label = NULL,
choices = c("", checklist_choices),
width = "100%",
selected = NULL,
options = list(placeholder = get_checklist_display_name_var(capitalized = TRUE))
)


button_input <- actionButton(
ns(button_input_id),
label = HTML("<span>Preview file<br>contents</span>"),
Expand All @@ -73,7 +74,7 @@ render_selected_list <- function(input, ns, iv, items = NULL, checklist_choices

preview_input <- actionButton(
ns(preview_input_id),
label = HTML("<span>Preview<br>checklist</span>"),
label = HTML(glue::glue("<span>Preview<br>{get_checklist_display_name_var()}</span>")),
style = "height: 34px !important; font-size: 12px !important; padding: 2px 2px 2px 2px !important; color: #5f5f5f !important; line-height: 1.2em",
#style = "min-width: auto; display: inline-block; text-align: center; line-height: 2em; height: 2em;",
#class = "checklist-preview-button"
Expand Down Expand Up @@ -226,8 +227,8 @@ convert_list_to_ui <- function(checklists, parent_name = NULL, is_first = TRUE)
first_child <- FALSE
}
} else {
error(.le$logger, glue::glue("Checklist not supported: {checklists}"))
rlang::abort("Unsupported type of checklist")
error(.le$logger, glue::glue("{get_checklist_display_name_var(capitalized = TRUE)} not supported: {checklists}"))
rlang::abort(glue::glue("Unsupported type of {get_checklist_display_name_var()}"))
}
debug(.le$logger, "Converted list to UI successfully")
return(ui_elements)
Expand Down Expand Up @@ -308,7 +309,7 @@ create_checklist_preview_event <- function(input, iv, ns, name, checklists) {
footer = NULL,
easyClose = TRUE,
renderUI({
"Select a checklist to preview in the Checklist dropdown."
glue::glue("Select a {get_checklist_display_name_var()} to preview in the {get_checklist_display_name_var(capitalized = TRUE)} dropdown.")
})
)
)
Expand Down
3 changes: 2 additions & 1 deletion R/app_02_resolve.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#' @importFrom log4r warn error info debug
#' @export
ghqc_resolve_app <- function() {
if (!exists("info_repo_path", .le)) ghqc_set_info_repo()
if (!exists("config_repo_path", .le)) ghqc_set_config_repo()
get_options()

# error handling before starting app
remote <- check_github_credentials()
Expand Down
3 changes: 2 additions & 1 deletion R/app_03_record.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#' @import shiny
#' @export
ghqc_record_app <- function() {
if (!exists("info_repo_path", .le)) ghqc_set_info_repo()
if (!exists("config_repo_path", .le)) ghqc_set_config_repo()
get_options()

# error handling before starting app
remote <- check_github_credentials()
Expand Down
3 changes: 2 additions & 1 deletion R/app_03_record_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ ghqc_record_server <- function(id, remote, org, repo, all_milestones) {
actionButton(ns("return"), "Return"),
style = "text-align: right;"
),
HTML(paste("It is recommended that relevant GitHub Issues and Milestones are closed upon completion of QC, and checklists within GitHub Issues are checked to indicate QCed items.<br><br> You may want to double check the following items for outstanding QC progress:<br><br>", modal_check()$message)),
#HTML(paste(glue::glue("It is recommended that all relevant GitHub Issues and Milestones are closed and all {get_checklist_display_name_var()} items within GitHub Issues are checked off to indicate completion of QC.<br><br> You may want to double check the following items for outstanding QC progress:<br><br>"), modal_check()$message)),
HTML(paste(glue::glue("Upon completion of QC, It is recommended that:<br>- All selected Milestones are closed<br>- All Issues within selected Milestones are closed<br>- All {get_checklist_display_name_var()} items within relevant Issues are completed<br><br> You may want to review the following items on GitHub for outstanding QC progress:<br><br>"), modal_check()$message)),
tags$style(HTML("
.modal-content {
word-wrap: break-word; /* Allows long text to break into new lines */
Expand Down
6 changes: 3 additions & 3 deletions R/app_03_record_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ generate_open_issue_message <- function(open_issues, warning_icon_html) {
generate_open_checklist_message <- function(issues_with_open_checklists, warning_icon_html) {
messages <- c()
if (length(issues_with_open_checklists) > 0) {
messages <- c(messages, sprintf(
"%s The selected Milestones contain the following Issues with open checklist items:<ul>%s</ul><br>",
messages <- c(messages, sprintf(glue::glue(
"%s The selected Milestones contain the following Issues with open {get_checklist_display_name_var()} items:<ul>%s</ul><br>"),
warning_icon_html, generate_tiered_html_list_with_hyperlink(issues_with_open_checklists)
))
}
Expand All @@ -79,7 +79,7 @@ determine_modal_message_report <- function(owner, repo, milestone_names) {
log_string <- glue::glue("Modal Check Inputs:
- Open Milestones: {glue::glue_collapse(open_milestones, sep = ', ')}
- Open Issues: {glue::glue_collapse(open_issues, sep = ', ')}
- Issues with unchecked checklist items: {glue::glue_collapse(open_checklists, sep = ', ')}
- Issues with unchecked {get_checklist_display_name_var()} items: {glue::glue_collapse(open_checklists, sep = ', ')}
")

log4r::debug(.le$logger, log_string)
Expand Down
Loading

0 comments on commit 0aa4fc5

Please sign in to comment.