Skip to content

Commit

Permalink
Merge pull request #151 from KB-iGOT/cbrelease-4.8.20
Browse files Browse the repository at this point in the history
Cbrelease 4.8.20
  • Loading branch information
sureshece16 authored Jan 7, 2025
2 parents d2e3290 + ac392b3 commit b169538
Show file tree
Hide file tree
Showing 20 changed files with 269 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,19 @@

<mat-form-field class="w-full">
<input type="text" placeholder="Type to search" aria-label="Type to search" matInput
(input)="filterStates($event.target.value)" formControlName="state" [matAutocomplete]="auto">
(input)="filterStates($event.target.value)" formControlName="state" [matAutocomplete]="auto"
(keydown)="onkeyDown($event)">
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn"
(opened)="onAutoCompleteOpened()" (closed)="onAutoCompleteClosed()"
(optionSelected)="onSelectStateMinistry($event.option.value)">
<ng-container *ngFor="let option of filteredStates">
<mat-option [value]="option">{{ option.orgName }}</mat-option>
<ng-container *ngIf="filteredStates?.length > 0; else noStates">
<ng-container *ngFor="let option of filteredStates">
<mat-option [value]="option">{{ option.orgName }}</mat-option>
</ng-container>
</ng-container>
<ng-template #noStates>
<mat-option disabled>No States found</mat-option>
</ng-template>
</mat-autocomplete>
<mat-error *ngIf="controls['state'].errors?.['required']">State is required.</mat-error>
</mat-form-field>
Expand All @@ -109,13 +116,22 @@

<mat-form-field class="w-full">
<input type="text" placeholder="Type to search" aria-label="Type to search" matInput
(input)="filterMinistry($event.target.value)" formControlName="ministry" [matAutocomplete]="auto">
(input)="filterMinistry($event.target.value)" formControlName="ministry" [matAutocomplete]="auto"
(keydown)="onkeyDown($event)">
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn"
(optionSelected)="onSelectStateMinistry($event.option.value)">
<ng-container *ngFor="let option of filteredMinistry">
<mat-option [value]="option">{{ option.orgName }}</mat-option>
(optionSelected)="onSelectStateMinistry($event.option.value)" (opened)="onAutoCompleteOpened()"
(closed)="onAutoCompleteClosed()">

<ng-container *ngIf="filteredMinistry?.length > 0; else noMinisry">
<ng-container *ngFor="let option of filteredMinistry">
<mat-option [value]="option">{{ option.orgName }}</mat-option>
</ng-container>
</ng-container>
<ng-template #noMinisry>
<mat-option disabled>No Ministry found</mat-option>
</ng-template>
</mat-autocomplete>

