Skip to content

Commit

Permalink
Merge pull request #270 from touhidurabir/i8734_main
Browse files Browse the repository at this point in the history
pkp/pkp-lib#8734 Removed extra process call to handle bulk email sending
  • Loading branch information
Vitaliy-1 authored Mar 27, 2023
2 parents 4c63612 + c02347e commit 8b3d65c
Showing 1 changed file with 2 additions and 33 deletions.
35 changes: 2 additions & 33 deletions src/components/Container/AccessPage.vue
Original file line number Diff line number Diff line change
@@ -1,48 +1,19 @@
<script type="text/javascript">
import Page from './Page.vue';
import NotifyUsersForm from '@/components/Form/context/NotifyUsersForm.vue';
import ProgressBar from '@/components/ProgressBar/ProgressBar.vue';
export default {
name: 'AccessPage',
extends: Page,
components: {
NotifyUsersForm,
ProgressBar,
},
data() {
return {
completedJobs: 0,
progressUrl: '',
queueId: '',
totalJobs: 0,
totalBulkJobs: 0,
};
},
methods: {
/**
* Process an email jobs queue
*
* @param string queueId
*/
processQueue(queueId) {
var self = this;
$.ajax({
url: this.progressUrl.replace('{queueId}', queueId),
method: 'POST',
headers: {
'X-Csrf-Token': pkp.currentUser.csrfToken,
'X-Http-Method-Override': 'PUT',
},
error: this.ajaxErrorCallback,
success(r) {
self.completedJobs = self.totalJobs - r.pendingJobs;
if (r.pendingJobs) {
self.processQueue(queueId);
}
},
});
},
/**
* Reload the page to send another email
*/
Expand All @@ -56,9 +27,7 @@ export default {
return;
}
this.queueId = data.queueId;
this.totalJobs = data.totalJobs;
this.processQueue(this.queueId);
this.totalBulkJobs = data.totalBulkJobs;
});
},
destroyed() {
Expand Down

0 comments on commit 8b3d65c

Please sign in to comment.