Skip to content

Commit

Permalink
fixing R checks
Browse files Browse the repository at this point in the history
fixing R checks
  • Loading branch information
jreps committed Sep 12, 2024
1 parent cbb41e0 commit 8e94769
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1,212 deletions.
30 changes: 17 additions & 13 deletions R/components-data-viewer.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,30 @@
#output: download buttons, table, and column selector


#' Result Table Viewer
#'
#' @param id string
#' @param downloadedFileName string, desired name of downloaded data file. can use the name from the module that is being used
#' @param boxTitle the title added to the box
#' @family {Utils}
#' @return shiny module UI
#' @family {Utils}

filteredDownloadButton <- function(tableId, label = "Download (Filtered)", filename = "filteredData.csv", icon = shiny::icon("download")) {
tags$div(class = "col-sm-3",
filteredDownloadButton <- function(
tableId,
label = "Download (Filtered)",
filename = "filteredData.csv",
icon = shiny::icon("download")
) {
shiny::tags$div(class = "col-sm-3",
htmltools::tags$button(
class = "btn btn-default",
tags$i(class = "fas fa-download", role = "presentation", "aria-label" = "download icon"),
shiny::tags$i(class = "fas fa-download", role = "presentation", "aria-label" = "download icon"),
label,
onclick = sprintf("Reactable.downloadDataCSV('%s', '%s')", tableId, filename)
)
)
}

#' Result Table Viewer
#'
#' @param id string
#' @param downloadedFileName string, desired name of downloaded data file. can use the name from the module that is being used
#' @param boxTitle the title added to the box
#' @family {Utils}
#' @return shiny module UI
#' @family {Utils}
resultTableViewer <- function(
id = "result-table",
downloadedFileName = NULL,
Expand Down Expand Up @@ -425,7 +429,7 @@ fuzzySearch<- reactable::JS('function(rows, columnIds, filterValue) {
},
content = function(file) {
data <- input$table_state
write.csv(data, file)
utils::write.csv(data, file)
}
)

Expand Down
Loading

0 comments on commit 8e94769

Please sign in to comment.