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 93500f0dbedf48e7a30648c3e5c924ebecac7aa5..55c11db6eb95af74a4121afeb22060a0632cf312 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 @@ -30,7 +30,7 @@ </div> <button type="button" class="btn btn-primary pull-right" (click)="uploadKubernetesFile()" - pTooltip="{{'APPS_WIZARD.ACCEPT_RULES_TOOLTIP' | translate}}" tooltipPosition="bottom" + pTooltip="{{'CLUSTERS.WIZARD.TOOLTIP_1' | translate}}" tooltipPosition="bottom" [showDelay]="50">{{'APPS_WIZARD.NEXT_BUTTON' | translate}}</button> </div> @@ -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)" @@ -91,7 +91,7 @@ </div> <button type="button" class="btn btn-primary pull-right" (click)="nextStep()" [disabled]="!step2valid()" - pTooltip="{{'APPS_WIZARD.ACCEPT_RULES_TOOLTIP' | translate}}" tooltipPosition="bottom" + pTooltip="{{'CLUSTERS.WIZARD.TOOLTIP_2' | translate}}" tooltipPosition="bottom" [showDelay]="50">{{'APPS_WIZARD.NEXT_BUTTON' | translate}}</button> </div> @@ -100,6 +100,10 @@ <div *ngIf="activeStepIndex === 2"> + <div class="bs-callout bs-callout-primary"> + <h4>{{'CLUSTERS.WIZARD.STEP_3' | translate }}</h4> + {{'CLUSTERS.WIZARD.STEP_3_INFO' | translate }} + </div> <div class="background-section"> <h4 style="font-size:15px; font-weight: bold">{{ 'CLUSTERS.TITLE' | translate }}</h4> <div class="panel-body"> @@ -107,7 +111,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 +122,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 +140,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 +157,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 +169,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..4e378297410c397dc24e3f6cfa320d0e60aeec3f 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,15 @@ export class AddClusterComponent implements OnInit { public step2valid(): boolean { return this.cluster.domainNames.length > 0 && this.cluster.contactEmail !== '' && this.cluster.description !== '' } + + public setInitialValues() { + if (this.cluster.ingress !== undefined) { + 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.spec.ts b/src/app/shared/users/privileges/userprivileges.component.spec.ts index 52c435ec048487b482d39d3959eea70c73194fdc..21cc3d3313de33a6c38a2e27b323da8df697f574 100644 --- a/src/app/shared/users/privileges/userprivileges.component.spec.ts +++ b/src/app/shared/users/privileges/userprivileges.component.spec.ts @@ -18,9 +18,9 @@ describe('UserPrivilegesComponent', () => { const authServiceSpy = createSpyObj('AuthService', ['hasRole']); authServiceSpy.hasRole.and.returnValue(true) - const domainServiceSpy = createSpyObj('DomainService', ['getGlobalDomainId', 'getAll', 'getMyDomains']) + const domainServiceSpy = createSpyObj('DomainService', ['getGlobalDomainId', 'getAllBase', 'getMyDomains']) domainServiceSpy.getGlobalDomainId.and.returnValue(1) - domainServiceSpy.getAll.and.returnValue(of([])) + domainServiceSpy.getAllBase.and.returnValue(of([])) domainServiceSpy.getMyDomains.and.returnValue(of([])) TestBed.configureTestingModule({ 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])) {