Skip to content

Commit

Permalink
Merge pull request #626 from mayuradesh/newdevelop
Browse files Browse the repository at this point in the history
MOSIP-30406 added sorting
  • Loading branch information
mayuradesh committed Dec 8, 2023
2 parents 4a65ba0 + 0b8a324 commit 5b205bb
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
35 changes: 35 additions & 0 deletions src/app/features/test-run/test-run/test-run.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,39 @@ mat-panel-title {
.expanded-details{
width: 250px;
}
}
.mat-column-testId {
word-wrap: break-word !important;
white-space: unset !important;
flex: 0 0 20% !important;
width: 20% !important;
overflow-wrap: break-word;
}
.mat-column-testName {
word-wrap: break-word !important;
white-space: unset !important;
flex: 0 0 50% !important;
width: 50% !important;
overflow-wrap: break-word;
}
.mat-column-resultStatus {
word-wrap: break-word !important;
white-space: unset !important;
flex: 0 0 10% !important;
width: 10% !important;
overflow-wrap: break-word;
}
.mat-column-executionStatus {
word-wrap: break-word !important;
white-space: unset !important;
flex: 0 0 10% !important;
width: 10% !important;
overflow-wrap: break-word;
}
.mat-column-expand {
word-wrap: break-word !important;
white-space: unset !important;
flex: 0 0 10% !important;
width: 1cap !important;
overflow-wrap: break-word;
}
10 changes: 5 additions & 5 deletions src/app/features/test-run/test-run/test-run.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
</div>
<div class="mat-elevation-z8">
<div class="filter-container">
<mat-paginator class="paginator" [pageSizeOptions]="[10,20,30]"
<mat-paginator class="paginator" [pageSizeOptions]="[10,20,30,40,50]"
aria-label="Select page of projects"></mat-paginator>
</div>
<div *ngIf="dataSource && dataSource.data && dataSource.data.length <= 0" [ngStyle]="{color: 'red', padding: '30px'}">
{{"viewTestRun.testRunDetailsAreNotAvailable"|translate}}
</div>
<div class="table-container">
<table mat-table [dataSource]="dataSource" multiTemplateDataRows class="testcases-table">
<table mat-table [dataSource]="dataSource" multiTemplateDataRows matSort class="testcases-table">
<caption>{{ "viewTestRun.tableDescription" | translate }}</caption>
<!--- Note that these columns can be defined in any order.
The actual rendered columns are set as a property on the row definition" -->
<!-- Test Order Sequence Column -->
<ng-container matColumnDef="testId">
<th mat-header-cell *matHeaderCellDef class="testIDHeader"> {{"viewTestRun.id"|translate}} </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header class="testIDHeader"> {{"viewTestRun.id"|translate}} </th>
<td mat-cell *matCellDef="let element" class="testIDCell">
{{element.testId}}<span *ngIf="element.methodId != '' && element.methodId !== 'Not_Available'">
- ( {{element.methodId}} )</span>
Expand All @@ -32,7 +32,7 @@
</td>
</ng-container>
<ng-container matColumnDef="resultStatus">
<th mat-header-cell *matHeaderCellDef class="resultStatusHeader"> {{"viewTestRun.status"|translate}}
<th mat-header-cell *matHeaderCellDef mat-sort-header class="resultStatusHeader"> {{"viewTestRun.status"|translate}}
</th>
<td mat-cell *matCellDef="let element" class="resultStatusCell">
<span class="custom-class" *ngIf="element.resultStatus == 'success'">
Expand All @@ -46,7 +46,7 @@
</td>
</ng-container>
<ng-container matColumnDef="executionStatus">
<th mat-header-cell *matHeaderCellDef class="executionStatusHeader">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="executionStatusHeader">
{{"viewTestRun.executionStatus"|translate}} </th>
<td mat-cell *matCellDef="let element" class="executionStatusCell">
<span class="custom-class" *ngIf="element.executionStatus == 'complete'">
Expand Down
4 changes: 3 additions & 1 deletion src/app/features/test-run/test-run/test-run.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { environment } from 'src/environments/environment';
import { Directory, Filesystem } from '@capacitor/filesystem';
import { Toast } from '@capacitor/toast';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';

@Component({
selector: 'app-test-run',
Expand Down Expand Up @@ -74,7 +75,7 @@ export class TestRunComponent implements OnInit {
resourceBundleJson: any = {};
langCode = this.userProfileService.getUserPreferredLanguage();
@ViewChild(MatPaginator) paginator: MatPaginator;

@ViewChild(MatSort) sort: MatSort;
constructor(
public authService: AuthService,
private activatedRoute: ActivatedRoute,
Expand Down Expand Up @@ -267,6 +268,7 @@ export class TestRunComponent implements OnInit {
}
this.dataSource = new MatTableDataSource(tableData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
resolve(true);
},
(errors) => {
Expand Down

0 comments on commit 5b205bb

Please sign in to comment.