From 2706f7ed74423875813866ab41c41eeed6114714 Mon Sep 17 00:00:00 2001 From: David Battersby Date: Fri, 12 Apr 2024 14:27:10 +0800 Subject: [PATCH] DEV: set toast progress bar to false by default (#26614) This change disables the toast notification progress bar by default. It can be enabled for a specific toast by setting showProgressBar: true. --- .../javascripts/discourse/app/components/bookmark-menu.gjs | 3 --- .../integration/components/float-kit/d-default-toast-test.js | 4 ++-- app/assets/javascripts/float-kit/addon/lib/constants.js | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/bookmark-menu.gjs b/app/assets/javascripts/discourse/app/components/bookmark-menu.gjs index c1fdd51acf7..07d1fd886da 100644 --- a/app/assets/javascripts/discourse/app/components/bookmark-menu.gjs +++ b/app/assets/javascripts/discourse/app/components/bookmark-menu.gjs @@ -88,7 +88,6 @@ export default class BookmarkMenu extends Component { // a bookmark, it switches to the other Edit/Delete menu. this.quicksaved = true; this.toasts.success({ - showProgressBar: false, duration: 3000, views: ["mobile"], data: { message: I18n.t("bookmarks.bookmarked_success") }, @@ -127,7 +126,6 @@ export default class BookmarkMenu extends Component { this.bookmarkManager.afterDelete(response, this.existingBookmark.id); this.toasts.success({ duration: 3000, - showProgressBar: false, data: { icon: "trash-alt", message: I18n.t("bookmarks.deleted_bookmark_success"), @@ -153,7 +151,6 @@ export default class BookmarkMenu extends Component { await this.bookmarkManager.save(); this.toasts.success({ duration: 3000, - showProgressBar: false, views: ["mobile"], data: { message: I18n.t("bookmarks.reminder_set_success") }, }); diff --git a/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-default-toast-test.js b/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-default-toast-test.js index a8619a77e76..7accec99cdc 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-default-toast-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-default-toast-test.js @@ -29,7 +29,7 @@ module( this.toast = new DToastInstance(this, {}); await render( - hbs`` + hbs`` ); assert.dom(".fk-d-default-toast__progress-bar").exists(); @@ -39,7 +39,7 @@ module( this.toast = new DToastInstance(this, {}); await render( - hbs`` + hbs`` ); assert.dom(".fk-d-default-toast__progress-bar").doesNotExist(); diff --git a/app/assets/javascripts/float-kit/addon/lib/constants.js b/app/assets/javascripts/float-kit/addon/lib/constants.js index 5b54a3df759..da60cca4a58 100644 --- a/app/assets/javascripts/float-kit/addon/lib/constants.js +++ b/app/assets/javascripts/float-kit/addon/lib/constants.js @@ -80,7 +80,7 @@ export const TOAST = { autoClose: true, duration: 3000, component: DDefaultToast, - showProgressBar: true, + showProgressBar: false, views: ["desktop", "mobile"], }, };