Skip to content

Commit 6f2ebb9

Browse files
authored
Merge pull request #35 from OpenTOSCA/fix/completion
Fix/completion
2 parents c355e74 + 344bd5d commit 6f2ebb9

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

src/app/application-management/application-upload/application-upload.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ export class ApplicationUploadComponent implements OnInit {
130130
* If topology completion is required this is caught within this handler.
131131
*/
132132
onUploadError(event): void {
133-
switch (event.xhr.status) {
133+
switch (event.error.status) {
134134
case 406:
135-
const response = JSON.parse(event.xhr.response);
135+
const response = event.error.error;
136136
this.linkToWineryResourceForCompletion = response['Location'];
137137
const fileName = event.files[0].name;
138138
const csarName = fileName.substr(0, fileName.length - 5);

src/app/core/component/deployment-completion/deployment-completion.component.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,48 @@
2525
</div>
2626
</div>
2727
<div *ngIf="activeIndex === 1">
28-
<div class="modal-body">
29-
<h4 *ngIf="connectionCompletionOptions">Host Selection</h4>
28+
<div class="modal-body" *ngIf="hostCompletionOptions; else noHostOptions">
29+
<h4>Host Selection</h4>
3030
<div class="panel panel-default" *ngFor="let hostCompletionOption of hostCompletionOptions">
3131
<div class="panel-heading">
3232
<h3 class="panel-title">Node template requiring host: {{hostCompletionOption?.nodeID}}</h3>
3333
</div>
3434
<div class="panel-body" [style.height.px]="amountOfHostOptions * 50">
3535
<p-dropdown [options]="hostOptions"
3636
(onChange)="onUpdateHostSelection(hostCompletionOption, $event)"
37-
autoWidth="false"
3837
[style]="{'width':'100%'}"
3938
required>
4039
</p-dropdown>
4140
</div>
4241
</div>
4342
</div>
43+
<ng-template #noHostOptions>
44+
<div class="modal-body">
45+
There are no host options to select!
46+
</div>
47+
</ng-template>
4448
</div>
4549
<div *ngIf="activeIndex === 2">
46-
<div class="modal-body">
47-
<h4 *ngIf="connectionCompletionOptions">Connection Selection</h4>
50+
<div class="modal-body" *ngIf="connectionCompletionOptions; else noConnectionOptions">
51+
<h4>Connection Selection</h4>
4852
<div class="panel panel-default" *ngFor="let connectionCompletionOption of connectionCompletionOptions">
4953
<div class="panel-heading">
5054
<h3 class="panel-title">Open Requirement: {{connectionCompletionOption?.nodeID}}</h3>
5155
</div>
5256
<div class="panel-body" [style.height.px]="amountOfConnectOptions * 50">
5357
<p-dropdown [options]="connectOptions"
5458
(onChange)="onUpdateConnectionSelection(connectionCompletionOption, $event)"
55-
autoWidth="false"
5659
[style]="{'width':'100%'}"
5760
required>
5861
</p-dropdown>
5962
</div>
6063
</div>
6164
</div>
65+
<ng-template #noConnectionOptions>
66+
<div class="modal-body">
67+
There are no connection options to select!
68+
</div>
69+
</ng-template>
6270
</div>
6371
<div *ngIf="activeIndex === 3">
6472
<div class="opentosca-modal-content">

src/app/core/component/deployment-completion/deployment-completion.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export class DeploymentCompletionComponent implements OnInit, AfterViewInit {
181181
// get connection injection options, i.e. rel templates with open requirement and possible values
182182
this.connectionCompletionOptions = injectionOptions.connectionInjectionOptions;
183183
this.logger.log('[deployment-completion.component][getInjectionOptions]', 'Got host completion options: '
184-
+ this.hostCompletionOptions);
184+
+ JSON.stringify(this.hostCompletionOptions));
185185
}
186186
// after getting the injection options, fill the dropdown with the fetched values
187187
}).then(() => {

0 commit comments

Comments
 (0)