From commits-return-5415-archive-asf-public=cust-asf.ponee.io@dlab.apache.org Wed May 27 10:49:52 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id CF3B3180626 for ; Wed, 27 May 2020 12:49:51 +0200 (CEST) Received: (qmail 13242 invoked by uid 500); 27 May 2020 10:49:51 -0000 Mailing-List: contact commits-help@dlab.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@dlab.apache.org Delivered-To: mailing list commits@dlab.apache.org Received: (qmail 13233 invoked by uid 99); 27 May 2020 10:49:51 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2020 10:49:51 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id D8E1381A3F; Wed, 27 May 2020 10:44:04 +0000 (UTC) Date: Wed, 27 May 2020 10:44:04 +0000 To: "commits@dlab.apache.org" Subject: [incubator-dlab] branch develop updated: [DLAB-1781]: Prevent applying if user has not changed anything for quotas (#767) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <159057624474.13401.17134868662558079771@gitbox.apache.org> From: dgnatyshyn@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-dlab X-Git-Refname: refs/heads/develop X-Git-Reftype: branch X-Git-Oldrev: 701dccf63521b0a3bd0aa288d0ac7ab3030df57c X-Git-Newrev: de8abf19409f03c9479bd1842aefcff0ada6ea7b X-Git-Rev: de8abf19409f03c9479bd1842aefcff0ada6ea7b X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. dgnatyshyn pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git The following commit(s) were added to refs/heads/develop by this push: new de8abf1 [DLAB-1781]: Prevent applying if user has not changed anything for quotas (#767) de8abf1 is described below commit de8abf19409f03c9479bd1842aefcff0ada6ea7b Author: Dmytro Gnatyshyn <42860905+DG1202@users.noreply.github.com> AuthorDate: Wed May 27 13:43:54 2020 +0300 [DLAB-1781]: Prevent applying if user has not changed anything for quotas (#767) --- .../manage-environment-dilog.component.html | 2 +- .../manage-environment-dilog.component.ts | 5 +++++ .../resources-grid/resources-grid.component.ts | 19 ++++++++++++++++++- .../webapp/src/app/resources/resources.component.html | 11 +++++++++-- 4 files changed, 33 insertions(+), 4 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 74ff5af..e3c77b8 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 @@ -97,7 +97,7 @@
-
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 f99944f..5187fa0 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 @@ -37,6 +37,8 @@ export class ManageEnvironmentComponent implements OnInit { public manageTotalsForm: FormGroup; @Output() manageEnv: EventEmitter<{}> = new EventEmitter(); + private initialFormState: any; + private isFormChanged: boolean = true; constructor( @Inject(MAT_DIALOG_DATA) public data: any, @@ -50,10 +52,12 @@ export class ManageEnvironmentComponent implements OnInit { this.setProjectsControl(); this.manageUsersForm.controls['total'].setValue(this.data.total.conf_max_budget || ''); this.onFormChange(); + this.initialFormState = this.manageUsersForm.value; } public onFormChange() { this.manageUsersForm.valueChanges.subscribe(value => { + this.isFormChanged = JSON.stringify(this.initialFormState) === JSON.stringify(this.manageUsersForm.value); if ((this.getCurrentTotalValue() && this.getCurrentTotalValue() >= this.getCurrentUsersTotal())) { this.manageUsersForm.controls['projects']['controls'].forEach(v => { v.controls['budget'].setErrors(null); @@ -86,6 +90,7 @@ export class ManageEnvironmentComponent implements OnInit { } public setProjectsControl() { + console.log(this.data.projectsList); this.manageUsersForm.setControl('projects', this._fb.array((this.data.projectsList || []).map((x: any) => this._fb.group({ project: x.name, diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts index 19b1eb5..9003974 100644 --- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts +++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts @@ -23,7 +23,7 @@ import { animate, state, style, transition, trigger } from '@angular/animations' import { ToastrService } from 'ngx-toastr'; import { MatDialog } from '@angular/material/dialog'; -import { UserResourceService } from '../../core/services'; +import {ProjectService, UserResourceService} from '../../core/services'; import { ExploratoryModel, Exploratory } from './resources-grid.model'; import { FilterConfigurationModel } from './filter-configuration.model'; @@ -90,6 +90,8 @@ export class ResourcesGridComponent implements OnInit { public displayedColumns: string[] = this.filteringColumns.map(item => item.name); public displayedFilterColumns: string[] = this.filteringColumns.map(item => item.filter_class); public bucketsList; + public activeProjectsList: any; + constructor( @@ -97,11 +99,25 @@ export class ResourcesGridComponent implements OnInit { private userResourceService: UserResourceService, private dialog: MatDialog, private progressBarService: ProgressBarService, + private projectService: ProjectService, ) { } ngOnInit(): void { this.buildGrid(); + this.getUserProjects(); + } + public getUserProjects() { + this.projectService.getUserProjectsList(true).subscribe((projects: any) => { + this.activeProjectsList = projects; + console.log(projects); + // console.log(projects); + // const activeProject = projects.find(item => item.name === this.resourceGrid.activeProject); + // if (this.resourceGrid.activeProject && activeProject) { + // this.setEndpoints(activeProject); + // this.createExploratoryForm.controls['project'].setValue(activeProject.name); + // } + }); } public buildGrid(): void { @@ -255,6 +271,7 @@ export class ResourcesGridComponent implements OnInit { if (filteredData.length) this.filtering = true; if (config) { + console.log(config); this.activeProject = config.project; filteredData = filteredData .filter(project => config.project ? project.project === config.project : 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 513d7fe..50c91c2 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 @@ -20,11 +20,18 @@