Skip to content

Commit 8f83994

Browse files
Merge pull request #236 from sohailamjad12/spv-portal_fixes
Karma Quest: spv portal fixes
2 parents fa24e1a + 5ceba35 commit 8f83994

File tree

10 files changed

+221
-77
lines changed

10 files changed

+221
-77
lines changed

project/ws/app/src/lib/routes/home/home.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
MatNativeDateModule,
3030
MatButtonToggleModule,
3131
MatRadioModule,
32+
MatTooltipModule,
3233
} from '@angular/material'
3334
import { MatCardModule } from '@angular/material/card'
3435
import { ReactiveFormsModule, FormsModule } from '@angular/forms'
@@ -170,6 +171,7 @@ import { AssignListPopupComponent } from './routes/request/assign-list-popup/ass
170171
BtnPageBackModuleAdmin,
171172
WidgetResolverModule,
172173
UserAutocompleteModule,
174+
MatTooltipModule,
173175
// TO-DO need to enable for image crop
174176
// ImageCropModule,
175177
UIAdminTableModule,

project/ws/app/src/lib/routes/home/routes/request/all-request/all-request.component.html

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ <h2>{{'Content Request'}}</h2>
77
<mat-card class="status-card" *ngFor="let card of statusCards">
88
<div class="card-content">
99
<div class="status-title">
10-
<span class="title-text"> {{ card?.value }}</span>
11-
<mat-icon class="info-icon">info</mat-icon>
10+
<span class="title-text"> {{ card?.value=== statusKey.fullfill ? 'Fullfilled' : card?.value }}</span>
11+
<mat-icon class="info-icon cursor-pointer" [matTooltip]="card?.message">info</mat-icon>
1212
</div>
13-
<div class="status-value">{{ card?.count }}</div>
13+
<div class="status-value">{{ card?.count ? card?.count : 0 }}</div>
1414
</div>
1515
</mat-card>
1616

@@ -22,55 +22,64 @@ <h2>{{'Content Request'}}</h2>
2222
<div class="table-class">
2323
<table mat-table [dataSource]="dataSource">
2424
<ng-container matColumnDef="RequestId">
25-
<th mat-header-cell *matHeaderCellDef>Request ID </th>
25+
<th mat-header-cell *matHeaderCellDef class="row-heading">Request ID </th>
2626
<td mat-cell class="title-class" *matCellDef="let element">{{element?.demand_id}}</td>
2727
</ng-container>
2828

2929
<ng-container matColumnDef="title">
30-
<th mat-header-cell *matHeaderCellDef>Title </th>
30+
<th mat-header-cell *matHeaderCellDef class="row-heading">Title </th>
3131
<td mat-cell class="title-class" *matCellDef="let element">{{element?.title}}</td>
3232
</ng-container>
33+
34+
<ng-container matColumnDef="requestedBy">
35+
<th mat-header-cell *matHeaderCellDef class="row-heading">Requested By </th>
36+
<td mat-cell class="title-class" *matCellDef="let element">{{element?.ownerOrgName}}</td>
37+
</ng-container>
3338

3439
<ng-container matColumnDef="requestType">
35-
<th mat-header-cell *matHeaderCellDef>Request Type </th>
40+
<th mat-header-cell *matHeaderCellDef class="row-heading">Request Type </th>
3641
<td mat-cell class="title-class" *matCellDef="let element">{{element?.requestType}}</td>
3742
</ng-container>
3843

3944
<ng-container matColumnDef="requestStatus">
40-
<th mat-header-cell *matHeaderCellDef>Request Status </th>
45+
<th mat-header-cell *matHeaderCellDef class="row-heading">Request Status </th>
4146
<td mat-cell class="title-class" *matCellDef="let element">
4247
<span [ngClass]="getStatusClass(element?.status)">{{element?.status}}</span></td>
4348
</ng-container>
4449

4550
<ng-container matColumnDef="assignee">
46-
<th mat-header-cell *matHeaderCellDef>Assignee </th>
47-
<td mat-cell class="title-class" *matCellDef="let element">{{element?.assignedProvider}}</td>
51+
<th mat-header-cell *matHeaderCellDef class="row-heading">Assignee </th>
52+
<td mat-cell class="title-class" *matCellDef="let element">{{element?.assignedProvider ? element?.assignedProvider : 'Not Assigned'}}</td>
4853
</ng-container>
4954

