From 3041c58b6bd06159304fbdf9faef128f8c6cf3bd Mon Sep 17 00:00:00 2001 From: Dimitris Efstathiou Date: Mon, 4 Dec 2023 20:29:35 +0200 Subject: [PATCH] pkp/pkp-lib#7505 Load Jats when changes happen to publication --- .../contributors/ContributorsListPanel.vue | 56 ++++++++--------- .../jats/SubmissionJatsListPanel.vue | 60 ++++++++----------- 2 files changed, 54 insertions(+), 62 deletions(-) diff --git a/src/components/ListPanel/contributors/ContributorsListPanel.vue b/src/components/ListPanel/contributors/ContributorsListPanel.vue index 04d8ece04..22306837e 100644 --- a/src/components/ListPanel/contributors/ContributorsListPanel.vue +++ b/src/components/ListPanel/contributors/ContributorsListPanel.vue @@ -366,6 +366,8 @@ export default { this.$emit('updated:contributors', newContributors); } this.closeFormModal(); + + this.getAndUpdatePublication(); }, /** @@ -374,20 +376,7 @@ export default { openPreviewModal() { this.isLoading = true; - $.ajax({ - url: this.publicationApiUrl, - type: 'GET', - context: this, - error: this.ajaxErrorCallback, - success(publication) { - this.$emit('updated:publication', publication); - - this.isModalOpenedPreview = true; - }, - complete(r) { - this.isLoading = false; - }, - }); + this.getAndUpdatePublication(); }, /** @@ -445,6 +434,8 @@ export default { }, ); this.$emit('updated:contributors', newContributors); + + this.getAndUpdatePublication(); }, complete(r) { this.isLoading = false; @@ -529,6 +520,8 @@ export default { cancelOrdering() { this.$emit('updated:contributors', this.itemsBeforeReordering); + this.getAndUpdatePublication(); + this.itemsBeforeReordering = null; this.isOrdering = false; }, @@ -563,20 +556,7 @@ export default { success(contributors) { this.$emit('updated:contributors', contributors); - // Update the publication in the background so that - // any author strings are updated - $.ajax({ - url: this.publicationApiUrl, - context: this, - type: 'GET', - success(publication) { - this.$emit('updated:publication', publication); - }, - complete() { - this.isLoading = false; - this.isOrdering = false; - }, - }); + this.getAndUpdatePublication(); }, error: this.ajaxErrorCallback, complete() { @@ -651,6 +631,26 @@ export default { this.$emit('updated:contributors', newItems); }, + + /** + * Update the publication in the background so that + * any author strings are updated + */ + getAndUpdatePublication() { + $.ajax({ + url: this.publicationApiUrl, + context: this, + type: 'GET', + success(publication) { + this.$emit('updated:publication', publication); + }, + complete() { + this.isLoading = false; + this.isOrdering = false; + }, + }); + }, + }, }; diff --git a/src/components/ListPanel/jats/SubmissionJatsListPanel.vue b/src/components/ListPanel/jats/SubmissionJatsListPanel.vue index a17443c2a..cc16dfd91 100644 --- a/src/components/ListPanel/jats/SubmissionJatsListPanel.vue +++ b/src/components/ListPanel/jats/SubmissionJatsListPanel.vue @@ -6,27 +6,28 @@

{{ title }}