ngx-render-material-forms 2.2.9 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2680,7 +2680,11 @@ class CommonService {
2680
2680
  const baseApiUrl = this.getBaseApiUrl();
2681
2681
  const vendorId = this.getValueByKey(this.paramsData, 'vendorId');
2682
2682
  const programId = this.getValueByKey(this.paramsData, 'programId');
2683
- return this.http.get(`${baseApiUrl}/api/VendorFormBuilder/GetVendorProductsV2?vendorId=${vendorId}&pageNumber=${pageNumber}&pageSize=${pazeSize}&search=${search}&onlyActive=${onlyActive}&includeDescription=${description}&levelOne=${levelOneId}&levelTwo=${levelTwoId}&levelThree=${levelThreeId}&levelFour=${levelFourId}&programId=${programId}`);
2683
+ let apiUrl = `${baseApiUrl}/api/VendorFormBuilder/GetVendorProductsV2?vendorId=${vendorId}&pageNumber=${pageNumber}&pageSize=${pazeSize}&search=${search}&onlyActive=${onlyActive}&includeDescription=${description}&levelOne=${levelOneId}&levelTwo=${levelTwoId}&levelThree=${levelThreeId}&levelFour=${levelFourId}`;
2684
+ if (programId) {
2685
+ apiUrl += `&programId=${programId}`;
2686
+ }
2687
+ return this.http.get(apiUrl);
2684
2688
  }
2685
2689
  listSubCategory(category) {
2686
2690
  const vendorId = this.getValueByKey(this.paramsData, 'vendorId');
@@ -2925,7 +2929,10 @@ class MaterialSelectComponent extends MaterialComponent {
2925
2929
  // Get the current hostname
2926
2930
  const hostname = window.location.hostname;
2927
2931
  const baseApiUrl = baseUrlMapping[btoa(hostname)] || null;
2928
- let url = `${baseApiUrl}/api/VendorFormBuilder/GetVendorProducts?vendorId=${envendorId}&pageNumber=${enpageNumber}&pageSize=${enpageSize}&search=${ensearchQuery}&onlyActive=${enactive}&includeDescription=${endescription}&programId=${enprogramId}`;
2932
+ let url = `${baseApiUrl}/api/VendorFormBuilder/GetVendorProducts?vendorId=${envendorId}&pageNumber=${enpageNumber}&pageSize=${enpageSize}&search=${ensearchQuery}&onlyActive=${enactive}&includeDescription=${endescription}`;
2933
+ if (enprogramId && programId) {
2934
+ url += `&programId=${enprogramId}`;
2935
+ }
2929
2936
  // Only add includeCountryId if it has a valid value
2930
2937
  if (encodeIncludeCountry !== null && encodeIncludeCountry !== undefined && this.isFilterProductBasedOnCustomerCountryValid(this.instance.component.data)) {
2931
2938
  url += `&filterProductBasedOnCustomerCountry=${encodeIncludeCountry}`;
@@ -4069,6 +4076,8 @@ class AddOnProductsComponent {
4069
4076
  }
4070
4077
  updateActiveFiltersCount() {
4071
4078
  this.activeFiltersCount = 0;
4079
+ if (this.searchQuery !== '')
4080
+ this.activeFiltersCount++;
4072
4081
  if (this.form.get('dropdownLevel1').value)
4073
4082
  this.activeFiltersCount++;
4074
4083
  if (this.form.get('dropdownLevel2').value)
@@ -4107,14 +4116,17 @@ class AddOnProductsComponent {
4107
4116
  this.levelFourId = 0;
4108
4117
  this.pageNumber = 1;
4109
4118
  this.pageSize = 20;
4119
+ this.form.controls['searchProductName'].setValue('');
4120
+ this.searchQuery = '';
4121
+ this.dataSource.data = [];
4122
+ this.spinnerFlag = false;
4110
4123
  this.updateActiveFiltersCount();
4111
- if (this.searchQuery === '') {
4112
- this.dataSource.data = [];
4113
- this.spinnerFlag = false;
4114
- }
4115
- else {
4116
- this.getProducts(false);
4117
- }
4124
+ // if (this.searchQuery === '') {
4125
+ // this.dataSource.data = [];
4126
+ // this.spinnerFlag = false;
4127
+ // } else {
4128
+ // this.getProducts(false);
4129
+ // }
4118
4130
  }
4119
4131
  shouldResetTable(search, levelOneId, levelTwoId, levelThreeId, levelFourId) {
4120
4132
  return search === '' && levelOneId === 0 && levelTwoId === 0 && levelThreeId === 0 && levelFourId === 0;