5055
<ng-container matColumnDef="requestedOn">
51-
<th mat-header-cell *matHeaderCellDef>Requested On </th>
56+
<th mat-header-cell *matHeaderCellDef class="row-heading">Requested On </th>
5257
<td mat-cell class="title-class" *matCellDef="let element">{{element?.createdOn | date}}</td>
5358
</ng-container>
5459

5560
<ng-container matColumnDef="interests">
56-
<th mat-header-cell *matHeaderCellDef>Interests</th>
61+
<th mat-header-cell *matHeaderCellDef class="row-heading">Interests</th>
5762
<td mat-cell class="title-class" *matCellDef="let element">
5863
<a class="action-btn-view" *ngIf="element?.interestCount!== 0"
59-
href="javascript:void(0)">{{element?.interestCount}}</a>
64+
href="javascript:void(0)">
65+
<span (click)="handleClick(element)">
66+
{{element?.interestCount}}
67+
</span>
68+
</a>
6069
<a class="" *ngIf="element?.interestCount === 0"
6170
href="javascript:void(0)">{{element?.requestType == 'Single' ? 'N/A' : element?.interestCount}}</a>
6271
</td>
6372
</ng-container>
6473

6574
<ng-container matColumnDef="details">
66-
<th mat-header-cell *matHeaderCellDef>Details</th>
75+
<th mat-header-cell *matHeaderCellDef class="row-heading">Details</th>
6776
<td mat-cell *matCellDef="let element">
6877
<mat-icon (click)="navigateToDetails(element?.demand_id)" class="cursor-pointer">visibility</mat-icon>
6978
</td>
7079
</ng-container>
7180

7281
<ng-container matColumnDef="action">
73-
<th mat-header-cell *matHeaderCellDef>Action</th>
82+
<th mat-header-cell *matHeaderCellDef class="row-heading"></th>
7483
<td mat-cell *matCellDef="let element">
7584

7685
<!-- <a class="action-btn-view" *ngIf="element.status === 'Unassigned'" (click)="showInterestPopup()"
@@ -106,7 +115,7 @@ <h2>{{'Content Request'}}</h2>
106115

107116
</ng-container>
108117

109-
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
118+
<tr mat-header-row *matHeaderRowDef="displayedColumns" class="table-row-data"></tr>
110119
<tr mat-row *matRowDef="let row;columns:displayedColumns"></tr>
111120

112121

