diff --git a/src/app/pages/user-accounts/components/requests-list-dashboard/requests-list-dashboard.component.html b/src/app/pages/user-accounts/components/requests-list-dashboard/requests-list-dashboard.component.html index cbbf6d0..e73c1d1 100644 --- a/src/app/pages/user-accounts/components/requests-list-dashboard/requests-list-dashboard.component.html +++ b/src/app/pages/user-accounts/components/requests-list-dashboard/requests-list-dashboard.component.html @@ -1,13 +1,19 @@
- {{ saving ? (params?.translations['Saving'] || 'Saving') : (params?.translations['Deleting'] || 'Deleting') }} .... + {{ + saving + ? params?.translations['Saving'] || 'Saving' + : params?.translations['Deleting'] || 'Deleting' + }} + ....
@@ -19,160 +25,450 @@ *ngIf="!params?.allDataForUserSupport" > -
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + +
{{ params?.translations['SN'] || 'SN' }}{{ params?.translations['Message'] || 'Request' }}{{ params?.translations['Date'] || 'Date' }}{{ params?.translations['Actions']|| 'Actions' }}
- {{ count + 1 }} - -
-
- {{ dataRow?.timeSinceResponseSent }} - -
- +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ params?.translations['SN'] || 'SN' }} + {{ params?.translations['Name'] || 'Names' }} + + {{ params?.translations['Phone'] || 'Phone' }} + + {{ + params?.translations['Username'] || 'Username' + }} + + {{ + params?.translations['Password'] || 'Password' + }} + + {{ params?.translations['Status'] || 'Status' }} + + {{ + params?.translations && + params?.translations['Remarks'] + ? params?.translations['Remarks'] + : 'Status' + }} +
+ {{ count + 1 }} + + {{ user?.firstName + ' ' + user?.surname }} + + {{ user?.phoneNumber }} + + {{ user?.username ? user?.username : '-' }} + + {{ user?.password ? user?.username : '-' }} + + {{ user?.status }} + + {{ + user?.reason + ? user?.reason + : user?.remarks + ? user?.remarks + : '' + }} + + +
+
+ +
+
+
+ +
- - diff --git a/src/app/shared/pipes/filter-requests-by-status.pipe.ts b/src/app/shared/pipes/filter-requests-by-status.pipe.ts new file mode 100644 index 0000000..1970a32 --- /dev/null +++ b/src/app/shared/pipes/filter-requests-by-status.pipe.ts @@ -0,0 +1,15 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'filterRequestsByStatus', +}) +export class FilterRequestsByStatusPipe implements PipeTransform { + transform(requests: any[], status: string): any { + if (!status) { + return requests || []; + } + return ( + (requests || []).filter((request) => request?.status === status) || [] + ); + } +} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index b6965ef..97cfec6 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -11,6 +11,7 @@ import { FilterFormRequestsPipe } from './pipes/filter-requests.pipe'; import { TranslateModule } from '@ngx-translate/core'; import { FilterItemsPipe } from './pipes/filter-items.pipe'; import { modals } from './modals'; +import { FilterRequestsByStatusPipe } from './pipes/filter-requests-by-status.pipe'; @NgModule({ imports: [ @@ -34,6 +35,7 @@ import { modals } from './modals'; NgxDhis2PeriodFilterModule, SearchItemPipe, FilterFormRequestsPipe, + FilterRequestsByStatusPipe, FilterItemsPipe, TranslateModule, ], @@ -43,6 +45,7 @@ import { modals } from './modals'; ...modals, SearchItemPipe, FilterFormRequestsPipe, + FilterRequestsByStatusPipe, FilterItemsPipe, ], })