From 947ba4940bba993845fe845227c2603dcbf87862 Mon Sep 17 00:00:00 2001 From: Ali <83188384+testA113@users.noreply.github.com> Date: Wed, 3 Jan 2024 10:03:33 +1300 Subject: [PATCH] refactor(app): migrate resource reservations [EE-6236] (#10695) * refactor(app): migrate resource reservations [EE-6236] --- app/kubernetes/react/components/index.ts | 17 +++ .../create/createApplication.html | 105 ++---------------- .../create/createApplicationController.js | 8 ++ .../ResourceReservationFormSection.tsx | 99 +++++++++++++++++ .../ResourceReservationFormSection/index.ts | 2 + .../resourceReservationValidation.ts | 29 +++++ .../ResourceReservationFormSection/types.ts | 4 + 7 files changed, 168 insertions(+), 96 deletions(-) create mode 100644 app/react/kubernetes/applications/components/ResourceReservationFormSection/ResourceReservationFormSection.tsx create mode 100644 app/react/kubernetes/applications/components/ResourceReservationFormSection/index.ts create mode 100644 app/react/kubernetes/applications/components/ResourceReservationFormSection/resourceReservationValidation.ts create mode 100644 app/react/kubernetes/applications/components/ResourceReservationFormSection/types.ts diff --git a/app/kubernetes/react/components/index.ts b/app/kubernetes/react/components/index.ts index f0ad11e94..eab580a93 100644 --- a/app/kubernetes/react/components/index.ts +++ b/app/kubernetes/react/components/index.ts @@ -30,6 +30,10 @@ import { configurationsValidationSchema } from '@/react/kubernetes/applications/ import { ConfigMapsFormSection } from '@/react/kubernetes/applications/components/ConfigurationsFormSection/ConfigMapsFormSection'; import { PersistedFoldersFormSection } from '@/react/kubernetes/applications/components/PersistedFoldersFormSection'; import { persistedFoldersValidation } from '@/react/kubernetes/applications/components/PersistedFoldersFormSection/persistedFoldersValidation'; +import { + ResourceReservationFormSection, + resourceReservationValidation, +} from '@/react/kubernetes/applications/components/ResourceReservationFormSection'; import { EnvironmentVariablesFieldset } from '@@/form-components/EnvironmentVariablesFieldset'; @@ -221,3 +225,16 @@ withFormValidation( ], persistedFoldersValidation ); + +withFormValidation( + ngModule, + withUIRouter(withCurrentUser(withReactQuery(ResourceReservationFormSection))), + 'resourceReservationFormSection', + [ + 'namespaceHasQuota', + 'resourceQuotaCapacityExceeded', + 'maxMemoryLimit', + 'maxCpuLimit', + ], + resourceReservationValidation +); diff --git a/app/kubernetes/views/applications/create/createApplication.html b/app/kubernetes/views/applications/create/createApplication.html index f559bb292..a4af13daa 100644 --- a/app/kubernetes/views/applications/create/createApplication.html +++ b/app/kubernetes/views/applications/create/createApplication.html @@ -432,102 +432,15 @@ -