aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components')
-rw-r--r--sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html18
-rw-r--r--sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts28
-rw-r--r--sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts2
3 files changed, 44 insertions, 4 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html
index 12228f24..3a0942e1 100644
--- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html
+++ b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.html
@@ -23,11 +23,27 @@
<input class="form-control" [(ngModel)]="microservice.version">
</div>
</div>
+<div class="form-group row">
+ <label class="col-md-2 form-control-label text-md-right">Dynamic</label>
+ <div class="col-md-10">
+ <p-radioButton name="dynamic" [value]=true label="true" (ngModelChange)="toggleDynamic($event)" [ngModel]="dynamic"></p-radioButton>
+ <p-radioButton name="dynamic" [value]=false label="false" (ngModelChange)="toggleDynamic($event)" [ngModel]="dynamic"></p-radioButton>
+ </div>
+</div>
+<div *ngIf="dynamic" class="form-group row">
+ <label class="col-md-2 form-control-label text-md-right">Definition</label>
+ <div class="col-md-8" style="padding-right:0px">
+ <input class="form-control" [(ngModel)]="microservice.definition">
+ </div>
+ <div class="col-md-2" style="padding-left:0px">
+ <button class="btn" (click)="loadDynamicInfo()">load</button>
+ </div>
+</div>
<div class="form-group row">
<label class="col-md-2 form-control-label text-md-right">Detail</label>
<div class="col-md-10">
- <textarea class="form-control" rows="8" [ngModel]="detail"
+ <textarea class="form-control" rows="8" [ngModel]="detail" [disabled]="dynamic"
(ngModelChange)="onDetailChanged($event)"></textarea>
</div>
</div>
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts
index 924b40f5..90b582c9 100644
--- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-detail/microservice-detail.component.ts
@@ -28,14 +28,16 @@ export class MicroserviceDetailComponent implements OnChanges {
@Input() microservice: Microservice;
public detail: string;
+ public dynamic = false;
- constructor() {
+ constructor(private configService: WorkflowConfigService) {
}
public ngOnChanges() {
if(this.microservice == null) {
- this.microservice = new Microservice('', '', {});
+ this.microservice = new Microservice('', '', {}, '');
}
+ this.dynamic = this.microservice.definition !== '';
this.parseSwagger2String();
}
@@ -57,4 +59,26 @@ export class MicroserviceDetailComponent implements OnChanges {
// if detail is not a json object, then not change the swagger
}
}
+
+ public toggleDynamic(dynamic: boolean) {
+ this.dynamic = dynamic;
+ this.onDetailChanged('{}');
+
+ if(!dynamic) {
+ this.microservice.definition = null;
+ }
+ }
+
+ private loadDynamicInfo() {
+ this.configService.loadDynamicInfo(this.microservice.definition)
+ .subscribe(response => {
+ try {
+ this.microservice.swagger = response;
+ this.parseSwagger2String();
+ } catch (e) {
+ console.log('detail transfer error');
+ console.error(e);
+ }
+ });
+ }
}
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts
index 2e22699d..6dcfe8c6 100644
--- a/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/menu/microservice/microservice-list/microservice-list.component.ts
@@ -32,7 +32,7 @@ export class MicroserviceListComponent {
}
public addMicroservice() {
- const microservice = new Microservice('new microservice', '', {});
+ const microservice = new Microservice('new microservice', '', {}, '');
this.microservices.push(microservice);
this.onMicroserviceSelected(microservice);