1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

chore: don't ask OSS users to reach out to CS (#7633)

The limit card says to contact cs@getunleash if you're at the limits,
but we probably don't want to show that to OSS customers (it's not
terrible, just not very helpful), so let's hide it for OSS.

Instead, we'll ask them to try the community slack.

Screenie:


![image](https://github.com/user-attachments/assets/5a5dc292-3878-4181-98ac-f1ce4583d8a3)
This commit is contained in:
Thomas Heartman 2024-07-22 11:03:10 +02:00 committed by GitHub
parent a5223af702
commit 0f0a680af3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@ import ErrorIcon from '@mui/icons-material/Cancel';
import CloseIcon from '@mui/icons-material/Close'; import CloseIcon from '@mui/icons-material/Close';
import type { FC } from 'react'; import type { FC } from 'react';
import { ConditionallyRender } from '../ConditionallyRender/ConditionallyRender'; import { ConditionallyRender } from '../ConditionallyRender/ConditionallyRender';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
const StyledBox = styled(Box)(({ theme }) => ({ const StyledBox = styled(Box)(({ theme }) => ({
display: 'flex', display: 'flex',
@ -70,6 +71,7 @@ export const Limit: FC<{
onClose?: () => void; onClose?: () => void;
className?: string; className?: string;
}> = ({ name, shortName, limit, currentValue, onClose, className }) => { }> = ({ name, shortName, limit, currentValue, onClose, className }) => {
const { isOss } = useUiConfig();
const percentageLimit = Math.floor((currentValue / limit) * 100); const percentageLimit = Math.floor((currentValue / limit) * 100);
const belowLimit = currentValue < limit; const belowLimit = currentValue < limit;
const threshold = 80; const threshold = 80;
@ -78,6 +80,21 @@ export const Limit: FC<{
return null; return null;
} }
const footerContent = isOss() ? (
<>
Need help with resource limits? Try the the{' '}
<a href='https://slack.unleash.run'>Unleash community Slack</a>.
</>
) : (
<>
If you need more than <strong>{limit}</strong> {shortName ?? name},
please reach out to us at{' '}
<a href='mailto:cs@getunleash.io?subject=Increase limit'>
cs@getunleash.io
</a>
</>
);
return ( return (
<StyledBox className={className}> <StyledBox className={className}>
<Header> <Header>
@ -135,13 +152,7 @@ export const Limit: FC<{
<Typography fontWeight='bold'>Limit: {limit}</Typography> <Typography fontWeight='bold'>Limit: {limit}</Typography>
</LimitExplanation> </LimitExplanation>
</Main> </Main>
<Footer> <Footer>{footerContent}</Footer>
If you need more than <strong>{limit}</strong>{' '}
{shortName ?? name}, please reach out to us at{' '}
<a href='mailto:cs@getunleash.io?subject=Increase limit'>
cs@getunleash.io
</a>
</Footer>
</StyledBox> </StyledBox>
); );
}; };