This is an automated email from the ASF dual-hosted git repository.
dgnatyshyn pushed a commit to branch DLAB-1571
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-1571 by this push:
new 70b9713 Allow to set project quota without total, fixed double value
in billing filters
new 27d49d7 Merge remote-tracking branch 'origin/DLAB-1571' into DLAB-1571
70b9713 is described below
commit 70b971301ad359293a5e5731f3ae42dd5c99138e
Author: Dmytro Gnatyshyn <[email protected]>
AuthorDate: Wed Apr 15 17:56:38 2020 +0300
Allow to set project quota without total, fixed double value in billing
filters
---
.../manage-environment-dilog.component.ts | 2 +-
.../src/app/administration/roles/roles.component.ts | 17 +++++++++++++++--
.../reporting-grid/reporting-grid.component.html | 2 +-
.../webapp/src/app/reporting/reporting.component.ts | 16 +++++++++++++++-
.../multi-level-select-dropdown.component.html | 2 +-
5 files changed, 33 insertions(+), 6 deletions(-)
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 a3ae8d2..f99944f 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
@@ -69,7 +69,7 @@ export class ManageEnvironmentComponent implements OnInit {
}
public setBudgetLimits(value) {
- if (this.getCurrentTotalValue() >= this.getCurrentUsersTotal()) {
+ if (this.getCurrentTotalValue() >= this.getCurrentUsersTotal() ||
!this.getCurrentTotalValue()) {
this.dialogRef.close(value);
} else {
this.manageUsersForm.controls['total'].setErrors({ overrun: true });
diff --git
a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
index e36205a..da36c4e 100644
---
a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
@@ -75,6 +75,9 @@ export class RolesComponent implements OnInit {
this.rolesList = roles.map((role) => {
return {role: role.description, type: role.type, cloud:
role.cloud};
});
+ if (!this.healthStatus.admin) {
+ this.rolesList = this.rolesList.filter(role => role.role !==
'Allow to execute administration operation');
+ }
this.rolesList = this.rolesList.sort((a, b) => (a.cloud > b.cloud) ?
1 : ((b.cloud > a.cloud) ? -1 : 0));
this.rolesList = this.rolesList.sort((a, b) => (a.type > b.type) ? 1
: ((b.type > a.type) ? -1 : 0));
this.updateGroupData(groups);
@@ -138,10 +141,14 @@ export class RolesComponent implements OnInit {
item.selected_roles = [...currGroupSource.selected_roles];
item.roles = [...currGroupSource.roles];
} else {
+ const isSuperAdminGroup = this.startedGroups.filter(v => v.group ===
item.group)[0].roles.filter(role => role.description === 'Allow to execute
administration operation').length;
+ const selectedRoles = isSuperAdminGroup ?
+ [...item.selected_roles.map(v => v.role), 'Allow to execute
administration operation'] :
+ item.selected_roles.map(v => v.role);
this.manageRolesGroups({
action, type, value: {
name: item.group,
- roleIds: this.extractIds(this.roles, item.selected_roles.map(v
=> v.role)),
+ roleIds: this.extractIds(this.roles, selectedRoles),
users: item.users || []
}
});
@@ -208,7 +215,13 @@ export class RolesComponent implements OnInit {
return v;
}).sort((a, b) => (a.group > b.group) ? 1 : ((b.group > a.group) ? -1 :
0));
this.groupsData.forEach(item => {
- item.selected_roles = item.roles.map(role => ({role: role.description,
type: role.type, cloud: role.cloud}));
+ if (this.healthStatus.admin) {
+ item.selected_roles = item.roles.map(role => ({role: role.description,
type: role.type, cloud: role.cloud}));
+ } else {
+ item.selected_roles = item.roles.filter(role => role.description !==
'Allow to execute administration operation')
+ .map(role => ({role: role.description, type: role.type, cloud:
role.cloud}));
+ }
+
});
this.getGroupsListCopy();
}
diff --git
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
index e775072..2ec7c45 100644
---
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
+++
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
@@ -116,7 +116,7 @@
</button>
</th>
<td mat-cell *matCellDef="let element">
- <span>{{element.shape}}</span>
+ <div *ngFor="let shape of element.shape.split('↵')">{{shape}}</div>
</td>
<td mat-footer-cell *matFooterCellDef class="table-footer"></td>
</ng-container>
diff --git
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
index cd44999..d2abd7a 100644
---
a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
@@ -156,7 +156,21 @@ export class ReportingComponent implements OnInit,
OnDestroy {
types.push(item['resource_type']);
if (item.shape && types.indexOf(item.shape)) {
- shapes.push(item.shape);
+ if (item.shape.indexOf('Master') > -1) {
+ for (let shape of item.shape.split('↵')) {
+ shape = shape.replace('Master: ', '');
+ shape = shape.replace(/Slave: /, '');
+ shape = shape.replace(/\s+/g, '');
+ shapes.indexOf(shape) === -1 && shapes.push(shape);
+ }
+ } else if (item.shape.match(/\d x \S+/)) {
+ const parsedShape = item.shape.match(/\d x \S+/)[0].split(' x ')[1];
+ if (shapes.indexOf(parsedShape) === -1) {
+ shapes.push(parsedShape);
+ }
+ } else {
+ shapes.indexOf(item.shape) === -1 && shapes.push(item.shape);
+ }
}
if (item.product && services.indexOf(item.product) === -1)
diff --git
a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
index c0162da..420aa09 100644
---
a/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
+++
b/services/self-service/src/main/resources/webapp/src/app/shared/form-controls/multi-level-select-dropdown/multi-level-select-dropdown.component.html
@@ -54,7 +54,7 @@
<li class="role-item"
role="presentation"
*ngIf="model && isOpenCategory[item.type] && item.type !==
'COMPUTATIONAL_SHAPE' && item.type !== 'NOTEBOOK_SHAPE'"
- [ngClass]="{'d-none': !isAdmin && item.role === 'Allow to
execute administration operation'}"
+ [hidden]="!isAdmin && item.role === 'Allow to execute
administration operation'"
>
<a href="#" class="list-item" role="menuitem"
(click)="toggleSelectedOptions($event, model, item)">
<span class="empty-checkbox" [ngClass]="{'checked':
checkInModel(item.role)}">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]