1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 13:59:40 +02:00

feat(app): sort environment variables (#4815)

* feat(app): sort environment variables

* feat(k8s/application): improve the sorting for the env variables when creating/editing application

* feat(k8s/application): update the removal of the env var

* feat(docker/service): improve the sorting order for env var in service edition view
This commit is contained in:
Alice Groux 2021-02-18 14:46:26 +01:00 committed by GitHub
parent 86335a4357
commit 387bbeceba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 15 deletions

View file

@ -165,15 +165,19 @@ class KubernetesCreateApplicationController {
this.formValues.EnvironmentVariables.push(new KubernetesApplicationEnvironmentVariableFormValue());
}
restoreEnvironmentVariable(index) {
this.formValues.EnvironmentVariables[index].NeedsDeletion = false;
restoreEnvironmentVariable(item) {
item.NeedsDeletion = false;
}
removeEnvironmentVariable(index) {
if (this.state.isEdit && !this.formValues.EnvironmentVariables[index].IsNew) {
this.formValues.EnvironmentVariables[index].NeedsDeletion = true;
} else {
this.formValues.EnvironmentVariables.splice(index, 1);
removeEnvironmentVariable(item) {
const index = this.formValues.EnvironmentVariables.indexOf(item);
if (index !== -1) {
const envVar = this.formValues.EnvironmentVariables[index];
if (!envVar.IsNew) {
envVar.NeedsDeletion = true;
} else {
this.formValues.EnvironmentVariables.splice(index, 1);
}
}
this.onChangeEnvironmentName();
}