aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2/pages')
-rw-r--r--catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html2
-rw-r--r--catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts27
2 files changed, 26 insertions, 3 deletions
diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html
index 6d5fd8d72f..982cbb204c 100644
--- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html
+++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.html
@@ -90,7 +90,7 @@
class="add-param-link add-btn"
*ngIf="!isUsingExistingWF() && !readonly"
data-tests-id="addInputParameter"
- [ngClass]="{'disabled':!isParamsValid()}"
+ [ngClass]="{'disabled':!canAdd()}"
(click)="addParam()">Add Parameter</a>
</div>
diff --git a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts
index 62473bd868..5d3b027493 100644
--- a/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts
+++ b/catalog-ui/src/app/ng2/pages/interface-operation/operation-creator/operation-creator.component.ts
@@ -246,10 +246,33 @@ export class OperationCreatorComponent {
this.tableParameters.push(new OperationParameter(param));
}
+ canAdd(): boolean {
+ let valid = true;
+ if (this.currentTab === this.TYPE_INPUT) {
+ _.forEach(this.inputParameters, param => {
+ if (!param.name || !param.property) {
+ valid = false;
+ }
+ });
+ } else {
+ _.forEach(this.outputParameters, param => {
+ if (!param.name || !param.type) {
+ valid = false;
+ }
+ });
+ }
+ return valid;
+ }
+
isParamsValid(): boolean {
let valid = true;
- _.forEach(this.tableParameters, param => {
- if (!param.name || (this.currentTab == this.TYPE_INPUT && !param.property)) {
+ _.forEach(this.inputParameters, param => {
+ if (!param.name || !param.property) {
+ valid = false;
+ }
+ });
+ _.forEach(this.outputParameters, param => {
+ if (!param.name || !param.type) {
valid = false;
}
});