Skip to content

Commit

Permalink
Merge pull request #538 from sohailamjad12/single_select
Browse files Browse the repository at this point in the history
Karma Quest: Re assign single select ui implemented
  • Loading branch information
vishnubansaltarento authored Jun 24, 2024
2 parents 1013f47 + e3a195e commit 33b0802
Show file tree
Hide file tree
Showing 6 changed files with 699 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { AssignListPopupComponent } from './assign-list-popup/assign-list-popup.
import { LoaderService } from '../../../../../../../../../src/app/services/loader.service'
/* tslint:disable */
import _ from 'lodash'
import { SingleAssignPopupComponent } from './single-assign-popup/single-assign-popup.component'
/* tslint:enable */
export enum statusValue {
Assigned= 'Assigned',
Expand Down Expand Up @@ -146,13 +147,17 @@ export class RequestListComponent implements OnInit {
case 'reAssignContent':
if (item.requestType === 'Broadcast') {
this.openAssignlistPopup(item)
} else {
this.queryParams = {
id: item.demand_id,
name: 'reassign',
}
this.router.navigate(['/app/home/create-request-form'], { queryParams: this.queryParams })
}
else {
this.openSingleReassignPopup(item)
}
// else {
// this.queryParams = {
// id: item.demand_id,
// name: 'reassign',
// }
// this.router.navigate(['/app/home/create-request-form'], { queryParams: this.queryParams })
// }

break
case 'copyContent':
Expand Down Expand Up @@ -244,14 +249,39 @@ export class RequestListComponent implements OnInit {

this.dialogRef.afterClosed().subscribe((_res: any) => {
if (_res && _res.data === 'confirmed') {
this.getRequestList()
setTimeout(()=>{
this.getRequestList()
},1000)
this.snackBar.open('Assigned submitted Successfully')
} else {
// this.snackBar.open('error')
}
})
}


openSingleReassignPopup(item:any){
this.dialogRef = this.dialog.open(SingleAssignPopupComponent, {
disableClose: false,
width: '90%',
height: '70vh',
data: item,
autoFocus: false,
})

this.dialogRef.afterClosed().subscribe((_res: any) => {
if (_res && _res.data === 'confirmed') {
setTimeout(()=>{
this.getRequestList()
},1000)

this.snackBar.open('Re-assign submitted Successfully')
} else {
// this.snackBar.open('error')
}
})
}

sanitizeHtml(html: string): SafeHtml {
return this.sanitizer.bypassSecurityTrustHtml(html)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<div class="main-container">
<div class="full-table-container" *ngIf="requestTypeData?.length > 0">
<form [formGroup]="requestForm">
<div class="header-section">
<div class="title">
<h2 class="titleText">{{'Re-Assign'}}</h2>
</div>
<div class="actions">
<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>
</button>

</div>

</div>
<!-- <div class="input-group rounded search-btns">
<input type="search" class="form-control rounded search-int" formControlName="orgSearch" placeholder="Search" aria-label="Search" (keyup)="searchText('orgSearch')" aria-describedby="search-addon" />
<span class="input-group-text border-0" id="search-addon">
<i class="fas fa-search"></i>
</span>
</div> -->

<mat-radio-group formControlName="assignee">
<div class="nav-container">
<div class="sidenav-content">
<div class="table-class">
<table mat-table [dataSource]="dataSource">
<ng-container matColumnDef="select">
<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="name">
<th mat-header-cell *matHeaderCellDef class="row-heading">Provider Name</th>
<td mat-cell class="title-class" *matCellDef="let provider">{{ provider?.orgName }}</td>
</ng-container>


<tr mat-header-row *matHeaderRowDef="displayedColumns" class="table-row-data"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns" [ngClass]="{'row-bg':row === this.requestTypeData[0]}"></tr>
</table>
<!-- <mat-paginator [pageSize]=5 [length]="this.requestTypeData?.length" [pageSizeOptions]="[5,10,20]"
(page)="onChangePage($event)"></mat-paginator> -->
<mat-paginator [pageSizeOptions]="[5,10,20]" showFirstLastButtons
></mat-paginator>

</div>
</div>
</div>
</mat-radio-group>
</form>
</div>
</div>

Loading

0 comments on commit 33b0802

Please sign in to comment.