Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/ocp-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@patternfly/react-table": "^5.0.0 <= 5.4.9",
"@patternfly/react-charts": "7.2.2",
"@types/react-redux": "^7.1.33",
"formik": "^2.4.5",
"formik": "^2.4.9",
"fuzzysearch": "^1.0.3",
"i18next": "^21.8.14",
"js-yaml": "^4.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const ApplicationInlineForm = ({

return (
<FieldArray name={`applications.${index}.files`}>
{({ push, remove }) => (
{(arrayHelpers) => (
<>
{app.files?.map((file, fileIndex) => {
const fieldName = `applications[${index}].files[${fileIndex}]`;
Expand All @@ -89,7 +89,7 @@ const ApplicationInlineForm = ({
variant="link"
icon={<MinusCircleIcon />}
iconPosition="start"
onClick={() => remove(fileIndex)}
onClick={() => arrayHelpers.remove(fileIndex)}
/>
</SplitItem>
)}
Expand All @@ -104,7 +104,7 @@ const ApplicationInlineForm = ({
icon={<PlusCircleIcon />}
iconPosition="start"
onClick={() => {
push({
arrayHelpers.push({
path: '',
content: '',
base64: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const ApplicationSection = ({ index, isReadOnly }: { index: number; isReadOnly?:
isSingleContainerApp={isContainer}
/>
<FieldArray name={`${appFieldName}.variables`}>
{({ push, remove }) => (
{(arrayHelpers) => (
<>
{app.variables.map((variable, varIndex) => (
<Split hasGutter key={varIndex}>
Expand Down Expand Up @@ -233,7 +233,7 @@ const ApplicationSection = ({ index, isReadOnly }: { index: number; isReadOnly?:
variant="link"
icon={<MinusCircleIcon />}
iconPosition="end"
onClick={() => remove(varIndex)}
onClick={() => arrayHelpers.remove(varIndex)}
/>
</SplitItem>
)}
Expand All @@ -248,7 +248,7 @@ const ApplicationSection = ({ index, isReadOnly }: { index: number; isReadOnly?:
icon={<PlusCircleIcon />}
iconPosition="start"
onClick={() => {
push({ name: '', value: '' });
arrayHelpers.push({ name: '', value: '' });
}}
>
{t('Add an application variable')}
Expand Down Expand Up @@ -282,7 +282,7 @@ const ApplicationTemplates = ({ isReadOnly }: { isReadOnly?: boolean }) => {
)}
</small>
<FieldArray name="applications">
{({ push, remove }) => (
{(arrayHelpers) => (
<>
{values.applications.map((_app, index) => (
<FormSection key={index}>
Expand All @@ -297,7 +297,7 @@ const ApplicationTemplates = ({ isReadOnly }: { isReadOnly?: boolean }) => {
variant="link"
icon={<MinusCircleIcon />}
iconPosition="start"
onClick={() => remove(index)}
onClick={() => arrayHelpers.remove(index)}
/>
</SplitItem>
)}
Expand All @@ -313,7 +313,7 @@ const ApplicationTemplates = ({ isReadOnly }: { isReadOnly?: boolean }) => {
icon={<PlusCircleIcon />}
iconPosition="start"
onClick={() => {
push({
arrayHelpers.push({
appType: AppType.AppTypeContainer,
specType: AppSpecType.OCI_IMAGE,
name: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ApplicationVolumeForm = ({
return (
<FormGroup label={t('Volumes')}>
<FieldArray name={`${appFieldName}.volumes`}>
{({ push, remove }) => (
{(arrayHelpers) => (
<>
{volumes.map((volume, volumeIndex) => {
const volumeFieldName = `${appFieldName}.volumes[${volumeIndex}]`;
Expand Down Expand Up @@ -108,7 +108,7 @@ const ApplicationVolumeForm = ({
variant="link"
icon={<MinusCircleIcon />}
iconPosition="start"
onClick={() => remove(volumeIndex)}
onClick={() => arrayHelpers.remove(volumeIndex)}
/>
</SplitItem>
)}
Expand All @@ -132,7 +132,7 @@ const ApplicationVolumeForm = ({
if (isSingleContainerApp) {
emptyVolume.mountPath = '';
}
push(emptyVolume);
arrayHelpers.push(emptyVolume);
}}
>
{t('Add volume')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const ConfigInlineTemplateForm = ({ index, isReadOnly }: ConfigInlineTemplateFor

return (
<FieldArray name={`configTemplates.${index}.files`}>
{({ push, remove }) => (
{(arrayHelpers) => (
<>
{inlineConfig.files?.map((_, fileIndex) => {
const fieldName = `configTemplates[${index}].files[${fileIndex}]`;
Expand All @@ -135,7 +135,7 @@ const ConfigInlineTemplateForm = ({ index, isReadOnly }: ConfigInlineTemplateFor
variant="link"
icon={<MinusCircleIcon />}
iconPosition="start"
onClick={() => remove(fileIndex)}
onClick={() => arrayHelpers.remove(fileIndex)}
/>
</SplitItem>
)}
Expand All @@ -149,7 +149,7 @@ const ConfigInlineTemplateForm = ({ index, isReadOnly }: ConfigInlineTemplateFor
icon={<PlusCircleIcon />}
iconPosition="start"
onClick={() => {
push({
arrayHelpers.push({
path: '',
content: '',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const ConfigurationTemplatesForm = ({
)}
>
<FieldArray name="configTemplates">
{({ push, remove }) => (
{(arrayHelpers) => (
<>
{values.configTemplates.map((_, index) => (
<FormSection key={index}>
Expand All @@ -183,7 +183,7 @@ const ConfigurationTemplatesForm = ({
variant="link"
icon={<MinusCircleIcon />}
iconPosition="start"
onClick={() => remove(index)}
onClick={() => arrayHelpers.remove(index)}
/>
</SplitItem>
)}
Expand All @@ -198,7 +198,7 @@ const ConfigurationTemplatesForm = ({
icon={<PlusCircleIcon />}
iconPosition="start"
onClick={() => {
push({
arrayHelpers.push({
name: '',
type: '',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const UpdateStepRolloutPolicy = ({ isReadOnly }: { isReadOnly: boolean }) => {

<FormGroup>
<FieldArray name="rolloutPolicy.batches">
{({ push, remove }) => (
{(arrayHelpers) => (
<>
{batches.map((_, index) => (
<FormSection key={index}>
Expand All @@ -164,7 +164,7 @@ const UpdateStepRolloutPolicy = ({ isReadOnly }: { isReadOnly: boolean }) => {
variant="link"
icon={<MinusCircleIcon />}
iconPosition="start"
onClick={() => remove(index)}
onClick={() => arrayHelpers.remove(index)}
isDisabled={batches.length === 1}
/>
</SplitItem>
Expand All @@ -180,7 +180,7 @@ const UpdateStepRolloutPolicy = ({ isReadOnly }: { isReadOnly: boolean }) => {
icon={<PlusCircleIcon />}
iconPosition="start"
onClick={() => {
push(getEmptyInitializedBatch());
arrayHelpers.push(getEmptyInitializedBatch());
}}
>
{t('Add batch')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,19 @@ const CreateResourceSyncsForm = () => {

return (
<FieldArray name="resourceSyncs">
{({ remove, push }) => (
{(arrayHelpers) => (
<>
{values.resourceSyncs.map((resourceSync, index) => (
<React.Fragment key={index}>
<CreateResourceSyncForm rs={resourceSync} index={index} />
{values.resourceSyncs.length > 1 && (
<FormGroup isInline>
<Button variant="link" icon={<MinusCircleIcon />} iconPosition="left" onClick={() => remove(index)}>
<Button
variant="link"
icon={<MinusCircleIcon />}
iconPosition="left"
onClick={() => arrayHelpers.remove(index)}
>
{t('Remove resource sync')}
</Button>
</FormGroup>
Expand All @@ -76,7 +81,7 @@ const CreateResourceSyncsForm = () => {
variant="link"
icon={<PlusCircleIcon />}
iconPosition="left"
onClick={() => push({ name: '', path: '', targetRevision: '' } as ResourceSyncFormValue)}
onClick={() => arrayHelpers.push({ name: '', path: '', targetRevision: '' } as ResourceSyncFormValue)}
>
{t('Add another resource sync')}
</Button>
Expand Down
Loading
Loading