From cffca20550402191c3631b0de334e7583b4c6f60 Mon Sep 17 00:00:00 2001 From: Yannick Pascaud <47552935+PYannick@users.noreply.github.com> Date: Thu, 19 Nov 2020 13:21:33 +0600 Subject: [PATCH 1/2] small adds to the Shiny app --- inst/shiny/hfcApp/server.R | 9 +++++++++ inst/shiny/hfcApp/ui.R | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/inst/shiny/hfcApp/server.R b/inst/shiny/hfcApp/server.R index a242e63..1a4cdd5 100644 --- a/inst/shiny/hfcApp/server.R +++ b/inst/shiny/hfcApp/server.R @@ -379,13 +379,16 @@ server <- function(input, output, session) { if(file.exists(XLSform)){ workbook <- openxlsx::loadWorkbook(file = XLSform) worksheets <- openxlsx::getSheetNames(XLSform) + nbWorksheets <- length(worksheets) # If the XLSform already have a HFC tab if("HFC" %in% worksheets){ # HFC tab already exist, remove the tab openxlsx::removeWorksheet(workbook, "HFC") + nbWorksheets <- nbWorksheets - 1 } else { # nothing } + openxlsx::removeFilter(workbook, 1:nbWorksheets) # Create the HFC tab and write the content openxlsx::addWorksheet(workbook, "HFC") openxlsx::writeDataTable(workbook, sheet = "HFC", x = variableTable[,c("variableName", "variableValue")], withFilter = FALSE) @@ -400,6 +403,12 @@ server <- function(input, output, session) { functionsOrder=functionsConfig[,c("functionName","ord")], functionsOutput=subset(functionsOutputs, outputType=="csv"), fileName=sub('\\..[^\\.]*$', '', fileName)) + messageText <- paste0("The .Rmd file has been created in the vignette directory as :", + sub('\\..[^\\.]*$', '', fileName), + ".Rmd, and the XLSform has been updated/created in the data-raw folder as: ", + fileName, + ".xlsx") + showNotification(messageText, type = 'message', duration = 5) }, ignoreInit=TRUE) } diff --git a/inst/shiny/hfcApp/ui.R b/inst/shiny/hfcApp/ui.R index e0a4fc4..c3bef04 100644 --- a/inst/shiny/hfcApp/ui.R +++ b/inst/shiny/hfcApp/ui.R @@ -7,6 +7,17 @@ library(shinythemes) #### APP side ui <- fluidPage(theme = shinytheme("cerulean"), shinyjs::useShinyjs(), + tags$head( + tags$style( + HTML(".shiny-notification { + position:fixed; + top: calc(50%); + left: calc(50% - 340px); + width: 680px + }" + ) + ) + ), tags$style(".glyphicon-ok {color:#00FF00}"), tags$style(".glyphicon-remove {color:#FF0000}"), title = "High Frequency Checks", From 9a3da057c5d47f109de37bbe724a18e7d2abbc87 Mon Sep 17 00:00:00 2001 From: Yannick Pascaud <47552935+PYannick@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:54:16 +0600 Subject: [PATCH 2/2] Update QuietGlobalVariables.R --- R/QuietGlobalVariables.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/QuietGlobalVariables.R b/R/QuietGlobalVariables.R index 4e03322..09bba26 100644 --- a/R/QuietGlobalVariables.R +++ b/R/QuietGlobalVariables.R @@ -36,4 +36,5 @@ if(getRversion() >= "2.15.1") "variablesDatasets", "categories", "ymax", - "ymin")) + "ymin", + "type"))