Skip to content

Commit e040548

Browse files
authored
feat: Enable convert to contract for direct payg accounts (#5008)
1 parent 9d511df commit e040548

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cypress/e2e/cloud/operator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe('Operator Page', () => {
145145
cy.getByTestID('account-view--header').contains('operator1 (1)')
146146
// should not be able to delete undeletable accounts
147147
cy.getByTestID('account-delete--button').should('be.disabled')
148-
// should not be able to convert non-free accounts to contract
148+
// should not be able to convert cancelled accounts to contract
149149
cy.getByTestID('account-convert-to-contract--button').should('be.disabled')
150150

151151
// Associated Users Section

src/operator/account/AccountViewHeader.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ const AccountViewHeader: FC = () => {
2626
deleteOverlayVisible,
2727
} = useContext(AccountContext)
2828
const {hasWritePermissions} = useContext(OperatorContext)
29+
const canConvertToContract =
30+
account.type === 'free' ||
31+
(account.type === 'pay_as_you_go' && account.zuoraAccountId !== null)
2932

3033
return (
3134
<FlexBox
@@ -47,7 +50,7 @@ const AccountViewHeader: FC = () => {
4750
setConvertToContractOverlayVisible(!convertToContractOverlayVisible)
4851
}
4952
status={
50-
account.type === 'free'
53+
canConvertToContract
5154
? ComponentStatus.Default
5255
: ComponentStatus.Disabled
5356
}

0 commit comments

Comments
 (0)