diff --git a/Dockerfile b/Dockerfile
index 80c4908a..41964b89 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM epamedp/headlamp:0.22.35
+FROM epamedp/headlamp:0.22.36
COPY --chown=100:101 assets/ /headlamp/frontend
COPY --chown=100:101 dist/main.js /headlamp/plugins/edp/main.js
diff --git a/src/pages/stage-details/components/Variables/index.tsx b/src/pages/stage-details/components/Variables/index.tsx
index 9c60ca2d..5a5c0d2e 100644
--- a/src/pages/stage-details/components/Variables/index.tsx
+++ b/src/pages/stage-details/components/Variables/index.tsx
@@ -51,69 +51,70 @@ export const Variables = ({ configMap }: { configMap: ConfigMapKubeObjectInterfa
const theme = useTheme();
- const onSubmit = (values) => {
- const configMapCopy = { ...configMap };
- configMapCopy.data = values.variables.reduce((acc, { key, value }) => {
- acc[key] = value;
- return acc;
- }, {});
+ const onSubmit = React.useCallback(
+ (values) => {
+ const configMapCopy = { ...configMap };
+ configMapCopy.data = values.variables.reduce((acc, { key, value }) => {
+ acc[key] = value;
+ return acc;
+ }, {});
- editConfigMap({ configMapData: configMapCopy });
- reset(values, { keepValues: true });
- };
+ editConfigMap({ configMapData: configMapCopy });
+ reset(values, { keepValues: true });
+ },
+ [configMap, editConfigMap, reset]
+ );
- const appendNewRow = () => append({ key: '', value: '' });
+ const appendNewRow = React.useCallback(() => append({ key: '', value: '' }), [append]);
- return (
-
- {!fields?.length ? (
-
- ) : (
+ const renderContent = React.useCallback(() => {
+ if (fields.length || dataEntries?.length) {
+ return (
- )}
-
- );
+ );
+ }
+
+ if (!dataEntries?.length) {
+ return (
+
+ );
+ }
+ }, [
+ appendNewRow,
+ configMapEditMutation.isLoading,
+ control,
+ dataEntries?.length,
+ errors,
+ fields,
+ handleDelete,
+ handleSubmit,
+ isDirty,
+ onSubmit,
+ register,
+ reset,
+ theme.palette.secondary.dark,
+ ]);
+
+ return {renderContent()};
};