mirror of https://github.com/portainer/portainer
fix(ui/env-vars): apply controlled input to field [EE-6411]
fix [EE-6411]pull/10737/head
parent
47845523a5
commit
8567d7fa37
|
@ -8,6 +8,7 @@ import { AnnotationsBeTeaser } from '@/react/kubernetes/annotations/AnnotationsB
|
||||||
import { withFormValidation } from '@/react-tools/withFormValidation';
|
import { withFormValidation } from '@/react-tools/withFormValidation';
|
||||||
import { GroupAssociationTable } from '@/react/portainer/environments/environment-groups/components/GroupAssociationTable';
|
import { GroupAssociationTable } from '@/react/portainer/environments/environment-groups/components/GroupAssociationTable';
|
||||||
import { AssociatedEnvironmentsSelector } from '@/react/portainer/environments/environment-groups/components/AssociatedEnvironmentsSelector';
|
import { AssociatedEnvironmentsSelector } from '@/react/portainer/environments/environment-groups/components/AssociatedEnvironmentsSelector';
|
||||||
|
import { withControlledInput } from '@/react-tools/withControlledInput';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
EnvironmentVariablesFieldset,
|
EnvironmentVariablesFieldset,
|
||||||
|
@ -225,7 +226,7 @@ export const componentsModule = ngModule.name;
|
||||||
|
|
||||||
withFormValidation(
|
withFormValidation(
|
||||||
ngModule,
|
ngModule,
|
||||||
EnvironmentVariablesFieldset,
|
withControlledInput(EnvironmentVariablesFieldset, { values: 'onChange' }),
|
||||||
'environmentVariablesFieldset',
|
'environmentVariablesFieldset',
|
||||||
[],
|
[],
|
||||||
envVarValidation
|
envVarValidation
|
||||||
|
@ -233,7 +234,7 @@ withFormValidation(
|
||||||
|
|
||||||
withFormValidation(
|
withFormValidation(
|
||||||
ngModule,
|
ngModule,
|
||||||
EnvironmentVariablesPanel,
|
withControlledInput(EnvironmentVariablesPanel, { values: 'onChange' }),
|
||||||
'environmentVariablesPanel',
|
'environmentVariablesPanel',
|
||||||
['explanation', 'showHelpMessage'],
|
['explanation', 'showHelpMessage'],
|
||||||
envVarValidation
|
envVarValidation
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
|
import { ComponentProps } from 'react';
|
||||||
|
|
||||||
import { FormSection } from '@@/form-components/FormSection';
|
import { FormSection } from '@@/form-components/FormSection';
|
||||||
import { TextTip } from '@@/Tip/TextTip';
|
import { TextTip } from '@@/Tip/TextTip';
|
||||||
|
|
||||||
import { ArrayError } from '../InputList/InputList';
|
|
||||||
|
|
||||||
import { Value } from './types';
|
|
||||||
import { EnvironmentVariablesFieldset } from './EnvironmentVariablesFieldset';
|
import { EnvironmentVariablesFieldset } from './EnvironmentVariablesFieldset';
|
||||||
|
|
||||||
|
type FieldsetProps = ComponentProps<typeof EnvironmentVariablesFieldset>;
|
||||||
|
|
||||||
export function EnvironmentVariablesPanel({
|
export function EnvironmentVariablesPanel({
|
||||||
explanation,
|
explanation,
|
||||||
onChange,
|
onChange,
|
||||||
|
@ -14,11 +15,8 @@ export function EnvironmentVariablesPanel({
|
||||||
errors,
|
errors,
|
||||||
}: {
|
}: {
|
||||||
explanation?: string;
|
explanation?: string;
|
||||||
values: Value;
|
|
||||||
onChange(value: Value): void;
|
|
||||||
showHelpMessage?: boolean;
|
showHelpMessage?: boolean;
|
||||||
errors?: ArrayError<Value>;
|
} & FieldsetProps) {
|
||||||
}) {
|
|
||||||
return (
|
return (
|
||||||
<FormSection title="Environment variables">
|
<FormSection title="Environment variables">
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
|
|
Loading…
Reference in New Issue