Skip to content

Commit

Permalink
Merge pull request #236 from sohailamjad12/spv-portal_fixes
Browse files Browse the repository at this point in the history
Karma Quest: spv portal fixes
  • Loading branch information
vishnubansaltarento authored Jun 20, 2024
2 parents fa24e1a + 5ceba35 commit 8f83994
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 77 deletions.
2 changes: 2 additions & 0 deletions project/ws/app/src/lib/routes/home/home.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
MatNativeDateModule,
MatButtonToggleModule,
MatRadioModule,
MatTooltipModule,
} from '@angular/material'
import { MatCardModule } from '@angular/material/card'
import { ReactiveFormsModule, FormsModule } from '@angular/forms'
Expand Down Expand Up @@ -170,6 +171,7 @@ import { AssignListPopupComponent } from './routes/request/assign-list-popup/ass
BtnPageBackModuleAdmin,
WidgetResolverModule,
UserAutocompleteModule,
MatTooltipModule,
// TO-DO need to enable for image crop
// ImageCropModule,
UIAdminTableModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ <h2>{{'Content Request'}}</h2>
<mat-card class="status-card" *ngFor="let card of statusCards">
<div class="card-content">
<div class="status-title">
<span class="title-text"> {{ card?.value }}</span>
<mat-icon class="info-icon">info</mat-icon>
<span class="title-text"> {{ card?.value=== statusKey.fullfill ? 'Fullfilled' : card?.value }}</span>
<mat-icon class="info-icon cursor-pointer" [matTooltip]="card?.message">info</mat-icon>
</div>
<div class="status-value">{{ card?.count }}</div>
<div class="status-value">{{ card?.count ? card?.count : 0 }}</div>
</div>
</mat-card>

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

<ng-container matColumnDef="title">
<th mat-header-cell *matHeaderCellDef>Title </th>
<th mat-header-cell *matHeaderCellDef class="row-heading">Title </th>
<td mat-cell class="title-class" *matCellDef="let element">{{element?.title}}</td>
</ng-container>

<ng-container matColumnDef="requestedBy">
<th mat-header-cell *matHeaderCellDef class="row-heading">Requested By </th>
<td mat-cell class="title-class" *matCellDef="let element">{{element?.ownerOrgName}}</td>
</ng-container>

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

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

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

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

<ng-container matColumnDef="interests">
<th mat-header-cell *matHeaderCellDef>Interests</th>
<th mat-header-cell *matHeaderCellDef class="row-heading">Interests</th>
<td mat-cell class="title-class" *matCellDef="let element">
<a class="action-btn-view" *ngIf="element?.interestCount!== 0"
href="javascript:void(0)">{{element?.interestCount}}</a>
href="javascript:void(0)">
<span (click)="handleClick(element)">
{{element?.interestCount}}
</span>
</a>
<a class="" *ngIf="element?.interestCount === 0"
href="javascript:void(0)">{{element?.requestType == 'Single' ? 'N/A' : element?.interestCount}}</a>
</td>
</ng-container>

<ng-container matColumnDef="details">
<th mat-header-cell *matHeaderCellDef>Details</th>
<th mat-header-cell *matHeaderCellDef class="row-heading">Details</th>
<td mat-cell *matCellDef="let element">
<mat-icon (click)="navigateToDetails(element?.demand_id)" class="cursor-pointer">visibility</mat-icon>
</td>
</ng-container>

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

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

