Don't allow allocations to be deleted by users if no limit is defined; closes #3703
This commit is contained in:
parent
c751ce7f44
commit
e88d24e0db
7 changed files with 68 additions and 19 deletions
|
@ -66,20 +66,22 @@ const NetworkContainer = () => {
|
|||
/>
|
||||
))
|
||||
}
|
||||
<Can action={'allocation.create'}>
|
||||
<SpinnerOverlay visible={loading}/>
|
||||
<div css={tw`mt-6 sm:flex items-center justify-end`}>
|
||||
<p css={tw`text-sm text-neutral-300 mb-4 sm:mr-6 sm:mb-0`}>
|
||||
You are currently using {data.length} of {allocationLimit} allowed allocations for this
|
||||
server.
|
||||
</p>
|
||||
{allocationLimit > data.length &&
|
||||
<Button css={tw`w-full sm:w-auto`} color={'primary'} onClick={onCreateAllocation}>
|
||||
Create Allocation
|
||||
</Button>
|
||||
}
|
||||
</div>
|
||||
</Can>
|
||||
{allocationLimit > 0 &&
|
||||
<Can action={'allocation.create'}>
|
||||
<SpinnerOverlay visible={loading}/>
|
||||
<div css={tw`mt-6 sm:flex items-center justify-end`}>
|
||||
<p css={tw`text-sm text-neutral-300 mb-4 sm:mr-6 sm:mb-0`}>
|
||||
You are currently using {data.length} of {allocationLimit} allowed allocations for
|
||||
this server.
|
||||
</p>
|
||||
{allocationLimit > data.length &&
|
||||
<Button css={tw`w-full sm:w-auto`} color={'primary'} onClick={onCreateAllocation}>
|
||||
Create Allocation
|
||||
</Button>
|
||||
}
|
||||
</div>
|
||||
</Can>
|
||||
}
|
||||
</>
|
||||
}
|
||||
</ServerContentBlock>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue