fix lookup field ids

This commit is contained in:
Keith J. Grant 2021-07-19 12:33:24 -07:00
parent 1aacd94cb5
commit 29753c6b9b
4 changed files with 14 additions and 6 deletions

View File

@ -20,6 +20,7 @@ const QS_CONFIG = getQSConfig('execution_environments', {
});
function ExecutionEnvironmentLookup({
id,
globallyAvailable,
helperTextInvalid,
isDefaultEnvironment,
@ -154,7 +155,7 @@ function ExecutionEnvironmentLookup({
const renderLookup = () => (
<>
<Lookup
id="execution-environments"
id={id}
header={t`Execution Environment`}
value={value}
onBlur={onBlur}
@ -213,7 +214,7 @@ function ExecutionEnvironmentLookup({
return (
<FormGroup
fieldId="execution-environment-lookup"
fieldId={id}
label={renderLabel(isGlobalDefaultEnvironment, isDefaultEnvironment)}
labelIcon={popoverContent && <Popover content={popoverContent} />}
helperTextInvalid={helperTextInvalid}
@ -231,6 +232,7 @@ function ExecutionEnvironmentLookup({
}
ExecutionEnvironmentLookup.propTypes = {
id: string,
value: ExecutionEnvironment,
popoverContent: string,
onChange: func.isRequired,
@ -243,6 +245,7 @@ ExecutionEnvironmentLookup.propTypes = {
};
ExecutionEnvironmentLookup.defaultProps = {
id: 'execution-environments',
popoverContent: '',
isDefaultEnvironment: false,
isGlobalDefaultEnvironment: false,

View File

@ -236,6 +236,7 @@ function InventoryLookup({
}
InventoryLookup.propTypes = {
fieldId: string,
value: Inventory,
onChange: func.isRequired,
required: bool,
@ -247,6 +248,7 @@ InventoryLookup.propTypes = {
};
InventoryLookup.defaultProps = {
fieldId: 'inventory',
value: null,
required: false,
isOverrideDisabled: false,

View File

@ -128,7 +128,7 @@ function Lookup(props) {
<InputGroup onBlur={onBlur}>
<Button
aria-label={t`Search`}
id={id}
id={`${id}-open`}
onClick={() => dispatch({ type: 'TOGGLE_MODAL' })}
variant={ButtonVariant.control}
isDisabled={isLoading || isDisabled}
@ -149,7 +149,7 @@ function Lookup(props) {
</ChipHolder>
) : (
<TextInput
id={`${id}-input`}
id={id}
value={typedText}
onChange={(inputValue) => {
setTypedText(inputValue);

View File

@ -19,6 +19,7 @@ const QS_CONFIG = getQSConfig('organizations', {
});
function OrganizationLookup({
id,
helperTextInvalid,
isValid,
onBlur,
@ -94,7 +95,7 @@ function OrganizationLookup({
return (
<FormGroup
fieldId="organization"
fieldId={id}
helperTextInvalid={helperTextInvalid}
isRequired={required}
validated={isValid ? 'default' : 'error'}
@ -103,7 +104,7 @@ function OrganizationLookup({
>
<Lookup
isDisabled={isDisabled}
id="organization"
id={id}
header={t`Organization`}
value={value}
onBlur={onBlur}
@ -158,6 +159,7 @@ function OrganizationLookup({
}
OrganizationLookup.propTypes = {
id: string,
helperTextInvalid: node,
isValid: bool,
onBlur: func,
@ -171,6 +173,7 @@ OrganizationLookup.propTypes = {
};
OrganizationLookup.defaultProps = {
id: 'organization',
helperTextInvalid: '',
isValid: true,
onBlur: () => {},