Skip to content

Commit

Permalink
Merge pull request #490 from NandiniAV/cbrelease-4.8.14
Browse files Browse the repository at this point in the history
Cbrelease 4.8.14
  • Loading branch information
vishnubansaltarento authored May 30, 2024
2 parents 2c0be80 + 2c74c1e commit 0351cea
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
cancel</mat-icon>
</div>
<div class="md:w-1/3">
<label class="margin-remove-bottom form-label required">Designation</label>
<label class="margin-remove-bottom form-label">Designation</label>
<mat-form-field appearance="outline">
<mat-select #designation formControlName="designation" i18n-placeholder
placeholder="Select designation"
Expand All @@ -95,10 +95,10 @@
</mat-option>
<mat-option [value]="'Other'">Other</mat-option>
</mat-select>
<mat-error [hidden]="false" i18n="Designation Error | Explains designation is required"
<!-- <mat-error [hidden]="false" i18n="Designation Error | Explains designation is required"
*ngIf="updateUserDataForm?.controls['designation'].errors?.required">
Designation is mandatory
</mat-error>
</mat-error> -->
</mat-form-field>
<mat-icon class="verified-icon margin-left-xs"
*ngIf="user?.profileDetails?.profileStatus === 'VERIFIED'">
Expand All @@ -117,7 +117,7 @@
<div class="md:w-1/3">
<label class="margin-remove-bottom form-label">Employee ID</label>
<mat-form-field appearance="outline">
<input type="text" matInput #employeeID formControlName="employeeID">
<input type="text" matInput #employeeID formControlName="employeeID" maxlength="15">
</mat-form-field>
</div>

Expand Down Expand Up @@ -207,9 +207,9 @@
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker (closed)="dob.blur()" i18n-aria-label aria-label="Date picker">
</mat-datepicker>
<mat-error [hidden]="false" i18n="Date of Birth Error | Explains name is required">
<!-- <mat-error [hidden]="false" i18n="Date of Birth Error | Explains name is required">
Date of birth is mandatory
</mat-error>
</mat-error> -->
</mat-form-field>
</div>

Expand All @@ -223,11 +223,11 @@
i18n-aria-label aria-label="Please choose a value from the list provided above.">
Please choose a value from the list provided above
</mat-error> -->
<mat-error [hidden]="false" i18n="domicileMedium Error|Explains Domicile Medium is required"
<!-- <mat-error [hidden]="false" i18n="domicileMedium Error|Explains Domicile Medium is required"
*ngIf="updateUserDataForm?.controls['domicileMedium'].errors?.required" i18n-aria-label
aria-label="Domicile Medium is mandatory">
Mother Tongue is mandatory
</mat-error>
</mat-error> -->
</mat-form-field>
<mat-autocomplete #motherTongueAuto="matAutocomplete" autoActiveFirstOption="true">
<mat-option *ngFor="let option of masterLanguages | async" [value]="option.name">
Expand All @@ -244,9 +244,9 @@
{{gender}}
</mat-option>
</mat-select>
<mat-error [hidden]="false" i18n="Gender Error | Explains gender is required">
<!-- <mat-error [hidden]="false" i18n="Gender Error | Explains gender is required">
Gender is mandatory
</mat-error>
</mat-error> -->
</mat-form-field>
</div>
</div>
Expand All @@ -258,9 +258,9 @@
<input id="pinCode" #pincode type="text" matInput placeholder="Type here" formControlName="pincode"
i18n-aria-label aria-label="Pin Code input field" autocomplete="off"
(keypress)="numericOnly($event)" maxlength="6">
<mat-error [hidden]="false" i18n="Pin code | Explains pin code is required">
<!-- <mat-error [hidden]="false" i18n="Pin code | Explains pin code is required">
Pin code is mandatory
</mat-error>
</mat-error> -->
</mat-form-field>
</div>

Expand All @@ -279,9 +279,9 @@
{{ctg}}
</mat-option>
</mat-select>
<mat-error [hidden]="false" i18n="Category Error | Explains category is required">
<!-- <mat-error [hidden]="false" i18n="Category Error | Explains category is required">
Category is mandatory
</mat-error>
</mat-error> -->
</mat-form-field>
</div>
</div>
Expand Down Expand Up @@ -430,7 +430,7 @@

