Skip to content

Commit

Permalink
refactor: move logic to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
alisher-epam committed Oct 6, 2023
1 parent dbc907c commit f3b4596
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const OngoingInfoForm = ({ hiddenFields = {} }) => {
const isSubscription = !!ongoingFormValues?.isSubscription;
const isClosedNonInteractive = values.workflowStatus && isWorkflowStatusClosed(values);
const isNonPendingNonInteractive = values.workflowStatus && !isWorkflowStatusIsPending(values);
const isOpenNonInteractive = values.workflowStatus && !isWorkflowStatusOpen(values);

if (isClosedNonInteractive && disabled) return null;

Expand All @@ -52,7 +53,7 @@ const OngoingInfoForm = ({ hiddenFields = {} }) => {
<VisibilityControl name="hiddenFields.ongoing.isSubscription">
<FieldRenewalSubscription
disabled={disabled}
isNonInteractive={isNonPendingNonInteractive && !isWorkflowStatusOpen(values)}
isNonInteractive={isNonPendingNonInteractive && isOpenNonInteractive}
/>
</VisibilityControl>
</Col>
Expand Down Expand Up @@ -81,7 +82,7 @@ const OngoingInfoForm = ({ hiddenFields = {} }) => {
<VisibilityControl name="hiddenFields.ongoing.renewalDate">
<FieldRenewalDate
disabled={!isSubscription}
isNonInteractive={isClosedNonInteractive && !isWorkflowStatusOpen(values)}
isNonInteractive={isClosedNonInteractive && isOpenNonInteractive}
/>
</VisibilityControl>
</Col>
Expand Down

0 comments on commit f3b4596

Please sign in to comment.