You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/10/18 14:42:14 UTC
[incubator-dlab] 04/04: [DLAB-1157]: set selected active project on
resource creation
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch DLAB-1057
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit edb3abe9bea9ba74e7b1b945a90bf34c398ae034
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Fri Oct 18 17:41:44 2019 +0300
[DLAB-1157]: set selected active project on resource creation
---
.../create-environment/create-environment.component.html | 4 +++-
.../create-environment/create-environment.component.ts | 9 ++++++++-
.../webapp/src/app/resources/resources.component.html | 11 ++++++-----
.../resources/webapp/src/app/resources/resources.component.ts | 10 ++++++++--
4 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
index 984679f..7dd58d9 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.html
@@ -49,7 +49,9 @@
<mat-form-field>
<mat-label>Select endpoint</mat-label>
<mat-select formControlName="endpoint" disableOptionCentering [disabled]="!endpoints.length">
- <mat-option *ngFor="let endpoint of endpoints" [value]="endpoint" (click)="getTemplates(createExploratoryForm?.controls['project'].value, endpoint)">{{ endpoint }}</mat-option>
+ <mat-option *ngFor="let endpoint of endpoints" [value]="endpoint"
+ (click)="getTemplates(createExploratoryForm?.controls['project'].value, endpoint)">{{ endpoint }}
+ </mat-option>
<mat-option *ngIf="!endpoints.length" class="multiple-select ml-10" disabled>Endpoints list is empty
</mat-option>
</mat-select>
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
index 9d6795a..d1ccb64 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/create-environment/create-environment.component.ts
@@ -69,7 +69,14 @@ export class ExploratoryEnvironmentCreateComponent implements OnInit {
}
public getUserProjects() {
- this.projectService.getUserProjectsList().subscribe((projects: any) => this.projects = projects);
+ this.projectService.getUserProjectsList().subscribe((projects: any) => {
+ this.projects = projects;
+ if (this.resourceGrid.activeProject) {
+ const activeProject = projects.find(item => item.name === this.resourceGrid.activeProject);
+ this.setEndpoints(activeProject)
+ this.createExploratoryForm.controls['project'].setValue(activeProject.name);
+ }
+ });
}
public setEndpoints(project) {
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.html b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.html
index db7b9da..b705c38 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.html
@@ -26,12 +26,13 @@
</button>
<div class="mat-reset">
- <!-- *ngIf="!projects.length -->
- <div class="control selector-wrapper">
+ <div class="control selector-wrapper" *ngIf="projects.length">
<mat-form-field>
<mat-label>Select active project</mat-label>
- <mat-select>
- <mat-option *ngFor="let project of projects" [value]="project.name" (click)="setActiveProject(project)">
+ <mat-select [(value)]="resourcesGrid.activeProject">
+ <mat-option *ngIf="projects.length > 1" (click)="setActiveProject()">Show all</mat-option>
+ <mat-option *ngFor="let project of projects" [value]="project.name"
+ (click)="setActiveProject(project.name)">
{{ project.name }}</mat-option>
<mat-option *ngIf="!projects.length" class="multiple-select ml-10" disabled>Projects list is empty
</mat-option>
@@ -42,8 +43,8 @@
</mat-form-field>
</div>
</div>
-
</div>
+
<div>
<button mat-raised-button class="butt butt-tool" (click)="manageUngit()">
<i class="material-icons"></i>Git credentials
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
index bc1459e..bfdcdee 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
@@ -18,7 +18,6 @@
*/
import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
-import { Subscription } from 'rxjs';
import { ToastrService } from 'ngx-toastr';
import { MatDialog } from '@angular/material/dialog';
@@ -80,13 +79,20 @@ export class ResourcesComponent implements OnInit {
}
public setActiveProject(project): void {
- console.log(project)
+ this.resourcesGrid.selectActiveProject(project);
+ }
+
+ public getActiveProject() {
+ console.log('activeProject: ', this.resourcesGrid.activeProject);
+
+ return this.resourcesGrid.activeProject;
}
private getProjects() {
this.projectService.getProjectsList().subscribe((projects: any) => this.projects = projects);
}
+
private getEnvironmentHealthStatus() {
this.healthStatusService.getEnvironmentHealthStatus().subscribe(
(result: any) => {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org