</ng-container>

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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,31 @@ table tr {
// width: 13% !important;
// }

table tr .cdk-column-title {
width: 18% !important;
}
// table tr .cdk-column-title {
// width: 18% !important;
// }

// table tr .cdk-column-RequestId {
// width: 9% !important;
// }

table tr .cdk-column-RequestId {
width: 9% !important;
// table tr .cdk-column-assignee {
// width: 20% !important;
// }

table .table-row-data {
height: 56px !important;
}

table tr .cdk-column-assignee {
width: 20% !important;
table tr .row-heading {
font-family: 'Lato';
font-weight: 400;
font-size: 14px !important;
line-height: 21px;
color: rgba(0, 0, 0, 0.6);
border-bottom: none;
width: 13% !important;
padding: 0 13px 0 13px !important;
}

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

.title-class {
font-family: Lato;
font-size: 14px;
font-size: 14px !important;
font-weight: 400;
line-height: 16.8px;
line-height: 21px;
color: rgba(0, 0, 0, 0.6) !important;
width: 13% !important;
padding: 0 13px !important;

}

.status-unassigned {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export enum statusValue {
Assigned= 'Assigned',
Unassigned = 'Unassigned',
Inprogress = 'InProgress',
invalid = 'invalid',
invalid = 'Invalid',
fullfill= 'Fulfill',
}
@Component({
selector: 'ws-app-all-request',
Expand All @@ -33,7 +34,8 @@ export class AllRequestComponent implements OnInit {
inProgress = false
invalid = false
dataSource: any
displayedColumns: string[] = ['RequestId', 'title', 'requestType', 'requestStatus', 'assignee', 'requestedOn', 'interests', 'action']
displayedColumns: string[] = ['RequestId', 'title','requestedBy',
'requestType', 'requestStatus', 'assignee', 'requestedOn', 'interests', 'action']
dialogRef: any
queryParams: any
statusCards:any[]=[]
Expand Down Expand Up @@ -67,8 +69,27 @@ export class AllRequestComponent implements OnInit {
this.requestService.getRequestList(request).subscribe((res:any)=>{
if(res.facets && res.facets.status){
this.statusCards = res.facets.status;
}

const toolTipText:any = {
"Assigned":'Total number of requests assigned',
"Invalid":'Total number of Invalid requests',
"Unassigned":'Total number of unassigned requests',
"InProgress":'Total number of In-progress requests',
"Fulfill":'Total number of requests fulfilled'
}
this.statusCards = this.statusCards.map(status=>({
...status,
message:toolTipText[status.value] || ''
}))
const allStatusValues = ["Assigned", "Invalid", "Unassigned", "InProgress", "Fulfill"];
const existingValues = new Set(this.statusCards.map(status => status.value));
// Add missing status values with a count of 0
allStatusValues.forEach(status => {
if (!existingValues.has(status)) {
this.statusCards.push({ value: status, count: 0 });
}
});

}
})

}
Expand All @@ -84,6 +105,7 @@ export class AllRequestComponent implements OnInit {
orderDirection: 'ASC',
}
this.requestService.getRequestList(request).subscribe((res: any) => {
if(res.data){
this.requestListData = res.data
if (this.requestListData) {
this.requestCount = res.totalCount
Expand All @@ -107,6 +129,7 @@ export class AllRequestComponent implements OnInit {
})
this.dataSource = new MatTableDataSource<any>(this.requestListData)
}
}
})

}
Expand All @@ -128,6 +151,18 @@ export class AllRequestComponent implements OnInit {
}
}


handleClick(element: any): void {
if (element.status && element.status.length > 0) {
if (element.status !== this.statusKey.Inprogress &&
element.status !== this.statusKey.invalid &&
element.status !== this.statusKey.fullfill) {
this.onClickMenu(element, 'assignContent')
}
}

}

onClickMenu(item: any, action: string) {
switch (action) {
case 'viewContent':
Expand Down Expand Up @@ -216,9 +251,12 @@ export class AllRequestComponent implements OnInit {
newStatus: 'Invalid',
}
this.requestService.markAsInvalid(request).subscribe(res => {
this.invalidRes = res
this.getRequestList()
this.snackBar.open('Marked as Invalid')
if(res){
this.invalidRes = res
this.getRequestList()
this.snackBar.open('Marked as Invalid')
}

}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<h2 class="titleText">{{assignText}}</h2>
</div>
<div class="actions">
<button mat-button type="button" class="search-btn" (click)="onSubmitAssign()" >{{submitAssign}}</button>
<button mat-button type="button" class="search-btn" [ngClass]="{'disableBtn': !requestForm.valid}" (click)="onSubmitAssign()"
[disabled]="!requestForm.valid" >{{submitAssign}}</button>

<button mat-button class="cancel" (click)="cancel()">
<span>Cancel</span>
Expand All @@ -21,28 +22,28 @@ <h2 class="titleText">{{assignText}}</h2>
<div class="table-class">
<table mat-table [dataSource]="dataSource">
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef></th>
<th mat-header-cell *matHeaderCellDef class="row-heading radio-width"></th>
<td mat-cell class="title-class" *matCellDef="let provider">
<mat-radio-button [value]="provider"></mat-radio-button>
</td>
</ng-container>

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

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

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

<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns" class="table-row-data"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
<mat-paginator [pageSize]="pageSize" [length]="this.providerCount" [pageSizeOptions]="[5,10,20]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@
border-radius: 4px;
min-width: 81px;
}
.disableBtn {
background: rgba(0, 0, 0, 0.4) !important;
}

}
}



.userTable {
box-shadow: none;
}
Expand All @@ -69,17 +74,44 @@
// width: 13% !important;
// }

table tr .cdk-column-title {
width: 18% !important;
}
// table tr .cdk-column-title {
// width: 18% !important;
// }

table tr .cdk-column-RequestId {
width: 9% !important;
}
// table tr .cdk-column-RequestId {
// width: 9% !important;
// }

table tr .cdk-column-assignee {
width: 17% !important;
// table tr .cdk-column-assignee {
// width: 17% !important;
// }

table .table-row-data {
height: 56px !important;
}
table tr .row-heading {
font-family: 'Lato';
font-weight: 400;
font-size: 14px !important;
line-height: 21px;
color: rgba(0, 0, 0, 0.6);
border-bottom: none;
// width: 13% !important;
// padding: 0 13px 0 13px !important;
}
table tr .radio-width{
width: 6% !important;
}

table tr .cdk-column-providerName {
width: 21% !important;
padding: 0 4% 0 0px !important;
}

table tr .cdk-column-details {
width: 40%;
padding: 0 10% 0 0px !important
}

.action-btn-view {
color: #1B4CA1;
Expand All @@ -93,8 +125,11 @@
.title-class {
font-family: Lato;
font-size: 14px;
font-size: 14px !important;
font-weight: 400;
line-height: 16.8px;
line-height: 21px;
color: rgba(0, 0, 0, 0.6) !important;
}

.search-border {
Expand Down
Loading

0 comments on commit 8f83994

Please sign in to comment.