diff options
author | 2019-05-13 15:30:27 +0300 | |
---|---|---|
committer | 2019-05-13 14:50:55 +0000 | |
commit | 3d5b80b9035b9832f86326858b4c6c2cecd952a3 (patch) | |
tree | 62109696bdc736bd2c7d3bfb68d730a2b44a3946 /catalog-ui/src/app/ng2/pages/interface-operation/operation-creator | |
parent | 8364c2d4c986e37cc1ea7e4120f5d13d14b03067 (diff) |
operation artifact optional and fixes
Change-Id: Ibce96d60248b26716ed518747444836b437f209f
Issue-ID: SDC-2249
Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/interface-operation/operation-creator')
2 files changed, 13 insertions, 12 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 5faddd829c..8f70f7f584 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 @@ -86,15 +86,15 @@ <div *ngIf="isUsingExternalWF()" class="form-item sdc-input"> - <label class="sdc-input__label required">{{ 'OPERATION_ARTIFACT' | translate }}</label> + <label class="sdc-input__label">{{ 'OPERATION_ARTIFACT' | translate }}</label> <div class="i-sdc-form-item i-sdc-form-file-upload"> <span class="i-sdc-form-file-name" data-tests-id="artifactFilename"> - {{ operation.artifactFile && operation.artifactFile.name }} + {{ operation.artifactFileName }} </span> <div - *ngIf="operation.artifactFile && operation.artifactFile.name" + *ngIf="operation.artifactFileName" class="i-sdc-form-file-upload-x-btn" data-tests-id="clearArtifact" (click)="onChangeArtifactFile({ target: {} })"></div> @@ -107,6 +107,7 @@ maxsize="10240" data-tests-id="artifactUpload" (change)="onChangeArtifactFile($event)" + (click)="$event.target.value = ''" /> <div class="file-upload-browse-btn">Browse</div> </label> 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 7b36062427..a574460478 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 @@ -186,6 +186,8 @@ export class OperationCreatorComponent implements OperationCreatorInput { if (inputOperation) { this.onSelectInterface(new DropDownOption(this.operation.interfaceType)); + this.operation.artifactFileName = this.operation.artifactFileName || this.operation.implementation.artifactName; + if (this.enableWorkflowAssociation && inputOperation.workflowVersionId && this.isUsingExistingWF(inputOperation)) { this.assignInputParameters[this.operation.workflowId] = {[inputOperation.workflowVersionId]: []}; this.assignOutputParameters[this.operation.workflowId] = {[inputOperation.workflowVersionId]: []}; @@ -317,13 +319,13 @@ export class OperationCreatorComponent implements OperationCreatorInput { ).sort((a, b) => a.name.localeCompare(b.name)), (version: any) => { if (!this.assignInputParameters[this.operation.workflowId][version.id] && version.id !== selectedVersionId) { - this.assignInputParameters[this.operation.workflowId][version.id] = _.map(version.inputs, (input: OperationParameter) => { - return new OperationParameter({...input, type: input.type.toLowerCase(), required: Boolean(input.required)}); + this.assignInputParameters[this.operation.workflowId][version.id] = _.map(version.inputs, (input: any) => { + return new OperationParameter({...input, type: input.type.toLowerCase(), required: Boolean(input.mandatory)}); }) .sort((a, b) => a.name.localeCompare(b.name)); - this.assignOutputParameters[this.operation.workflowId][version.id] = _.map(version.outputs, (output: OperationParameter) => { - return new OperationParameter({...output, type: output.type.toLowerCase(), required: Boolean(output.required)}); + this.assignOutputParameters[this.operation.workflowId][version.id] = _.map(version.outputs, (output: any) => { + return new OperationParameter({...output, type: output.type.toLowerCase(), required: Boolean(output.mandatory)}); }) .sort((a, b) => a.name.localeCompare(b.name)); } @@ -383,9 +385,9 @@ export class OperationCreatorComponent implements OperationCreatorInput { onChangeArtifactFile(e: any) { const file = e.target.files && e.target.files[0]; - this.operation.artifactFile = file; + this.operation.artifactFileName = file && file.name; - if (!this.operation.artifactFile) { + if (!this.operation.artifactFileName) { this.operation.artifactData = null; this.validityChanged(); return; @@ -495,9 +497,7 @@ export class OperationCreatorComponent implements OperationCreatorInput { checkFormValidForSubmit = (): boolean => { return this.operation.name && - (this.isUsingExternalWF() ? - (this.operation.artifactFile && this.operation.artifactFile.name) : - (!this.isUsingExistingWF() || this.operation.workflowVersionId)) && + (!this.isUsingExistingWF() || this.operation.workflowVersionId) && this.isParamsValid(); } |