project/ws/app/src/lib/routes/home/routes/request/all-request/all-request.component.scss

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,31 @@ table tr {
7777
// width: 13% !important;
7878
// }
7979

80-
table tr .cdk-column-title {
81-
width: 18% !important;
82-
}
80+
// table tr .cdk-column-title {
81+
// width: 18% !important;
82+
// }
83+
84+
// table tr .cdk-column-RequestId {
85+
// width: 9% !important;
86+
// }
8387

84-
table tr .cdk-column-RequestId {
85-
width: 9% !important;
88+
// table tr .cdk-column-assignee {
89+
// width: 20% !important;
90+
// }
91+
92+
table .table-row-data {
93+
height: 56px !important;
8694
}
8795

88-
table tr .cdk-column-assignee {
89-
width: 20% !important;
96+
table tr .row-heading {
97+
font-family: 'Lato';
98+
font-weight: 400;
99+
font-size: 14px !important;
100+
line-height: 21px;
101+
color: rgba(0, 0, 0, 0.6);
102+
border-bottom: none;
103+
width: 13% !important;
104+
padding: 0 13px 0 13px !important;
90105
}
91106

92107
.action-btn-view {
@@ -100,9 +115,13 @@ table tr .cdk-column-assignee {
100115

101116
.title-class {
102117
font-family: Lato;
103-
font-size: 14px;
118+
font-size: 14px !important;
104119
font-weight: 400;
105-
line-height: 16.8px;
120+
line-height: 21px;
121+
color: rgba(0, 0, 0, 0.6) !important;
122+
width: 13% !important;
123+
padding: 0 13px !important;
124+
106125
}
107126

108127
.status-unassigned {

project/ws/app/src/lib/routes/home/routes/request/all-request/all-request.component.ts

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export enum statusValue {
99
Assigned= 'Assigned',
1010
Unassigned = 'Unassigned',
1111
Inprogress = 'InProgress',
12-
invalid = 'invalid',
12+
invalid = 'Invalid',
13+
fullfill= 'Fulfill',
1314
}
1415
@Component({
1516
selector: 'ws-app-all-request',
@@ -33,7 +34,8 @@ export class AllRequestComponent implements OnInit {
3334
inProgress = false
3435
invalid = false
3536
dataSource: any
36-
displayedColumns: string[] = ['RequestId', 'title', 'requestType', 'requestStatus', 'assignee', 'requestedOn', 'interests', 'action']
37+
displayedColumns: string[] = ['RequestId', 'title','requestedBy',
38+
'requestType', 'requestStatus', 'assignee', 'requestedOn', 'interests', 'action']
3739
dialogRef: any
3840
queryParams: any
3941
statusCards:any[]=[]
@@ -67,8 +69,27 @@ export class AllRequestComponent implements OnInit {
6769
this.requestService.getRequestList(request).subscribe((res:any)=>{
6870
if(res.facets && res.facets.status){
6971
this.statusCards = res.facets.status;
70-
}
71-
72+
const toolTipText:any = {
73+
"Assigned":'Total number of requests assigned',
74+
"Invalid":'Total number of Invalid requests',
75+
"Unassigned":'Total number of unassigned requests',
76+
"InProgress":'Total number of In-progress requests',
77+
"Fulfill":'Total number of requests fulfilled'
78+
}
79+
this.statusCards = this.statusCards.map(status=>({
80+
...status,
81+
message:toolTipText[status.value] || ''
82+
}))
83+
const allStatusValues = ["Assigned", "Invalid", "Unassigned", "InProgress", "Fulfill"];
84+
const existingValues = new Set(this.statusCards.map(status => status.value));
85+
// Add missing status values with a count of 0
86+
allStatusValues.forEach(status => {
87+
if (!existingValues.has(status)) {
88+
this.statusCards.push({ value: status, count: 0 });
89+
}
90+
});
91+
92+
}
7293
})
7394

7495
}
@@ -84,6 +105,7 @@ export class AllRequestComponent implements OnInit {
84105
orderDirection: 'ASC',
85106
}
86107
this.requestService.getRequestList(request).subscribe((res: any) => {
108+
if(res.data){
87109
this.requestListData = res.data
88110
if (this.requestListData) {
89111
this.requestCount = res.totalCount
@@ -107,6 +129,7 @@ export class AllRequestComponent implements OnInit {
107129
})
108130
this.dataSource = new MatTableDataSource<any>(this.requestListData)
109131
}
132+
}
110133
})
111134

112135
}
@@ -128,6 +151,18 @@ export class AllRequestComponent implements OnInit {
128151
}
129152
}
130153

154+
155+
handleClick(element: any): void {
156+
if (element.status && element.status.length > 0) {
157+
if (element.status !== this.statusKey.Inprogress &&
158+
element.status !== this.statusKey.invalid &&
159+
element.status !== this.statusKey.fullfill) {
160+
this.onClickMenu(element, 'assignContent')
161+
}
162+
}
163+
164+
}
165+
131166
onClickMenu(item: any, action: string) {
132167
switch (action) {
133168
case 'viewContent':
@@ -216,9 +251,12 @@ export class AllRequestComponent implements OnInit {
216251
newStatus: 'Invalid',
217252
}
218253
this.requestService.markAsInvalid(request).subscribe(res => {
219-
this.invalidRes = res
220-
this.getRequestList()
221-
this.snackBar.open('Marked as Invalid')
254+
if(res){
255+
this.invalidRes = res
256+
this.getRequestList()
257+
this.snackBar.open('Marked as Invalid')
258+
}
259+
222260
}
223261
)
224262

project/ws/app/src/lib/routes/home/routes/request/assign-list-popup/assign-list-popup.component.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<h2 class="titleText">{{assignText}}</h2>
77
</div>
88
<div class="actions">
9-
<button mat-button type="button" class="search-btn" (click)="onSubmitAssign()" >{{submitAssign}}</button>
9+
<button mat-button type="button" class="search-btn" [ngClass]="{'disableBtn': !requestForm.valid}" (click)="onSubmitAssign()"
10+
[disabled]="!requestForm.valid" >{{submitAssign}}</button>
1011

1112
<button mat-button class="cancel" (click)="cancel()">
1213
<span>Cancel</span>
@@ -21,28 +22,28 @@ <h2 class="titleText">{{assignText}}</h2>
2122
<div class="table-class">
2223
<table mat-table [dataSource]="dataSource">
2324
<ng-container matColumnDef="select">
24-
<th mat-header-cell *matHeaderCellDef></th>
25+
<th mat-header-cell *matHeaderCellDef class="row-heading radio-width"></th>
2526
<td mat-cell class="title-class" *matCellDef="let provider">
2627
<mat-radio-button [value]="provider"></mat-radio-button>
2728
</td>
2829
</ng-container>
2930

3031
<ng-container matColumnDef="providerName">
31-
<th mat-header-cell *matHeaderCellDef>Provider Name</th>
32+
<th mat-header-cell *matHeaderCellDef class="row-heading">Provider Name</th>
3233
<td mat-cell class="title-class" *matCellDef="let provider">{{ provider?.orgName ? provider?.orgName : '_' }}</td>
3334
</ng-container>
3435

3536
<ng-container matColumnDef="details">
36-
<th mat-header-cell *matHeaderCellDef>Details</th>
37+
<th mat-header-cell *matHeaderCellDef class="row-heading">Details</th>
3738
<td mat-cell class="title-class" *matCellDef="let provider">{{ provider?.description ? provider?.description: '_' }}</td>
3839
</ng-container>
3940

4041
<ng-container matColumnDef="eta">
41-
<th mat-header-cell *matHeaderCellDef>ETA</th>
42+
<th mat-header-cell *matHeaderCellDef class="row-heading">ETA</th>
4243
<td mat-cell class="title-class" *matCellDef="let provider">{{ provider?.turnAroundTime ? provider?.turnAroundTime : '_' }}</td>
4344
</ng-container>
4445

45-
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
46+
<tr mat-header-row *matHeaderRowDef="displayedColumns" class="table-row-data"></tr>
4647
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
4748
</table>
4849
<mat-paginator [pageSize]="pageSize" [length]="this.providerCount" [pageSizeOptions]="[5,10,20]"

project/ws/app/src/lib/routes/home/routes/request/assign-list-popup/assign-list-popup.component.scss

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@
4747
border-radius: 4px;
4848
min-width: 81px;
4949
}
50+
.disableBtn {
51+
background: rgba(0, 0, 0, 0.4) !important;
52+
}
53+
5054
}
5155
}
5256

5357

58+
5459
.userTable {
5560
box-shadow: none;
5661
}
@@ -69,17 +74,44 @@
6974
// width: 13% !important;
7075
// }
7176

72-
table tr .cdk-column-title {
73-
width: 18% !important;
74-
}
77+
// table tr .cdk-column-title {
78+
// width: 18% !important;
79+
// }
7580

76-
table tr .cdk-column-RequestId {
77-
width: 9% !important;
78-
}
81+
// table tr .cdk-column-RequestId {
82+
// width: 9% !important;
83+
// }
7984

80-
table tr .cdk-column-assignee {
81-
width: 17% !important;
85+
// table tr .cdk-column-assignee {
86+
// width: 17% !important;
87+
// }
88+
89+
table .table-row-data {
90+
height: 56px !important;
8291
}
92+
table tr .row-heading {
93+
font-family: 'Lato';
94+
font-weight: 400;
95+
font-size: 14px !important;
96+
line-height: 21px;
97+
color: rgba(0, 0, 0, 0.6);
98+
border-bottom: none;
99+
// width: 13% !important;
100+
// padding: 0 13px 0 13px !important;
101+
}
102+
table tr .radio-width{
103+
width: 6% !important;
104+
}
105+
106+
table tr .cdk-column-providerName {
107+
width: 21% !important;
108+
padding: 0 4% 0 0px !important;
109+
}
110+
111+
table tr .cdk-column-details {
112+
width: 40%;
113+
padding: 0 10% 0 0px !important
114+
}
83115

84116
.action-btn-view {
85117
color: #1B4CA1;
@@ -93,8 +125,11 @@
93125
.title-class {
94126
font-family: Lato;
95127
font-size: 14px;
128+
font-size: 14px !important;
96129
font-weight: 400;
97130
line-height: 16.8px;
131+
line-height: 21px;
132+
color: rgba(0, 0, 0, 0.6) !important;
98133
}
99134

100135
.search-border {

0 commit comments

Comments
 (0)