mirror of https://github.com/portainer/portainer
covert RepositoryMechanism to constant
parent
042a66d15c
commit
1faed11fd6
|
@ -209,9 +209,9 @@ class KubernetesDeployController {
|
|||
payload.AdditionalFiles = this.formValues.AdditionalFiles;
|
||||
if (this.formValues.RepositoryAutomaticUpdates) {
|
||||
payload.AutoUpdate = {};
|
||||
if (this.formValues.RepositoryMechanism === `Interval`) {
|
||||
if (this.formValues.RepositoryMechanism === RepositoryMechanismTypes.INTERVAL) {
|
||||
payload.AutoUpdate.Interval = this.formValues.RepositoryFetchInterval;
|
||||
} else if (this.formValues.RepositoryMechanism === `Webhook`) {
|
||||
} else if (this.formValues.RepositoryMechanism === RepositoryMechanismTypes.WEBHOOK) {
|
||||
payload.AutoUpdate.Webhook = this.formValues.RepositoryWebhookURL.split('/').reverse()[0];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,10 +119,10 @@ class KubernetesRedeployAppGitFormController {
|
|||
this.formValues.AutoUpdate.RepositoryAutomaticUpdates = true;
|
||||
|
||||
if (this.stack.AutoUpdate.Interval) {
|
||||
this.formValues.AutoUpdate.RepositoryMechanism = `Interval`;
|
||||
this.formValues.AutoUpdate.RepositoryMechanism = RepositoryMechanismTypes.INTERVAL;
|
||||
this.formValues.AutoUpdate.RepositoryFetchInterval = this.stack.AutoUpdate.Interval;
|
||||
} else if (this.stack.AutoUpdate.Webhook) {
|
||||
this.formValues.AutoUpdate.RepositoryMechanism = `Webhook`;
|
||||
this.formValues.AutoUpdate.RepositoryMechanism = RepositoryMechanismTypes.WEBHOOK;
|
||||
this.formValues.AutoUpdate.RepositoryWebhookURL = this.WebhookHelper.returnStackWebhookUrl(this.stack.AutoUpdate.Webhook);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -161,10 +161,10 @@ class StackRedeployGitFormController {
|
|||
this.formValues.AutoUpdate.RepositoryAutomaticUpdates = true;
|
||||
|
||||
if (this.stack.AutoUpdate.Interval) {
|
||||
this.formValues.AutoUpdate.RepositoryMechanism = `Interval`;
|
||||
this.formValues.AutoUpdate.RepositoryMechanism = RepositoryMechanismTypes.INTERVAL;
|
||||
this.formValues.AutoUpdate.RepositoryFetchInterval = this.stack.AutoUpdate.Interval;
|
||||
} else if (this.stack.AutoUpdate.Webhook) {
|
||||
this.formValues.AutoUpdate.RepositoryMechanism = `Webhook`;
|
||||
this.formValues.AutoUpdate.RepositoryMechanism = RepositoryMechanismTypes.WEBHOOK;
|
||||
this.formValues.AutoUpdate.RepositoryWebhookURL = this.WebhookHelper.returnStackWebhookUrl(this.stack.AutoUpdate.Webhook);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue