Skip to content

Commit

Permalink
Merge pull request #545 from sohailamjad12/search_Mdoissue
Browse files Browse the repository at this point in the history
Karma Quest:KB5551, KB5264 search issue resolved
  • Loading branch information
vishnubansaltarento authored Jun 27, 2024
2 parents 8573604 + 8020879 commit 070b6d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
<mat-form-field appearance="outline" class="w-full field-height" fxFlex="40">
<mat-select class=" placeholder-text" placeholder="Choose the Assignee" formControlName="assignee">
<input #search autocomplete="off" placeholder="Search" class="assigneeSearch"
(keyup)="searchValueData('assigneeText')" formControlName="assigneeText" matInput>
(keyup)="searchValueData('assigneeText')" (keydown.space)="$event.stopPropagation()" formControlName="assigneeText" matInput>
<mat-option *ngFor="let option of filteredAssigneeType" [value]="option">{{option.orgName}}</mat-option>

</mat-select>
Expand Down Expand Up @@ -338,7 +338,8 @@
</mat-select-trigger>
<mat-optgroup>
<mat-form-field floatLabel="never">
<input #search autocomplete="off" placeholder="Search" (keyup)="searchValueData('providerText')" formControlName="providerText" matInput>
<input #search autocomplete="off" placeholder="Search" (keyup)="searchValueData('providerText')" (keydown.space)="$event.stopPropagation()"
formControlName="providerText" matInput>
<button [disableRipple]="true" *ngIf="search.value" matSuffix mat-icon-button aria-label="Clear"
(click)="clearSearch($event,'providerText')"><mat-icon>close</mat-icon></button>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { CompetencyViewComponent } from '../competency-view/competency-view.comp
import { ConfirmationBoxComponent } from '../../../../training-plan/components/confirmation-box/confirmation.box.component'
/* tslint:disable */
import _ from 'lodash'
import { debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators'
/* tslint:enable */

@Component({
Expand Down Expand Up @@ -178,12 +179,20 @@ export class CreateRequestFormComponent implements OnInit {

searchValueData(searchValue: any) {
if (searchValue === 'providerText') {
this.requestForm.controls['providerText'].valueChanges.subscribe((newValue: any) => {
this.requestForm.controls['providerText'].valueChanges.pipe(
debounceTime(100),
distinctUntilChanged(),
startWith(''),
).subscribe((newValue: any) => {
this.filteredRequestType = this.filterOrgValues(newValue, this.requestTypeData)
})
}
if (searchValue === 'assigneeText') {
this.requestForm.controls['assigneeText'].valueChanges.subscribe((newValue: any) => {
this.requestForm.controls['assigneeText'].valueChanges.pipe(
debounceTime(100),
distinctUntilChanged(),
startWith(''),
).subscribe((newValue: any) => {
this.filteredAssigneeType = this.filterOrgValues(newValue, this.requestTypeData)
})
}
Expand Down

0 comments on commit 070b6d9

Please sign in to comment.