Skip to content

Commit

Permalink
Merge pull request #918 from redpanda-data/feature/better-license-exp…
Browse files Browse the repository at this point in the history
…iration-warning

Better license expiration warning
  • Loading branch information
jvorcak authored Nov 14, 2023
2 parents 2d5371e + 3fc0470 commit dc5421f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 37 deletions.
40 changes: 22 additions & 18 deletions frontend/src/components/layout/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ErrorDisplay } from '../misc/ErrorDisplay';
import { renderErrorModals } from '../misc/ErrorModal';
import { RouteView } from '../routes';
import { ModalContainer } from '../../utils/ModalContainer';
import { Alert, AlertIcon, Box, Flex, Link, Text } from '@redpanda-data/ui';


@observer
Expand Down Expand Up @@ -62,26 +63,29 @@ class LicenseNotification extends Component {
});

const warnings = withRemainingTime.filter(x => x.isExpiringSoon || x.isExpired);
if (!warnings.length)
if (!warnings.length) {
return null;

return <div className="expiringLicenses">
{warnings.map(e =>
<div key={e.source}>
<div>
Your Redpanda Enterprise license (<span className="source">{e.sourceDisplayName}</span>)
{e.isExpired
? <> has expired <span className="date">{e.prettyDateTime}</span> ({e.prettyDuration} ago)</>
: <> will expire <span className="date">{e.prettyDateTime}</span> ({e.prettyDuration} remaining)</>
}
</div>
<div>
To renew your license key, request a new/trial license at:{' '}
<a href="https://redpanda.com/license-request" target="_blank" rel="noreferrer">https://redpanda.com/license-request</a>
</div>
</div>
}

return <Box>
{warnings.map(e => <Alert key={e.source} status="warning" mb={4}>
<AlertIcon/>
<Flex flexDirection="column">
<Box>
Your Redpanda Enterprise license (<Text textTransform="capitalize" display="inline">{e.sourceDisplayName}</Text>)
{e.isExpired
? <> has expired <span>{e.prettyDateTime}</span> ({e.prettyDuration} ago)</>
: <> will expire <span>{e.prettyDateTime}</span> ({e.prettyDuration} remaining)</>
}
</Box>
<Box>
To renew your license key, request a new/trial license at:{' '}
<Link href="https://redpanda.com/license-request" target="_blank" rel="noreferrer">https://redpanda.com/license-request</Link>
</Box>
</Flex>
</Alert>
)}
</div>
</Box>
}
}

Expand Down
19 changes: 0 additions & 19 deletions frontend/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3480,25 +3480,6 @@ input::placeholder {
}
}

.expiringLicenses {
display: flex;
flex-direction: column;
gap: 1em;

margin: 1em;
padding: 0.5em;
border: solid 2px #e142267a;
background: #e1422638;
color: #ff2f00;
font-weight: 500;


a {
text-decoration: underline 1px solid;
}
}


.iconSelectOption {
display: flex;
align-items: center;
Expand Down

0 comments on commit dc5421f

Please sign in to comment.