CreateImageWizard: oscap options add spinner
The select `loadingVariant` seems to do nothing. Add a loader for when the oscap profiles are being loaded.
This commit is contained in:
parent
c38e821ae5
commit
18c329be2a
1 changed files with 18 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import {
|
|||
TextContent,
|
||||
Text,
|
||||
Button,
|
||||
Spinner,
|
||||
} from '@patternfly/react-core';
|
||||
import {
|
||||
Select,
|
||||
|
|
@ -290,6 +291,10 @@ const ProfileSelector = () => {
|
|||
};
|
||||
|
||||
const options = () => {
|
||||
if (isFetching) {
|
||||
return [<OScapLoadingOption key="oscap-loading-option" />];
|
||||
}
|
||||
|
||||
if (profiles) {
|
||||
return [<OScapNoneOption key="oscap-none-option" />].concat(
|
||||
profiles.map((profile_id, index) => {
|
||||
|
|
@ -322,7 +327,6 @@ const ProfileSelector = () => {
|
|||
>
|
||||
{complianceType === 'openscap' && (
|
||||
<Select
|
||||
loadingVariant={isFetching ? 'spinner' : undefined}
|
||||
ouiaId="profileSelect"
|
||||
variant={SelectVariant.typeahead}
|
||||
onToggle={handleToggle}
|
||||
|
|
@ -335,6 +339,9 @@ const ProfileSelector = () => {
|
|||
typeAheadAriaLabel="Select a profile"
|
||||
isDisabled={!isSuccess || hasWslTargetOnly}
|
||||
onFilter={(_event, value) => {
|
||||
if (isFetching) {
|
||||
return [<OScapLoadingOption key="oscap-loading-option" />];
|
||||
}
|
||||
if (profiles) {
|
||||
return [<OScapNoneOption key="oscap-none-option" />].concat(
|
||||
profiles.map((profile_id, index) => {
|
||||
|
|
@ -389,6 +396,16 @@ const OScapNoneOption = () => {
|
|||
);
|
||||
};
|
||||
|
||||
const OScapLoadingOption = () => {
|
||||
return (
|
||||
<SelectOption
|
||||
value={{ toString: () => 'Loading...', compareTo: () => false }}
|
||||
>
|
||||
<Spinner size="lg" />
|
||||
</SelectOption>
|
||||
);
|
||||
};
|
||||
|
||||
type OScapSelectOptionPropType = {
|
||||
profile_id: DistributionProfileItem;
|
||||
filter?: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue