diff options
author | 2020-12-03 17:17:07 +0000 | |
---|---|---|
committer | 2020-12-03 17:17:07 +0000 | |
commit | 4e62d2653db35c295e2697398dd3c4278ed56009 (patch) | |
tree | fc2520ae999d9eaaad1d918138e8fa0e1b4bc4dd /cds-ui/designer-client/src/app/modules/feature-modules/packages | |
parent | 7871f10b1c93e938f5f26e7c9545fa422cd58351 (diff) | |
parent | eafc8865d856cc282e0e0845c67ff232b1a5b805 (diff) |
Merge "add Enrich&Deploy function in designer"
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages')
4 files changed, 24 insertions, 12 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html index 415179735..340ff2f48 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html @@ -326,7 +326,7 @@ </span> <input type="radio" name="options" [id]="suggestedAttribute+'.,.'" autocomplete="off" - [checked]="suggestedAttributes[0].includes(suggestedAttribute)"> + [checked]="suggestedAttributes[0]?.includes(suggestedAttribute)"> {{suggestedAttribute}} <i class="icon-required-star" type="button" aria-hidden="true"></i> @@ -358,7 +358,7 @@ <input type="radio" name="options" [id]="suggestedArtifact" autocomplete="off" (click)="addArtifactFile(suggestedArtifact)" - [checked]="currentArtifacts[0].includes(suggestedArtifact)"> + [checked]="currentArtifacts[0]?.includes(suggestedArtifact)"> {{suggestedArtifact}} </label> @@ -389,7 +389,7 @@ --> <input type="radio" name="options" [id]="suggestedMappingParameter" autocomplete="off" (click)="addSuggestedMappingParameter(suggestedMappingParameter)" - [checked]="suggestedMappingParameters[0].includes(suggestedMappingParameter)"> + [checked]="suggestedMappingParameters[0]?.includes(suggestedMappingParameter)"> {{suggestedMappingParameter}} </label> @@ -645,17 +645,17 @@ <div class="col-sm-9"> <div class="list-group list-group-horizontal"> <button type="button" class="list-group-item list-group-item-action" - [className]="suggestedEditedAttribute.type.includes('string')?'' + + [className]="suggestedEditedAttribute?.type?.includes('string')?'' + 'list-group-item list-group-item-action active':'list-group-item list-group-item-action'">String </button> <button type="button" class="list-group-item list-group-item-action" - [className]="suggestedEditedAttribute.type.includes('integer')?'' + + [className]="suggestedEditedAttribute?.type?.includes('integer')?'' + ' list-group-item list-group-item-action active':'list-group-item list-group-item-action'">Integer</button> <button type="button" class="list-group-item list-group-item-action" - [className]="suggestedEditedAttribute.type.includes('boolean')?'' + + [className]="suggestedEditedAttribute?.type?.includes('boolean')?'' + 'list-group-item list-group-item-action active':'list-group-item list-group-item-action'">Boolean</button> <button type="button" class="list-group-item list-group-item-action" - [className]="suggestedEditedAttribute.type.includes('list')?'' + + [className]="suggestedEditedAttribute?.type?.includes('list')?'' + 'list-group-item list-group-item-action active':'list-group-item list-group-item-action'">List</button> <button type="button" class="list-group-item list-group-item-action">Other </button> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html index 87ef61c27..18ce515b5 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.html @@ -92,11 +92,12 @@ <li> <a (click)="saveBluePrint()"><i class="icon-save-sm" aria-hidden="true"></i> Save</a> </li> - <li> + <!-- <li> <a (click)="enrichBluePrint()"><i class="icon-enrich" aria-hidden="true"></i> Enrich</a> - </li> + </li> --> <li> - <a (click)="publishBluePrint()"><i class="fa fa-play-circle" aria-hidden="true"></i> Deploy</a> + <a (click)="enrichBluePrint()"><i class="fa fa-play-circle" aria-hidden="true"></i> + Enrich & Deploy</a> </li> </ul> </div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts index 3347aa3ac..f3dc2fc4a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/designer.component.ts @@ -493,15 +493,17 @@ export class DesignerComponent implements OnInit, OnDestroy { this.create(); this.zipFile.generateAsync({ type: 'blob' }) .then(blob => { - this.packageCreationService.enrichPackage(blob).subscribe(response => { + this.packageCreationService.enrichAndDeployPackage(blob).subscribe(response => { + // this.packageCreationService.enrichPackage(blob).subscribe(response => { console.log('success'); const blobInfo = new Blob([response], { type: 'application/octet-stream' }); this.packageCreationStore.clear(); this.packageCreationExtractionService.extractBlobToStore(blobInfo); - this.toastService.success('Enriched successfully '); + this.toastService.success('Enriched & Deployed successfully '); }, err => { console.log(err); this.toastService.error(err.message, 'Enrich Failed'); + this.ngxService.stop(); }, () => { this.ngxService.stop(); }); diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts index ed3db4286..2625dc8b3 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts @@ -63,6 +63,10 @@ export class PackageCreationService { return this.api.post(BlueprintURLs.enrich, body, {responseType: 'blob'}); } + private enrichandpublish(body: any | null, options?: any): Observable<any> { + return this.api.post(BlueprintURLs.enrichandpublish, body, {responseType: 'blob'}); + } + private deployBluePrint(body: any | null, options?: any): Observable<any> { return this.api.post(BlueprintURLs.deploy, body, {responseType: 'text'}); } @@ -86,6 +90,11 @@ export class PackageCreationService { return this.enrichBlueprint(formData); } + enrichAndDeployPackage(blob) { + const formData = this.getFormData(blob); + return this.enrichandpublish(formData); + } + deploy(blob) { const formData = this.getFormData(blob); return this.deployBluePrint(formData); |