@@ -23,16 +23,17 @@ import {
2323 SubmitRequestsDecision ,
2424 SubmitReviewsDecision ,
2525} from '@osf/features/preprints/store/preprint' ;
26- import { StringOrNull } from '@shared/helpers' ;
26+ import { InputLimits } from '@osf/shared/constants' ;
27+ import { StringOrNull } from '@osf/shared/helpers' ;
2728
2829@Component ( {
29- selector : 'osf-make-decision' ,
30+ selector : 'osf-preprint- make-decision' ,
3031 imports : [ Button , TranslatePipe , TitleCasePipe , Dialog , Tooltip , RadioButton , FormsModule , Textarea , Message ] ,
31- templateUrl : './make-decision.component.html' ,
32- styleUrl : './make-decision.component.scss' ,
32+ templateUrl : './preprint- make-decision.component.html' ,
33+ styleUrl : './preprint- make-decision.component.scss' ,
3334 changeDetection : ChangeDetectionStrategy . OnPush ,
3435} )
35- export class MakeDecisionComponent {
36+ export class PreprintMakeDecisionComponent {
3637 private readonly translateService = inject ( TranslateService ) ;
3738 private readonly router = inject ( Router ) ;
3839 private readonly actions = createDispatchMap ( {
@@ -55,6 +56,7 @@ export class MakeDecisionComponent {
5556 reviewerComment = signal < StringOrNull > ( null ) ;
5657 requestDecisionJustification = signal < StringOrNull > ( null ) ;
5758 saving = signal < boolean > ( false ) ;
59+ decisionCommentLimit = InputLimits . decisionComment . maxLength ;
5860
5961 labelDecisionButton = computed ( ( ) => {
6062 const preprint = this . preprint ( ) ! ;
@@ -102,9 +104,9 @@ export class MakeDecisionComponent {
102104 return 'preprints.details.decision.submitButton.modifyDecision' ;
103105 } ) ;
104106
105- submitButtonDisabled = computed ( ( ) => {
106- return ( ! this . decisionChanged ( ) && ! this . commentEdited ( ) ) || this . commentExceedsLimit ( ) ;
107- } ) ;
107+ submitButtonDisabled = computed (
108+ ( ) => ( ! this . decisionChanged ( ) && ! this . commentEdited ( ) ) || this . commentExceedsLimit ( )
109+ ) ;
108110
109111 acceptOptionExplanation = computed ( ( ) => {
110112 const reviewsWorkflow = this . provider ( ) . reviewsWorkflow ;
@@ -146,9 +148,9 @@ export class MakeDecisionComponent {
146148 }
147149 } ) ;
148150
149- rejectRadioButtonValue = computed ( ( ) => {
150- return this . preprint ( ) ?. isPublished ? ReviewsState . Withdrawn : ReviewsState . Rejected ;
151- } ) ;
151+ rejectRadioButtonValue = computed ( ( ) =>
152+ this . preprint ( ) ?. isPublished ? ReviewsState . Withdrawn : ReviewsState . Rejected
153+ ) ;
152154
153155 settingsComments = computed ( ( ) => {
154156 const commentType = this . provider ( ) . reviewsCommentsPrivate ? 'private' : 'public' ;
@@ -160,28 +162,25 @@ export class MakeDecisionComponent {
160162 return decisionSettings . names [ commentType ] ;
161163 } ) ;
162164
163- settingsModeration = computed ( ( ) => {
164- return decisionSettings . moderation [ this . provider ( ) . reviewsWorkflow || ProviderReviewsWorkflow . PreModeration ] ;
165- } ) ;
165+ settingsModeration = computed (
166+ ( ) => decisionSettings . moderation [ this . provider ( ) . reviewsWorkflow || ProviderReviewsWorkflow . PreModeration ]
167+ ) ;
166168
167- commentEdited = computed ( ( ) => {
168- return this . reviewerComment ( ) ?. trim ( ) !== this . initialReviewerComment ( ) ;
169- } ) ;
169+ commentEdited = computed ( ( ) => this . reviewerComment ( ) ?. trim ( ) !== this . initialReviewerComment ( ) ) ;
170170
171171 commentExceedsLimit = computed ( ( ) => {
172172 const comment = this . reviewerComment ( ) ;
173173 if ( ! comment ) return false ;
174174
175- return comment . length > formInputLimits . decisionComment . maxLength ;
175+ return comment . length > this . decisionCommentLimit ;
176176 } ) ;
177177
178- commentLengthErrorMessage = computed ( ( ) => {
179- const limit = formInputLimits . decisionComment . maxLength ;
180- return this . translateService . instant ( 'preprints.details.decision.commentLengthError' , {
181- limit,
178+ commentLengthErrorMessage = computed ( ( ) =>
179+ this . translateService . instant ( 'preprints.details.decision.commentLengthError' , {
180+ limit : this . decisionCommentLimit ,
182181 length : this . reviewerComment ( ) ! . length ,
183- } ) ;
184- } ) ;
182+ } )
183+ ) ;
185184
186185 requestDecisionJustificationErrorMessage = computed ( ( ) => {
187186 const justification = this . requestDecisionJustification ( ) ;
@@ -196,9 +195,7 @@ export class MakeDecisionComponent {
196195 return null ;
197196 } ) ;
198197
199- decisionChanged = computed ( ( ) => {
200- return this . preprint ( ) ?. reviewsState !== this . decision ( ) ;
201- } ) ;
198+ decisionChanged = computed ( ( ) => this . preprint ( ) ?. reviewsState !== this . decision ( ) ) ;
202199
203200 constructor ( ) {
204201 effect ( ( ) => {
0 commit comments