From c56c236e3a2c26587a2d45ea8ac5606b2562ff66 Mon Sep 17 00:00:00 2001 From: Richard Wei <54336863+WaysonWei@users.noreply.github.com> Date: Thu, 22 Jul 2021 16:21:25 +1200 Subject: [PATCH] fix(stack): show warning if endpoint is selected (#5234) * fix/EE-916/Invalid warning in stack details * fix typo for isEndpointSelected function * check yarmlError is valid * combine yamlError and isEndpointSelected into one linie --- .../stack-duplication-form-controller.js | 5 +++++ .../stack-duplication-form/stack-duplication-form.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/portainer/components/stack-duplication-form/stack-duplication-form-controller.js b/app/portainer/components/stack-duplication-form/stack-duplication-form-controller.js index b0e7b5ff4..f5574518a 100644 --- a/app/portainer/components/stack-duplication-form/stack-duplication-form-controller.js +++ b/app/portainer/components/stack-duplication-form/stack-duplication-form-controller.js @@ -18,6 +18,7 @@ angular.module('portainer.app').controller('StackDuplicationFormController', [ ctrl.duplicateStack = duplicateStack; ctrl.migrateStack = migrateStack; ctrl.isMigrationButtonDisabled = isMigrationButtonDisabled; + ctrl.isEndpointSelected = isEndpointSelected; function isFormValidForMigration() { return ctrl.formValues.endpoint && ctrl.formValues.endpoint.Id; @@ -62,5 +63,9 @@ angular.module('portainer.app').controller('StackDuplicationFormController', [ function isTargetEndpointAndCurrentEquals() { return ctrl.formValues.endpoint && ctrl.formValues.endpoint.Id === ctrl.currentEndpointId; } + + function isEndpointSelected() { + return ctrl.formValues.endpoint && ctrl.formValues.endpoint.Id; + } }, ]); diff --git a/app/portainer/components/stack-duplication-form/stack-duplication-form.html b/app/portainer/components/stack-duplication-form/stack-duplication-form.html index cf2e0a293..25ce62913 100644 --- a/app/portainer/components/stack-duplication-form/stack-duplication-form.html +++ b/app/portainer/components/stack-duplication-form/stack-duplication-form.html @@ -33,7 +33,7 @@ Duplicate Duplication in progress... -