2
2
useSubmission ,
3
3
CompletedReviewAssignmentStatuses ,
4
4
} from '@/composables/useSubmission.js' ;
5
+ import { useCurrentUser } from '@/composables/useCurrentUser' ;
6
+
5
7
import { useLocalize } from '@/composables/useLocalize' ;
6
8
import { useDate } from '@/composables/useDate' ;
7
9
import { Actions as ParticipantManagerActions } from '@/managers/ParticipantManager/useParticipantManagerActions' ;
@@ -20,6 +22,11 @@ const {
20
22
getStageLabel,
21
23
} = useSubmission ( ) ;
22
24
25
+ const {
26
+ hasCurrentUserAtLeastOneAssignedRoleInAnyStage,
27
+ isCurrentUserAssignedAsReviewer,
28
+ } = useCurrentUser ( ) ;
29
+
23
30
export function useDashboardConfigEditorialActivity ( ) {
24
31
function getEditorialActivityForEditorialDashboard ( submission ) {
25
32
const activeStage = getActiveStage ( submission ) ;
@@ -51,6 +58,46 @@ export function useDashboardConfigEditorialActivity() {
51
58
] ;
52
59
}
53
60
61
+ // Warning that I am assigned as author, relevant if I am NOT assigned via any editorial role
62
+ if (
63
+ hasCurrentUserAtLeastOneAssignedRoleInAnyStage ( submission , [
64
+ pkp . const . ROLE_ID_AUTHOR ,
65
+ ] ) &&
66
+ ! hasCurrentUserAtLeastOneAssignedRoleInAnyStage ( submission , [
67
+ pkp . const . ROLE_ID_MANAGER ,
68
+ pkp . const . ROLE_ID_SUB_EDITOR ,
69
+ pkp . const . ROLE_ID_ASSISTANT ,
70
+ ] )
71
+ ) {
72
+ return [
73
+ {
74
+ component : 'DashboardCellSubmissionActivityActionAlert' ,
75
+ props : {
76
+ alert : t ( 'dashboard.noAccessBeingAuthor' ) ,
77
+ } ,
78
+ } ,
79
+ ] ;
80
+ }
81
+
82
+ // Warning that I am assigned as author, relevant if I am NOT assigned via any editorial role
83
+ if (
84
+ isCurrentUserAssignedAsReviewer ( submission ) &&
85
+ ! hasCurrentUserAtLeastOneAssignedRoleInAnyStage ( submission , [
86
+ pkp . const . ROLE_ID_MANAGER ,
87
+ pkp . const . ROLE_ID_SUB_EDITOR ,
88
+ pkp . const . ROLE_ID_ASSISTANT ,
89
+ ] )
90
+ ) {
91
+ return [
92
+ {
93
+ component : 'DashboardCellSubmissionActivityActionAlert' ,
94
+ props : {
95
+ alert : t ( 'dashboard.noAccessBeingReviewer' ) ,
96
+ } ,
97
+ } ,
98
+ ] ;
99
+ }
100
+
54
101
if ( activeStage . id === pkp . const . WORKFLOW_STAGE_ID_SUBMISSION ) {
55
102
if ( ! submission . editorAssigned ) {
56
103
return [
0 commit comments