mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: improve traffic messaging summary (#6922)
Minor tweaks to traffic messaging summary.
This commit is contained in:
		
							parent
							
								
									f5061bc3ff
								
							
						
					
					
						commit
						1b2f983974
					
				| @ -85,8 +85,10 @@ const getSelectablePeriods = (): SelectablePeriod[] => { | |||||||
|             current.getMonth() - subtractMonthCount, |             current.getMonth() - subtractMonthCount, | ||||||
|             1, |             1, | ||||||
|         ); |         ); | ||||||
|  |         if (date > new Date('2024-03-31')) { | ||||||
|             selectablePeriods.push(toSelectablePeriod(date)); |             selectablePeriods.push(toSelectablePeriod(date)); | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|     return selectablePeriods; |     return selectablePeriods; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -357,7 +359,7 @@ export const NetworkTrafficUsage: VFC = () => { | |||||||
|     return ( |     return ( | ||||||
|         <ConditionallyRender |         <ConditionallyRender | ||||||
|             condition={isOss() || !flagEnabled} |             condition={isOss() || !flagEnabled} | ||||||
|             show={<Alert severity='warning'>No data available.</Alert>} |             show={<Alert severity='warning'>Not enabled.</Alert>} | ||||||
|             elseShow={ |             elseShow={ | ||||||
|                 <> |                 <> | ||||||
|                     <StyledBox> |                     <StyledBox> | ||||||
|  | |||||||
| @ -53,6 +53,7 @@ export const NetworkTrafficUsagePlanSummary = ({ | |||||||
|     planIncludedRequests, |     planIncludedRequests, | ||||||
| }: INetworkTrafficUsagePlanSummary) => { | }: INetworkTrafficUsagePlanSummary) => { | ||||||
|     const { isPro } = useUiConfig(); |     const { isPro } = useUiConfig(); | ||||||
|  |     const overages = usageTotal - planIncludedRequests; | ||||||
|     return ( |     return ( | ||||||
|         <StyledContainer> |         <StyledContainer> | ||||||
|             <Grid item> |             <Grid item> | ||||||
| @ -61,7 +62,7 @@ export const NetworkTrafficUsagePlanSummary = ({ | |||||||
|                 </StyledCardTitleRow> |                 </StyledCardTitleRow> | ||||||
|                 <StyledCardDescription> |                 <StyledCardDescription> | ||||||
|                     <RowContainer> |                     <RowContainer> | ||||||
|                         Incoming requests for selection{' '} |                         Incoming requests selected month{' '} | ||||||
|                         <StyledNumbersDiv> |                         <StyledNumbersDiv> | ||||||
|                             <ConditionallyRender |                             <ConditionallyRender | ||||||
|                                 condition={isPro()} |                                 condition={isPro()} | ||||||
| @ -107,6 +108,19 @@ export const NetworkTrafficUsagePlanSummary = ({ | |||||||
|                         </StyledCardDescription> |                         </StyledCardDescription> | ||||||
|                     } |                     } | ||||||
|                 /> |                 /> | ||||||
|  |                 <ConditionallyRender | ||||||
|  |                     condition={isPro() && overages > 0} | ||||||
|  |                     show={ | ||||||
|  |                         <StyledCardDescription> | ||||||
|  |                             <RowContainer> | ||||||
|  |                                 Requests overages this month | ||||||
|  |                                 <StyledNumbersDiv> | ||||||
|  |                                     {overages.toLocaleString()} requests | ||||||
|  |                                 </StyledNumbersDiv> | ||||||
|  |                             </RowContainer> | ||||||
|  |                         </StyledCardDescription> | ||||||
|  |                     } | ||||||
|  |                 /> | ||||||
|             </Grid> |             </Grid> | ||||||
|         </StyledContainer> |         </StyledContainer> | ||||||
|     ); |     ); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user