diff --git a/changes/19760-software-update-tooltip b/changes/19760-software-update-tooltip new file mode 100644 index 0000000000..75c0ae8f46 --- /dev/null +++ b/changes/19760-software-update-tooltip @@ -0,0 +1 @@ +* Update software updated timestamp tooltip \ No newline at end of file diff --git a/frontend/components/LastUpdatedText/LastUpdatedText.tsx b/frontend/components/LastUpdatedText/LastUpdatedText.tsx index 74985fbd28..cfcc7ae73f 100644 --- a/frontend/components/LastUpdatedText/LastUpdatedText.tsx +++ b/frontend/components/LastUpdatedText/LastUpdatedText.tsx @@ -6,14 +6,27 @@ import TooltipWrapper from "components/TooltipWrapper"; const baseClass = "component__last-updated-text"; -interface ILastUpdatedTextProps { +interface ILastUpdatedTextBase { lastUpdatedAt?: string; +} + +interface ILastUpdatedTextWithCustomTooltip extends ILastUpdatedTextBase { + customTooltipText: React.ReactNode; + whatToRetrieve?: never; +} + +interface ILastUpdatedTextWithWhatToRetrieve extends ILastUpdatedTextBase { + customTooltipText?: never; whatToRetrieve: string; } + const LastUpdatedText = ({ lastUpdatedAt, whatToRetrieve, -}: ILastUpdatedTextProps): JSX.Element => { + customTooltipText, +}: + | ILastUpdatedTextWithCustomTooltip + | ILastUpdatedTextWithWhatToRetrieve): JSX.Element => { if (!lastUpdatedAt || lastUpdatedAt === "0001-01-01T00:00:00Z") { lastUpdatedAt = "never"; } else { @@ -24,16 +37,16 @@ const LastUpdatedText = ({ ); } + const tooltipContent = customTooltipText || ( + <> + Fleet periodically queries all hosts
+ to retrieve {whatToRetrieve}. + + ); + return ( - - Fleet periodically queries all hosts
- to retrieve {whatToRetrieve}. - - } - > + {`Updated ${lastUpdatedAt}`}
diff --git a/frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx b/frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx index bb912ce9a3..f76a6deca6 100644 --- a/frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx +++ b/frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx @@ -1,6 +1,6 @@ /** software/os OS tab > Table */ -import React, { useCallback, useContext, useMemo } from "react"; +import React, { useCallback, useMemo } from "react"; import { InjectedRouter } from "react-router"; import { Row } from "react-table"; @@ -137,7 +137,13 @@ const SoftwareOSTable = ({ {data?.os_versions && data?.counts_updated_at && ( + The last time software data was
+ updated, including vulnerabilities
+ and host counts. + + } /> )} diff --git a/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx b/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx index 714e8dcdd0..ceb61c2a41 100644 --- a/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx +++ b/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx @@ -270,7 +270,13 @@ const SoftwareTable = ({ {tableData && data?.counts_updated_at && ( + The last time software data was
+ updated, including vulnerabilities
+ and host counts. + + } /> )} diff --git a/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tsx b/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tsx index bb6301a9b0..1152c13376 100644 --- a/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tsx +++ b/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tsx @@ -189,7 +189,13 @@ const SoftwareVulnerabilitiesTable = ({ {data?.vulnerabilities && data?.counts_updated_at && ( + The last time software data was
+ updated, including vulnerabilities
+ and host counts. + + } /> )}