covert RepositoryMechanism to constant

pull/5596/head
Felix Han 2021-09-07 08:56:17 +12:00
parent 042a66d15c
commit 1faed11fd6
3 changed files with 6 additions and 6 deletions

View File

@ -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];
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}