fix(app): fix exhaused error message [EE-6231] (#10949)

Co-authored-by: testa113 <testa113>
pull/10943/head
Ali 2024-01-15 11:03:38 +13:00 committed by GitHub
parent cb7efd8601
commit d750389c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -66,7 +66,7 @@
<namespace-selector
values="ctrl.formValues.ResourcePool.Namespace.Name"
on-change="(ctrl.onChangeNamespaceName)"
validation-data="{hasQuota: ctrl.state.resourcePoolHasQuota, isResourceQuotaCapacityExceeded: ctrl.resourceQuotaCapacityExceeded(), namespaceOptionCount: ctrl.resourcePools.length, isAdmin: ctrl.isAdmin}"
validation-data="{hasQuota: ctrl.state.resourcePoolHasQuota, isResourceQuotaCapacityExceeded: ctrl.resourceQuotaCapacityExceeded(), namespaceOptionCount: ctrl.resourcePools.length, isEnvironmentAdmin: ctrl.state.isEnvironmentAdmin}"
is-edit="ctrl.state.isEdit"
></namespace-selector>
<!-- kubernetes services options -->
@ -159,7 +159,7 @@
<namespace-selector
values="ctrl.formValues.ResourcePool.Namespace.Name"
on-change="(ctrl.onChangeNamespaceName)"
validation-data="{hasQuota: ctrl.state.resourcePoolHasQuota, isResourceQuotaCapacityExceeded: ctrl.resourceQuotaCapacityExceeded(), namespaceOptionCount: ctrl.resourcePools.length, isAdmin: ctrl.isAdmin}"
validation-data="{hasQuota: ctrl.state.resourcePoolHasQuota, isResourceQuotaCapacityExceeded: ctrl.resourceQuotaCapacityExceeded(), namespaceOptionCount: ctrl.resourcePools.length, isEnvironmentAdmin: ctrl.state.isEnvironmentAdmin}"
is-edit="ctrl.state.isEdit"
></namespace-selector>
<!-- #endregion -->

View File

@ -121,6 +121,7 @@ class KubernetesCreateApplicationController {
persistedFoldersUseExistingVolumes: false,
pullImageValidity: false,
nodePortServices: [],
isEnvironmentAdmin: this.Authentication.hasAuthorizations(['K8sResourcePoolsW']),
};
this.isAdmin = this.Authentication.isAdmin();

View File

@ -4,7 +4,7 @@ type ValidationData = {
hasQuota: boolean;
isResourceQuotaCapacityExceeded: boolean;
namespaceOptionCount: number;
isAdmin: boolean;
isEnvironmentAdmin: boolean;
};
const emptyValue =
@ -17,7 +17,7 @@ export function namespaceSelectorValidation(
hasQuota,
isResourceQuotaCapacityExceeded,
namespaceOptionCount,
isAdmin,
isEnvironmentAdmin,
} = validationData || {};
return string()
.required(emptyValue)
@ -25,7 +25,7 @@ export function namespaceSelectorValidation(
.test(
'resourceQuotaCapacityExceeded',
`This namespace has exhausted its resource capacity and you will not be able to deploy the application.${
isAdmin
isEnvironmentAdmin
? ''
: ' Contact your administrator to expand the capacity of the namespace.'
}`,