@@ -22,6 +22,8 @@ const WITHDRAWN = 'withdrawn';
2222const PRE_MODERATION = 'pre-moderation' ;
2323const POST_MODERATION = 'post-moderation' ;
2424
25+ const PROVIDER_OSF = 'provider-osf' ;
26+
2527const STATUS = Object ( { } ) ;
2628STATUS [ PENDING ] = 'preprints.detail.status_banner.pending' ;
2729STATUS [ ACCEPTED ] = 'preprints.detail.status_banner.accepted' ;
@@ -30,6 +32,7 @@ STATUS[PENDING_WITHDRAWAL]= 'preprints.detail.status_banner.pending_withdrawal';
3032STATUS [ WITHDRAWAL_REJECTED ] = 'preprints.detail.status_banner.withdrawal_rejected' ;
3133
3234const MESSAGE = Object ( { } ) ;
35+ MESSAGE [ PROVIDER_OSF ] = 'preprints.detail.status_banner.message.provider_osf' ;
3336MESSAGE [ PRE_MODERATION ] = 'preprints.detail.status_banner.message.pending_pre' ;
3437MESSAGE [ POST_MODERATION ] = 'preprints.detail.status_banner.message.pending_post' ;
3538MESSAGE [ ACCEPTED ] = 'preprints.detail.status_banner.message.accepted' ;
@@ -45,6 +48,7 @@ WORKFLOW[POST_MODERATION] = 'preprints.detail.status_banner.post_moderation';
4548WORKFLOW [ UNKNOWN ] = 'preprints.detail.status_banner.post_moderation' ;
4649
4750const CLASS_NAMES = Object ( { } ) ;
51+ CLASS_NAMES [ PROVIDER_OSF ] = 'preprint-status-pending-pre' ;
4852CLASS_NAMES [ PRE_MODERATION ] = 'preprint-status-pending-pre' ;
4953CLASS_NAMES [ POST_MODERATION ] = 'preprint-status-pending-post' ;
5054CLASS_NAMES [ ACCEPTED ] = 'preprint-status-accepted' ;
@@ -68,6 +72,7 @@ interface InputArgs {
6872 provider : PreprintProviderModel ;
6973 latestWithdrawalRequest : PreprintRequestModel | null ;
7074 latestAction : PreprintRequestActionModel | ReviewActionModel | null ;
75+ isOSFBanner : boolean | null ;
7176}
7277
7378export default class PreprintStatusBanner extends Component < InputArgs > {
@@ -104,7 +109,9 @@ export default class PreprintStatusBanner extends Component<InputArgs>{
104109 }
105110
106111 public get getClassName ( ) : string {
107- if ( this . isPendingWithdrawal ) {
112+ if ( this . args . isOSFBanner ) {
113+ return CLASS_NAMES [ PROVIDER_OSF ] ;
114+ } else if ( this . isPendingWithdrawal ) {
108115 return CLASS_NAMES [ PENDING_WITHDRAWAL ] ;
109116 } else if ( this . isWithdrawn ) {
110117 return CLASS_NAMES [ WITHDRAWN ] ;
@@ -119,7 +126,12 @@ export default class PreprintStatusBanner extends Component<InputArgs>{
119126
120127 public get bannerContent ( ) : string {
121128 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 ) {
123135 return this . intl . t ( this . statusExplanation , { documentType : provider . documentType . singular } ) ;
124136 } else if ( this . isWithdrawn ) {
125137 return this . intl . t ( MESSAGE [ WITHDRAWN ] , { documentType : provider . documentType . singular } ) ;
0 commit comments