Skip to content

Commit

Permalink
adjust copy
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed May 31, 2024
1 parent 962520a commit ee8a8cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/components/tx/SignOrExecuteForm/PermissionsCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,13 @@ const PermissionsCheck: React.FC<{ onSubmit?: SubmitCallback; safeTx: SafeTransa

return (
<TxCard>
<Typography variant="h5">Execute through role</Typography>
<Typography variant="h5">Execute without confirmations</Typography>

{allowingRole && (
<>
<Typography component="div">
As a member of the <Role>{allowingRole.roleKey}</Role> role you can execute this transaction immediately.
As a member of the <Role>{allowingRole.roleKey}</Role> you can execute this transaction immediately without
confirmations from other owners.
</Typography>
<AdvancedParams
willExecute
Expand All @@ -176,7 +177,7 @@ const PermissionsCheck: React.FC<{ onSubmit?: SubmitCallback; safeTx: SafeTransa

{mostLikelyRole.status && (
<ErrorMessage>
The permissions check fails with the following status:
The permission check fails with the following status:
<br />
<code>{Status[mostLikelyRole.status]}</code>
</ErrorMessage>
Expand Down Expand Up @@ -215,7 +216,7 @@ const PermissionsCheck: React.FC<{ onSubmit?: SubmitCallback; safeTx: SafeTransa
disabled={!isOk || !allowingRole || isPending}
sx={{ minWidth: '209px' }}
>
{isPending ? <CircularProgress size={20} /> : 'Execute through role'}
{isPending ? <CircularProgress size={20} /> : 'Execute'}
</Button>
)}
</CheckWallet>
Expand Down Expand Up @@ -311,7 +312,7 @@ const useRoles = (metaTx?: MetaTransactionData) => {
}

/**
* Returns the status of the permissions check, `null` if it depends on the condition evaluation.
* Returns the status of the permission check, `null` if it depends on the condition evaluation.
*/
const checkTransaction = (role: RoleSummary, metaTx: MetaTransactionData): Status | null => {
const target = role.targets.find((t) => t.address === metaTx.to.toLowerCase())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('PermissionsCheck', () => {
})

// the card is not shown
expect(queryByText('Execute through role')).not.toBeInTheDocument()
expect(queryByText('Execute without confirmations')).not.toBeInTheDocument()
})

it('disables the submit button when the call is not allowed and shows the permission check status', async () => {
Expand All @@ -131,7 +131,7 @@ describe('PermissionsCheck', () => {
})

const { findByText, getByText } = render(<PermissionsCheck safeTx={safeTx} />)
expect(await findByText('Execute through role', { selector: 'button' })).toBeDisabled()
expect(await findByText('Execute')).toBeDisabled()

expect(
getByText(
Expand All @@ -156,7 +156,7 @@ describe('PermissionsCheck', () => {

const { findByText } = render(<PermissionsCheck safeTx={safeTx} onSubmit={onSubmit} />)

fireEvent.click(await findByText('Execute through role', { selector: 'button' }))
fireEvent.click(await findByText('Execute'))

await waitFor(() => {
expect(executeSpy).toHaveBeenCalledWith(
Expand Down

0 comments on commit ee8a8cf

Please sign in to comment.