diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 348976a2c..f4a825a48 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- - '*'
+ - scf_master
tags:
- '*'
pull_request:
diff --git a/addon/components/bs-alert.hbs b/addon/components/bs-alert.hbs
index e192d07fb..ed8b27fbb 100644
--- a/addon/components/bs-alert.hbs
+++ b/addon/components/bs-alert.hbs
@@ -1,8 +1,7 @@
{{#unless this.hidden}}
{{#if this.dismissible}}
diff --git a/addon/components/bs-alert.js b/addon/components/bs-alert.js
index e483c607e..bbad72857 100644
--- a/addon/components/bs-alert.js
+++ b/addon/components/bs-alert.js
@@ -1,7 +1,7 @@
import { action } from '@ember/object';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
-import { later } from '@ember/runloop';
+import { later, schedule } from '@ember/runloop';
import usesTransition from 'ember-bootstrap/utils/decorators/uses-transition';
import deprecateSubclassing from 'ember-bootstrap/utils/deprecate-subclassing';
import arg from 'ember-bootstrap/utils/decorators/arg';
@@ -86,15 +86,33 @@ export default class Alert extends Component {
* @public
*/
get visible() {
- return this._visible ?? true;
+ let visible = this.args.visible;
+ if (visible !== this._visibleArg) {
+ // untracked bookkeeping, so the alert can be shown again after being dismissed once `@visible` changes
+ // eslint-disable-next-line ember/no-side-effects
+ this._visibleArg = visible;
+ this._visibleArgChanges++;
+ }
+ if (this._dismissedAt === this._visibleArgChanges) {
+ return false;
+ }
+ return visible !== undefined ? visible : true;
}
/**
- * @property _visible
+ * `@visible` as last seen by `visible`, and how often it has changed. These are untracked, as `visible` updates them
+ * while rendering.
+ * @private
+ */
+ _visibleArg = this.args.visible;
+ _visibleArgChanges = 0;
+
+ /**
+ * The value of `_visibleArgChanges` when the alert was dismissed, so the alert stays hidden until `@visible` changes.
* @private
*/
@tracked
- _visible = this.args.visible;
+ _dismissedAt = -1;
/**
* Set to false to disable the fade out animation when hiding the alert.
@@ -163,7 +181,7 @@ export default class Alert extends Component {
@action
dismiss() {
if (this.args.onDismiss?.() !== false) {
- this._visible = false;
+ this._dismissedAt = this._visibleArgChanges;
}
}
@@ -202,7 +220,12 @@ export default class Alert extends Component {
);
} else {
this.hidden = true;
- this.args.onDismissed?.();
+ // hide() runs while rendering, and onDismissed may set @visible, which that render has already read
+ schedule('afterRender', this, function () {
+ if (!this.isDestroyed) {
+ this.args.onDismissed?.();
+ }
+ });
}
}
@@ -214,9 +237,4 @@ export default class Alert extends Component {
this.hide();
}
}
-
- @action
- updateVisibility() {
- this._visible = this.args.visible;
- }
}
diff --git a/addon/components/bs-modal/footer.hbs b/addon/components/bs-modal/footer.hbs
index bcabd3220..fa09ec07e 100644
--- a/addon/components/bs-modal/footer.hbs
+++ b/addon/components/bs-modal/footer.hbs
@@ -5,7 +5,7 @@
{{else}}
{{#if @submitTitle}}
-
+
{{else}}
{{/if}}
diff --git a/addon/components/bs-modal/footer.js b/addon/components/bs-modal/footer.js
index 729eb115f..db033fd66 100644
--- a/addon/components/bs-modal/footer.js
+++ b/addon/components/bs-modal/footer.js
@@ -70,8 +70,14 @@ import { action } from '@ember/object';
export default class ModalFooter extends Component {
@action
handleSubmit(event) {
- // the footer is a