-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Select[1] components need to be adapted to take data from the metadata. This will be applied for the fields 'Radius proxy configuration' and 'External IdP configuration'. [1]- http://v4-archive.patternfly.org/v4/components/select Signed-off-by: Carla Martinez <[email protected]>
- Loading branch information
Showing
10 changed files
with
359 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from "react"; | ||
// PatternFly | ||
import { Select, SelectOption, SelectVariant } from "@patternfly/react-core"; | ||
// Utils | ||
import { | ||
IPAParamDefinitionSelect, | ||
getParamPropertiesSelect, | ||
} from "src/utils/ipaObjectUtils"; | ||
|
||
const IpaSelect = (props: IPAParamDefinitionSelect) => { | ||
const { required, readOnly, value } = getParamPropertiesSelect(props); | ||
|
||
let valueSelected = ""; | ||
if (value !== undefined && value && value !== "") { | ||
valueSelected = value.toString(); | ||
} | ||
|
||
return ( | ||
<Select | ||
id={props.id} | ||
name={props.name} | ||
variant={props.variant || SelectVariant.single} | ||
aria-label={props.name} | ||
onToggle={props.onToggle} | ||
onSelect={props.onSelect} | ||
selections={valueSelected} | ||
isOpen={props.isOpen} | ||
aria-labelledby={props.ariaLabelledBy || props.id} | ||
readOnly={readOnly} | ||
isDisabled={readOnly} | ||
required={required} | ||
> | ||
{props.elementsOptions.map((option, index) => { | ||
return <SelectOption key={index} value={option} />; | ||
})} | ||
</Select> | ||
); | ||
}; | ||
|
||
export default IpaSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.