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
pull/5345/head
Richard Wei 2021-07-22 16:21:25 +12:00 committed by GitHub
parent 68453482af
commit c56c236e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

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

View File

@ -33,7 +33,7 @@
<span ng-hide="$ctrl.state.duplicationInProgress"> <i class="fa fa-clone space-right" aria-hidden="true"></i> Duplicate </span>
<span ng-show="$ctrl.state.duplicationInProgress">Duplication in progress...</span>
</button>
<div ng-if="$ctrl.yamlError"
<div ng-if="$ctrl.yamlError && $ctrl.isEndpointSelected()"
><span class="text-danger small">{{ $ctrl.yamlError }}</span></div
>
</div>