From 1a67d88e12fb6f99b3f61776fa962d1af424056e Mon Sep 17 00:00:00 2001
From: Marton Kovacs
Date: Tue, 17 Oct 2023 09:38:27 +0200
Subject: [PATCH 1/6] changed icon styling, calling custom class from css
stylsheet did not work with icon R function
---
DESCRIPTION | 5 +++--
R/app_ui.R | 6 +++---
dev/02_dev.R | 1 +
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index c357f74..d243d66 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -52,8 +52,9 @@ Imports:
markdown,
lifecycle,
rlang,
- stats
-RoxygenNote: 7.2.1
+ stats,
+ fontawesome
+RoxygenNote: 7.2.3
Suggests:
testthat,
knitr,
diff --git a/R/app_ui.R b/R/app_ui.R
index 50d386e..38157ba 100644
--- a/R/app_ui.R
+++ b/R/app_ui.R
@@ -30,7 +30,7 @@ app_ui <- function() {
div(
class = "help-icon-container",
title = "Copy the contributors table template in Google Drive. Go to File -> Make a copy",
- icon("far fa-question-circle", lib = "font-awesome", class = "help-icon")
+ fontawesome::fa_i(name = "fas fa-circle-question", style = "color: #D45F68; font-size: 2em;")
)
),
wellPanel(
@@ -55,7 +55,7 @@ app_ui <- function() {
div(
class = "help-icon-container",
title = "Use the share URL of the filled out contributors table and click on the upload button. OR upload your contributors table in a .csv, .tsv or .xlsx format.",
- icon("far fa-question-circle", lib = "font-awesome", class = "help-icon")
+ fontawesome::fa_i(name = "fas fa-circle-question", style = "color: #D45F68; font-size: 2em;")
)
),
wellPanel(
@@ -76,7 +76,7 @@ app_ui <- function() {
div(
class = "help-icon-container",
title = "You need a valid contributors table to generate the outputs. Once you have it, click on one of the output buttons to preview and download the output.",
- icon("far fa-question-circle", lib = "font-awesome", class = "help-icon")
+ fontawesome::fa_i(name = "fas fa-circle-question", style = "color: #D45F68; font-size: 2em;")
)
),
wellPanel(
diff --git a/dev/02_dev.R b/dev/02_dev.R
index 92cae13..230444d 100644
--- a/dev/02_dev.R
+++ b/dev/02_dev.R
@@ -40,6 +40,7 @@ usethis::use_package("markdown")
usethis::use_package("lifecycle")
usethis::use_package("rlang")
usethis::use_package("stats")
+usethis::use_package("fontawesome")
# usethis::use_package("covr", "Suggests")
usethis::use_pipe()
From ea9879fa2f1b49320cb89a5120e4536daacf1894 Mon Sep 17 00:00:00 2001
From: Marton Kovacs
Date: Fri, 3 Nov 2023 23:40:14 +0100
Subject: [PATCH 2/6] fixed clip button with because new package update broke
it
---
R/mod_credit_roles.R | 7 ++++++-
R/mod_funding_information.R | 7 ++++++-
R/mod_title_page.R | 7 ++++++-
R/mod_xml_report.R | 7 ++++++-
4 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/R/mod_credit_roles.R b/R/mod_credit_roles.R
index c498e78..e37ace3 100644
--- a/R/mod_credit_roles.R
+++ b/R/mod_credit_roles.R
@@ -154,7 +154,12 @@ mod_credit_roles_server <- function(id, input_data){
## Add clipboard buttons
output$clip <- renderUI({
- rclipboard::rclipButton("clip_btn", "Copy output to clipboard", to_clip(), icon("clipboard"), modal = TRUE)
+ rclipboard::rclipButton(
+ inputId = "clip_btn",
+ label = "Copy output to clipboard",
+ clipText = to_clip(),
+ icon = icon("clipboard"),
+ modal = TRUE)
})
## Workaround for execution within RStudio version < 1.2
diff --git a/R/mod_funding_information.R b/R/mod_funding_information.R
index 8bfe807..bebe899 100644
--- a/R/mod_funding_information.R
+++ b/R/mod_funding_information.R
@@ -117,7 +117,12 @@ mod_funding_information_server <- function(id, input_data){
# Clip ---------------------------
## Add clipboard buttons
output$clip <- renderUI({
- rclipboard::rclipButton("clip_btn", "Copy output to clipboard", to_download_and_clip(), icon("clipboard"), modal = TRUE)
+ rclipboard::rclipButton(
+ inputId = "clip_btn",
+ label = "Copy output to clipboard",
+ clipText = to_download_and_clip(),
+ icon = icon("clipboard"),
+ modal = TRUE)
})
## Workaround for execution within RStudio version < 1.2
diff --git a/R/mod_title_page.R b/R/mod_title_page.R
index b9bfede..f476e50 100644
--- a/R/mod_title_page.R
+++ b/R/mod_title_page.R
@@ -115,7 +115,12 @@ mod_title_page_server <- function(id, input_data){
## Add clipboard buttons
output$clip <- renderUI({
- rclipboard::rclipButton("clip_btn", "Copy output to clipboard", to_clip(), icon("clipboard"), modal = TRUE)
+ rclipboard::rclipButton(
+ inputId = "clip_btn",
+ label = "Copy output to clipboard",
+ clipText = to_clip(),
+ icon = icon("clipboard"),
+ modal = TRUE)
})
## Workaround for execution within RStudio version < 1.2
diff --git a/R/mod_xml_report.R b/R/mod_xml_report.R
index 6a2140e..bee0e43 100644
--- a/R/mod_xml_report.R
+++ b/R/mod_xml_report.R
@@ -68,7 +68,12 @@ mod_xml_report_server <- function(id, input_data){
# Add clipboard buttons
output$clip <- renderUI({
- rclipboard::rclipButton("clip_btn", "Copy output to clipboard", to_print(), icon("clipboard"), modal = TRUE)
+ rclipboard::rclipButton(
+ inputId = "clip_btn",
+ label = "Copy output to clipboard",
+ clipText = to_print(),
+ icon = icon("clipboard"),
+ modal = TRUE)
})
## Workaround for execution within RStudio version < 1.2
From be6e7e9211a1f655ad463c5bec78f1ac8b38dff1 Mon Sep 17 00:00:00 2001
From: Marton Kovacs
Date: Sat, 4 Nov 2023 09:32:53 +0100
Subject: [PATCH 3/6] added matamo event tracking to output creation and table
show
---
R/mod_credit_roles.R | 25 +++++++++++++++------
R/mod_funding_information.R | 27 +++++++++++++++++------
R/mod_show_spreadsheet.R | 5 ++++-
R/mod_show_yaml.R | 43 +++++++++++++++++++++++++++----------
R/mod_title_page.R | 27 +++++++++++++++++------
R/mod_xml_report.R | 27 +++++++++++++++++------
6 files changed, 117 insertions(+), 37 deletions(-)
diff --git a/R/mod_credit_roles.R b/R/mod_credit_roles.R
index e37ace3..1779ef2 100644
--- a/R/mod_credit_roles.R
+++ b/R/mod_credit_roles.R
@@ -25,7 +25,7 @@ mod_credit_roles_ui <- function(id){
tagAppendAttributes(
# Track click event with Matomo
onclick = "_paq.push(['trackEvent', 'Output', 'Click show', 'Author information'])"
- )
+ )
)
}
@@ -80,12 +80,23 @@ mod_credit_roles_server <- function(id, input_data){
div(
style = "display: inline-block",
uiOutput(session$ns("clip"))
- ),
- downloadButton(
- NS(id, "report"),
- label = "Download file",
- class = "download-report"
- ),
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click clip', 'Author information'])"
+ ),
+ div(
+ style = "display: inline-block",
+ downloadButton(
+ NS(id, "report"),
+ label = "Download file",
+ class = "download-report"
+ )
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click download', 'Author information'])"
+ ),
modalButton("Close")
)
)
diff --git a/R/mod_funding_information.R b/R/mod_funding_information.R
index bebe899..6bda63b 100644
--- a/R/mod_funding_information.R
+++ b/R/mod_funding_information.R
@@ -15,6 +15,10 @@ mod_funding_information_ui <- function(id){
NS(id, "show_report"),
label = "Show funding information",
class = "btn btn-primary btn-validate")
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click show', 'Funding information'])"
)
)
}
@@ -56,12 +60,23 @@ mod_funding_information_server <- function(id, input_data){
div(
style = "display: inline-block",
uiOutput(session$ns("clip"))
- ),
- downloadButton(
- NS(id, "report"),
- label = "Download file",
- class = "download-report"
- ),
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click clip', 'Funding information'])"
+ ),
+ div(
+ style = "display: inline-block",
+ downloadButton(
+ NS(id, "report"),
+ label = "Download file",
+ class = "download-report"
+ )
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click download', 'Funding information'])"
+ ),
modalButton("Close")
)
)
diff --git a/R/mod_show_spreadsheet.R b/R/mod_show_spreadsheet.R
index c230fba..6694802 100644
--- a/R/mod_show_spreadsheet.R
+++ b/R/mod_show_spreadsheet.R
@@ -18,7 +18,6 @@ mod_show_spreadsheet_ui <- function(id) {
tagList(
div(
# style = "display: block; text-align: right;",
- title = "Click to upload from file",
id = "show-div",
actionButton(
NS(id, "show_data"),
@@ -27,6 +26,10 @@ mod_show_spreadsheet_ui <- function(id) {
icon("fas fa-eye", lib = "font-awesome")
),
class = "btn-primary")
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Input', 'Click show', 'Table'])"
)
)
}
diff --git a/R/mod_show_yaml.R b/R/mod_show_yaml.R
index 5045fc5..3d68a67 100644
--- a/R/mod_show_yaml.R
+++ b/R/mod_show_yaml.R
@@ -18,11 +18,16 @@ mod_show_yaml_ui <- function(id) {
tagList(
div(class = "out-btn",
- actionButton(inputId = NS(id, "show_yaml"),
- label = HTML("Show papaja YAML"),
- class = "btn btn-primary btn-validate")
+ actionButton(
+ inputId = NS(id, "show_yaml"),
+ label = HTML("Show papaja YAML"),
+ class = "btn btn-primary btn-validate")
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click show', 'YAML information'])"
+ )
)
- )
}
# Module Server
@@ -68,7 +73,12 @@ mod_show_yaml_server <- function(id, input_data) {
# Add clipboard buttons
output$yaml_clip <- renderUI({
- rclipboard::rclipButton("yaml_clip_btn", "Copy YAML to clipboard", author_yaml(), icon("clipboard"), modal = TRUE)
+ rclipboard::rclipButton(
+ inputId = "yaml_clip_btn",
+ label = "Copy YAML to clipboard",
+ clipText = author_yaml(),
+ icon = icon("clipboard"),
+ modal = TRUE)
})
## Workaround for execution within RStudio version < 1.2
@@ -93,12 +103,23 @@ mod_show_yaml_server <- function(id, input_data) {
div(
style = "display: inline-block",
uiOutput(session$ns("yaml_clip"))
- ),
- downloadButton(
- NS(id, "report"),
- label = "Download YAML file",
- class = "download-report"
- ),
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click clip', 'YAML information'])"
+ ),
+ div(
+ style = "display: inline-block",
+ downloadButton(
+ NS(id, "report"),
+ label = "Download YAML file",
+ class = "download-report"
+ )
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click download', 'YAML information'])"
+ ),
modalButton("Close")
)
)
diff --git a/R/mod_title_page.R b/R/mod_title_page.R
index f476e50..5e0ddc6 100644
--- a/R/mod_title_page.R
+++ b/R/mod_title_page.R
@@ -21,6 +21,10 @@ mod_title_page_ui <- function(id){
NS(id, "show_report"),
label = "Show author list with affiliations",
class = "btn btn-primary btn-validate")
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click show', 'Title information'])"
)
)
}
@@ -53,12 +57,23 @@ mod_title_page_server <- function(id, input_data){
div(
style = "display: inline-block",
uiOutput(session$ns("clip"))
- ),
- downloadButton(
- NS(id, "report"),
- label = "Download file",
- class = "download-report"
- ),
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click clip', 'Title information'])"
+ ),
+ div(
+ style = "display: inline-block",
+ downloadButton(
+ NS(id, "report"),
+ label = "Download file",
+ class = "download-report"
+ )
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click download', 'Title information'])"
+ ),
modalButton("Close")
)
)
diff --git a/R/mod_xml_report.R b/R/mod_xml_report.R
index bee0e43..f87cb90 100644
--- a/R/mod_xml_report.R
+++ b/R/mod_xml_report.R
@@ -20,6 +20,10 @@ mod_xml_report_ui <- function(id){
actionButton(NS(id, "show_report"),
label = "Show XML file (for publisher use)",
class = "btn btn-primary btn-validate")
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click show', 'XML information'])"
)
)
}
@@ -92,12 +96,23 @@ mod_xml_report_server <- function(id, input_data){
div(
style = "display: inline-block",
uiOutput(session$ns("clip"))
- ),
- downloadButton(
- NS(id, "report"),
- label = "Download file",
- class = "download-report"
- ),
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click clip', 'XML information'])"
+ ),
+ div(
+ style = "display: inline-block",
+ downloadButton(
+ NS(id, "report"),
+ label = "Download file",
+ class = "download-report"
+ )
+ ) %>%
+ tagAppendAttributes(
+ # Track click event with Matomo
+ onclick = "_paq.push(['trackEvent', 'Output', 'Click download', 'XML information'])"
+ ),
modalButton("Close")
)
)
From bb8059c468d963b0b068135c4cc44e3da4ef0e88 Mon Sep 17 00:00:00 2001
From: Marton Kovacs
Date: Sat, 4 Nov 2023 09:39:27 +0100
Subject: [PATCH 4/6] changed read spreadsheet order for convenience
---
R/mod_read_spreadsheet.R | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/R/mod_read_spreadsheet.R b/R/mod_read_spreadsheet.R
index e711c64..36baf99 100644
--- a/R/mod_read_spreadsheet.R
+++ b/R/mod_read_spreadsheet.R
@@ -19,6 +19,16 @@ mod_read_spreadsheet_ui <- function(id){
tabsetPanel(
id = NS(id, "which_input"),
type = "tabs",
+ tabPanel(
+ "URL",
+ h5("Paste the url of a shared googlesheet and click the upload button", class = "main-steps-desc"),
+ textInput(
+ NS(id, "url"),
+ label = NULL,
+ value = "",
+ width = NULL,
+ placeholder = "https://docs.google.com/spreadsheets/d/.../edit?usp=sharing")
+ ),
tabPanel(
"Local file",
h5("Choose the spreadsheet on your computer", class = "main-steps-desc"),
@@ -30,16 +40,6 @@ mod_read_spreadsheet_ui <- function(id){
'.tsv',
'.xlsx'),
multiple = FALSE)
- ),
- tabPanel(
- "URL",
- h5("Paste the url of a shared googlesheet and click the upload button", class = "main-steps-desc"),
- textInput(
- NS(id, "url"),
- label = NULL,
- value = "",
- width = NULL,
- placeholder = "https://docs.google.com/spreadsheets/d/.../edit?usp=sharing")
)
),
actionButton(
@@ -95,8 +95,8 @@ mod_read_spreadsheet_server <- function(id) {
list(error = read_output$error[["message"]],
warning = ""))
return(NULL)
- } else { #have successfully read the file or Google Sheet
- message("File or Google Sheet has been uploaded.") #Print message for logfile so we know when people have uploaded a contributor table
+ } else { # Have successfully read the file or Google Sheet
+ message("File or Google Sheet has been uploaded.") # Print message for logfile so we know when people have uploaded a contributor table
return(read_output$result)
}
})
From a55abc0dead2826a801be3c3f214c2d5cdecb783 Mon Sep 17 00:00:00 2001
From: Marton Kovacs
Date: Sat, 4 Nov 2023 11:33:34 +0100
Subject: [PATCH 5/6] added suppot us button
---
R/app_ui.R | 21 ++-
inst/app/www/about.Rmd | 14 +-
inst/app/www/about.html | 362 ++++++++++++++++++++++++++++++----------
inst/app/www/custom.css | 22 ++-
4 files changed, 319 insertions(+), 100 deletions(-)
diff --git a/R/app_ui.R b/R/app_ui.R
index 38157ba..5aaf52e 100644
--- a/R/app_ui.R
+++ b/R/app_ui.R
@@ -5,6 +5,17 @@ app_ui <- function() {
golem_add_external_resources(),
navbarPage(
+ # Header
+ header = tagList(
+ div(id = "support-div",
+ a(id = "support-btn",
+ class = "btn",
+ href = "https://opencollective.com/tenzing",
+ target = "_blank",
+ "Support us",
+ )
+ )
+ ),
# Title
title = list(
div(
@@ -40,7 +51,8 @@ app_ui <- function() {
tags$a(href = "https://docs.google.com/spreadsheets/d/1Gl0cwqN_nTsdFH9yhSvi9NypBfDCEhViGq4A3MnBrG8/edit?usp=sharing",
"contributors table template",
target="_blank",
- style = "display: inline; color: #ffdf57; text-decoration: underline;")
+ style = "display: inline; color: #ffdf57; text-decoration: underline;",
+ class = "link")
)
),
# Second step
@@ -91,13 +103,8 @@ app_ui <- function() {
# Citation
HTML(
"Citation:
- Holcombe, A. O., Kovacs, M., Aust, F., & Aczel, B. (2020). Documenting contributions to scholarly articles using CRediT and tenzing. PLoS ONE, 15 (12), e0244611.
"
+ Holcombe, A. O., Kovacs, M., Aust, F., & Aczel, B. (2020). Documenting contributions to scholarly articles using CRediT and tenzing. PLoS ONE, 15 (12), e0244611.
"
),
- # Donation
- HTML(
- "Donation:
- Open Collective
"
- ),
# Privacy notice
HTML("Privacy notice:
To get a sense of how many users we have, we log a masked version of IP addresses. You are not identifiable by the logged information.
")
diff --git a/inst/app/www/about.Rmd b/inst/app/www/about.Rmd
index 9f5c9b8..9ddecb5 100644
--- a/inst/app/www/about.Rmd
+++ b/inst/app/www/about.Rmd
@@ -5,9 +5,9 @@ output: html_document
### About contributorship
-[CRediT](http://credit.niso.org/) (Contributor Roles Taxonomy) is a high-level taxonomy, including 14 roles, that indicate some of the roles played by contributors to scientific scholarly output. The roles describe each contributor’s specific contribution to the scholarly output.
+CRediT (Contributor Roles Taxonomy) is a high-level taxonomy, including 14 roles, that indicate some of the roles played by contributors to scientific scholarly output. The roles describe each contributor's specific contribution to the scholarly output.
-_tenzing_ is named after the Nepali-Indian Sherpa Tenzing Norgay, who was one of the two individuals who reached the summit of Mount Everest for the first time. Despite his essential contribution, the achievement is less credited to him than to his partner, the New Zealand mountaineer Edmund Hillary.
+*tenzing* is named after the Nepali-Indian Sherpa Tenzing Norgay, who was one of the two individuals who reached the summit of Mount Everest for the first time. Despite his essential contribution, the achievement is less credited to him than to his partner, the New Zealand mountaineer Edmund Hillary.
### Contributors
@@ -17,14 +17,14 @@ Marton Kovacs, Alex Holcombe, Balazs Aczel, Frederik Aust, Julien Colomb
Please cite the following article when referring to tenzing:
-Holcombe, A. O., Kovacs, M., Aust, F., & Aczel, B. (2020). [Documenting contributions to scholarly articles using CRediT and tenzing](https://doi.org/10.1371/journal.pone.0244611). _Plos one, 15_(12), e0244611.
+Holcombe, A. O., Kovacs, M., Aust, F., & Aczel, B. (2020). Documenting contributions to scholarly articles using CRediT and tenzing . *Plos one, 15*(12), e0244611.
### Organizations recommending the app
-[Collabra: Psychology](https://www.collabra.org/)
-
-[DORA](https://sfdora.org/resource-library/?_resource_type=tools)
+Collabra: Psychology
+
+DORA
### Questions and comments
-If you have any questions or comments, please write to Marton Kovacs: marton.balazs.kovacs@gmail.com, or submit an issue [on Github](https://github.com/marton-balazs-kovacs/tenzing).
+If you have any questions or comments, please write to Marton Kovacs , or submit an issue on Github .
diff --git a/inst/app/www/about.html b/inst/app/www/about.html
index fdaec36..1fedd66 100644
--- a/inst/app/www/about.html
+++ b/inst/app/www/about.html
@@ -13,34 +13,228 @@
about.knit
-
-
+
+
-
-
-
-
+
+
+
+
-
-
+h1.title {font-size: 38px;}
+h2 {font-size: 30px;}
+h3 {font-size: 24px;}
+h4 {font-size: 18px;}
+h5 {font-size: 16px;}
+h6 {font-size: 12px;}
+code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
+pre:not([class]) { background-color: white }
+
+
+code{white-space: pre-wrap;}
+span.smallcaps{font-variant: small-caps;}
+span.underline{text-decoration: underline;}
+div.column{display: inline-block; vertical-align: top; width: 50%;}
+div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+ul.task-list{list-style: none;}
+