Skip to content

Commit

Permalink
Merge pull request #515 from sunbird-cb/cbrelease-4.8.14
Browse files Browse the repository at this point in the history
Cbrelease 4.8.14 to 4.8.15
  • Loading branch information
vishnubansaltarento authored Jun 10, 2024
2 parents 4f2802f + 6b3b2b9 commit e3af174
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@
<input class="appr-text-field w-full-imp" #tags matInput i18n-placeholder="Type here"
placeholder="Type here" formControlName="tags" i18n-aria-label aria-label="Type here"
[matChipInputFor]="chipListTags" autocomplete="off" maxlength="100"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="addActivity($event)" />
[matChipInputSeparatorKeyCodes]="separatorKeysCodes" (matChipInputTokenEnd)="addActivity($event)"
maxlength="100" />
</div>
</div>
<div class="right-input-div">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,13 @@ export class UserCardComponent implements OnInit, OnChanges {
},
// tslint:disable-next-line: align
(err: { error: any }) => {
this.openSnackbar(err.error.params.errmsg)
if (err.error.params.errmsg && err.error.params.errmsg !== 'null') {
this.openSnackbar(err.error.params.errmsg)
panel.close()
} else {
this.openSnackbar('Error in updating user')
panel.close()
}
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const MY_FORMATS = {
},
}

const EMAIL_PATTERN = /^[a-zA-Z0-9](\.?[a-zA-Z0-9_]+)*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
// const EMAIL_PATTERN = /^[a-zA-Z0-9](\.?[a-zA-Z0-9_]+)*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
const MOBILE_PATTERN = /^[0]?[6789]\d{9}$/
const PIN_CODE_PATTERN = /^[1-9][0-9]{5}$/

Expand All @@ -49,8 +49,9 @@ export class SingleUserCreationComponent implements OnInit, AfterViewInit, OnDes
rolesArr: string[] = []
fullProfile: any
namePatern = `^[a-zA-Z\\s\\']{1,50}$`
emailRegix = `^[\\w\-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$`
userCreationForm = this.formBuilder.group({
email: new FormControl('', [Validators.required, Validators.pattern(EMAIL_PATTERN)]),
email: new FormControl('', [Validators.required, Validators.pattern(this.emailRegix)]),
firstName: new FormControl('', [Validators.required, Validators.pattern(this.namePatern)]),
phone: new FormControl('', [Validators.required, Validators.pattern(MOBILE_PATTERN), Validators.minLength(10)]),
channel: new FormControl(''),
Expand Down Expand Up @@ -220,7 +221,7 @@ export class SingleUserCreationComponent implements OnInit, AfterViewInit, OnDes
handleValidTags(event: any): any {
const charCode = event.charCode
// tslint:disable-next-line
return ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || charCode == 8 || charCode == 32 || (charCode >= 48 && charCode <= 57))
return ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || charCode == 8 || charCode == 32)
}

handleRemoveTag(tag: any): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ export class UsersViewComponent implements OnInit, OnDestroy {
this.activeUsersData = allusersData.content
this.activeUsersData = this.activeUsersData.filter((wf: any) => wf.profileDetails.profileStatus !== 'NOT-MY-USER')
this.activeUsersDataCount = allusersData.count
const i = this.activeUsersData.findIndex((wf: any) => wf.userId === this.currentUser)
if (i > -1) {
this.activeUsersData.splice(i, 1)
allusersData.count = allusersData.count - 1
}
// 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
Expand All @@ -227,13 +227,13 @@ export class UsersViewComponent implements OnInit, OnDestroy {
this.verifiedUsersData = allusersData.content
this.verifiedUsersDataCount = data.result.response.count

if (this.currentUserStatus === 'VERIFIED') {
const i = this.verifiedUsersData.findIndex((wf: any) => wf.userId === this.currentUser)
if (i > -1) {
this.verifiedUsersData.splice(i, 1)
this.verifiedUsersDataCount = this.verifiedUsersDataCount ? this.verifiedUsersDataCount - 1 : this.verifiedUsersDataCount
}
}
// if (this.currentUserStatus === 'VERIFIED') {
// const i = this.verifiedUsersData.findIndex((wf: any) => wf.userId === this.currentUser)
// if (i > -1) {
// this.verifiedUsersData.splice(i, 1)
// this.verifiedUsersDataCount = this.verifiedUsersDataCount ? this.verifiedUsersDataCount - 1 : this.verifiedUsersDataCount
// }
// }
})
}

Expand All @@ -249,14 +249,14 @@ export class UsersViewComponent implements OnInit, OnDestroy {
this.nonverifiedUsersData = allusersData.content
this.nonverifiedUsersDataCount = data.result.response.count

if (this.currentUserStatus === 'NOT-VERIFIED') {
const i = this.nonverifiedUsersData.findIndex((wf: any) => wf.userId === this.currentUser)
if (i > -1) {
this.nonverifiedUsersData.splice(i, 1)
this.nonverifiedUsersDataCount = this.nonverifiedUsersDataCount ?
this.nonverifiedUsersDataCount - 1 : this.nonverifiedUsersDataCount
}
}
// if (this.currentUserStatus === 'NOT-VERIFIED') {
// const i = this.nonverifiedUsersData.findIndex((wf: any) => wf.userId === this.currentUser)
// if (i > -1) {
// this.nonverifiedUsersData.splice(i, 1)
// this.nonverifiedUsersDataCount = this.nonverifiedUsersDataCount ?
// this.nonverifiedUsersDataCount - 1 : this.nonverifiedUsersDataCount
// }
// }
})
}

Expand Down
3 changes: 3 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 @@ -127,6 +127,9 @@ export class UsersService {
limit: pageLimit,
offset: offsetNum,
query: searchText,
sort_by: {
firstName: 'asc',
},
},
}
return this.http.post<any>(`${API_END_POINTS.GET_ALL_USERS}`, reqBody)
Expand Down

0 comments on commit e3af174

Please sign in to comment.