Skip to content

Commit

Permalink
fix: improve traffic messaging summary (#6922)
Browse files Browse the repository at this point in the history
Minor tweaks to traffic messaging summary.
  • Loading branch information
ivarconr committed Apr 24, 2024
1 parent f5061bc commit 1b2f983
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ const getSelectablePeriods = (): SelectablePeriod[] => {
current.getMonth() - subtractMonthCount,
1,
);
selectablePeriods.push(toSelectablePeriod(date));
if (date > new Date('2024-03-31')) {
selectablePeriods.push(toSelectablePeriod(date));
}
}
return selectablePeriods;
};
Expand Down Expand Up @@ -357,7 +359,7 @@ export const NetworkTrafficUsage: VFC = () => {
return (
<ConditionallyRender
condition={isOss() || !flagEnabled}
show={<Alert severity='warning'>No data available.</Alert>}
show={<Alert severity='warning'>Not enabled.</Alert>}
elseShow={
<>
<StyledBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const NetworkTrafficUsagePlanSummary = ({
planIncludedRequests,
}: INetworkTrafficUsagePlanSummary) => {
const { isPro } = useUiConfig();
const overages = usageTotal - planIncludedRequests;
return (
<StyledContainer>
<Grid item>
Expand All @@ -61,7 +62,7 @@ export const NetworkTrafficUsagePlanSummary = ({
</StyledCardTitleRow>
<StyledCardDescription>
<RowContainer>
Incoming requests for selection{' '}
Incoming requests selected month{' '}
<StyledNumbersDiv>
<ConditionallyRender
condition={isPro()}
Expand Down Expand Up @@ -107,6 +108,19 @@ export const NetworkTrafficUsagePlanSummary = ({
</StyledCardDescription>
}
/>
<ConditionallyRender
condition={isPro() && overages > 0}
show={
<StyledCardDescription>
<RowContainer>
Requests overages this month
<StyledNumbersDiv>
{overages.toLocaleString()} requests
</StyledNumbersDiv>
</RowContainer>
</StyledCardDescription>
}
/>
</Grid>
</StyledContainer>
);
Expand Down

0 comments on commit 1b2f983

Please sign in to comment.