mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 16:29:02 +08:00
fix: update API key expiration display logic in MultiIngestionSettings component (#6717)
- display 'No Expiry' for invalid or zero date expiration dates.
This commit is contained in:
parent
14096f8d53
commit
00abadd429
@ -561,10 +561,11 @@ function MultiIngestionSettings(): JSX.Element {
|
|||||||
APIKey.created_at,
|
APIKey.created_at,
|
||||||
formatTimezoneAdjustedTimestamp,
|
formatTimezoneAdjustedTimestamp,
|
||||||
);
|
);
|
||||||
const formattedDateAndTime =
|
|
||||||
APIKey &&
|
const expiresOn =
|
||||||
APIKey?.expires_at &&
|
!APIKey?.expires_at || APIKey?.expires_at === '0001-01-01T00:00:00Z'
|
||||||
getFormattedTime(APIKey?.expires_at, formatTimezoneAdjustedTimestamp);
|
? 'No Expiry'
|
||||||
|
: getFormattedTime(APIKey?.expires_at, formatTimezoneAdjustedTimestamp);
|
||||||
|
|
||||||
const updatedOn = getFormattedTime(
|
const updatedOn = getFormattedTime(
|
||||||
APIKey?.updated_at,
|
APIKey?.updated_at,
|
||||||
@ -987,7 +988,7 @@ function MultiIngestionSettings(): JSX.Element {
|
|||||||
<div className="ingestion-key-last-used-at">
|
<div className="ingestion-key-last-used-at">
|
||||||
<CalendarClock size={14} />
|
<CalendarClock size={14} />
|
||||||
Expires on <Minus size={12} />
|
Expires on <Minus size={12} />
|
||||||
<Typography.Text>{formattedDateAndTime}</Typography.Text>
|
<Typography.Text>{expiresOn}</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user