diff --git a/changes/20143-targets-input-spinner b/changes/20143-targets-input-spinner new file mode 100644 index 0000000000..da5e679348 --- /dev/null +++ b/changes/20143-targets-input-spinner @@ -0,0 +1 @@ +- Fix styling issues with the target inputs loading spinner on the run live query/policy page. diff --git a/frontend/components/LiveQuery/TargetsInput/TargetsInput.tsx b/frontend/components/LiveQuery/TargetsInput/TargetsInput.tsx index e18200309c..dcfc2074d8 100644 --- a/frontend/components/LiveQuery/TargetsInput/TargetsInput.tsx +++ b/frontend/components/LiveQuery/TargetsInput/TargetsInput.tsx @@ -9,6 +9,7 @@ import DataError from "components/DataError"; // @ts-ignore import InputFieldWithIcon from "components/forms/fields/InputFieldWithIcon/InputFieldWithIcon"; import TableContainer from "components/TableContainer"; +import Spinner from "components/Spinner"; import { ITargestInputHostTableConfig } from "./TargetsInputHostsTableConfig"; interface ITargetsInputProps { @@ -70,32 +71,35 @@ const TargetsInput = ({ placeholder={placeholder} onChange={setSearchText} /> - {isActiveSearch && ( -
- > - columnConfigs={searchResultsTableConfig} - data={dropdownHosts} - isLoading={isTargetsLoading} - emptyComponent={() => ( -
-
-

No hosts match the current search criteria.

-

- Expecting to see hosts? Try again in a few seconds as the - system catches up. -

+ {isActiveSearch && + (isTargetsLoading ? ( + + ) : ( +
+ > + columnConfigs={searchResultsTableConfig} + data={dropdownHosts} + isLoading={false} + emptyComponent={() => ( +
+
+

No hosts match the current search criteria.

+

+ Expecting to see hosts? Try again in a few seconds as + the system catches up. +

+
-
- )} - showMarkAllPages={false} - isAllPagesSelected={false} - disableCount - disablePagination - disableMultiRowSelect - onClickRow={handleRowSelect} - /> -
- )} + )} + showMarkAllPages={false} + isAllPagesSelected={false} + disableCount + disablePagination + disableMultiRowSelect + onClickRow={handleRowSelect} + /> +
+ ))} {isSearchError && (
diff --git a/frontend/components/LiveQuery/TargetsInput/_styles.scss b/frontend/components/LiveQuery/TargetsInput/_styles.scss index 55b1f0339d..e219d2660d 100644 --- a/frontend/components/LiveQuery/TargetsInput/_styles.scss +++ b/frontend/components/LiveQuery/TargetsInput/_styles.scss @@ -102,6 +102,6 @@ // override the default styles for the spinner. // TODO: set better default styles for the spinner .loading-spinner.centered { - margin: auto; + margin: 1rem auto; } }