From 0ddda0e544c1bb5a84a1633ab27a47b44c9b8bd4 Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.fr>
Date: Tue, 24 Mar 2020 15:23:24 +0000
Subject: [PATCH] v0.2.9.4 NEW: add observEvent objects to synchonize dataset
 between the Interface the Summary sheet tabPanels #10

---
 DESCRIPTION           |  2 +-
 NEWS.md               |  2 +-
 inst/ShinyGR/server.R | 15 +++++++++++++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index e0bbaf9..a213f1b 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: airGRteaching
 Type: Package
 Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
-Version: 0.2.9.3
+Version: 0.2.9.4
 Date: 2020-03-24
 Authors@R: c(
   person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
diff --git a/NEWS.md b/NEWS.md
index 3365397..3dfc077 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -4,7 +4,7 @@
 
 
 
-### 0.2.9.3 Release Notes (2020-03-24)
+### 0.2.9.4 Release Notes (2020-03-24)
 
 ____________________________________________________________________________________
 
diff --git a/inst/ShinyGR/server.R b/inst/ShinyGR/server.R
index 25afe98..82ff857 100644
--- a/inst/ShinyGR/server.R
+++ b/inst/ShinyGR/server.R
@@ -441,13 +441,24 @@ shinyServer(function(input, output, session) {
   }, priority = +10)
   
 
-  ## Time window slider
+  ## Time window slider and dataset choosen on the Summary sheet panel
   observeEvent({input$Dataset}, {
     updateSliderInput(session, inputId = "Period",
                       min = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]][1L], tz = "UTC"),
                       max = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]][2L], tz = "UTC"),
                       value = as.POSIXct(.ShinyGR.args$SimPer[[input$Dataset]], tz = "UTC"),
                       timeFormat = "%F", timezone = "+0000")
+    updateSelectInput(session, inputId = "DatasetSheet",
+                      choices = .ShinyGR.args$NamesObsBV,
+                      selected = input$Dataset)
+  })
+  
+  
+  ## Dataset choosen on the SInterface panel
+  observeEvent({input$DatasetSheet}, {
+    updateSelectInput(session, inputId = "Dataset",
+                      choices = .ShinyGR.args$NamesObsBV,
+                      selected = input$DatasetSheet)
   })
   
   
@@ -976,7 +987,7 @@ shinyServer(function(input, output, session) {
       tags$p(tags$h6("Click on the image to open it in a new window and to enlarge it."),
              tags$a(href = urlSheet, target = "_blank", rel = "noopener noreferrer",
                     tags$img(src = urlSheet, height = "770px",
-                             alt = sprintf("Go to webGR.inrae.fr to see %s in the activities/database section", codeBH),
+                             alt = sprintf("If the image does not appear, try by clicking on this link."),
                              title = "Click to open in a new window")))
     } else {
       urlSheet <- "fig/sheet_W1110010_thumbnail.png"
-- 
GitLab