Added modal when sending email

This commit is contained in:
neviyn 2019-08-27 10:13:06 +01:00
parent f5ed44415e
commit 60717b9023
2 changed files with 23 additions and 0 deletions

View File

@ -35,6 +35,7 @@
> >
</b-col> </b-col>
</b-row> </b-row>
<!--
<b-row class="my-3" align-h="center"> <b-row class="my-3" align-h="center">
<b-col lg="6" sm="12"> <b-col lg="6" sm="12">
<b-button class="scale-in-center" size="lg" to="/groupsession" block <b-button class="scale-in-center" size="lg" to="/groupsession" block
@ -42,6 +43,7 @@
> >
</b-col> </b-col>
</b-row> </b-row>
-->
</b-container> </b-container>
</template> </template>

View File

@ -17,6 +17,21 @@
<v-icon name="exclamation-circle" />Dismiss <v-icon name="exclamation-circle" />Dismiss
</button> </button>
</div> </div>
</b-modal>
<b-modal
ref="emailSendingModal"
class="text-center"
centered
hide-header
hide-footer
>
<div class="modal-header">
<h3 class="modal-title">Sending</h3>
</div>
<div class="d-block">
<br />
<p><v-icon name="spinner" spin="true" scale="2"></v-icon> Processing data and sending to the configured email address.</p>
</div>
</b-modal> </b-modal>
<b-modal <b-modal
ref="emailCompleteModal" ref="emailCompleteModal"
@ -294,6 +309,7 @@
<script> <script>
import Vue from "vue"; import Vue from "vue";
import "vue-awesome/icons/search"; import "vue-awesome/icons/search";
import "vue-awesome/icons/spinner"
import ObservationEntry from "../components/ObservationEntry.vue"; import ObservationEntry from "../components/ObservationEntry.vue";
import ObservationSearchBar from "../components/ObservationSearchBar"; import ObservationSearchBar from "../components/ObservationSearchBar";
@ -388,6 +404,7 @@ export default {
this.startDate = moment().subtract(amount, timeType); this.startDate = moment().subtract(amount, timeType);
}, },
sendEmail: function() { sendEmail: function() {
this.$refs.emailSendingModal.show();
Vue.axios Vue.axios
.post("/observations/email", { .post("/observations/email", {
site: this.$store.state.search.site, site: this.$store.state.search.site,
@ -398,9 +415,11 @@ export default {
person: this.$store.state.search.person person: this.$store.state.search.person
}) })
.then(() => { .then(() => {
this.$refs.emailSendingModal.hide();
this.$refs.emailCompleteModal.show(); this.$refs.emailCompleteModal.show();
}) })
.catch(error => { .catch(error => {
this.$refs.emailSendingModal.hide();
this.errorStatus = error.response.status; this.errorStatus = error.response.status;
this.errorMessage = error.response.data; this.errorMessage = error.response.data;
this.$refs.errorModal.show(); this.$refs.errorModal.show();
@ -418,6 +437,8 @@ export default {
position: relative; position: relative;
text-align: center; text-align: center;
} }
/*noinspection CssUnusedSymbol*/
.scorewarning { .scorewarning {
background-color: red; background-color: red;
} }