Skip to content
Snippets Groups Projects
Commit c73fcd59 authored by Lukasz Lopatowski's avatar Lukasz Lopatowski
Browse files

Merge branch 'fix-webhooks' into 'develop'

show error message

See merge request !193
parents f53c9063 992e434b
No related branches found
No related tags found
1 merge request!193show error message
......@@ -79,6 +79,9 @@
type="submit">{{ 'PORTAL_CONFIGURATION.SUBMIT_BUTTON' | translate }}</button>
</div>
<div>
<div *ngIf="errorMessage" class="alert alert-danger mt-2">{{ errorMessage }}</div>
</div>
</div>
</form>
......
......@@ -15,6 +15,8 @@ export class WebhookDetailsComponent extends BaseComponent implements OnInit {
public webhook: Webhook;
public authRequired: boolean = false;
public errorMessage: string = "";
constructor(private service: WebhookService,
public router: Router,
private route: ActivatedRoute) {
......@@ -42,6 +44,9 @@ export class WebhookDetailsComponent extends BaseComponent implements OnInit {
this.service.update(this.webhook).subscribe(result => {
console.log(result);
this.webhook = result;
}, error => {
console.error(error);
this.errorMessage = "Error updating webhook: " + error.message;
});
}
}
......@@ -47,6 +47,10 @@ export class ClusterManagerComponent {
}
public closeModalAndSaveCluster() {
if(this.addedCluster.domainNames !== undefined && this.addedCluster.domainNames !== null) {
this.addedCluster.domainNames = [null];
}
console.log(this.addedCluster);
this.clusterService.sendCluster(this.updatedFile, this.addedCluster).subscribe(result => {
console.log(result);
this.getAllClusters();
......
......@@ -47,12 +47,14 @@
</div>
</div>
<!-- TODO: Fix selector, show value on init when selectedDomain is null/empty -->
<div class="form-group">
<label for="clusterCreationDate" class="col-sm-2 control-label">{{ 'CLUSTERS.DOMAIN' | translate }}</label>
<div class="col-sm-10">
<div class="col-sm-10">
<select id="domain" #domainSelect class="form-control" (change)="onDomainSelection(domainSelect.value)">
<option *ngFor="let domain of domains" [selected]="cluster.domainNames[0] === domain.name" [value]="domain.name"
<option *ngFor="let domain of domains" [selected]="selectedDomain" [value]="domain.name"
>{{domain.name}}
</option>
</select>
......
......@@ -17,6 +17,7 @@ export class ClusterManagerDetailsComponent extends BaseComponent implements OnI
public cluster: ClusterManager ;
public cluterId;
public error = "";
public selectedDomain: string = ""
public domains = [];
......@@ -50,6 +51,9 @@ export class ClusterManagerDetailsComponent extends BaseComponent implements OnI
this.clusterService.getClusterDetails(this.cluterId).subscribe(result => {
console.log(result);
this.cluster = result;
if(this.cluster.domainNames !== undefined && this.cluster.domainNames !== null && this.cluster.domainNames.length > 0) {
this.selectedDomain = this.cluster.domainNames[0];
}
} )
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment