mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 14:29:40 +02:00
fix(app): fix wording and 2 key validation [EE-6233] (#10944)
Co-authored-by: testa113 <testa113>
This commit is contained in:
parent
55f66f161e
commit
cb7efd8601
6 changed files with 21 additions and 21 deletions
|
@ -11,7 +11,11 @@ import { isErrorType } from '@@/form-components/formikUtils';
|
|||
import { Button } from '@@/buttons';
|
||||
import { TextTip } from '@@/Tip/TextTip';
|
||||
|
||||
import { ConfigurationFormValues, ConfigurationOverrideKey } from './types';
|
||||
import {
|
||||
ConfigurationFormValues,
|
||||
ConfigurationOverrideKey,
|
||||
ConfigurationType,
|
||||
} from './types';
|
||||
import { ConfigurationData } from './ConfigurationKey';
|
||||
|
||||
type Props = {
|
||||
|
@ -21,7 +25,7 @@ type Props = {
|
|||
configurations: Array<ConfigMap | Secret>;
|
||||
index: number;
|
||||
error?: ItemError<ConfigurationFormValues>;
|
||||
dataCyType: 'config' | 'secret';
|
||||
configurationType: ConfigurationType;
|
||||
};
|
||||
|
||||
export function ConfigurationItem({
|
||||
|
@ -31,7 +35,7 @@ export function ConfigurationItem({
|
|||
configurations,
|
||||
index,
|
||||
onRemoveItem,
|
||||
dataCyType,
|
||||
configurationType,
|
||||
}: Props) {
|
||||
// rule out the error being of type string
|
||||
const formikError = isErrorType(error) ? error : undefined;
|
||||
|
@ -55,7 +59,7 @@ export function ConfigurationItem({
|
|||
)}
|
||||
onChange={onSelectConfigMap}
|
||||
size="sm"
|
||||
data-cy={`k8sAppCreate-add${dataCyType}Select_${index}`}
|
||||
data-cy={`k8sAppCreate-add${configurationType}Select_${index}`}
|
||||
/>
|
||||
</InputGroup>
|
||||
{formikError?.selectedConfiguration && (
|
||||
|
@ -95,8 +99,8 @@ export function ConfigurationItem({
|
|||
{!item.overriden && (
|
||||
<TextTip color="blue">
|
||||
The following keys will be loaded from the{' '}
|
||||
<code>{item.selectedConfiguration.metadata?.name}</code>
|
||||
ConfigMap as environment variables:
|
||||
<code>{item.selectedConfiguration.metadata?.name}</code>{' '}
|
||||
{configurationType} as environment variables:
|
||||
{Object.keys(configurationData).map((key, index) => (
|
||||
<span key={key}>
|
||||
<code>{key}</code>
|
||||
|
@ -116,7 +120,7 @@ export function ConfigurationItem({
|
|||
onChange({ ...item, overridenKeys: newOverridenKeys });
|
||||
}}
|
||||
overrideKeysErrors={formikError?.overridenKeys}
|
||||
dataCyType={dataCyType}
|
||||
configurationType={configurationType}
|
||||
configurationIndex={index}
|
||||
keyIndex={keyIndex}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue