Skip to content

Commit

Permalink
Merge pull request #1724 from bcgov/feature/TCVP-2771
Browse files Browse the repository at this point in the history
TCVP-2771: Update front-end
  • Loading branch information
saikrishnametpalli-nttdata authored Mar 28, 2024
2 parents 7c425d5 + 82df08e commit 647eeab
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
</ng-container>
</app-table-filters>



<div class="table-responsive">
<table mat-table [dataSource]="dataSource" matSort (matSortChange)="sortData($event)">

Expand Down Expand Up @@ -75,7 +73,7 @@
</td>
</ng-container>

<ng-container matColumnDef="disputantGivenNames">
<ng-container matColumnDef="disputantGivenName1">
<th mat-header-cell *matHeaderCellDef mat-sort-header>
Given Name(s)
</th>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Component, OnInit, ViewChild, AfterViewInit, Output, EventEmitter, Input } from '@angular/core';
import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table';
import { MatSort, Sort } from '@angular/material/sort';
import { Sort } from '@angular/material/sort';
import { DisputeService, Dispute } from 'app/services/dispute.service';
import { DisputeRequestCourtAppearanceYn, DisputeDisputantDetectedOcrIssues, DisputeStatus, DisputeSystemDetectedOcrIssues, PagedDisputeListItemCollection, SortDirection } from 'app/api';
import { LoggerService } from '@core/services/logger.service';
import { AuthService, KeycloakProfile } from 'app/services/auth.service';
import { DateUtil } from '@shared/utils/date-util';
import { TableFilter, TableFilterKeys } from '@shared/models/table-filter-options.model';
import { TableFilterService } from 'app/services/table-filter.service';

Expand All @@ -30,7 +29,7 @@ export class TicketInboxComponent implements OnInit {
'submittedTs',
'ticketNumber',
'disputantSurname',
'disputantGivenNames',
'disputantGivenName1',
'status',
'requestCourtAppearanceYn',
'disputantDetectedOcrIssues',
Expand All @@ -54,6 +53,7 @@ export class TicketInboxComponent implements OnInit {
private disputeService: DisputeService,
private logger: LoggerService,
private authService: AuthService,
private tableFilterService: TableFilterService,
) {
this.disputeService.refreshDisputes.subscribe(x => {
this.getAllDisputes();
Expand All @@ -69,6 +69,9 @@ export class TicketInboxComponent implements OnInit {
})

// when authentication token available, get data
let dataFilter: TableFilter = this.tableFilterService.tableFilters[this.tabIndex];
dataFilter.status = dataFilter.status ?? "";
this.filters = dataFilter;
this.getAllDisputes();
this.countNewTickets();
}
Expand Down Expand Up @@ -117,6 +120,7 @@ export class TicketInboxComponent implements OnInit {
// called on keyup in filter field
onApplyFilter(dataFilters: TableFilter) {
this.filters = dataFilters;
this.currentPage = 1;
this.getAllDisputes();
}

Expand All @@ -127,6 +131,7 @@ export class TicketInboxComponent implements OnInit {
sortData(sort: Sort){
this.sortBy = [sort.active];
this.sortDirection = [sort.direction ? sort.direction as SortDirection : SortDirection.Desc];
this.currentPage = 1;
this.getAllDisputes();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class TableFiltersComponent implements OnInit {
// Put this call in a Timeout to keep UI responsive.
setTimeout(() => {
this.tableFilterService.tableFilters[this.tabIndex] = this.dataFilters;
this.dataFilters.status = this.dataFilters.status ?? "";
this.onFilterChanged.emit(this.dataFilters);
}, 100);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class DisputeService implements IDisputeService {
return this.disputeApiService.apiDisputeDisputesGet(filters.status ? undefined : [ExcludeStatus.Cancelled,
ExcludeStatus.Processing, ExcludeStatus.Rejected, ExcludeStatus.Concluded], filters.ticketNumber, filters.disputantSurname,
filters.status ? [filters.status] : [DisputeStatus.New, DisputeStatus.Validated], filters.dateSubmittedFrom,
filters.dateSubmittedTo, undefined, sortBy, sortDirection, undefined, pageNumber, 10)
filters.dateSubmittedTo, undefined, sortBy, sortDirection, undefined, pageNumber, 25)
.pipe(
map((response: PagedDisputeListItemCollection) => {
this.logger.info('DisputeService::getDisputes', response);
Expand Down

0 comments on commit 647eeab

Please sign in to comment.