diff --git a/CHANGELOG.md b/CHANGELOG.md index d7a90ce9d..2226e5b63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (GH #920) Optimize docker builds, making them faster by leveraging more caching mechanisms and removing unnecessary package installation - (GH #1007) Create new Taginput component to replace Buefy's taginput component - (GH #1009) Replace buefy toasts with c-toasts from `csc-ui` +- (GH #1014) Replace buefy snackbars with custom c-toasts from `csc-ui` ### Fixed diff --git a/swift_browser_ui_frontend/src/common/lang.js b/swift_browser_ui_frontend/src/common/lang.js index 50de29100..afb4c7ba3 100644 --- a/swift_browser_ui_frontend/src/common/lang.js +++ b/swift_browser_ui_frontend/src/common/lang.js @@ -425,6 +425,10 @@ let default_translations = { uploadedFiles: "Uploaded files will be shared with all project members in ", advancedOptions: "Advanced encryption options", + enReady: + "Encryption engine is ready. Refresh the " + + "window to enable encryption.", + refresh: "Refresh", }, search: { container: "Bucket", @@ -903,6 +907,10 @@ let default_translations = { uploadedFiles: "Lähetetyt tiedostot jaetaan kaikille jäsenille projektissa ", advancedOptions: "Edistyneitä salausvaihtoehtoja", + enReady: + "Encryption engine is ready. Refresh the " + + "window to enable encryption.", + refresh: "Refresh", }, search: { container: "Säiliö", diff --git a/swift_browser_ui_frontend/src/components/BrowserSecondaryNavbar.vue b/swift_browser_ui_frontend/src/components/BrowserSecondaryNavbar.vue index 28be95d10..2155c28dd 100644 --- a/swift_browser_ui_frontend/src/components/BrowserSecondaryNavbar.vue +++ b/swift_browser_ui_frontend/src/components/BrowserSecondaryNavbar.vue @@ -63,6 +63,18 @@ vertical="center" data-testid="copy-toasts" /> + +

{{ $t("message.encrypt.enReady") }}

+ + {{ $t("message.encrypt.refresh") }} + +
@@ -430,17 +442,19 @@ export default { }); } }, + removeToast: function() { + this.enableDownload(); + document.querySelector("#largeDownload-toasts") + .removeToast("largeDownload"); + }, confirmDownload: function () { - // Snackbar for enabling large downloads for the duration of the - // session - this.$buefy.snackbar.open({ - duration: 5000, - message: this.$t("message.largeDownMessage"), - type: "is-success", - position: "is-top", - actionText: this.$t("message.largeDownAction"), - onAction: this.enableDownload, - }); + document.querySelector("#largeDownload-toasts").addToast( + { type: "info", + message: "", + id: "largeDownload", + progress: false, + custom: true }, + ); }, enableDownload: function () { // Enables large downloads upon execution diff --git a/swift_browser_ui_frontend/src/entries/main.js b/swift_browser_ui_frontend/src/entries/main.js index cd059e406..fc5032d6f 100644 --- a/swift_browser_ui_frontend/src/entries/main.js +++ b/swift_browser_ui_frontend/src/entries/main.js @@ -247,18 +247,14 @@ new Vue({ navigator.serviceWorker.addEventListener("message", e => { if (e.data.eventType == "wasmReady") { - this.$buefy.snackbar.open({ - message: - "Encryption engine is ready. Hit refresh to refresh the " + - "window to enable encryption.", - type: "is-success", - position: "is-top", - actionText: "Refresh", - indefinite: true, - onAction: () => { - location.reload(); - }, - }); + document.querySelector("#refresh-toasts").addToast( + { type: "success", + message: "", + id: "refresh-toast", + progress: false, + persistent: true, + custom: true }, + ); } });