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.
This commit is contained in:
David Battersby 2024-04-12 14:27:10 +08:00 committed by GitHub
parent 18bb6b0871
commit 2706f7ed74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View File

@ -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") },
});

View File

@ -29,7 +29,7 @@ module(
this.toast = new DToastInstance(this, {});
await render(
hbs`<DDefaultToast @data={{this.toast.options.data}} @showProgressBar={{true}} @autoClose={{true}} @onRegisterProgressBar={{(noop)}} />`
hbs`<DDefaultToast @data={{this.toast.options.data}} @showProgressBar={{true}} @onRegisterProgressBar={{(noop)}} />`
);
assert.dom(".fk-d-default-toast__progress-bar").exists();
@ -39,7 +39,7 @@ module(
this.toast = new DToastInstance(this, {});
await render(
hbs`<DDefaultToast @data={{this.toast.options.data}} @showProgressBar={{false}} @autoClose={{false}} />`
hbs`<DDefaultToast @data={{this.toast.options.data}} @showProgressBar={{false}} />`
);
assert.dom(".fk-d-default-toast__progress-bar").doesNotExist();

View File

@ -80,7 +80,7 @@ export const TOAST = {
autoClose: true,
duration: 3000,
component: DDefaultToast,
showProgressBar: true,
showProgressBar: false,
views: ["desktop", "mobile"],
},
};