<div class="md:w-1/4">
<label class="view-text-label">Mobile Number</label>
<p>+91-{{user.profileDetails && user.profileDetails.personalDetails ?
<p>+91 {{user.profileDetails && user.profileDetails.personalDetails ?
user.profileDetails.personalDetails.mobile : '-'}}</p>
</div>

Expand Down Expand Up @@ -648,7 +648,7 @@

<div class="md:w-1/4">
<label class="view-text-label">Mobile Number</label>
<p>+91-{{appData.user.profileDetails && appData.user.profileDetails.personalDetails ?
<p>+91 {{appData.user.profileDetails && appData.user.profileDetails.personalDetails ?
appData.user.profileDetails.personalDetails.mobile : '-'}}</p>
</div>

Expand Down Expand Up @@ -682,12 +682,12 @@
appData.user.profileDetails.personalDetails.category : '-'}}</p>
</div>

<div class="md:w-1/4">
<!-- <div class="md:w-1/4">
<label class="view-text-label">Pay Band</label>
<p>{{appData.user.profileDetails && appData.user.profileDetails.employmentDetails &&
appData.user.profileDetails.employmentDetails.payType ?
appData.user.profileDetails.employmentDetails.payType : '-'}}</p>
</div>
</div> -->
</div>
<div class="flex flex-row margin-top-m">
<div class="md:w-1/4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export class UserCardComponent implements OnInit, OnChanges {
emailRegix = `^[\\w\-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$`
pincodePattern = '(^[0-9]{6}$)'
yearPattern = '(^[0-9]{4}$)'
empIDPattern = `/^[a-z0-9]+$/i`

userGroup: any

Expand All @@ -111,9 +112,9 @@ export class UserCardComponent implements OnInit, OnChanges {
private route: ActivatedRoute, private snackBar: MatSnackBar,
private events: EventService) {
this.updateUserDataForm = new FormGroup({
designation: new FormControl('', [Validators.required]),
designation: new FormControl('', []),
group: new FormControl('', [Validators.required]),
employeeID: new FormControl('', []),
employeeID: new FormControl('', [Validators.pattern(this.empIDPattern)]),
ehrmsID: new FormControl({ value: '', disabled: true }, []),
dob: new FormControl('', []),
primaryEmail: new FormControl('', [Validators.required, Validators.email, Validators.pattern(this.emailRegix)]),
Expand Down Expand Up @@ -364,15 +365,28 @@ export class UserCardComponent implements OnInit, OnChanges {
}

onEditUser(user: any, pnael: any) {
pnael.open()
user.enableEdit = !user.enableEdit
this.setUserDetails(user)
this.mapRoles(user)
let userval = user
this.usersSvc.getUserById(user.userId).subscribe((res: any) => {
if (res) {
userval = res
this.usersData.forEach((u: any) => {
if (u.userId === user.userId) {
u.enableEdit = true
userval.enableEdit = true
} else {
u.enableEdit = false
}
})

pnael.open()
this.setUserDetails(userval)
}
})
}

getUerData(user: any, data: any) {
user.enableEdit = false
const profileDataAll = user
let profileDataAll = user
this.userStatus = profileDataAll.isDeleted ? 'Inactive' : 'Active'

const profileData = profileDataAll.profileDetails
Expand All @@ -384,7 +398,13 @@ export class UserCardComponent implements OnInit, OnChanges {
this.comment = ''
this.getApprovalList(data)
} else {
this.mapRoles(user)
this.usersSvc.getUserById(user.userId).subscribe((res: any) => {
if (res) {
profileDataAll = res
profileDataAll.enableEdit = false
this.mapRoles(profileDataAll)
}
})
}
}

Expand All @@ -410,10 +430,10 @@ export class UserCardComponent implements OnInit, OnChanges {
const usrRoles = user.organisations[0] && user.organisations[0].roles
? user.organisations[0].roles : []
if (usrRoles.length > 0) {
this.updateUserDataForm.controls['roles'].setValue(usrRoles)
usrRoles.forEach((role: any) => {
this.orguserRoles.push(role)
this.modifyUserRoles(role)
this.updateUserDataForm.controls['roles'].setValue(usrRoles)
})
}
} else {
Expand Down Expand Up @@ -480,6 +500,7 @@ export class UserCardComponent implements OnInit, OnChanges {
this.updateUserDataForm.controls['employeeID'].setValue(user.profileDetails.employmentDetails.employeeCode)
}
}
this.mapRoles(user)
}
}

Expand Down Expand Up @@ -574,9 +595,6 @@ export class UserCardComponent implements OnInit, OnChanges {

onSubmit(form: any, user: any, panel: any) {
if (form.valid) {
// const tags = user.profileDetails && user.profileDetails.additionalProperties && user.profileDetails.additionalProperties.tags ?
// user.profileDetails.additionalProperties.tags : []
// if (tags !== this.selectedtags) {
this.reqbody = {
request: {
userId: user.userId,
Expand Down Expand Up @@ -604,20 +622,6 @@ export class UserCardComponent implements OnInit, OnChanges {
},
},
}
// } else {
// this.reqbody = {
// request: {
// userId: user.userId,
// profileDetails: {
// professionalDetails: [
// {
// designation: this.updateUserDataForm.controls['designation'].value,
// },
// ],
// },
// },
// }
// }
this.usersSvc.updateUserDetails(this.reqbody).subscribe(dres => {
if (dres) {
if (this.isMdoLeader) {
Expand All @@ -638,15 +642,6 @@ export class UserCardComponent implements OnInit, OnChanges {
panel.close()
this.updateList.emit()
this.searchByEnterKey.emit('')
// this.router.navigate(['/app/home/users/allusers'])

// this.usersSvc.getUserById(user.userId).subscribe((_res: any) => {
// if (_res) {
// // tslint:disable-next-line
// user = _res
// user['enableEdit'] = false
// }
// })
}
})
} else {
Expand All @@ -658,13 +653,6 @@ export class UserCardComponent implements OnInit, OnChanges {
panel.close()
this.updateList.emit()
this.openSnackbar('User updated Successfully')
// this.usersSvc.getUserById(user.userId).subscribe((res: any) => {
// if (res) {
// // tslint:disable-next-line
// user = res
// user.enableEdit = false
// }
// })
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<ws-widget-user-card [userId]="currentUser" [currentFilter]="currentFilter" [usersData]="activeUsersData"
[totalRecords]="activeUsersDataCount" [tabChangeIndex]="pageIndex" [isApprovals]="false"
(searchByEnterKey)="onEnterkySearch($event)" (paginationData)="onPaginateChange($event)"
(updateList)="getUsers('')"></ws-widget-user-card>
(updateList)="getAllUsers('')"></ws-widget-user-card>
</ng-container>
<ng-container *ngIf="currentFilter === 'verified'">
<ws-widget-user-card [userId]="currentUser" [currentFilter]="currentFilter" [usersData]="verifiedUsersData"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ export class UsersViewComponent implements OnInit, OnDestroy {
this.usersService.getAllKongUsers(filtreq, this.limit, this.pageIndex, query).subscribe((data: any) => {
const allusersData = data.result.response
this.activeUsersData = allusersData.content
this.activeUsersDataCount = data.result.response.count
this.activeUsersData = this.activeUsersData.filter((wf: any) => wf.profileDetails.profileStatus !== 'NOT-MY-USER')
// if (allusersData.count > this.activeUsersData.length) {
// const count = allusersData.count - this.activeUsersData.length
// this.activeUsersDataCount = allusersData.count - count
// } else {
this.activeUsersDataCount = allusersData.count
// }
})
}
async getVUsers(query: string) {
Expand Down
23 changes: 23 additions & 0 deletions project/ws/app/src/lib/routes/users/services/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const API_END_POINTS = {
GET_GROUPS: '/api/user/v1/groups',
getMasterNationlity: '/apis/protected/v8/user/profileRegistry/getMasterNationalities',
editProfileDetails: '/apis/proxies/v8/user/v1/extPatch',
getPendingFields: '/apis/proxies/v8/workflow/v2/userWFApplicationFieldsSearch',
getApprovalPendingFields: '/apis/proxies/v8/workflow/v2/userWFApplicationFieldsSearch',
}

@Injectable()
Expand Down Expand Up @@ -238,4 +240,25 @@ export class UsersService {
editProfileDetails(data: any) {
return this.http.post<any>(API_END_POINTS.editProfileDetails, data)
}

listApprovalPendingFields() {
return this.http.post<any>(API_END_POINTS.getPendingFields, {
serviceName: 'profile',
applicationStatus: 'SEND_FOR_APPROVAL',
})
}

fetchApprovalPendingFields() {
return this.http.post<any>(API_END_POINTS.getApprovalPendingFields, {
serviceName: 'profile',
applicationStatus: 'SEND_FOR_APPROVAL',
})
}

listRejectedFields() {
return this.http.post<any>(API_END_POINTS.getPendingFields, {
serviceName: 'profile',
applicationStatus: 'REJECTED',
})
}
}

0 comments on commit 0351cea

Please sign in to comment.