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/07/23 11:16:16 UTC

[incubator-dlab] branch DLAB-814 updated (2f35441 -> cb91c41)

This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a change to branch DLAB-814
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


    from 2f35441  Merge branch 'develop' of github.com:apache/incubator-dlab into DLAB-814
     new 1514dd2  [DLAB-814]: updated api calls; set quota per project
     new cb91c41  [DLAB-814]: updated name project pataneter in quota form

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../manage-environment-dilog.component.html        |  2 +-
 .../manage-environment-dilog.component.ts          |  4 +-
 .../management/management.component.ts             |  3 +-
 .../services/applicationServiceFacade.service.ts   | 14 +++---
 .../src/app/core/services/healthStatus.service.ts  | 56 ++++++++++------------
 .../src/app/core/services/project.service.ts       |  9 ++++
 6 files changed, 44 insertions(+), 44 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/02: [DLAB-814]: updated api calls; set quota per project

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a commit to branch DLAB-814
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 1514dd2550191efb3797756f17d04afb24f5c8ee
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jul 23 13:37:34 2019 +0300

    [DLAB-814]: updated api calls; set quota per project
---
 .../management/management.component.ts             |  3 +-
 .../services/applicationServiceFacade.service.ts   | 14 +++---
 .../src/app/core/services/healthStatus.service.ts  | 56 ++++++++++------------
 .../src/app/core/services/project.service.ts       |  9 ++++
 4 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
