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

Improve domain group view

parent 45479c22
No related branches found
No related tags found
No related merge requests found
...@@ -30,26 +30,40 @@ ...@@ -30,26 +30,40 @@
</div> </div>
</div> </div>
<div *ngIf="!this.addingMode" style="margin-top: 3rem">
<button type="button" class="btn btn-success" (click)="showModal()">{{'DOMAINS.LIST.ADD' | translate}}</button> <div *ngIf="!this.addingMode" class="panel panel-default" style="margin-top: 3rem">
<table class="table table-hover table-condensed" aria-describedby="Domains in Group table" style="margin-top: 3rem"> <div class="panel-heading">
<thead>
<tr> <div style="display: flex; justify-content: start; align-items: center">
<th scope="col">{{'DOMAINS.LIST.DOMAIN_NAME' | translate}}</th> <div>
<th scope="col">{{'DOMAINS.LIST.DOMAIN_CODE_NAME' | translate}}</th> {{ 'DOMAINS.LIST.LIST' | translate }}
<th scope="col"></th> </div>
</tr> </div>
<ng-template ngFor let-domain [ngForOf]="domainGroup.domains" let-i="index"> </div>
<tr class="table-row"> <div class="panel-body">
<td>{{domain.name}}</td> <div style="display: flex; justify-content: end">
<td>{{domain.codename}}</td> <button type="button" class="btn btn-success" (click)="showModal()">{{'DOMAINS.LIST.ADD' | translate}}</button>
<td style="width: 20%"> </div>
<button type="button" class="btn btn-danger" (click)="deleteDomainFromGroup(domain)">{{'DOMAINS.LIST.DELETE' | translate}}</button> <table class="table table-hover table-condensed" aria-describedby="Domains in Group table" style="margin-top: 2rem">
</td> <thead>
<tr>
<th scope="col">{{'DOMAINS.LIST.DOMAIN_NAME' | translate}}</th>
<th scope="col">{{'DOMAINS.LIST.DOMAIN_CODE_NAME' | translate}}</th>
<th scope="col"></th>
</tr> </tr>
</ng-template> <ng-template ngFor let-domain [ngForOf]="domainGroup.domains" let-i="index">
</thead> <tr class="table-row">
</table> <td>{{domain.name}}</td>
<td>{{domain.codename}}</td>
<td style="width: 20%">
<button type="button" class="btn btn-danger" (click)="deleteDomainFromGroup(domain)">{{'DOMAINS.LIST.DELETE' | translate}}</button>
</td>
</tr>
</ng-template>
</thead>
</table>
</div>
</div> </div>
<div *ngIf="!this.addingMode" class="panel panel-default" style="margin-top: 3rem"> <div *ngIf="!this.addingMode" class="panel panel-default" style="margin-top: 3rem">
...@@ -66,8 +80,9 @@ ...@@ -66,8 +80,9 @@
<table class="table table-hover table-condensed" aria-describedby="Domain details table"> <table class="table table-hover table-condensed" aria-describedby="Domain details table">
<thead> <thead>
<tr> <tr>
<th scope="col"> <th scope="col" style="display:flex; justify-content: space-between">
{{ 'DOMAIN_DETAILS.APP_NAME' | translate }} <span>{{ 'DOMAIN_DETAILS.APP_NAME' | translate }}</span>
<span style="margin-right: 5rem">{{ 'DOMAINS.LIST.ACTIVE' | translate}}</span>
</th> </th>
</tr> </tr>
</thead> </thead>
......
...@@ -42,6 +42,7 @@ export class DomainGroupViewComponent extends BaseComponent implements OnInit { ...@@ -42,6 +42,7 @@ export class DomainGroupViewComponent extends BaseComponent implements OnInit {
this.domainService.getDomainGroup(this.domainGroupId).subscribe( this.domainService.getDomainGroup(this.domainGroupId).subscribe(
(domainGroup) => { (domainGroup) => {
this.domainGroup = domainGroup; this.domainGroup = domainGroup;
this.sortApplication();
}, },
err => { err => {
console.error(err); console.error(err);
...@@ -133,7 +134,12 @@ export class DomainGroupViewComponent extends BaseComponent implements OnInit { ...@@ -133,7 +134,12 @@ export class DomainGroupViewComponent extends BaseComponent implements OnInit {
} }
} }
} }
}
public sortApplication(): void {
if(this.domainGroup.applicationStatePerDomain !== undefined && this.domainGroup.applicationStatePerDomain !== null) {
this.domainGroup.applicationStatePerDomain.sort((a, b) => a.applicationBaseName.localeCompare(b.applicationBaseName))
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment