Skip to content
Snippets Groups Projects
Commit e3c1a077 authored by kbeyro's avatar kbeyro
Browse files

Update bulks roles

parent 18d8f579
No related branches found
No related tags found
No related merge requests found
......@@ -27,14 +27,14 @@
</div>
</div>
<table *ngIf="mode === 'DOMAIN'" class="table table-hover table-condensed" style="margin-top: 3rem"
aria-describedby="Bulk deployment table">
aria-describedby="Bulk deployment table" sortable-table (sorted)="onSort($event)">
<thead>
<tr>
<th scope="col">{{'BULK.LIST.ID' | translate}}</th>
<th scope="col">{{'BULK.LIST.CREATOR' | translate}}</th>
<th scope="col">{{'BULK.LIST.CREATION_DATE' | translate}}</th>
<th scope="col">{{'BULK.LIST.STATE' | translate}}</th>
<th scope="col"></th>
<th scope="col" class="column-sortable" sortable-column="id">{{'BULK.LIST.ID' | translate}}</th>
<th scope="col" class="column-sortable" sortable-column="creator">{{'BULK.LIST.CREATOR' | translate}}</th>
<th scope="col" class="column-sortable" sortable-column="date">{{'BULK.LIST.CREATION_DATE' | translate}}</th>
<th scope="col" class="column-sortable" sortable-column="state">{{'BULK.LIST.STATE' | translate}}</th>
<th scope="col" ></th>
</tr>
</thead>
......
......@@ -78,7 +78,29 @@ export class BulkListComponent {
this.bulks.sort((a, b) => new Date(a.creationDate).getTime() - new Date(b.creationDate).getTime())
}
} else {
} else if (sortColumn === "app_name" || sortColumn === 'instance_no') {
this.bulks.sort((a, b) => {
if (direction === 'asc') {
if (this.getProperty(a, sortColumn) > this.getProperty(b, sortColumn) ) {
return 1;
}
if (this.getProperty(a, sortColumn) < this.getProperty(b, sortColumn)) {
return -1;
}
return 0;
} else {
if (this.getProperty(a, sortColumn) > this.getProperty(b, sortColumn)) {
return -1;
}
if (this.getProperty(a, sortColumn) < this.getProperty(b, sortColumn)) {
return 1;
}
return 0;
}
})
}else {
this.bulks.sort((a, b) => {
if (direction === 'asc') {
if (a[sortColumn] > b[sortColumn]) {
......@@ -105,7 +127,6 @@ export class BulkListComponent {
public getAppBulkDetails(id: number) {
this.appDeploy.getAppBulkDetails(id).subscribe( (data: Blob) => {
console.warn(data)
const blob = new Blob([data], { type: 'text/csv' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
......@@ -116,4 +137,14 @@ export class BulkListComponent {
window.URL.revokeObjectURL(url);
})
}
private getProperty(bulk: BulkDeployment, key : string) {
if(key === 'app_name') {
return bulk.details['appName']
} else if(key === "instance_no") {
return bulk.details['appInstanceNo']
}
return null
}
}
......@@ -224,7 +224,7 @@
<td>{{getAppInstanceName(response)}}</td>
<td>{{getDomainCodeName(response)}}</td>
<td style="width: 5%" class="text-right">
<span *ngif="response.type === 'APPLICATION' && response?.details['appInstanceId'] !== undefined" class="dropdown">
<span class="dropdown">
<a style="display: inline-block" class="dropdown-toggle " aria-expanded="false" aria-haspopup="true"
data-toggle="dropdown" href="#" role="button">
<em class="fas fa-cog icon-black icon-bigger"></em>
......
......@@ -2,7 +2,7 @@
<h3>{{'DOMAINS.LIST.GROUPS' | translate}}</h3>
<div class="flex space-between">
<div class="flex">
<a *roles="['ROLE_SYSTEM_ADMIN']" [routerLink]="['/admin/domains/groups/add']" class="btn btn-primary"
<a *roles="['ROLE_SYSTEM_ADMIN', 'ROLE_VL_MANAGER']" [routerLink]="['/admin/domains/groups/add']" class="btn btn-primary"
role="button">{{'DOMAINS.ADD_BUTTON' | translate}}</a>
</div>
<div class="flex">
......
......@@ -13,7 +13,7 @@ import { DomainAnnotationsComponent } from './domain-annotations/domain-annotati
export const DomainsRoutes: Route[] = [
{
path: 'admin/domains', component: DomainsListComponent, canActivate: [AuthGuard, RoleGuard],
data: {roles: ['ROLE_SYSTEM_ADMIN', 'ROLE_DOMAIN_ADMIN', 'ROLE_OPERATOR', 'ROLE_VL_DOMAIN_ADMIN']}
data: {roles: ['ROLE_SYSTEM_ADMIN', 'ROLE_DOMAIN_ADMIN', 'ROLE_OPERATOR', 'ROLE_VL_DOMAIN_ADMIN', 'ROLE_VL_MANAGER']}
},
{
path: 'admin/domains/add', component: DomainComponent, canActivate: [AuthGuard, RoleGuard],
......
......@@ -10,5 +10,5 @@ export const UsersRoutes: Route[] = [
{ path: 'admin/users/view/:id', component: UserDetailsComponent, canActivate: [AuthGuard, RoleGuard],
data: {mode: ComponentMode.VIEW, roles: ['ROLE_SYSTEM_ADMIN']} },
{ path: 'domain/users', component: UsersListComponent, canActivate: [AuthGuard, RoleGuard],
data: {roles: ['ROLE_DOMAIN_ADMIN', 'ROLE_VL_MANAGER']}},
data: {roles: ['ROLE_DOMAIN_ADMIN', 'ROLE_VL_MANAGER', 'ROLE_VL_MANAGER']}},
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment