fix(striker-ui): mark optimize for OS as required

main
Tsu-ba-me 3 years ago
parent 6eb66c7df3
commit d65fd45c45
  1. 15
      striker-ui/components/ProvisionServerDialog.tsx

@ -119,6 +119,8 @@ type OrganizedAnvilDetailMetadataForProvisionServer = Omit<
fileUUIDs: string[];
};
type OSAutoCompleteOption = { label: string; key: string };
type FilterAnvilsFunction = (
allAnvils: OrganizedAnvilDetailMetadataForProvisionServer[],
storageGroupUUIDMapToFree: StorageGroupUUIDMapToFree,
@ -975,7 +977,7 @@ const ProvisionServerDialog = ({
const [anvilSelectItems, setAnvilSelectItems] = useState<SelectItem[]>([]);
const [fileSelectItems, setFileSelectItems] = useState<SelectItem[]>([]);
const [osAutocompleteOptions, setOSAutocompleteOptions] = useState<
{ label: string; key: string }[]
OSAutoCompleteOption[]
>([]);
const [storageGroupSelectItems, setStorageGroupSelectItems] = useState<
SelectItem[]
@ -1021,6 +1023,9 @@ const ProvisionServerDialog = ({
InputMessage | undefined
>();
const [inputOptimizeForOSValue, setInputOptimizeForOSValue] =
useState<OSAutoCompleteOption | null>(null);
const [includeAnvilUUIDs, setIncludeAnvilUUIDs] = useState<string[]>([]);
const [includeFileUUIDs, setIncludeFileUUIDs] = useState<string[]>([]);
const [includeStorageGroupUUIDs, setIncludeStorageGroupUUIDs] = useState<
@ -1553,12 +1558,20 @@ const ProvisionServerDialog = ({
value: inputAnvilValue,
}}
/>
<BodyText text={`OS: ${inputOptimizeForOSValue}`} />
<Autocomplete
id="ps-optimize-for-os"
extendRenderInput={({ inputLabelProps = {} }) => {
inputLabelProps.isNotifyRequired = inputOptimizeForOSValue === null;
}}
label="Optimize for OS"
noOptionsText="No matching OS"
onChange={(event, value) => {
setInputOptimizeForOSValue(value);
}}
openOnFocus
options={osAutocompleteOptions}
value={inputOptimizeForOSValue}
/>
</Box>
<Box

Loading…
Cancel
Save