Skip to content

Commit 2f13f94

Browse files
committed
add invitation types
1 parent 72dcd93 commit 2f13f94

File tree

4 files changed

+448
-55
lines changed

4 files changed

+448
-55
lines changed

public/globals.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,11 @@ window.pkp = {
10141014
"Once the user is enabled, they will regain access to OJS, and you'll be able to invite them to roles as needed.",
10151015
'grid.user.grid.user.disableReasonDescription':
10161016
"Please note that once a user is disabled, you won't be able to add them to any roles until they are enabled again.",
1017+
'reviewer.responseDueDate':'Review Response Date',
1018+
'reviewer.reviewDueDate':'Review Response Due Date',
1019+
'reviewer.reviewTypes':'Review Types',
1020+
'reviewerInvitation.modal.message':'{$email} has been invited to review the submission "{$articleTitle}"<br><br> You can be updated about the user\'s descision on the reviewer panel in the review workflow or through email and OJS notifications',
1021+
'reviewerInvitation.modal.button':'View submission'
10171022
},
10181023
tinyMCE: {
10191024
skinUrl: '/styles/tinymce',
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<template>
2+
<FieldOptions
3+
:is-required="false"
4+
component="field-options"
5+
:all-errors="{}"
6+
name="reviewTypes"
7+
:label="t('reviewer.reviewTypes')"
8+
type="radio"
9+
:options="options"
10+
@change="
11+
(fieldName, propName, newValue, localeKey) =>
12+
updateReviewDetails(index, fieldName, newValue)
13+
"
14+
/>
15+
<div class="p-8">
16+
<FieldText
17+
name="responseDueDate"
18+
:label="t('reviewer.responseDueDate')"
19+
input-type="date"
20+
:is-required="true"
21+
value=""
22+
:all-errors="{}"
23+
@change="
24+
(fieldName, propName, newValue, localeKey) =>
25+
updateReviewDetails(index, fieldName, newValue)
26+
"
27+
/>
28+
<FieldText
29+
name="reviewDueDate"
30+
:label="t('reviewer.reviewDueDate')"
31+
input-type="date"
32+
:is-required="true"
33+
value=""
34+
:all-errors="{}"
35+
@change="
36+
(fieldName, propName, newValue, localeKey) =>
37+
updateReviewDetails(index, fieldName, newValue)
38+
"
39+
/>
40+
</div>
41+
</template>
42+
<script setup>
43+
import {defineProps} from 'vue';
44+
import FieldOptions from '@/components/Form/fields/FieldOptions.vue';
45+
import FieldText from '@/components/Form/fields/FieldText.vue';
46+
import {useLocalize} from '@/composables/useLocalize';
47+
import {useUserInvitationPageStore} from './UserInvitationPageStore';
48+
49+
defineProps({
50+
validateFields: {
51+
type: Array,
52+
default() {
53+
return null;
54+
},
55+
},
56+
});
57+
58+
const store = useUserInvitationPageStore();
59+
const {t} = useLocalize();
60+
const options = [
61+
{value: 'anonymus', label: 'Anonymus Reviewer / Anonymus Author'},
62+
{value: 'disclosed', label: 'Anonymus Reviewer / Disclosed Author'},
63+
{value: 'open', label: 'open'},
64+
];
65+
66+
function updateReviewDetails(index, fieldName, newValue) {
67+
store.updatePayload(fieldName, newValue, false);
68+
}
69+
</script>

src/pages/userInvitation/UserInvitationPageStore.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {useModal} from '@/composables/useModal';
77
export const useUserInvitationPageStore = defineComponentStore(
88
'userInvitationPage',
99
(pageInitConfig) => {
10+
const INVITATION_USER_ROLE_ASSIGNMENT = 'userRoleAssignment';
1011
const {openDialog} = useModal();
1112
const {t} = useLocalize();
1213
/**
@@ -339,12 +340,21 @@ export const useUserInvitationPageStore = defineComponentStore(
339340
if (data.value) {
340341
openDialog({
341342
title: t('userInvitation.modal.title'),
342-
message: t('userInvitation.modal.message', {
343-
email: invitationPayload.value.inviteeEmail,
344-
}),
343+
message:
344+
invitationType.value === INVITATION_USER_ROLE_ASSIGNMENT
345+
? t('userInvitation.modal.message', {
346+
email: invitationPayload.value.inviteeEmail,
347+
})
348+
: t('reviewerInvitation.modal.message', {
349+
email: invitationPayload.value.inviteeEmail,
350+
articleTitle: '',
351+
}),
345352
actions: [
346353
{
347-
label: t('userInvitation.modal.button'),
354+
label:
355+
invitationType.value === INVITATION_USER_ROLE_ASSIGNMENT
356+
? t('userInvitation.modal.button')
357+
: t('reviewerInvitation.modal.button'),
348358
callback: (close) => {
349359
redirectToPage();
350360
},

0 commit comments

Comments
 (0)