<mat-error *ngIf="controls['ministry'].errors?.['required']">Center is required.</mat-error>
</mat-form-field>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {
ORG_NAME_PATTERN = /^[a-zA-Z0-9 ().,@\-\$\/\\:\[\]!\s]*$/

untilDestroyed$ = new Subject<void>();
isMatcompleteOpened = false;
EXCLUDED_MINISRIES: string[] = []
constructor(
private formBuilder: FormBuilder,
private snackBar: MatSnackBar,
Expand All @@ -59,6 +61,9 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {

ngOnInit(): void {
this.loggedInUserId = _.get(this.activatedRoute, 'snapshot.parent.data.configService.userProfile.userId')
this.EXCLUDED_MINISRIES = this.activatedRoute.snapshot.parent ?
this.activatedRoute.snapshot.parent?.data?.pageData?.data?.excludedOrganizationsSborgId : []

this.initialization()
if (this.openMode === 'editMode') {
this.getOrganization(this.rowData.organisation, this.rowData.type.toLowerCase())
Expand All @@ -80,8 +85,11 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {
this.statesList = _.get(this.dropdownList, 'statesList', [])
this.filteredStates = [...this.statesList]

this.ministriesList = _.get(this.dropdownList, 'ministriesList', [])
this.ministriesList = _.get(this.dropdownList, 'ministriesList', []).filter(
(ministry: any) => !this.EXCLUDED_MINISRIES.includes(ministry?.sbOrgId)
)
this.filteredMinistry = [...this.ministriesList]

}

this.organisationForm = this.formBuilder.group({
Expand Down Expand Up @@ -302,7 +310,6 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {

onSelectStateMinistry(org: any) {
this.getOrganization(org.orgName, this.controls['category'].value)

}

uploadOrganizationLogo() {
Expand All @@ -326,4 +333,16 @@ export class CreateOrganisationComponent implements OnInit, OnDestroy {
}
})
}

onkeyDown(_event: any) {
return this.isMatcompleteOpened
}

onAutoCompleteOpened() {
this.isMatcompleteOpened = true
}

onAutoCompleteClosed() {
this.isMatcompleteOpened = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<div class="wrapper-card py-4 px-12 rounded-lg mt-4">
<div class="flex justify-between">
<div class="qr-scanner-cont">
<img [src]="customRegistrationLinks?.qrRegistrationLink" alt="qr-scanner" width="180"
<img [src]="customRegistrationLinks?.qrRegistrationLogoPath" alt="qr-scanner" width="180"
height="180">
</div>
<div class="flex flex-column items-center justify-center gap-2">
Expand All @@ -117,7 +117,7 @@
<div class="wrapper-card p-4 rounded-lg mt-4">
<div class="flex gap-4 items-center">
<img src="/assets/icons/users.svg" alt="users" width="32" height="32">
<span class="text-sm">Number of Users Onboarded: <strong
<span class="text-sm">Users Onboarded via Custom URL: <strong
class="ml-1">{{numberOfUsersOnboarded}}</strong></span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export class CustomSelfRegistrationComponent implements OnInit, OnDestroy {
this.selfRegistrationForm.get('endDate')?.setValue(new Date(this.latestRegisteredData.endDate))
this.customRegistrationLinks = {
registrationLink: this.latestRegisteredData.url,
qrRegistrationLink: this.getQRCodePath(this.latestRegisteredData),
qrRegistrationLink: this.latestRegisteredData.qrCodeImagePath?.replace('portal', 'spv'),
qrRegistrationLogoPath: this.getQRCodePath(this.latestRegisteredData),

}
this.numberOfUsersOnboarded = this.latestRegisteredData.numberOfUsersOnboarded
Expand Down Expand Up @@ -119,7 +120,8 @@ export class CustomSelfRegistrationComponent implements OnInit, OnDestroy {

this.customRegistrationLinks = {
registrationLink: response.result.registrationLink,
qrRegistrationLink: this.getQRCodePath(response.result),
qrRegistrationLink: response.result?.qrRegistrationLink.replace('portal', 'spv'),
qrRegistrationLogoPath: response.result?.qrCodeLogoPath.replace('portal', 'spv'),
}
this.latestRegisteredData.status = 'active'

Expand Down Expand Up @@ -148,18 +150,18 @@ export class CustomSelfRegistrationComponent implements OnInit, OnDestroy {
}

getQRCodePath(response: any) {
if (response && response.qrLogoPath) {
if (response && response?.qrLogoPath) {
return response.qrLogoPath.replace('portal', 'spv')
}
else if (response && response.qrRegistrationLink) {
return response.qrRegistrationLink.replace('portal', 'spv')
}
else if (response && response.qrLogoFilePath) {
return response.qrLogoFilePath.replace('portal', 'spv')
else if (response && response?.qrCodeLogoPath) {
return response.qrCodeLogoPath.replace('portal', 'spv')
}
else if (response && response.qrCodeImagePath) {
else if (response && response?.qrCodeImagePath) {
return response.qrCodeImagePath.replace('portal', 'spv')
}
else if (response && response?.qrRegistrationLink) {
return response.qrRegistrationLink.replace('portal', 'spv')
}
}

addOverflowHidden() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
class="example-table table1 responsiveTable">

<ng-container matColumnDef="{{col.key}}" *ngFor="let col of tableData!.columns">
<mat-header-cell *matHeaderCellDef mat-sort-header> {{col.displayName}} </mat-header-cell>
<mat-cell *matCellDef="let element" (click)="selection.toggle(element); onRowClick(element)">
<mat-header-cell *matHeaderCellDef mat-sort-header
[ngClass]="{'organization-table': selectedDepartment === 'organisation'}"> {{col.displayName}}
</mat-header-cell>
<mat-cell *matCellDef="let element" (click)="selection.toggle(element); onRowClick(element)"
[ngClass]="{'organization-table': selectedDepartment === 'organisation'}">
<span *ngIf="col.isList" class="textclass"
[matTooltip]="(element[col.key]).split('<br />').join(', ')">
<div innerHTML="{{element[col.key]}}"></div>
Expand All @@ -45,8 +48,11 @@
</mat-cell>
</ng-container>
<ng-container matColumnDef="Actions" *ngIf="tableData!.actions && tableData!.actions.length > 0">
<mat-header-cell *matHeaderCellDef class="clr-darkish-blue action-header"> Actions </mat-header-cell>
<mat-cell *matCellDef="let row" class="action-cell">
<mat-header-cell *matHeaderCellDef class="clr-darkish-blue action-header"
[ngClass]="{'organization-table': selectedDepartment === 'organisation'}"> Actions
</mat-header-cell>
<mat-cell *matCellDef="let row" class="action-cell"
[ngClass]="{'organization-table': selectedDepartment === 'organisation'}">
<div *ngFor="let ac of tableData!.actions">
<ng-container *ngIf="ac.type === 'button'">
<div *ngIf="ac.optional">
Expand Down Expand Up @@ -75,7 +81,8 @@
Access</button>
<button mat-menu-item (click)="goToRoute('mentormanage', row)">Mentor
Management</button>
<button mat-menu-item (click)="goToRoute('designation_master', row)">Manage
<button mat-menu-item (click)="goToRoute('designation_master', row)"
*ngIf="needCreate">Manage
Designations</button>
<!-- <button mat-menu-item
(click)="goToRoute('grade_setting', row)">Grades/Group</button> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ $title-line-count: 2;
margin-left: unset !important;
}

::ng-deep .mat-column-Actions, .mat-column-type {
::ng-deep .organization-table.mat-column-Actions, .organization-table.mat-column-type {
width: 90px;
flex: none;
}
Expand All @@ -729,4 +729,9 @@ $title-line-count: 2;
@media (max-width: 1280px) {
width: 230px;
}
}

::ng-deep .mat-column-mdo {
width: 450px;
flex: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,16 @@ export class UIDirectoryTableComponent implements OnInit, AfterViewInit, OnChang
this.showNewNoContent = this.tableData?.showNewNoContent ? true : false
this.dataSource.data = _.get(data, 'data.currentValue', [])
this.length = this.tableData.tableDataCount

// this.paginator.firstPage()
if (this.dataSource && this.dataSource.data && this.dataSource.data.length > 0) {
this.tableData.loader = false
}

else if (this.dataSource && this.dataSource.data && this.dataSource.data.length === 0 && this.getFilterValue) {
this.tableData.loader = false
}
if (data && data['selectedDepartment']) {
this.pageIndex = 0
}
}
ngAfterViewInit() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@
<div class="no-information-found" *ngIf="dataSource.filteredData.length===0">No data found
</div>
</div>
<mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
[showFirstLastButtons]="showFirstLastButtonsFlag">
</mat-paginator>
<div class="flex flex-row justify-center" *ngIf="totalRecords">
<mat-paginator [pageSize]="pageSize" [length]="totalRecords" [pageSizeOptions]="[20,30,40]"
(page)="onChangePage($event)" showFirstLastButtons="showFirstLastButtonsFlag"></mat-paginator>

</div>
</div>

<mat-menu #cardMenu="matMenu">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { UserPopupComponent } from '../user-popup/user-popup'
import { CreateMDOService as MDO2 } from '../../../routes/home/services/create-mdo.services'
import { EventService } from '@sunbird-cb/utils'
import { environment } from '../../../../../../../../src/environments/environment'
import { PageEvent } from '@angular/material/paginator'

@Component({
selector: 'ws-widget-ui-user-table',
Expand All @@ -32,13 +33,15 @@ export class UIAdminUserTableComponent implements OnInit, AfterViewInit, OnChang
@Input() isCreate?: boolean
@Input() otherInput?: any
@Input() totalDataRecords?: any
@Input() totalRecords?: any = 0
@Input() currentTabData!: string
@Input() inputDepartmentId?: string | undefined
@Input() showFirstLastButtonsFlag = false
@Output() clicked?: EventEmitter<any>
@Output() actionsClick?: EventEmitter<any>
@Output() eOnRowClick = new EventEmitter<any>()
@Output() searchByEnterKey = new EventEmitter<any>()
@Output() paginationData = new EventEmitter()
bodyHeight = document.body.clientHeight - 125
displayedColumns: IColums[] | undefined
viewPaginator = false
Expand All @@ -62,6 +65,9 @@ export class UIAdminUserTableComponent implements OnInit, AfterViewInit, OnChang
reportsPath: any
orgName!: string
subOrgType: string = ''
startIndex = 0
lastIndex = 20
searchText: string = ''
constructor(
private router: Router, public dialog: MatDialog,
private activatedRoute: ActivatedRoute,
Expand Down Expand Up @@ -167,6 +173,11 @@ export class UIAdminUserTableComponent implements OnInit, AfterViewInit, OnChang
}
return ''
}
onChangePage(pe: PageEvent): void {
this.startIndex = (pe.pageIndex) * pe.pageSize // Calculate offset
this.lastIndex = pe.pageSize
this.searchByEnterKey.emit({ query: (this.searchText) ? this.searchText : '', limit: pe.pageSize, offset: this.startIndex })
}
openPopup() {
const dialogRef = this.dialog.open(UserPopupComponent, {
maxHeight: 'auto',
Expand Down Expand Up @@ -261,12 +272,24 @@ export class UIAdminUserTableComponent implements OnInit, AfterViewInit, OnChang
createDept: JSON.stringify(this.otherInput),
orgName: this.orgName,
redirectionPath: window.location.href,
subOrgType: this.subOrgType && this.subOrgType.toLowerCase() === 'ministry' ? 'mdo' : 'state'
subOrgType: this.getSubOrgType()

},
})
}

getSubOrgType(): string {
const subOrgTypeLowerCase = this.subOrgType?.toLowerCase()
switch (subOrgTypeLowerCase) {
case 'ministry':
return 'mdo'
case 'state':
return 'state'
default:
return 'cbp-providers'
}
}

gotoCreatePosition() {
this.raiseTelemetry('button')
this.router.navigate([`/app/home/requests/positions/new`],
Expand All @@ -287,6 +310,7 @@ export class UIAdminUserTableComponent implements OnInit, AfterViewInit, OnChang
}

onSearchEnter(event: any) {
this.searchText = event.target.value
this.searchByEnterKey.emit(event.target.value)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ export class RolesAccessComponent implements OnInit, AfterViewInit {
// this.currentDept = params['currentDept']
this.currentDept = params['subOrgType']
})
if (this.currentDept === 'CBP Providers' || this.currentDept === 'cbp-providers') {
this.currentDept = 'CBP'
}
else if (this.currentDept && this.currentDept.toLowerCase() === 'ministry') this.currentDept = 'mdo'
// if (this.currentDept === 'CBP Providers' || this.currentDept === 'cbp-providers') {
// this.currentDept = 'CBP'
// }
if (this.currentDept && this.currentDept.toLowerCase() === 'ministry') this.currentDept = 'mdo'
else if (this.currentDept && this.currentDept.toLowerCase() === 'state') this.currentDept = 'state'
else this.currentDept = 'CBP'

}

Expand Down
Loading

0 comments on commit b169538

Please sign in to comment.