18692: Snackbar changes
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Wed, 21 Sep 2022 22:09:04 +0000 (00:09 +0200)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Wed, 21 Sep 2022 22:09:04 +0000 (00:09 +0200)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

.env
src/views-components/snackbar/snackbar.tsx

diff --git a/.env b/.env
index fd91b99c6a28f33db092cf50f6405ba42020b17b..7c38110f088698e81f5e805dc649d13992245221 100644 (file)
--- a/.env
+++ b/.env
@@ -3,5 +3,7 @@
 # SPDX-License-Identifier: AGPL-3.0
 
 REACT_APP_ARVADOS_CONFIG_URL=/config.json
-REACT_APP_ARVADOS_API_HOST=c97qk.arvadosapi.com
-HTTPS=true
\ No newline at end of file
+REACT_APP_ARVADOS_API_HOST=ce8i5.arvadosapi.com
+#
+#127.0.0.1:9999
+HTTPS=false
\ No newline at end of file
index f3d3368ba0bdbd3e3561081e394bdedcded0774b..1887f0bde042c0e95fa5b78326dc71247ec75d10 100644 (file)
@@ -125,7 +125,7 @@ export const Snackbar = withStyles(styles)(connect(mapStateToProps, mapDispatchT
                                         {message.message}
                                     </span>
                                 }
-                                action={actions(message, props.onClick, props.onClose, classes, index)}
+                                action={actions(message, props.onClick, props.onClose, classes, index, props.autoHideDuration)}
                             />
                          })
                     }
@@ -135,7 +135,11 @@ export const Snackbar = withStyles(styles)(connect(mapStateToProps, mapDispatchT
     }
 ));
 
-const actions = (props: SnackbarMessage, onClick, onClose, classes, index) => {
+const actions = (props: SnackbarMessage, onClick, onClose, classes, index, autoHideDuration) => {
+    if (onClose && autoHideDuration) {
+        setTimeout(onClose, autoHideDuration);
+    }
+
     const actions = [
         <IconButton
             key="close"