1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 22:39:41 +02:00

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
This commit is contained in:
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.duplicateStack = duplicateStack;
ctrl.migrateStack = migrateStack; ctrl.migrateStack = migrateStack;
ctrl.isMigrationButtonDisabled = isMigrationButtonDisabled; ctrl.isMigrationButtonDisabled = isMigrationButtonDisabled;
ctrl.isEndpointSelected = isEndpointSelected;
function isFormValidForMigration() { function isFormValidForMigration() {
return ctrl.formValues.endpoint && ctrl.formValues.endpoint.Id; return ctrl.formValues.endpoint && ctrl.formValues.endpoint.Id;
@ -62,5 +63,9 @@ angular.module('portainer.app').controller('StackDuplicationFormController', [
function isTargetEndpointAndCurrentEquals() { function isTargetEndpointAndCurrentEquals() {
return ctrl.formValues.endpoint && ctrl.formValues.endpoint.Id === ctrl.currentEndpointId; 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-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> <span ng-show="$ctrl.state.duplicationInProgress">Duplication in progress...</span>
</button> </button>
<div ng-if="$ctrl.yamlError" <div ng-if="$ctrl.yamlError && $ctrl.isEndpointSelected()"
><span class="text-danger small">{{ $ctrl.yamlError }}</span></div ><span class="text-danger small">{{ $ctrl.yamlError }}</span></div
> >
</div> </div>