Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Styling alert for API usage banner #4360

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 28 additions & 21 deletions frontend/web/components/OrganisationLimit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,41 @@ const OrganisationLimit: FC<OrganisationLimitType> = ({
totalApiCalls?.totals.total,
)}/${Format.shortenNumber(maxApiCalls?.max_api_calls)}`

const alertMaxApiCallsText = `You have used ${apiUsageMessageText} of your allowed requests.`
const alertMaxApiCallsText = `You have used ${apiUsageMessageText} of your allowed requests`

const QuotaExceededMessage = () => {
return (
<div
className={'alert alert-danger announcement'}
style={{ display: 'initial' }}
>
<span className='icon-alert'>
<Icon name='close-circle' />
</span>
<>
Your organisation has exceeded its API usage quota{' '}
{`(${alertMaxApiCallsText}).`}{' '}
{Utils.getPlanName(organisationPlan) === 'Free' ? (
<b>Please upgrade your plan to continue receiving service.</b>
) : (
<b>Automated billing for the overages may apply.</b>
)}
</>
<Button
className='btn ml-3'
onClick={() => {
document.location.replace(Constants.upgradeURL)
}}
>
Upgrade plan
</Button>
<Row>
<span className='icon-alert'>
<Icon name='close-circle' />
</span>
<div
style={{
display: 'flex',
flexDirection: 'column',
}}
>
Your organisation has exceeded its API usage quota{' '}
{`(${alertMaxApiCallsText}).`}{' '}
{Utils.getPlanName(organisationPlan) === 'Free' ? (
<b>Please upgrade your plan to continue receiving service.</b>
) : (
<b>Automated billing for the overages may apply.</b>
)}
</div>
<Button
className='btn ml-3'
onClick={() => {
document.location.replace(Constants.upgradeURL)
}}
>
Upgrade plan
</Button>
</Row>
</div>
)
}
Expand Down
Loading