index 7afbf17..326fda3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
@@ -117,7 +117,7 @@ export class ManagementComponent implements OnInit {
   }
 
   setBudgetLimits($event) {
-    this.healthStatusService.updateUsersBudget($event.projects).subscribe((result: any) => {
+    this.projectService.updateProjectsBudget($event.projects).subscribe((result: any) => {
       this.healthStatusService.updateTotalBudgetData($event.total).subscribe((res: any) => {
         result.status === HTTP_STATUS_CODES.OK
           && res.status === HTTP_STATUS_CODES.NO_CONTENT
@@ -131,7 +131,6 @@ export class ManagementComponent implements OnInit {
     this.healthStatusService.manageEnvironment(event.action, event.user)
       .subscribe(res => {
         this.getActiveUsersList().subscribe(usersList => {
-          // this.manageEnvironmentDialog.usersList = usersList;
           this.toastr.success(`Action ${event.action} is processing!`, 'Processing!');
           this.buildGrid();
         });
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
index 2cfb52d..03206eb 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
@@ -410,13 +410,6 @@ export class ApplicationServiceFacade {
       });
   }
 
-  public buildUpdateUsersBudget(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
-      this.requestRegistry.Item(ApplicationServiceFacade.BUDGET),
-      data,
-      { observe: 'response' });
-  }
-
   public buildGetSsnMonitorData(): Observable<any> {
     return this.buildRequest(RequestMethod.Get,
       this.requestRegistry.Item(ApplicationServiceFacade.SNN_MONITOR),
@@ -551,6 +544,13 @@ export class ApplicationServiceFacade {
       data);
   }
 
+  public buildUpdateProjectsBudget(param, data): Observable<any> {
+    return this.buildRequest(RequestMethod.Put,
+      this.requestRegistry.Item(ApplicationServiceFacade.PROJECT) + param,
+      data,
+      { observe: 'response' });
+  }
+
   public buildGetEndpointsData(): Observable<any> {
     return this.buildRequest(RequestMethod.Get,
       this.requestRegistry.Item(ApplicationServiceFacade.ENDPOINT),
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/healthStatus.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/healthStatus.service.ts
index 8dbad93..d593d08 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/healthStatus.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/healthStatus.service.ts
@@ -33,7 +33,7 @@ export class HealthStatusService {
   constructor(
     private applicationServiceFacade: ApplicationServiceFacade,
     private appRoutingService: AppRoutingService
-  ) {}
+  ) { }
 
   get statusData() {
     return this._statusData.asObservable();
@@ -49,39 +49,39 @@ export class HealthStatusService {
   }
 
   public isHealthStatusOk(): Observable<boolean> {
-      return this.applicationServiceFacade
-        .buildGetEnvironmentHealthStatus()
-        .pipe(
-          map(response => {
-            if (response.status === HTTP_STATUS_CODES.OK)
-              if (response.body.status === 'ok')
-                return true;
+    return this.applicationServiceFacade
+      .buildGetEnvironmentHealthStatus()
+      .pipe(
+        map(response => {
+          if (response.status === HTTP_STATUS_CODES.OK)
+            if (response.body.status === 'ok')
+              return true;
 
-            return false;
-          }));
+          return false;
+        }));
   }
 
   public getEnvironmentHealthStatus(): Observable<GeneralEnvironmentStatus> {
     return this.applicationServiceFacade
-    .buildGetEnvironmentHealthStatus()
-    .pipe(
-      map(response => {
-        this._statusData.next(response.body);
-        return response.body;
-      }),
-      catchError(ErrorUtils.handleServiceError));
+      .buildGetEnvironmentHealthStatus()
+      .pipe(
+        map(response => {
+          this._statusData.next(response.body);
+          return response.body;
+        }),
+        catchError(ErrorUtils.handleServiceError));
   }
 
   public getEnvironmentStatuses(): Observable<GeneralEnvironmentStatus> {
     const body = '?full=1';
     return this.applicationServiceFacade
-    .buildGetEnvironmentStatuses(body)
-    .pipe(
-      map(response => {
-        this._statusData.next(response);
-        return response;
-      }),
-      catchError(ErrorUtils.handleServiceError));
+      .buildGetEnvironmentStatuses(body)
+      .pipe(
+        map(response => {
+          this._statusData.next(response);
+          return response;
+        }),
+        catchError(ErrorUtils.handleServiceError));
   }
 
   public runEdgeNode(): Observable<{}> {
@@ -145,14 +145,6 @@ export class HealthStatusService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public updateUsersBudget(data): Observable<{}> {
-    return this.applicationServiceFacade
-      .buildUpdateUsersBudget(data)
-      .pipe(
-        map(response => response),
-        catchError(ErrorUtils.handleServiceError));
-  }
-
   public getSsnMonitorData(): Observable<{}> {
     return this.applicationServiceFacade
       .buildGetSsnMonitorData()
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
index 3923533..bc06862 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/project.service.ts
@@ -77,4 +77,13 @@ export class ProjectService {
         map(response => response),
         catchError(ErrorUtils.handleServiceError));
   }
+
+  public updateProjectsBudget(data): Observable<{}> {
+    const url = '/budget';
+    return this.applicationServiceFacade
+      .buildUpdateProjectsBudget(url, data)
+      .pipe(
+        map(response => response),
+        catchError(ErrorUtils.handleServiceError));
+  }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 02/02: [DLAB-814]: updated name project pataneter in quota form

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a commit to branch DLAB-814
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit cb91c41bf8e3a4af509ee82ee399c4c9382830d5
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jul 23 14:14:04 2019 +0300

    [DLAB-814]: updated name project pataneter in quota form
---
 .../manage-environment/manage-environment-dilog.component.html        | 2 +-
 .../manage-environment/manage-environment-dilog.component.ts          | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.html
index 2f2100d..f52a7e0 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.html
@@ -35,7 +35,7 @@
             <div class="scrolling-content" id="scrolling" formArrayName="projects">
               <mat-list-item *ngFor="let item of usersEnvironments.controls; let i=index" [formGroupName]="i"
                 class="list-item">
-                <div class="username ellipsis">{{ manageUsersForm.controls['projects'].controls[i].value['name'] }}
+                <div class="username ellipsis">{{ manageUsersForm.controls['projects'].controls[i].value['project'] }}
                 </div>
                 <div class="quotes" *ngIf="DICTIONARY.cloud_provider !== 'gcp'">
                   <input type="number" min="0" placeholder="Enter limit, in USD" formControlName="budget">
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.ts
index 0dd8ebe..1aac973 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/manage-environment/manage-environment-dilog.component.ts
@@ -48,7 +48,7 @@ export class ManageEnvironmentComponent implements OnInit {
     !this.manageUsersForm && this.initForm();
     this.manageUsersForm.setControl('projects',
       this._fb.array((this.data.projectsList || []).map((x: any) => this._fb.group({
-        name: x.name, budget: [x.budget, [Validators.min(0), this.userValidityCheck.bind(this)]], status: x.status
+        project: x.name, budget: [x.budget, [Validators.min(0), this.userValidityCheck.bind(this)]], status: x.status
       }))));
 
     this.manageUsersForm.controls['total'].setValue(this.data.total.conf_max_budget || null);
@@ -74,7 +74,7 @@ export class ManageEnvironmentComponent implements OnInit {
   private initForm(): void {
     this.manageUsersForm = this._fb.group({
       total: [null, [Validators.min(0), this.totalValidityCheck.bind(this)]],
-      projects: this._fb.array([this._fb.group({ name: '', budget: null, status: '' })])
+      projects: this._fb.array([this._fb.group({ project: '', budget: null, status: '' })])
     });
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org