diff --git a/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.ts b/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.ts index 1bad5f063..4cf499ed7 100644 --- a/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.ts +++ b/project/ws/app/src/lib/routes/home/components/request-list/create-request-form/create-request-form.component.ts @@ -156,16 +156,16 @@ export class CreateRequestFormComponent implements OnInit { this.selectRequestType(this.requestObjData.requestType) if (this.filteredRequestType) { if (this.requestObjData.preferredProvider && this.requestObjData.preferredProvider.length) { - const prefferedData = this.filteredRequestType.filter(option => - this.requestObjData.preferredProvider.some((res: any) => - res.providerId === option.id + const prefferedData = this.filteredRequestType.filter(option => + this.requestObjData.preferredProvider.some((res: any) => + res.providerId === option.id + ) ) - ) - if (prefferedData && prefferedData.length) { - this.requestForm.controls['providers'].setValue(prefferedData) + if (prefferedData && prefferedData.length) { + this.requestForm.controls['providers'].setValue(prefferedData) + } } } - } if (this.filteredAssigneeType) { if (this.requestObjData.assignedProvider) { @@ -254,6 +254,7 @@ export class CreateRequestFormComponent implements OnInit { filters: { isCbp: true, }, + limit: 1000, }, } this.homeService.getRequestTypeList(requestObj).subscribe(data => { diff --git a/project/ws/app/src/lib/routes/home/components/request-list/single-assign-popup/single-assign-popup.component.ts b/project/ws/app/src/lib/routes/home/components/request-list/single-assign-popup/single-assign-popup.component.ts index 56daadcab..ee465cafa 100644 --- a/project/ws/app/src/lib/routes/home/components/request-list/single-assign-popup/single-assign-popup.component.ts +++ b/project/ws/app/src/lib/routes/home/components/request-list/single-assign-popup/single-assign-popup.component.ts @@ -24,7 +24,7 @@ export class SingleAssignPopupComponent implements OnInit { submitAssign = '' requestTypeData: any[] = [] filterRequestData: any[] = [] - isDisable = false + isDisable = false // @ViewChild(MatPaginator, { static: false }) paginator!: MatPaginator; dataSource = new MatTableDataSource([]) @ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | null = null @@ -55,9 +55,9 @@ export class SingleAssignPopupComponent implements OnInit { this.getOrgListData() if (this.configService['confService'].userProfile || this.configService['confService'].userProfileV2) { this.fullProfile = this.configService['confService'].userProfile ? - this.configService['confService'].userProfile - : this.configService['confService'].userProfileV2 - this.userId = this.fullProfile.userId + this.configService['confService'].userProfile + : this.configService['confService'].userProfileV2 + this.userId = this.fullProfile.userId } } @@ -83,7 +83,7 @@ export class SingleAssignPopupComponent implements OnInit { this.requestTypeData.unshift(selectedData) } } - } + } getOrgListData() { const requestObj = { @@ -91,6 +91,7 @@ export class SingleAssignPopupComponent implements OnInit { filters: { isCbp: true, }, + limit: 1000, }, } this.homeService.getRequestTypeList(requestObj).subscribe(data => { @@ -104,7 +105,7 @@ export class SingleAssignPopupComponent implements OnInit { } }) - } + } // searchText(event:any){ // this.requestForm.controls['orgSearch'].valueChanges.subscribe((newValue: any) => { @@ -124,9 +125,9 @@ export class SingleAssignPopupComponent implements OnInit { this.pageNumber = event.pageIndex this.pageSize = event.pageSize this.getOrgListData() - } + } - onSubmitAssign() { + onSubmitAssign() { const selectedProvider = this.requestForm.value.assignee let assigneeProvider: any if (this.requestForm.value.assignee) { @@ -137,19 +138,19 @@ export class SingleAssignPopupComponent implements OnInit { } if (selectedProvider) { const request = { - title: this.data.title, - objective: this.data.objective, - typeOfUser: this.data.typeOfUser, - // learningMode: this.requestForm.value.learningMode.toLowerCase(), - competencies: this.data.competencies, - referenceLink: this.data.referenceLink, - requestType: this.data.requestType, - preferredProvider: this.data.preferredProvider, - assignedProvider: assigneeProvider, - status: this.data.status, - source: this.data.owner, - demand_id: this.data.demand_id, - learningMode: this.data.learningMode, + title: this.data.title, + objective: this.data.objective, + typeOfUser: this.data.typeOfUser, + // learningMode: this.requestForm.value.learningMode.toLowerCase(), + competencies: this.data.competencies, + referenceLink: this.data.referenceLink, + requestType: this.data.requestType, + preferredProvider: this.data.preferredProvider, + assignedProvider: assigneeProvider, + status: this.data.status, + source: this.data.owner, + demand_id: this.data.demand_id, + learningMode: this.data.learningMode, // assignedBy: this.userId, } this.homeService.createDemand(request).subscribe((res: any) => { @@ -158,10 +159,10 @@ export class SingleAssignPopupComponent implements OnInit { } }, (error: any) => { - this.dialogRef.close({ error }) + this.dialogRef.close({ error }) } - ) + ) } else { } } diff --git a/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.html b/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.html index 32fe10925..9bf24d096 100644 --- a/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.html +++ b/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.html @@ -16,13 +16,17 @@
- + {{user?.profileDetails?.personalDetails?.firstname}} + + {{user?.profileDetails?.personalDetails?.firstName}} + {{user?.firstName}} -
CSV file logo
-
Upload csv format file only
+
Upload xlsx format file only
Browse files
+ name="file" placeholder="Choose file" (dblclick)="$event.preventDefault();" accept=".xlsx, .xls" />
Max file size: 100 MB
-
Supported file types: csv
+
Supported file types: xlsx
diff --git a/project/ws/app/src/lib/routes/home/routes/reports-section/reports-section.component.ts b/project/ws/app/src/lib/routes/home/routes/reports-section/reports-section.component.ts index 9a47326d3..93f6f1f92 100644 --- a/project/ws/app/src/lib/routes/home/routes/reports-section/reports-section.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/reports-section/reports-section.component.ts @@ -333,9 +333,9 @@ export class ReportsSectionComponent implements OnInit { openVideoPopup() { let url = '' if (this.configSvc && this.userDetails.roles.includes('MDO_LEADER')) { - url = `${environment.karmYogiPath}/content-store/MDO-leader-reports.MP4` + url = `${environment.karmYogiPath}/assets/public/content/guide-videos/MDO-leader-reports.MP4` } else { - url = `${environment.karmYogiPath}/content-store/MDO-admin-reports.mp4` + url = `${environment.karmYogiPath}/assets/public/content/guide-videos/MDO-admin-reports.mp4` } this.dialog.open(ReportsVideoComponent, { data: { diff --git a/project/ws/app/src/lib/routes/home/routes/users-view/bulk-upload/bulk-upload.component.html b/project/ws/app/src/lib/routes/home/routes/users-view/bulk-upload/bulk-upload.component.html index 86ea1bc48..bfadb3952 100644 --- a/project/ws/app/src/lib/routes/home/routes/users-view/bulk-upload/bulk-upload.component.html +++ b/project/ws/app/src/lib/routes/home/routes/users-view/bulk-upload/bulk-upload.component.html @@ -25,18 +25,18 @@ (dblclick)="$event.preventDefault()"> CSV file logo -
Upload csv format file only
+
Upload xlsx format file only
Browse files
+ name="file" placeholder="Choose file" (dblclick)="$event.preventDefault();" accept=".xlsx, .xls" />
Max file size: 100 MB
-
Supported file types: csv
+
Supported file types: xlsx
diff --git a/project/ws/app/src/lib/routes/home/routes/users-view/users-view.component.ts b/project/ws/app/src/lib/routes/home/routes/users-view/users-view.component.ts index 245dca131..f76debc60 100644 --- a/project/ws/app/src/lib/routes/home/routes/users-view/users-view.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/users-view/users-view.component.ts @@ -53,6 +53,7 @@ export class UsersViewComponent implements OnInit, OnDestroy { notmyuserUsersDataCount?: number | 0 content: NsContent.IContent = {} as NsContent.IContent isMdoAdmin = false + userList: any = [] reportsNoteList: string[] = [] @@ -233,21 +234,48 @@ export class UsersViewComponent implements OnInit, OnDestroy { }, } this.usersService.getAllKongUsers(reqBody).subscribe((data: any) => { - const allusersData = data.result.response - this.activeUsersData = allusersData.content - // this.activeUsersData = this.activeUsersData.filter((wf: any) => wf.profileDetails.profileStatus !== 'NOT-MY-USER') - this.activeUsersDataCount = allusersData.count - this.filterFacets = allusersData.facets ? allusersData.facets : [] - - // const i = this.activeUsersData.findIndex((wf: any) => wf.userId === this.currentUser) - // if (i > -1) { - // this.activeUsersData.splice(i, 1) - // allusersData.count = allusersData.count - 1 - // } - - // if (this.notmyuserUsersDataCount && allusersData.count > this.notmyuserUsersDataCount) { - // this.activeUsersDataCount = allusersData.count - this.notmyuserUsersDataCount - // } + const allusersData = data && data.result && data.result.response + const userContent = allusersData.content + const searchText = this.getSearchText(query).toLowerCase() + if (searchText && searchText.length && searchText.length > 0) { + const userData: any = [] + if (data && data.result && data.result.response && data.result.response.count && + data.result.response.count > 0) { + if (userContent && userContent.length > 0) { + // userContent.forEach((element: any) => { + for (const element of userContent) { + const userMail = element && element.profileDetails && element.profileDetails.personalDetails && + element.profileDetails.personalDetails.primaryEmail && + element.profileDetails.personalDetails.primaryEmail.toLowerCase() + const userName = element && element.firstName && element.firstName.toLowerCase() + const userPhone = element && element.profileDetails && element.profileDetails.personalDetails && + element.profileDetails.personalDetails.mobile + const emailMatch = userMail && userMail.includes(searchText) + const firstNameMatch = userName && userName.includes(searchText) + const phoneMatch = userPhone && userPhone.toString().startsWith(searchText) || userPhone && + userPhone.toString().includes(searchText) + + if (emailMatch || firstNameMatch || phoneMatch) { + userData.push(element) + this.activeUsersData = userData + this.activeUsersDataCount = userData.length + } else { + // this.activeUsersData = [] + // this.activeUsersDataCount = 0 + this.activeUsersData = userData + this.activeUsersDataCount = userData.length + } + } + } + } else { + this.activeUsersData = allusersData.content + this.activeUsersDataCount = allusersData.count + } + + } else { + this.activeUsersData = allusersData.content + this.activeUsersDataCount = allusersData.count + } }) } async getVUsers(query: any) { @@ -289,10 +317,46 @@ export class UsersViewComponent implements OnInit, OnDestroy { }, } this.usersService.getAllKongUsers(reqBody).subscribe((data: any) => { - const allusersData = data.result.response - this.verifiedUsersData = allusersData.content - this.verifiedUsersDataCount = data.result.response.count - this.filterFacets = allusersData.facets ? allusersData.facets : [] + const allusersData = data && data.result && data.result.response + const userContent = allusersData.content + const searchText = this.getSearchText(query).toLowerCase() + if (searchText && searchText.length && searchText.length > 0) { + const userData: any = [] + if (data && data.result && data.result.response && data.result.response.count && + data.result.response.count > 0) { + for (const element of userContent) { + const userMail = element && element.profileDetails && element.profileDetails.personalDetails && + element.profileDetails.personalDetails.primaryEmail && + element.profileDetails.personalDetails.primaryEmail.toLowerCase() + const userName = element && element.firstName && element.firstName.toLowerCase() + const userPhone = element && element.profileDetails && element.profileDetails.personalDetails && + element.profileDetails.personalDetails.mobile + const emailMatch = userMail && userMail.includes(searchText) + const firstNameMatch = userName && userName.includes(searchText) + const phoneMatch = userPhone && userPhone.toString().startsWith(searchText) || userPhone && + userPhone.toString().includes(searchText) + + if (emailMatch || firstNameMatch || phoneMatch) { + userData.push(element) + this.verifiedUsersData = userData + this.verifiedUsersDataCount = userData.length + } else { + this.verifiedUsersData = userData + this.verifiedUsersDataCount = userData.length + } + } + } else { + this.verifiedUsersData = allusersData.content + this.verifiedUsersDataCount = data.result.response.count + } + + } else { + this.verifiedUsersData = allusersData.content + this.verifiedUsersDataCount = data.result.response.count + } + // this.verifiedUsersData = allusersData.content + // this.verifiedUsersDataCount = data.result.response.count + // this.filterFacets = allusersData.facets ? allusersData.facets : [] // if (this.currentUserStatus === 'VERIFIED') { // const i = this.verifiedUsersData.findIndex((wf: any) => wf.userId === this.currentUser) @@ -343,10 +407,10 @@ export class UsersViewComponent implements OnInit, OnDestroy { }, } this.usersService.getAllKongUsers(reqBody).subscribe((data: any) => { - const allusersData = data.result.response - this.nonverifiedUsersData = allusersData.content - this.nonverifiedUsersDataCount = data.result.response.count - this.filterFacets = allusersData.facets ? allusersData.facets : [] + const allusersData = data && data.result && data.result.response + // this.nonverifiedUsersData = allusersData.content + // this.nonverifiedUsersDataCount = data.result.response.count + // this.filterFacets = allusersData.facets ? allusersData.facets : [] // if (this.currentUserStatus === 'NOT-VERIFIED') { // const i = this.nonverifiedUsersData.findIndex((wf: any) => wf.userId === this.currentUser) @@ -356,6 +420,42 @@ export class UsersViewComponent implements OnInit, OnDestroy { // this.nonverifiedUsersDataCount - 1 : this.nonverifiedUsersDataCount // } // } + const userContent = allusersData.content + const searchText = this.getSearchText(query).toLowerCase() + if (searchText && searchText.length && searchText.length > 0) { + const userData: any = [] + if (data && data.result && data.result.response && data.result.response.count && + data.result.response.count > 0) { + for (const element of userContent) { + const userMail = element && element.profileDetails && element.profileDetails.personalDetails && + element.profileDetails.personalDetails.primaryEmail && + element.profileDetails.personalDetails.primaryEmail.toLowerCase() + const userName = element && element.firstName && element.firstName.toLowerCase() + const userPhone = element && element.profileDetails && element.profileDetails.personalDetails && + element.profileDetails.personalDetails.mobile + const emailMatch = userMail && userMail.includes(searchText) + const firstNameMatch = userName && userName.includes(searchText) + const phoneMatch = userPhone && userPhone.toString().startsWith(searchText) || userPhone && + userPhone.toString().includes(searchText) + + if (emailMatch || firstNameMatch || phoneMatch) { + userData.push(element) + this.nonverifiedUsersData = userData + this.nonverifiedUsersDataCount = userData.length + } else { + this.nonverifiedUsersData = userData + this.nonverifiedUsersDataCount = userData.length + } + } + } else { + this.nonverifiedUsersData = allusersData.content + this.nonverifiedUsersDataCount = data.result.response.count + } + + } else { + this.nonverifiedUsersData = allusersData.content + this.nonverifiedUsersDataCount = data.result.response.count + } }) } @@ -398,10 +498,46 @@ export class UsersViewComponent implements OnInit, OnDestroy { }, } this.usersService.getAllKongUsers(reqBody).subscribe((data: any) => { - const allusersData = data.result.response - this.notmyuserUsersData = allusersData.content - this.notmyuserUsersDataCount = data.result.response.count - this.filterFacets = allusersData.facets ? allusersData.facets : [] + const allusersData = data && data.result && data.result.response + // this.notmyuserUsersData = allusersData.content + // this.notmyuserUsersDataCount = data.result.response.count + // this.filterFacets = allusersData.facets ? allusersData.facets : [] + const userContent = allusersData.content + const searchText = this.getSearchText(query).toLowerCase() + if (searchText && searchText.length && searchText.length > 0) { + const userData: any = [] + if (data && data.result && data.result.response && data.result.response.count && + data.result.response.count > 0) { + for (const element of userContent) { + const userMail = element && element.profileDetails && element.profileDetails.personalDetails && + element.profileDetails.personalDetails.primaryEmail && + element.profileDetails.personalDetails.primaryEmail.toLowerCase() + const userName = element && element.firstName && element.firstName.toLowerCase() + const userPhone = element && element.profileDetails && element.profileDetails.personalDetails && + element.profileDetails.personalDetails.mobile + const emailMatch = userMail && userMail.includes(searchText) + const firstNameMatch = userName && userName.includes(searchText) + const phoneMatch = userPhone && userPhone.toString().startsWith(searchText) || userPhone && + userPhone.toString().includes(searchText) + + if (emailMatch || firstNameMatch || phoneMatch) { + userData.push(element) + this.notmyuserUsersData = userData + this.notmyuserUsersDataCount = userData.length + } else { + this.notmyuserUsersData = userData + this.notmyuserUsersDataCount = userData.length + } + } + } else { + this.notmyuserUsersData = allusersData.content + this.notmyuserUsersDataCount = data.result.response.count + } + + } else { + this.notmyuserUsersData = allusersData.content + this.notmyuserUsersDataCount = data.result.response.count + } }) }