From 4469a7bd44378d0bf4127f341a87accf043425af Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Thu, 21 Nov 2024 19:12:57 +0600 Subject: [PATCH] pkp/pkp-lib#4787 Reviewer suggestions 3 case consider WIP --- .../users/SelectReviewerSuggestionListItem.vue | 14 +++++++++++++- .../reviewerSuggestionManagerStore.js | 2 ++ .../useReviewerSuggestionManagerActions.js | 6 +++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/ListPanel/users/SelectReviewerSuggestionListItem.vue b/src/components/ListPanel/users/SelectReviewerSuggestionListItem.vue index a40262183..114bb9cf8 100644 --- a/src/components/ListPanel/users/SelectReviewerSuggestionListItem.vue +++ b/src/components/ListPanel/users/SelectReviewerSuggestionListItem.vue @@ -101,6 +101,14 @@ export default { * @param */ select() { + if (this.item.existingUserId && this.item.existingReviewerRole) { + pkp.eventBus.$emit('selected:reviewer', { + id: this.item.existingUserId, + fullName: this.localize(this.item.fullName), + }); + return; + } + const {t} = useLocalize(); const {openLegacyModal} = useLegacyGridUrl({ @@ -110,7 +118,11 @@ export default { submissionId: this.submissionId, stageId: this.stageId, reviewRoundId: this.reviewRoundId, - selectionType: pkp.const.REVIEWER_SELECT_CREATE, + selectionType: this.item.existingUserId + ? this.item.existingReviewerRole + ? pkp.const.REVIEWER_SELECT_ADVANCED_SEARCH + : pkp.const.REVIEWER_SELECT_ENROLL_EXISTING + : pkp.const.REVIEWER_SELECT_CREATE, reviewerSuggestionId: this.item.id, }, }); diff --git a/src/managers/ReviewerSuggestionManager/reviewerSuggestionManagerStore.js b/src/managers/ReviewerSuggestionManager/reviewerSuggestionManagerStore.js index f3a9d34ab..9a1e24f5b 100644 --- a/src/managers/ReviewerSuggestionManager/reviewerSuggestionManagerStore.js +++ b/src/managers/ReviewerSuggestionManager/reviewerSuggestionManagerStore.js @@ -51,6 +51,8 @@ export const useReviewerSuggestionManagerStore = defineComponentStore( fullName: localize(reviewerSuggestion.fullName), affiliation: localize(reviewerSuggestion.affiliation), suggestionReason: localize(reviewerSuggestion.suggestionReason), + existingReviewerRole: reviewerSuggestion.existingReviewerRole, + existingUserId: reviewerSuggestion.existingUserId, }); }); diff --git a/src/managers/ReviewerSuggestionManager/useReviewerSuggestionManagerActions.js b/src/managers/ReviewerSuggestionManager/useReviewerSuggestionManagerActions.js index ad11d7a9e..7b8fea687 100644 --- a/src/managers/ReviewerSuggestionManager/useReviewerSuggestionManagerActions.js +++ b/src/managers/ReviewerSuggestionManager/useReviewerSuggestionManagerActions.js @@ -19,7 +19,11 @@ export function useReviewerSuggestionManagerActions() { submissionId: submission.id, stageId: submissionStageId, reviewRoundId: reviewRoundId, - selectionType: pkp.const.REVIEWER_SELECT_CREATE, + selectionType: reviewerSuggestion.existingUserId + ? reviewerSuggestion.existingReviewerRole + ? pkp.const.REVIEWER_SELECT_ADVANCED_SEARCH + : pkp.const.REVIEWER_SELECT_ENROLL_EXISTING + : pkp.const.REVIEWER_SELECT_CREATE, reviewerSuggestionId: reviewerSuggestion.id, }, });