Skip to content

Commit

Permalink
pkp/pkp-lib#10743 Refine Reviewer manager
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Feb 14, 2025
1 parent dd35983 commit 39766ef
Show file tree
Hide file tree
Showing 25 changed files with 505 additions and 139 deletions.
72 changes: 41 additions & 31 deletions public/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ window.pkp = {
REVIEW_ASSIGNMENT_STATUS_THANKED: 9,
REVIEW_ASSIGNMENT_STATUS_CANCELLED: 10,
REVIEW_ASSIGNMENT_STATUS_REQUEST_RESEND: 11,
REVIEW_ASSIGNMENT_STATUS_VIEWED: 12,
REVIEW_ROUND_STATUS_REVISIONS_REQUESTED: 1,
REVIEW_ROUND_STATUS_RESUBMIT_FOR_REVIEW: 2,
REVIEW_ROUND_STATUS_SENT_TO_EXTERNAL: 3,
Expand Down Expand Up @@ -365,6 +366,7 @@ window.pkp = {
'editor.review.reviewDetails': 'Review Details',
'editor.review.reviewDue': 'Review due: {$date}',
'editor.review.reviewSubmitted': 'Review Submitted',
'editor.review.reviewViewed': 'Review Viewed',
'editor.review.reviewerThanked': 'Reviewer Thanked',
'editor.review.sendReminder': 'Send Reminder',
'editor.review.thankReviewer': 'Thank Reviewer',
Expand Down Expand Up @@ -413,7 +415,11 @@ window.pkp = {
'editor.submissionArchive.confirmDelete':
'Are you sure you want to permanently delete this submission?',
'editor.submissionLibrary': 'Library',
'editor.submissionReview.anonymous': 'Anonymous Reviewer/Disclosed Author',
'editor.submissionReview.doubleAnonymous':
'Anonymous Reviewer/Anonymous Author',
'editor.submissionReview.editReview': 'Edit Review',
'editor.submissionReview.open': 'Open',
'editor.submissionReview.uploadFile': 'Upload Review File',
'email.bcc': 'BCC',
'email.cc': 'CC',
Expand Down Expand Up @@ -443,12 +449,12 @@ window.pkp = {
'form.errorGoTo': 'Jump to next error',
'form.errorMany': 'Please correct {$count} errors.',
'form.errorOne': 'Please correct one error.',
'form.errors':
'The form was not saved because {$count} error(s) were encountered. Please correct these errors and try again.',
'form.errorSummaryOne':
'1 error detected! Please correct the error below before proceeding.',
'form.errorSummaryMany':
'{$count} errors detected! Please correct the errors below before proceeding.',
'form.errorSummaryOne':
'1 error detected! Please correct the error below before proceeding.',
'form.errors':
'The form was not saved because {$count} error(s) were encountered. Please correct these errors and try again.',
'form.multilingualLabel': '{$label} in {$localeName}',
'form.multilingualProgress': '{$count}/{$total} languages completed',
'form.saved': 'Saved',
Expand All @@ -458,10 +464,12 @@ window.pkp = {
'grid.action.deleteContributor': 'Delete Contributor',
'grid.action.deleteContributor.confirmationMessage':
'Are you sure you want to remove {$name} as a contributor? This action can not be undone.',
'grid.action.disable': 'Disable User',
'grid.action.disable': 'Disable',
'grid.action.edit': 'Edit',
'grid.action.editFile': 'Edit a file',
'grid.action.enable': 'Enable',
'grid.action.logInAs': 'Login As',
'grid.action.mergeUser': 'Merge user',
'grid.action.moreInformation': 'More Information',
'grid.action.order': 'Order',
'grid.action.remove': 'Remove',
Expand All @@ -473,7 +481,8 @@ window.pkp = {
'grid.user.confirmLogInAs':
'Log in as this user? All actions you perform will be attributed to this user.',
'grid.user.currentUsers': 'Current Users',
'grid.action.mergeUser': 'Merge User',
'grid.user.disable': 'Disable',
'grid.user.email': 'Email',
'help.help': 'Help',
'informationCenter.informationCenter': 'Information Center',
'invitation.cancelInvite.actionName': 'Cancel Invite',
Expand Down Expand Up @@ -585,6 +594,8 @@ window.pkp = {
'Add and edit templates that you would like to make available to the user when they are sending this email. The default will be loaded automatically, and the user will be able to quickly load any other templates you add here.',
'manager.mailables.editTemplate': 'Edit Template',
'manager.mailables.templates': 'Templates',
'manager.people.confirmRemove':
'Remove this user from this journal? This action will unenroll the user from all roles within this journal.',
'manager.publication.productionStage': 'Production',
'manager.publication.reviewStage': 'Review',
'manager.publication.submissionStage': 'Submission',
Expand Down Expand Up @@ -783,6 +794,26 @@ window.pkp = {
'submissions.declined': 'Declined',
'submissions.incomplete': 'Incomplete',
'user.affiliation': 'Affiliation',
'user.affiliations': 'Affiliations',
'user.affiliations.deleteModal.message':
'The affiliation <strong>{$affiliation}</strong> will be deleted.',
'user.affiliations.deleteModal.title': 'Are you sure?',
'user.affiliations.description':
'Enter the full name of the institution below, avoiding any acronyms. Select the name from the dropdown and click "Add" to include the affiliation in your profile. (e.g. "Simon Fraser University")',
'user.affiliations.institution': 'Institution',
'user.affiliations.primaryLocaleRequired':
'The primary language {$primaryLocale} is required',
'user.affiliations.searchPhraseLabel':
'Type the institute name in {$language}',
'user.affiliations.translation': 'More information',
'user.affiliations.translationActionsAriaLabel': 'Click to edit or delete',
'user.affiliations.translationDeleteActionLabel': 'Remove institution',
'user.affiliations.translationEditActionLabel': 'Edit institution name',
'user.affiliations.translationsAllAvailable': 'All translations available',
'user.affiliations.translationsSomeAvailable':
'{$count} of {$total} languages completed',
'user.affiliations.typeTranslationNameInLanguageLabel':
'Type the institute name in {$language}',
'user.authorization.accessibleWorkflowStage':
"You don't currently have access to that stage of the workflow.",
'user.email': 'Email',
Expand All @@ -797,8 +828,11 @@ window.pkp = {
'user.role.reviewer': 'Reviewer',
'user.role.reviewers': 'Reviewers',
'user.roles': 'Roles',
'user.startDate': 'Start Date',
'user.username': 'Username',
'userAccess.management.options': '##userAccess.management.options##',
'userAccess.search': 'Search User',
'userAccess.tableHeader.name': 'Name',
'userAccess.tableHeader.startDate': 'Start Date',
'userInvitation.cancel.goBack': 'Go Back',
'userInvitation.cancel.message':
'Are you sure want to cancel this invitation?',
Expand Down Expand Up @@ -832,30 +866,6 @@ window.pkp = {
'The submission has been advanced to the next round of review',
'workflow.submissionNextReviewRoundInFutureStage':
'The submission advanced to the next review round, was accepted, and is currently in the {$stage} stage.',
'user.affiliations': 'Affiliations',
'user.affiliations.description':
'Enter the full name of the institution below, avoiding any acronyms. Select the name from the dropdown and click "Add" to include the affiliation in your profile. (e.g. "Simon Fraser University")',
'user.affiliations.institution': 'Institution',
'user.affiliations.translation': 'More information',
'user.affiliations.translationEditActionLabel': 'Edit institution name',
'user.affiliations.translationDeleteActionLabel': 'Remove institution',
'user.affiliations.translationActionsAriaLabel': 'Click to edit or delete',
'user.affiliations.translationsAllAvailable': 'All translations available',
'user.affiliations.translationsSomeAvailable':
'{$count} of {$total} languages completed',
'user.affiliations.typeTranslationNameInLanguageLabel':
'Type the institute name in {$language}',
'user.affiliations.translationNameInLanguage':
'Institute name in {$language}',
'user.affiliations.deleteModal.title': 'Are you sure?',
'user.affiliations.deleteModal.message':
'The affiliation <strong>{$affiliation}</strong> will be deleted.',
'user.affiliations.searchPhraseLabel':
'Type the institute name in {$language}',
'user.affiliations.searchPhraseNothingFound':
'Your search phrase could not be found',
'user.affiliations.primaryLocaleRequired':
'The primary language {$primaryLocale} is required',
'workflow.uploadRevisions': 'Upload revisions',
},
tinyMCE: {
Expand Down
8 changes: 8 additions & 0 deletions src/components/Badge/Badge.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ export const VariantSuccessBg = {
},
};

export const VariantAttention = {
args: {
slot: 'Competing interests',
label: 'Competing interests',
colorVariant: 'attention',
},
};

export const VariantAttentionBg = {
args: {
slot: 'Review overdue',
Expand Down
13 changes: 12 additions & 1 deletion src/components/Badge/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export default {
'attention',
].includes(prop),
},
sizeVariant: {
required: false,
default: () => 'default',
// compact is used in reviewer status for competing interest
validator: (prop) => ['default', 'compact'].includes(prop),
},
/** */
/** Adds a small dot to the left of the `content` */
hasDot: Boolean,
Expand All @@ -75,11 +81,16 @@ export default {
const colorVariant = this.colorVariant;
return {
// base
'inline-block py-1 px-3 text-base-normal rounded-[1.2em] border': true,
'inline-block rounded-[1.2em] border': true,
// size default
'text-base-normal py-1 px-3': this.sizeVariant === 'default',
// size compact
'text-sm-normal py-[0.18rem] px-2': this.sizeVariant === 'compact',
// default
'text-default border-light': colorVariant === 'default',
// default-on-dark
'text-on-dark border-light': colorVariant === 'default-on-dark',
// primary
'border-primary text-primary bg-secondary':
colorVariant === 'primary',
Expand Down
70 changes: 70 additions & 0 deletions src/components/ReviewMethodIcons/ReviewMethodIcons.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<template>
<span>
<PkpPopover>
<template #button>
<span class="flex gap-x-1">
<Icon
v-for="icon in icons"
:key="icon"
:class="iconSize"
:icon="icon"
/>
</span>
</template>
<span class="text-base-normal uppercase text-default">{{ label }}</span>
</PkpPopover>
</span>
</template>
<script setup>
import {computed} from 'vue';
import Icon from '@/components/Icon/Icon.vue';
import PkpPopover from '@/components/Popover/Popover.vue';
import {useLocalize} from '@/composables/useLocalize';
const props = defineProps({
reviewMethod: {type: Number, required: true},
sizeVariants: {
required: false,
type: String,
default: () => 'default',
validator: (prop) => ['default', 'large'].includes(prop),
},
});
const {t} = useLocalize();
const icons = computed(() => {
switch (props.reviewMethod) {
case pkp.const.SUBMISSION_REVIEW_METHOD_ANONYMOUS:
return ['OpenReview', 'AnonymousReview'];
case pkp.const.SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS:
return ['AnonymousReview', 'AnonymousReview'];
case pkp.const.SUBMISSION_REVIEW_METHOD_OPEN:
return ['OpenReview', 'OpenReview'];
}
return ['OpenReview', 'OpenReview'];
});
const label = computed(() => {
switch (props.reviewMethod) {
case pkp.const.SUBMISSION_REVIEW_METHOD_ANONYMOUS:
return t('editor.submissionReview.anonymous');
case pkp.const.SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS:
return t('editor.submissionReview.doubleAnonymous');
case pkp.const.SUBMISSION_REVIEW_METHOD_OPEN:
return t('editor.submissionReview.open');
}
return t('editor.submissionReview.open');
});
const iconSize = computed(() => {
if (props.sizeVariants === 'large') {
return 'h-6 w-6';
}
return 'h-5 w-5';
});
</script>
21 changes: 9 additions & 12 deletions src/composables/useSubmission.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,14 @@ export function useSubmission() {
);
}

function getReviewMethodIcons(reviewAssignment) {
switch (reviewAssignment.reviewMethod) {
case pkp.const.SUBMISSION_REVIEW_METHOD_ANONYMOUS:
return ['OpenReview', 'AnonymousReview'];
case pkp.const.SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS:
return ['AnonymousReview', 'AnonymousReview'];
case pkp.const.SUBMISSION_REVIEW_METHOD_OPEN:
return ['OpenReview', 'OpenReview'];
}

return ['OpenReview', 'OpenReview'];
function getOpenAndCompletedReviewAssignmentsForRound(
reviewAssignments,
reviewRoundId,
) {
return getOpenReviewAssignmentsForRound(
reviewAssignments,
reviewRoundId,
).filter((reviewAssignment) => !!reviewAssignment.dateCompleted);
}

function isDecisionAvailable(submission, decisionId) {
Expand Down Expand Up @@ -267,7 +264,7 @@ export function useSubmission() {
getCompletedReviewAssignments,
getOpenReviewAssignments,
getOpenReviewAssignmentsForRound,
getReviewMethodIcons,
getOpenAndCompletedReviewAssignmentsForRound,
InProgressReviewAssignmentStatuses,
isDecisionAvailable,
};
Expand Down
2 changes: 1 addition & 1 deletion src/managers/FileManager/fileManagerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const useFileManagerStore = defineComponentStore(
newFilesApiUrl !== oldFilesApiUrl ||
JSON.stringify(newQueryParams) !== JSON.stringify(oldQueryParams)
) {
files.value = null;
data.value = null;
fetchFiles();
}
},
Expand Down
Loading

0 comments on commit 39766ef

Please sign in to comment.