Skip to content

Commit

Permalink
Merge pull request #475 from NandiniAV/cbrelease-4.8.14
Browse files Browse the repository at this point in the history
Issue fixes
  • Loading branch information
vishnubansaltarento authored May 24, 2024
2 parents ecb50c9 + 0134b98 commit 6a47828
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Apply Filter <mat-icon class="margin-right-xs">filter_list</mat-icon>
</button>
</div>
<div class="flex flex-end" *ngIf="!isApprovals">
<div class="flex flex-end" *ngIf="!isApprovals && currentFilter === 'allusers'">
<button mat-button type="button" class="search-btn" [routerLink]="['/app/home/user-creation']"
[ngClass]="{'disable': isContentLive}">Create user</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class SearchComponent implements OnInit {
@Input() isApprovals: any
@Input() showApproveALL: any
@Input() disableApproveALL: any
@Input() currentFilter: any
@Output() handleApiData = new EventEmitter()
@Output() handleapproveAll = new EventEmitter()
searchText = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="searchfilter" *ngIf="!isApprovals">
<ws-app-searchuser (handleApiData)="onSearch($event)" (handleapproveAll)="onApproveALL()"
[showApproveALL]="showApproveALL"></ws-app-searchuser>
[showApproveALL]="showApproveALL" [currentFilter]="currentFilter"></ws-app-searchuser>
</div>

<div *ngIf="!isApprovals">
Expand Down Expand Up @@ -36,19 +36,18 @@
&&
user?.profileDetails?.professionalDetails[0]?.designation ?
user?.profileDetails?.professionalDetails[0]?.designation : '-'}}</div>
<div class="mat-caption ws-mat-black40-text"
<!-- <div class="mat-caption ws-mat-black40-text"
*ngIf="user?.profileDetails?.profileStatus === 'VERIFIED' && user?.profileDetails?.profileStatusVerifiedOn">
Verified on: {{user?.profileDetails?.profileStatusVerifiedOn | date: 'dd/MM/yyyy'}}</div>
<div class="mat-caption ws-mat-black40-text"
*ngIf="user?.profileDetails?.profileStatus !== 'VERIFIED' && user?.profileDetails?.profileStatusVerifiedOn">
Marked on: {{user?.profileDetails?.profileStatusVerifiedOn | date: 'dd/MM/yyyy'}}</div>
<div class="mat-caption ws-mat-black40-text" *ngIf="!user?.profileDetails?.profileStatusVerifiedOn">
Verified on: {{user?.profileDetails?.profileStatusUpdatedOn | date: 'dd/MM/yyyy'}}</div> -->
<div class="mat-caption ws-mat-black40-text" *ngIf="user?.profileDetails?.profileStatusUpdatedOn">
Marked on: {{user?.profileDetails?.profileStatusUpdatedOn | date: 'dd/MM/yyyy'}}</div>
<div class="mat-caption ws-mat-black40-text" *ngIf="!user?.profileDetails?.profileStatusUpdatedOn">
-</div>
</div>
</div>
<div class="float-right" *ngIf="isMdoAdmin || isMdoLeader">
<div class="button margin-top-m mat-body" (click)="onEditUser(user, panel);$event.stopPropagation();"
*ngIf="currentFilter !== 'notmyuser'">
*ngIf="currentFilter !== 'notmyuser' && !user?.enableEdit">
<mat-icon>edit</mat-icon> Edit
</div>
<div class="button margin-top-m mat-body" (click)="confirmReassign(confirm, user);$event.stopPropagation();"
Expand All @@ -64,6 +63,9 @@
<mat-slide-toggle (click)="markStatus('NOT-VERIFIED', user)">Mark this user as
non-verified</mat-slide-toggle>
</p>
<p class="float-right mat-body-2" *ngIf="user?.profileDetails?.profileStatus === 'NOT-VERIFIED'">
<mat-slide-toggle (click)="markStatus('VERIFIED', user)">This is my user</mat-slide-toggle>
</p>
<div class="flex flex-row margin-top-m">
<div class="md:w-1/3">
<label class="margin-remove-bottom form-label required">Group</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ export class UserCardComponent implements OnInit {
today = new Date()

constructor(private usersSvc: UsersService, private roleservice: RolesService,
private dialog: MatDialog, private approvalSvc: ApprovalsService,
private route: ActivatedRoute, private snackBar: MatSnackBar,
private events: EventService) {
private dialog: MatDialog, private approvalSvc: ApprovalsService,
private route: ActivatedRoute, private snackBar: MatSnackBar,
private events: EventService) {
this.updateUserDataForm = new FormGroup({
designation: new FormControl('', [Validators.required]),
group: new FormControl('', [Validators.required]),
Expand Down Expand Up @@ -556,7 +556,6 @@ export class UserCardComponent implements OnInit {
// }
this.usersSvc.updateUserDetails(this.reqbody).subscribe(dres => {
if (dres) {
this.openSnackbar('User updated Successfully')
if (this.isMdoLeader) {
if (form.value.roles !== this.orguserRoles) {
const dreq = {
Expand All @@ -570,7 +569,8 @@ export class UserCardComponent implements OnInit {
this.usersSvc.addUserToDepartment(dreq).subscribe(res => {
if (res) {
this.updateUserDataForm.reset({ roles: '' })
this.openSnackbar('User role updated Successfully')
// this.openSnackbar('User role updated Successfully')q
this.openSnackbar('User updated Successfully')
panel.close()
this.updateList.emit()
// this.router.navigate(['/app/home/users/allusers'])
Expand All @@ -592,6 +592,7 @@ export class UserCardComponent implements OnInit {

panel.close()
this.updateList.emit()
this.openSnackbar('User updated Successfully')
// this.usersSvc.getUserById(user.userId).subscribe((res: any) => {
// if (res) {
// // tslint:disable-next-line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<li>Download the Sample File ZIP.</li>
<li>Fill in user details in the Sample File.</li>
<li>Verify via OTP.</li>
<li>Upload the populated sample csv file.</li>
<li>Upload the populated sample file.</li>
<li>Check the upload results for confirmation.</li>
</ol>
</div>
Expand All @@ -30,7 +30,7 @@
(dblclick)="$event.preventDefault()">
<img src="/assets/icons/csv-file.svg" alt="CSV file logo" />
</div>
<div *ngIf="showFileError" class="error-msg">Upload CSV format file only</div>
<div *ngIf="showFileError" class="error-msg">Upload xsls format file only</div>
<div class="flex flex-col items-center">
<div class="text-primary cursor-pointer" (click)="fileInput.click()" (dblclick)="$event.preventDefault()">
Browse files</div>
Expand All @@ -42,7 +42,7 @@
</div>
<div class="flex flex-col items-center margin-bottom-m">
<div class="flex">Max file size: 100 MB</div>
<div class="flex">Supported file types: CSV</div>
<div class="flex">Supported file types: xsls</div>
</div>
</div>
</div>
Expand All @@ -51,7 +51,7 @@

<div class="text-base font-bold">File logs</div>
<div class="flex flex-col gap-6">
<div class="file-container" *ngFor="let list of lastUploadList | slice:startIndex:lastIndex">
<div class="file-container" *ngFor="let list of lastUploadList | orderBy:'datecreatedon':'desc'">
<div class="flex flex-col gap-4">
<div class="flex flex-row justify-between items-center">
<div class="flex flex-row gap-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
font-size: 14px;
line-height: 18px;
color: rgba($color: #000000, $alpha: 0.88);
word-break: break-all;
}

.outline-button {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="flex flex-col gap-6">
<div class="flex flex-col gap-4 bulk-container">
<div class="flex font-bold">Bulk user creation</div>
<div class="flex font-bold">Bulk creation</div>
<div class="flex flex-row gap-8">
<div class="flex-1">
<div class="flex flex-col gap-3 dashed-card">
Expand All @@ -10,7 +10,7 @@
<li>Download the Sample File ZIP.</li>
<li>Fill in user details in the Sample File.</li>
<li>Verify via OTP.</li>
<li>Upload the populated sample csv file.</li>
<li>Upload the populated sample file.</li>
<li>Check the upload results for confirmation.</li>
</ol>
</div>
Expand All @@ -25,7 +25,7 @@
(dblclick)="$event.preventDefault()">
<img src="/assets/icons/csv-file.svg" alt="CSV file logo" />
</div>
<div *ngIf="showFileError" class="error-msg">Upload CSV format file only</div>
<div *ngIf="showFileError" class="error-msg">Upload xsls format file only</div>
<div class="flex flex-col items-center">
<div class="text-primary cursor-pointer" (click)="fileInput.click()" (dblclick)="$event.preventDefault()">
Browse files</div>
Expand All @@ -37,7 +37,7 @@
</div>
<div class="flex flex-col items-center margin-bottom-m">
<div class="flex">Max file size: 100 MB</div>
<div class="flex">Supported file types: CSV</div>
<div class="flex">Supported file types: xsls</div>
</div>
</div>
</div>
Expand All @@ -46,13 +46,14 @@

<div class="text-base font-bold">File logs</div>
<div class="flex flex-col gap-6">
<div class="file-container" *ngFor="let list of lastUploadList | slice:startIndex:lastIndex">
<div class="file-container" *ngFor="let list of lastUploadList | orderBy:'dateCreatedOn':'desc'">
<div class="flex flex-col gap-4">
<div class="flex flex-row justify-between items-center">
<div class="flex flex-row gap-1">
<div class="font-bold">File Information</div>
</div>
<div class="flex flex-row gap-2 outline-button items-center" (click)="handleDownloadFile(list)">
<div class="flex flex-row gap-2 outline-button items-center" *ngIf="list?.status !== 'SUCCESSFUL'"
(click)="handleDownloadFile(list)">
<mat-icon>download_2</mat-icon>
Download error log
</div>
Expand Down Expand Up @@ -85,7 +86,7 @@
<div class="value">{{ list?.dateCreatedOn | date: 'dd MMM yyyy h:mm a' }}</div>
</div>
<div class="flex flex-col">
<div class="label">Completed ON</div>
<div class="label">Completed On</div>
<div class="value">{{ list?.dateUpdatedOn | date: 'dd MMM yyyy h:mm a' }}</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
font-size: 14px;
line-height: 18px;
color: rgba($color: #000000, $alpha: 0.88);
word-break: break-all;
}

.outline-button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
<div class="flex flex-row gap-6">
<div class="input-container">
<div class="label required">Full name</div>
<input type="text" class="input-text" formControlName="firstName" placeholder="Type here" />
<input type="text" class="input-text" formControlName="firstName" placeholder="Type here" maxlength="50" />
<mat-error class="text-xs"
*ngIf="userCreationForm?.get('firstName')?.touched && userCreationForm?.get('firstName')?.invalid">
Please enter your full name
*ngIf="userCreationForm?.get('firstName')?.touched && userCreationForm?.controls['firstName'].errors?.pattern">
Please enter a valid name
</mat-error>
<mat-error class="text-xs"
*ngIf="userCreationForm?.get('firstName')?.touched && userCreationForm?.controls['firstName'].errors?.required">
Full name is mandatory
</mat-error>
</div>
<div class="input-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export const MY_FORMATS = {
},
}

const EMAIL_PATTERN = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/
const MOBILE_PATTERN = /^[0]?[6789]\d{9}$/
const PIN_CODE_PATTERN = /^[1-9][0-9]{5}$/
const EMAIL_PATTERN = `^[\\w\-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$`
const MOBILE_PATTERN = '^((\\+91-?)|0)?[0-9]{10}$'
const PIN_CODE_PATTERN = '(^[0-9]{6}$)'

@Component({
selector: 'ws-single-user-creation',
Expand All @@ -47,9 +47,10 @@ export class SingleUserCreationComponent implements OnInit, OnDestroy {
masterData: any = {}
rolesArr: string[] = []
fullProfile: any
namePatern = `^[a-zA-Z\\s\\']{1,50}$`
userCreationForm = this.formBuilder.group({
email: new FormControl('', [Validators.required, Validators.pattern(EMAIL_PATTERN)]),
firstName: new FormControl('', [Validators.required]),
firstName: new FormControl('', [Validators.required, Validators.pattern(this.namePatern)]),
phone: new FormControl('', [Validators.required, Validators.pattern(MOBILE_PATTERN), Validators.minLength(10)]),
channel: new FormControl(''),
designation: new FormControl('', [Validators.required]),
Expand Down Expand Up @@ -122,7 +123,7 @@ export class SingleUserCreationComponent implements OnInit, OnDestroy {
.subscribe((_res: any) => {
this.masterData['designation'] = _res.responseData
this.masterData['designationBackup'] = _res.responseData
}, (_err: HttpErrorResponse) => {
}, (_err: HttpErrorResponse) => {
if (!_err.ok) {
this.matSnackBar.open('Unable to fetch designation details, please try again later!')
}
Expand All @@ -135,7 +136,7 @@ export class SingleUserCreationComponent implements OnInit, OnDestroy {
.subscribe((res: any) => {
this.masterData['language'] = res.languages
this.masterData['languageBackup'] = res.languages
}, (_err: HttpErrorResponse) => {
}, (_err: HttpErrorResponse) => {
if (!_err.ok) {
this.matSnackBar.open('Unable to fetch master language details, please try again later!')
}
Expand All @@ -147,7 +148,7 @@ export class SingleUserCreationComponent implements OnInit, OnDestroy {
.pipe(takeUntil(this.destroySubject$))
.subscribe((res: any) => {
this.masterData['group'] = res.result.response
}, (_err: HttpErrorResponse) => {
}, (_err: HttpErrorResponse) => {
if (!_err.ok) {
this.matSnackBar.open('Unable to fetch group data, please try again later!')
}
Expand All @@ -165,7 +166,7 @@ export class SingleUserCreationComponent implements OnInit, OnDestroy {
this.masterData['mdoRoles'] = mdoArray.roles
}
}
}, (_err: HttpErrorResponse) => {
}, (_err: HttpErrorResponse) => {
if (!_err.ok) {
this.matSnackBar.open('Unable to fetch roles list, please try again later!')
}
Expand Down Expand Up @@ -237,7 +238,7 @@ export class SingleUserCreationComponent implements OnInit, OnDestroy {
.subscribe((_res: any) => {
this.matSnackBar.open('User created successfully!')
this.handleFormClear()
}, (_err: HttpErrorResponse) => {
}, (_err: HttpErrorResponse) => {
if (!_err.ok) {
this.matSnackBar.open(_.get(_err, 'error.params.errmsg') || 'Unable to create user, please try again later!')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="flex flex-col gap-6">
<div class="flex flex-row gap-4 items-center">
<mat-icon class="cursor-pointer" [routerLink]="['/app/home/users/all-users']">arrow_back</mat-icon>
<div class="flex font-bold">User Creation&nbsp;/&nbsp;{{ tabSelected }}</div>
<mat-icon class="cursor-pointer" [routerLink]="['/app/home/users/allusers']">arrow_back</mat-icon>
<div class="flex font-bold">User creation</div>
</div>

<mat-tab-group class="user-creation-mat-group" (selectedTabChange)="handleTabChanged($event)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,33 +206,6 @@ export class UsersViewComponent implements OnInit, OnDestroy {

this.usersService.getAllKongUsers(filtreq, this.limit, this.pageIndex, query).subscribe((data: any) => {
const allusersData = data.result.response
// if (allusersData && allusersData.content && allusersData.content.length > 0) {
// _.filter(allusersData.content, { isDeleted: false }).forEach((user: any) => {
// // tslint:disable-next-line
// const org = { roles: _.get(_.first(_.filter(user.organisations,
// { organisationId: _.get(this.configSvc, 'unMappedUser.rootOrg.id') })), 'roles') }
// usersData.push({
// fullname: user ? `${user.firstName}` : null,
// // fullname: user ? `${user.firstName} ${user.lastName}` : null,
// email: user.personalDetails && user.personalDetails.primaryEmail ?
// this.profileUtilSvc.emailTransform(user.personalDetails.primaryEmail) : this.profileUtilSvc.emailTransform(user.email),
// role: org.roles || [],
// userId: user.id,
// active: !user.isDeleted,
// blocked: user.blocked,
// roles: _.join(_.map((org.roles || []), i => `<li>${i}</li>`), ''),
// orgId: user.rootOrgId,
// orgName: user.rootOrgName,
// allowEditUser: this.showEditUser(org.roles),
// })
// })

// usersData.sort((a: any, b: any) => {
// const textA = a.fullname.toUpperCase()
// const textB = b.fullname.toUpperCase()
// return (textA < textB) ? -1 : (textA > textB) ? 1 : 0
// })
// }
this.activeUsersData = allusersData.content
this.activeUsersDataCount = data.result.response.count
})
Expand Down

0 comments on commit 6a47828

Please sign in to comment.