CASH-79: add Save Progress success alert message
This commit is contained in:
parent
ba32c8e417
commit
14b899453f
1 changed files with 16 additions and 3 deletions
|
|
@ -2,14 +2,21 @@
|
|||
<div class="save-progress-modal-question">
|
||||
<buttonMain
|
||||
ref="buttonMain"
|
||||
v-if="!isProgressSaved"
|
||||
:buttonText="buttonText"
|
||||
loaderColor="white"
|
||||
:suppressLoader="true"
|
||||
@click-event="openModal" />
|
||||
<alert
|
||||
class="my-4"
|
||||
v-else
|
||||
cmsWidgetName="SaveProgressModalAlertWidget"
|
||||
alertClass="alert-success" />
|
||||
<modal
|
||||
:ref="modalName"
|
||||
:headerText="modalHeaderText"
|
||||
suppressPageScroll
|
||||
:onModalClosedCallback="onModalClosed"
|
||||
:footerButtonText="modalButtonText"
|
||||
@footer-button-event="saveProgress">
|
||||
<p class="modal-body">{{ modalBodyText }}</p>
|
||||
|
|
@ -27,6 +34,7 @@ import saveProgressQuestion from "@/fmg-components/save-progress-modal-question/
|
|||
import modal from "@/digital-components/modal/modal";
|
||||
import { storeActions } from "@/constants/store-actions.js";
|
||||
import buttonMain from "@/ux-components/button-main/button-main";
|
||||
import alert from "@/ux-components/alert/alert";
|
||||
|
||||
export default {
|
||||
name: "save-progress-modal-question",
|
||||
|
|
@ -34,6 +42,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
userInput: "",
|
||||
isProgressSaved: false,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
|
@ -69,15 +78,18 @@ export default {
|
|||
this.modal.openModal();
|
||||
this.modal.resetButtonStyle();
|
||||
},
|
||||
closeModal() {
|
||||
this.modal.closeModal();
|
||||
},
|
||||
// onModalClosed() {
|
||||
// this.isProgressSaved = true;
|
||||
// },
|
||||
async saveProgress() {
|
||||
console.log("Saving Progress! userInput is: ", this.userInput);
|
||||
|
||||
// save email address to store
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.userInput, false);
|
||||
|
||||
// hide save progress button; show success message alert
|
||||
this.isProgressSaved = true;
|
||||
|
||||
// TODO send store call to send to new API (that triggers an email send)
|
||||
|
||||
// TODO hide button trigger and replace with success message
|
||||
|
|
@ -88,6 +100,7 @@ export default {
|
|||
modal,
|
||||
buttonMain,
|
||||
saveProgressQuestion,
|
||||
alert,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue