Polish report empty states (#14507)

This commit is contained in:
Jacob Shandling 2023-10-12 12:13:52 -07:00 committed by GitHub
parent 65e6c4a758
commit c5ffd58679
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 13 deletions

View file

@ -218,7 +218,8 @@ const QueryDetailsPage = ({
<div className={`${baseClass}__settings`}>
<div className={`${baseClass}__automations`}>
<TooltipWrapper
tipContent={`Query automations let you send data to your log destination on a schedule. When automations are <b>on</b>, data is sent according to a querys frequency.`}
// TODO - change to JSX after tooltip refactor
tipContent={`Query automations let you send data to your log <br />destination on a schedule. When automations are <b>on</b>, <br />data is sent according to a querys frequency.`}
>
Automations:
</TooltipWrapper>

View file

@ -46,8 +46,12 @@ const NoResults = ({
// Collecting results state only shows if caching is enabled
if (collectingResults && !disabledCaching) {
const collectingResultsInfo = () =>
`Fleet is collecting query results. Check back in about ${readableCheckbackTime}.`;
const collectingResultsInfo = () => (
<>
Fleet is collecting query results. <br />
Check back in about {readableCheckbackTime}.
</>
);
return (
<EmptyTable
@ -58,7 +62,7 @@ const NoResults = ({
);
}
const noResultsInfo = () => {
const getNoResultsInfo = () => {
// In order of empty page priority
if (disabledCaching) {
const tipContent = () => {
@ -73,23 +77,25 @@ const NoResults = ({
}
return "Unknown";
};
return (
return [
"Nothing to report",
<>
Results from this query are{" "}
<TooltipWrapper tipContent={tipContent()}>
not reported in Fleet
</TooltipWrapper>
.
</>
);
</>,
];
}
if (!queryInterval) {
return (
return [
"Nothing to report",
<>
This query does not collect data on a schedule. Add <br />a{" "}
<strong>frequency</strong> or run this as a live query to see results.
</>
);
</>,
];
}
// No errors will be reported in V1
// if (errorsOnly) {
@ -100,15 +106,24 @@ const NoResults = ({
// </>
// );
// }
return "This query has returned no data so far.";
return [
"Nothing to report yet",
<>
This query has returned no data so far. If you&apos;re <br />
expecting to see results, try running a live query to
<br />
get diagnostics.
</>,
];
};
const [emptyHeader, emptyDetails] = getNoResultsInfo();
return (
<EmptyTable
className={baseClass}
iconName="empty-software"
header={"Nothing to report yet"}
info={noResultsInfo()}
header={emptyHeader}
info={emptyDetails}
/>
);
};