diff --git a/src/app/shared/admin/clusters/add-cluster/add-cluster.component.html b/src/app/shared/admin/clusters/add-cluster/add-cluster.component.html index d3bf766ab3bc497e3214763267c494ad418e695c..461a1c107e184248b0dbed33aa73a8a76787a540 100644 --- a/src/app/shared/admin/clusters/add-cluster/add-cluster.component.html +++ b/src/app/shared/admin/clusters/add-cluster/add-cluster.component.html @@ -60,7 +60,7 @@ [ngModelOptions]="{standalone: true}"> </div> - <div *roles="['ROLE_OPERATOR', 'ROLE_SYSTEM_ADMIN']" class="mt-4"> + <!-- <div *roles="['ROLE_OPERATOR', 'ROLE_SYSTEM_ADMIN']" class="mt-4"> <div> <label for="assignDomain">Assign to domain? </label> <input type="checkbox" [(ngModel)]="assignedDomain" (change)="onDomainChange($event)" @@ -75,9 +75,9 @@ </select> </div> - </div> + </div> --> - <div *roles="[ 'ROLE_DOMAIN_ADMIN']" class="mt-4"> + <div class="mt-4"> <div class="mt-4" > <label for="name">{{'CLUSTERS.DOMAIN' | translate}}*</label> <select id="domain" #domainSelect class="form-control" (change)="onDomainSelection(domainSelect.value)" @@ -107,7 +107,7 @@ <div class="panel-default panel-heading">{{ 'CLUSTERS.INGRESS' | translate }} </div> <div class="panel-body"> - <div class="form-group"> + <!-- <div class="form-group"> <label for="ingresscontrollerconfigoption" class="col-sm-2 control-label">{{ 'CLUSTERS.CONTROLLER_CONFIG_OPTION' | translate }}</label> <div class="col-sm-10" *ngIf="controllerConfigOption"> @@ -118,7 +118,7 @@ [value]="controllerConfigOption.get(configOption)">{{configOption}}</option> </select> </div> - </div> + </div> --> <div class="form-group"> <label for="suportedingressclass" class="col-sm-2 control-label">{{ 'CLUSTERS.SUPPORTED_INGRESS_CLASS' | translate }}</label> @@ -136,7 +136,7 @@ [(ngModel)]="cluster.ingress.publicIngressClass" [disabled]=""> </div> </div> - <div class="form-group"> + <!-- <div class="form-group"> <label for="ingresscontrollerchartname" class="col-sm-2 control-label">{{ 'CLUSTERS.CONTROLLER_CHART_NAME' | translate }}</label> <div class="col-sm-10"> @@ -153,8 +153,8 @@ name="ingresscontrollerchartarchive" [(ngModel)]="cluster.ingress.controllerChartArchive" [disabled]=""> </div> - </div> - <div class="form-group"> + </div> --> + <!-- <div class="form-group"> <label for="ingressresourceconfigoption" class="col-sm-2 control-label">{{ 'CLUSTERS.RESOURCE_CONFIG_OPTION' | translate }}</label> <div class="col-sm-10"> @@ -165,7 +165,7 @@ [value]="resourceConfigOption.get(configOption)">{{configOption}}</option> </select> </div> - </div> + </div> --> <div class="form-group"> <label for="ingressexternalservicedomain" class="col-sm-2 control-label">{{ 'CLUSTERS.EXTERNAL_SERVICE_DOMAIN' | translate }}</label> diff --git a/src/app/shared/admin/clusters/add-cluster/add-cluster.component.ts b/src/app/shared/admin/clusters/add-cluster/add-cluster.component.ts index a62827e3485549c3aa0fd440114a830238cab48c..844446721c1fd42e007e95cb7428d5c96e679f2b 100644 --- a/src/app/shared/admin/clusters/add-cluster/add-cluster.component.ts +++ b/src/app/shared/admin/clusters/add-cluster/add-cluster.component.ts @@ -126,6 +126,7 @@ export class AddClusterComponent implements OnInit { public submit(): void { console.log(this.cluster); this.deteleDates(); + this.setInitialValues(); this.cluserService.sendCluster(new File([this.kubernetesFile], 'kubernetes.yaml'), this.cluster).subscribe(result => { console.log(result); this.cluster = result; @@ -160,4 +161,13 @@ export class AddClusterComponent implements OnInit { public step2valid(): boolean { return this.cluster.domainNames.length > 0 && this.cluster.contactEmail !== '' && this.cluster.description !== '' } + + public setInitialValues() { + this.cluster.ingress.controllerConfigOption = IngressControllerConfigOption.USE_EXISTING; + this.cluster.ingress.controllerChartName = ""; + this.cluster.ingress.controllerChartArchive = ""; + this.cluster.ingress.resourceConfigOption = IngressResourceConfigOption.DEPLOY_FROM_CHART; + + } + } diff --git a/src/app/shared/users/privileges/userprivileges.component.html b/src/app/shared/users/privileges/userprivileges.component.html index 6feca4009dc2629fe8b8eeb758489bd1561579f3..c5eaf693dfdf77b90dffad87681dd00b131a15db 100644 --- a/src/app/shared/users/privileges/userprivileges.component.html +++ b/src/app/shared/users/privileges/userprivileges.component.html @@ -7,7 +7,6 @@ <label style="margin-right:10px" for="domainId" >{{'USER_PRIVILEGES.DOMAIN' | translate}}:</label> <select class="form-control" [formGroup]="newPrivilegeForm" id="domainId" name="domainId" formControlName="domainId" style="min-width: 170px" - [attr.disabled]="domainId!==domainService.getGlobalDomainId()? '' : null" (ngModelChange)="clearSelectedRole()"> <option *ngFor="let domain of domains" [value]="domain.id">{{domain.name}}</option> </select> diff --git a/src/app/shared/users/privileges/userprivileges.component.ts b/src/app/shared/users/privileges/userprivileges.component.ts index 5c7e8d99875729dbfc43be8c7bab9b8e6920bd83..8aa48e581508afffab17739fdf990d361e44fe7f 100644 --- a/src/app/shared/users/privileges/userprivileges.component.ts +++ b/src/app/shared/users/privileges/userprivileges.component.ts @@ -15,6 +15,7 @@ import {UserDataService} from '../../../service/userdata.service'; styleUrls: ['./userprivileges.component.css'] }) @RoleAware +//TODO: remove domainId dependencies on selector -> allways set to globaldomain at init, only SYSTEM_ADMIN can access this view export class UserPrivilegesComponent extends BaseComponent implements OnInit { public Role = Role; @@ -43,9 +44,13 @@ export class UserPrivilegesComponent extends BaseComponent implements OnInit { this.roles = this.getAllowedRoles(); userData.selectedDomainId.subscribe(value => { - this.domainId = value; + // this.domainId = value; + this.domainId = this.domainService.getGlobalDomainId(); + if(this.authService.hasRole(Role[Role.ROLE_SYSTEM_ADMIN])) { + this.newPrivilegeForm.get('domainId').setValue(this.domainService.getGlobalDomainId()); + + } // after the domain is retrieved, set selected domain as current - this.newPrivilegeForm.get('domainId').setValue(this.domainId); }); } @@ -90,7 +95,7 @@ export class UserPrivilegesComponent extends BaseComponent implements OnInit { ngOnInit() { if (this.authService.hasRole(Role[Role.ROLE_SYSTEM_ADMIN])) { - this.domainService.getAll().subscribe((domains) => { + this.domainService.getAllBase().subscribe((domains) => { this.domains = domains }); } else if (this.authService.hasRole(Role[Role.ROLE_DOMAIN_ADMIN])) {