Disable update application button on load of edit screen (#10957)

This commit is contained in:
Prabhat Khera
2024-01-16 09:31:44 +13:00
committed by GitHub
parent fcc5736d61
commit bbf1900677
3 changed files with 14 additions and 9 deletions

View File

@@ -414,7 +414,7 @@
style="margin-top: 7px; margin-left: 0"
button-spinner="ctrl.state.updateWebEditorInProgress"
>
<span ng-show="!ctrl.state.updateWebEditorInProgress">Update the application</span>
<span ng-show="!ctrl.state.updateWebEditorInProgress">Update application</span>
<span ng-show="ctrl.state.updateWebEditorInProgress">Update in progress...</span>
</button>
</div>

View File

@@ -216,10 +216,12 @@ class KubernetesCreateApplicationController {
}
onChangeFileContent(value) {
if (this.stackFileContent.replace(/(\r\n|\n|\r)/gm, '') !== value.replace(/(\r\n|\n|\r)/gm, '')) {
this.state.isEditorDirty = true;
this.stackFileContent = value;
}
this.$scope.$evalAsync(() => {
if (this.stackFileContent.replace(/(\r\n|\n|\r)/gm, '') !== value.replace(/(\r\n|\n|\r)/gm, '')) {
this.state.isEditorDirty = true;
this.stackFileContent = value;
}
});
}
onDataAccessPolicyChange(value) {
@@ -1055,9 +1057,6 @@ class KubernetesCreateApplicationController {
this.formValues.OriginalIngresses = this.ingresses;
this.formValues.ImageModel = await this.parseImageConfiguration(this.formValues.ImageModel);
this.savedFormValues = angular.copy(this.formValues);
this.updateNamespaceLimits(this.namespaceWithQuota);
this.updateSliders(this.namespaceWithQuota);
if (this.application.ApplicationType !== KubernetesApplicationTypes.StatefulSet) {
_.forEach(this.formValues.PersistedFolders, (persistedFolder) => {
@@ -1070,6 +1069,10 @@ class KubernetesCreateApplicationController {
}
this.formValues.OriginalPersistedFolders = this.formValues.PersistedFolders;
await this.refreshNamespaceData(namespace);
this.savedFormValues = angular.copy(this.formValues);
this.updateNamespaceLimits(this.namespaceWithQuota);
this.updateSliders(this.namespaceWithQuota);
} else {
this.formValues.AutoScaler = KubernetesApplicationHelper.generateAutoScalerFormValueFromHorizontalPodAutoScaler(null, this.formValues.ReplicaCount);
}

View File

@@ -316,7 +316,9 @@ export function usePatchApplicationMutation(
}: {
appKind: AppKind;
patch: ApplicationPatch;
contentType?: string;
contentType?:
| 'application/json-patch+json'
| 'application/strategic-merge-patch+json';
}) =>
patchApplication(
environmentId,