1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00

refactor(stacks): extract auto update logic [EE-4945] (#8545)

This commit is contained in:
Chaim Lev-Ari 2023-03-02 17:07:50 +02:00 committed by GitHub
parent 085381e6fc
commit 6918da2414
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 410 additions and 166 deletions

View file

@ -9,7 +9,7 @@ import { isBE } from '@/react/portainer/feature-flags/feature-flags.service';
import { kubernetes } from '@@/BoxSelector/common-options/deployment-methods';
import { editor, git, customTemplate, url } from '@@/BoxSelector/common-options/build-methods';
import { parseAutoUpdateResponse, transformAutoUpdateViewModel } from '@/react/portainer/gitops/AutoUpdateFieldset/utils';
import { baseStackWebhookUrl } from '@/portainer/helpers/webhookHelper';
import { baseStackWebhookUrl, createWebhookId } from '@/portainer/helpers/webhookHelper';
import { confirmWebEditorDiscard } from '@@/modals/confirm';
class KubernetesDeployController {
@ -45,6 +45,7 @@ class KubernetesDeployController {
templateId: null,
template: null,
baseWebhookUrl: baseStackWebhookUrl(),
webhookId: createWebhookId(),
};
this.formValues = {
@ -256,7 +257,7 @@ class KubernetesDeployController {
}
payload.ManifestFile = this.formValues.ComposeFilePathInRepository;
payload.AdditionalFiles = this.formValues.AdditionalFiles;
payload.AutoUpdate = transformAutoUpdateViewModel(this.formValues.AutoUpdate);
payload.AutoUpdate = transformAutoUpdateViewModel(this.formValues.AutoUpdate, this.state.webhookId);
} else if (method === KubernetesDeployRequestMethods.STRING) {
payload.StackFileContent = this.formValues.EditorContent;
} else {