@@ -22,6 +22,8 @@ const WITHDRAWN = 'withdrawn';
22
22
const PRE_MODERATION = 'pre-moderation' ;
23
23
const POST_MODERATION = 'post-moderation' ;
24
24
25
+ const PROVIDER_OSF = 'provider-osf' ;
26
+
25
27
const STATUS = Object ( { } ) ;
26
28
STATUS [ PENDING ] = 'preprints.detail.status_banner.pending' ;
27
29
STATUS [ ACCEPTED ] = 'preprints.detail.status_banner.accepted' ;
@@ -30,6 +32,7 @@ STATUS[PENDING_WITHDRAWAL]= 'preprints.detail.status_banner.pending_withdrawal';
30
32
STATUS [ WITHDRAWAL_REJECTED ] = 'preprints.detail.status_banner.withdrawal_rejected' ;
31
33
32
34
const MESSAGE = Object ( { } ) ;
35
+ MESSAGE [ PROVIDER_OSF ] = 'preprints.detail.status_banner.message.provider_osf' ;
33
36
MESSAGE [ PRE_MODERATION ] = 'preprints.detail.status_banner.message.pending_pre' ;
34
37
MESSAGE [ POST_MODERATION ] = 'preprints.detail.status_banner.message.pending_post' ;
35
38
MESSAGE [ ACCEPTED ] = 'preprints.detail.status_banner.message.accepted' ;
@@ -45,6 +48,7 @@ WORKFLOW[POST_MODERATION] = 'preprints.detail.status_banner.post_moderation';
45
48
WORKFLOW [ UNKNOWN ] = 'preprints.detail.status_banner.post_moderation' ;
46
49
47
50
const CLASS_NAMES = Object ( { } ) ;
51
+ CLASS_NAMES [ PROVIDER_OSF ] = 'preprint-status-pending-pre' ;
48
52
CLASS_NAMES [ PRE_MODERATION ] = 'preprint-status-pending-pre' ;
49
53
CLASS_NAMES [ POST_MODERATION ] = 'preprint-status-pending-post' ;
50
54
CLASS_NAMES [ ACCEPTED ] = 'preprint-status-accepted' ;
@@ -68,6 +72,7 @@ interface InputArgs {
68
72
provider : PreprintProviderModel ;
69
73
latestWithdrawalRequest : PreprintRequestModel | null ;
70
74
latestAction : PreprintRequestActionModel | ReviewActionModel | null ;
75
+ isOSFBanner : boolean | null ;
71
76
}
72
77
73
78
export default class PreprintStatusBanner extends Component < InputArgs > {
@@ -104,7 +109,9 @@ export default class PreprintStatusBanner extends Component<InputArgs>{
104
109
}
105
110
106
111
public get getClassName ( ) : string {
107
- if ( this . isPendingWithdrawal ) {
112
+ if ( this . args . isOSFBanner ) {
113
+ return CLASS_NAMES [ PROVIDER_OSF ] ;
114
+ } else if ( this . isPendingWithdrawal ) {
108
115
return CLASS_NAMES [ PENDING_WITHDRAWAL ] ;
109
116
} else if ( this . isWithdrawn ) {
110
117
return CLASS_NAMES [ WITHDRAWN ] ;
@@ -119,7 +126,12 @@ export default class PreprintStatusBanner extends Component<InputArgs>{
119
126
120
127
public get bannerContent ( ) : string {
121
128
const { provider } = this . args ;
122
- if ( this . isPendingWithdrawal ) {
129
+ if ( this . args . isOSFBanner ) {
130
+ return this . intl . t ( MESSAGE [ PROVIDER_OSF ] , {
131
+ name : 'OSF' ,
132
+ documentType : provider . documentType . plural ,
133
+ } ) ;
134
+ } else if ( this . isPendingWithdrawal ) {
123
135
return this . intl . t ( this . statusExplanation , { documentType : provider . documentType . singular } ) ;
124
136
} else if ( this . isWithdrawn ) {
125
137
return this . intl . t ( MESSAGE [ WITHDRAWN ] , { documentType : provider . documentType . singular } ) ;
0 commit comments