Skip to content

Commit

Permalink
Merge pull request #507 from rahulramakrishnan3/release-3.0.0
Browse files Browse the repository at this point in the history
new changes
  • Loading branch information
Cafnanc authored Jun 25, 2024
2 parents e305e1e + 2d7d92f commit a997b7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/app/pages/home-search/home-search.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class="overlay-chip"
*ngFor="let chip of overlayChips; let i = index"
(click)="selectChip(chip)"
[ngClass]="{'selected-chip': criteriaChip === chip.label}">
[ngClass]="{'selected-chip': criteriaChip?.label === chip.label}">
<ion-icon name="close-circle" color="white"></ion-icon>
<ion-label class="chip-label">{{ chip.label }}</ion-label>
</ion-chip>
Expand All @@ -35,7 +35,7 @@
<div style="width: auto">
<ion-chip class="chip">
<ion-icon name="close-circle" color="white" (click)="closeCriteriaChip()"></ion-icon>
<ion-label class="chip-label">{{criteriaChip.label}}</ion-label>
<ion-label class="chip-label">{{criteriaChip?.label}}</ion-label>
</ion-chip>
</div>
</ion-col>
Expand Down
15 changes: 6 additions & 9 deletions src/app/pages/home-search/home-search.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class HomeSearchPage implements OnInit {
user: any;
criteriaChip: any;
chips =[]
criteriaChipValue: string;
criteriaChipName: any;
params: any;
overlayChips: any;
isOpen = false;
Expand All @@ -63,12 +63,11 @@ export class HomeSearchPage implements OnInit {
this.activatedRoute.queryParamMap.subscribe(async (params) => {
this.params = params;
this.criteriaChip = JSON.parse(params.get('criteriaChip'));
this.searchText = this.params.get('searchString')
this.searchText = this.params.get('searchString');
})
}

async ngOnInit() {
this.criteriaChipValue = this.params.get('chipName');
this.user = this.localStorage.getLocalData(localKeys.USER_DETAILS)
this.fetchSessionList()
this.permissionService.getPlatformConfig().then((config)=>{
Expand Down Expand Up @@ -113,7 +112,7 @@ export class HomeSearchPage implements OnInit {
}

async fetchSessionList() {
var obj={page: this.page, limit: this.limit, type: this.type, searchText : this.searchText, selectedChip : this.criteriaChipValue, filterData : this.urlQueryData}
var obj={page: this.page, limit: this.limit, type: this.type, searchText : this.searchText, selectedChip : this.criteriaChip?.name, filterData : this.urlQueryData}
var response = await this.sessionService.getSessionsList(obj);
this.results = response?.result?.data;
this.totalCount = response.result.count;
Expand Down Expand Up @@ -182,9 +181,8 @@ export class HomeSearchPage implements OnInit {
}

closeCriteriaChip(){
this.criteriaChip.name = this.criteriaChip.label = "";
this.searchText = this.params.get('searchString')
this.router.navigate(['/' + CommonRoutes.HOME_SEARCH], { queryParams: {searchText : this.searchText, selectedChip : ''} });
this.criteriaChip = null;
this.router.navigate(['/' + CommonRoutes.HOME_SEARCH], { queryParams: {searchString : this.searchText} });
this.fetchSessionList()
}

Expand All @@ -208,8 +206,7 @@ export class HomeSearchPage implements OnInit {
}

selectChip(chip) {
this.criteriaChip = chip.label;
this.criteriaChipValue = chip.name;
this.criteriaChip = chip;
this.fetchSessionList()
this.isOpen = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ export class DynamicFormComponent implements OnInit {
return JSON.stringify(a) == JSON.stringify(b);
}
onSubmit() {
console.log('Form valid: ', this.myForm.valid);
console.log('Form values: ', this.myForm.value);
this.isFormValid();
}
reset() {
Expand Down

0 comments on commit a997b7a

Please sign in to comment.