diff --git a/Dockerfile b/Dockerfile index 5eb2b14..ad05935 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,8 @@ RUN aptitude install -y -f -o APT::Get::Fix-Missing=true \ libharfbuzz-dev \ libfribidi-dev \ mesa-common-dev \ + libudunits2-dev \ + libgdal-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -41,8 +43,8 @@ RUN dpkg -S /usr/include/GL/gl.h \ && R -e 'install.packages("devtools")' \ && R -e 'devtools::install_version("remotes", version = "2.3.0")' -RUN R -e 'remotes::install_github("EDIorg/EMLassemblyline@ad838f970ee259eda7f96d6a0bbe7f9fa509c66e")' -RUN Rscript -e 'remotes::install_github("LukasK13/SummeRnote@7c404e1578ab3567fdb331716ca831913ccf645a")' +RUN R -e 'remotes::install_github("EDIorg/EMLassemblyline@d3d2eb90a67370c1138e234c09dd96c529408f90")' +RUN Rscript -e 'remotes::install_github("earnaud/SummeRnote")' RUN R -e 'remotes::install_version("RCurl",upgrade="never", version = "1.98-1.3")'\ && R -e 'remotes::install_version("attempt",upgrade="never", version = "0.3.1")' \ @@ -66,7 +68,10 @@ RUN R -e 'remotes::install_version("RCurl",upgrade="never", version = "1.98-1.3 && R -e 'remotes::install_version("golem",upgrade="never", version = "0.3.1")' \ && R -e 'remotes::install_version("textutils",upgrade="never", version = "0.2-1")' \ && R -e 'remotes::install_version("tippy",upgrade="never", version = "0.1.0")' \ -&& R -e 'remotes::install_version("shinybusy",upgrade="never", version = "0.2.2")' +&& R -e 'remotes::install_version("shinybusy",upgrade="never", version = "0.2.2")' \ +&& R -e 'remotes::install_version("units",upgrade="never", version = "0.7-2")'\ +&& R -e 'remotes::install_version("sf",upgrade="never", version = "1.0-5")' \ +&& R -e 'remotes::install_version("leaflet",upgrade="never", version = "2.0.4.1")' RUN R -e 'remotes::install_local(dir(".", pattern = "MetaShARK_.*\\.tar.gz"), upgrade="never")' diff --git a/MetaShARK_1.7.0.tar.gz b/MetaShARK_1.7.0.tar.gz index ef6e175..43b9eff 100644 Binary files a/MetaShARK_1.7.0.tar.gz and b/MetaShARK_1.7.0.tar.gz differ diff --git a/NAMESPACE b/NAMESPACE index 2eed318..e8d3baa 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,6 +12,7 @@ export(isHTMLTruthy) export(listReactiveValues) export(makeReactiveTrigger) export(optional) +export(reactiveDirReader) export(readHTMLfromMD) export(remove_shiny_inputs) export(renderBibliography) diff --git a/R/eal_2_DataFiles_helpers.R b/R/eal_2_DataFiles_helpers.R index 689b165..f52d02b 100644 --- a/R/eal_2_DataFiles_helpers.R +++ b/R/eal_2_DataFiles_helpers.R @@ -2,14 +2,12 @@ #' #' @noRd insertDataFileInput <- function(id, main.env){ - # Add row - .id <- unns(id) - # create the UI -- no NS !!! + # create the UI new.ui <- DataFileInputUI(id, main.env) # insert the UI insertUI(selector = "#inserthere_eal2", ui = new.ui, immediate = TRUE) # create the server - DataFileInput(.id, main.env) + DataFileInput(unns(id), main.env) } #' @import shiny @@ -44,7 +42,7 @@ DataFileInputUI <- function(id, main.env) { shinyjs::hidden( tags$div( id = NS(id, "content"), - class = "contentRow", + # class = "contentRow", tagList( fluidRow( column( diff --git a/R/eal_3_Attributes_helpers.R b/R/eal_3_Attributes_helpers.R index 91b23f2..e6e8dc1 100644 --- a/R/eal_3_Attributes_helpers.R +++ b/R/eal_3_Attributes_helpers.R @@ -65,11 +65,11 @@ setUnitList <- function(main.env, set = NULL) { types <- unique(names(choices[sapply(choices, length) != 1])) out <- choices[sapply(choices, length) == 1] out <- c(custom = out$custom, out[names(out) != "custom"]) - # browser() sapply(types, function(type){ out[[type]] <<- unname(choices[which(names(choices) == type)])[[1]] }) + # Correct value set for updates if(!is.null(set)) { set <- set |> @@ -83,8 +83,6 @@ setUnitList <- function(main.env, set = NULL) { as.list() } - # TODO rework unit listing - # Output return(list( unit.list = out, diff --git a/R/fill_module.R b/R/fill_module.R index 641465b..86087ea 100644 --- a/R/fill_module.R +++ b/R/fill_module.R @@ -8,7 +8,7 @@ fillUI <- function(id) { tags$h4("EML Assembly Line"), fluidPage( style = "padding-top:2.5%; background-color: #ffffff57", - # * Top row ---- + ## Top row ---- tags$table( style="width: 100%", HTML( @@ -20,7 +20,10 @@ fillUI <- function(id) { ), tags$tr( tags$td( - style="width: 350px; min-width: 350px", + style=" + width: 350px; min-width: 350px; max-width: 500px; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + ", h3( textOutput(NS(id, "current_step")) ) @@ -62,7 +65,7 @@ fillUI <- function(id) { ), # uiOutput(NS(id, "chain")), - # * Pages ---- + ## Pages ---- pagesUI( NS(id, "wizard"), parent.id = id @@ -130,7 +133,7 @@ fill <- function(id, main.env) { ) }) - # * Quit ---- + ## Quit ---- { # show modal.state 'quit' button clicked observeEvent(input$quit, { @@ -187,13 +190,22 @@ fill <- function(id, main.env) { ) } # quit management - # * Save ---- + ## Save ---- observeEvent(input$save, { if(main.env$dev) devmsg("saved: %s", main.env$EAL$page, timer.env = main.env) saveReactive(main.env, main.env$EAL$page, do.template = FALSE) }) + ## Autosave ---- + observeEvent(main.env$EAL$page, { + req(main.env$EAL$page != 1) + if(main.env$dev) + devmsg("autosaved: %s", main.env$EAL$page, timer.env = main.env) + saveReactive(main.env, main.env$EAL$page, do.template = FALSE) + }, priority = -2, label = "EAL: autosave") # important priority + + ## Current step ---- output$current_step <- renderText({ req(main.env$EAL$current) @@ -214,18 +226,18 @@ fill <- function(id, main.env) { withProgress( { - # * Save & Template ---- + ## Save & Template ---- devmsg(tag="fill_module.R", "save & template", timer.env = main.env) if(main.env$EAL$old.page > 1) saveReactive( main.env, - main.env$EAL$old.page, + main.env$EAL$old.page, # do not template on 'previous' do.template = main.env$EAL$old.page < main.env$EAL$page ) incProgress(1/7) - # * set EAL variables ---- + ## set EAL variables ---- devmsg(tag="fill_module.R", "set EAL variables", timer.env = main.env) # left Data Files if (main.env$EAL$old.page == 2) @@ -239,29 +251,29 @@ fill <- function(id, main.env) { main.env$EAL$tag.list <- tagList() incProgress(1/7) - # * Reset local.rv ---- + ## Reset local.rv ---- devmsg(tag="fill_module.R", "set local rv", timer.env = main.env) main.env <- setLocalRV(main.env) incProgress(1/7) - # * Change page ---- + ## Change page ---- devmsg(tag="fill_module.R", "change pane", timer.env = main.env) updateTabsetPanel(session, "wizard-wizard", selected = steps[main.env$EAL$page]) incProgress(1/7) - # * Update history ---- + ## Update history ---- if (!main.env$EAL$current %in% main.env$EAL$history) { main.env$EAL$history <- c(main.env$EAL$history, main.env$EAL$current) } devmsg(tag="fill_module.R", "update history", timer.env = main.env) incProgress(1/7) - # * Savevar changes ---- + ## Savevar changes ---- devmsg(tag="fill_module.R", "save variables change", timer.env = main.env) main.env$save.variable$step <- main.env$EAL$page # save current location main.env$save.variable$history <- main.env$EAL$history # erase old save - # * Accessory UI elements ---- + ## Accessory UI elements ---- devmsg(tag="fill_module.R", "display UI", timer.env = main.env) if(main.env$EAL$page > 1) { shinyjs::show("top_row") @@ -280,13 +292,13 @@ fill <- function(id, main.env) { devmsg(tag="fill_module.R", "ended", timer.env = main.env) - # * Helps ==== + ## Helps ==== { main.env$EAL$help <- modalDialog( title = paste0(main.env$EAL$current, " - Help"), switch( main.env$EAL$page, - # ** SelectDP ==== + ### SelectDP ==== tagList( tags$p("This module allows you to manage your", tags$strong("data packages"), ". A data package (aka DP) is a collection of a dataset and its associated metadata @@ -308,7 +320,7 @@ fill <- function(id, main.env) { fields in further steps. You still will be able to edit them at your convenience.") ), - # ** Data Files ==== + ### Data Files ==== tagList( tags$p("This module allows you to load data files from the dataset you want to describe. Once uploaded, you can set:"), @@ -323,7 +335,7 @@ fill <- function(id, main.env) { tags$p("Recommended size per file is around 1 Gb. Such files and heavier ones might slow down the app.") ), - # ** Attributes ==== + ### Attributes ==== tagList( tags$p("This module allows you to describe precisely each attribute of each file. Some of these metadata are guessed from the data files. Such fields are annoted with a star (*). @@ -362,12 +374,12 @@ fill <- function(id, main.env) { tags$li(tags$i("Unit description:"), "some additional notes about the unit, how to compute it.") ) ), - # ** Catvars ==== + ### Catvars ==== tagList( tags$p("This module allows you to detail the categorical variables (class \"categorical\" in Attributes). For each variable, you will be able to detail each of its value by a short description.") ), - # ** Geocov ==== + ### Geocov ==== tagList( tags$p("This module allows you to define the geographic area in which the data have been produced. You have the choice between two methods to define geographic coverage:"), @@ -393,14 +405,14 @@ fill <- function(id, main.env) { ) ) ), - # ** Taxcov ==== + ### Taxcov ==== tagList( tags$p("This module allows you to define the taxonomical coverage of the study. You will be asked to select columns among your files containing the species name. Also, let the app know if the taxonomic coverage shall be written with scientific, common or both names. At last, select at least one taxonomic authority among the ones suggested."), ), - # ** Personnel ==== + ### Personnel ==== tagList( tags$p("This module allows you to get a full list of the people who contributed to the creation of this dataset. The recommended best practice is to", tags$b("use the ORCID"), "of a person. With @@ -416,7 +428,7 @@ fill <- function(id, main.env) { tags$li("Custom: as the list of roles is not exhaustive, feel free to add any role you consider important.") ) ), - # ** Misc ==== + ### Misc ==== tagList( tags$p("This module allows you to define the last details of your data package. Note that you can write some of these metadata using the markdown syntax. Here are brief descriptions of the fields:"), @@ -434,7 +446,7 @@ fill <- function(id, main.env) { from GBIF-EML).") ) ), - # ** Make EML ==== + ### Make EML ==== tagList( tags$p("Here we are (well done) ! This is the final step to write EML. Just click the button and let the magic happen. If an error occurs, this will be displayed to the screen. In this case, do not hesitate to get in touch with the dev team."), diff --git a/man/reactiveDirReader.Rd b/man/reactiveDirReader.Rd new file mode 100644 index 0000000..8457aee --- /dev/null +++ b/man/reactiveDirReader.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils_reactiveDirReader.R +\name{reactiveDirReader} +\alias{reactiveDirReader} +\title{reactiveDirReader} +\usage{ +files.poll <- reactiveDirReader(path, session, pattern, full.names = FALSE, intervalMillis = 1000) +} +\arguments{ +\item{repo}{(character) Path of the target directory to poll.} + +\item{session}{The user session to associate this file reader with, or NULL if none. If non-null, the reader will automatically stop when the session ends.} + +\item{pattern}{(character) an optional regular expression. Only file names which match the regular expression will be returned.} + +\item{full.names}{(logical) a logical value. If TRUE, the directory path is prepended to the file names to give a relative file path. If FALSE, the file names (rather than paths) are returned.} + +\item{intervalMillis}{(integer) Approximate number of milliseconds to wait between calls to checkFunc. This can be either a numeric value, or a function that returns a numeric value.} +} +\value{ +A reactive returning the files contained in the target repository. If folders +are returned, their content won't be detailed. If no file is to be found, only +returns "No files found." through \code{validate()}. +} +\description{ +Function adapted from \code{reactivePoll()}. Used to create a reactive data source, +which works by periodically polling a directory of non-reactive data sources. +}