ngx-render-material-forms 2.2.8 → 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.
@@ -2679,7 +2679,12 @@ class CommonService {
2679
2679
  loadProducts(pageNumber, pazeSize, search = '', onlyActive = true, description = false, levelOneId, levelTwoId, levelThreeId, levelFourId) {
2680
2680
  const baseApiUrl = this.getBaseApiUrl();
2681
2681
  const vendorId = this.getValueByKey(this.paramsData, 'vendorId');
2682
- 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}`);
2682
+ const programId = this.getValueByKey(this.paramsData, '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);
2683
2688
  }
2684
2689
  listSubCategory(category) {
2685
2690
  const vendorId = this.getValueByKey(this.paramsData, 'vendorId');
@@ -2885,6 +2890,7 @@ class MaterialSelectComponent extends MaterialComponent {
2885
2890
  const vendorId = this.getValueByKey(paramsData, 'vendorId');
2886
2891
  const onlyActive = this.getValueByKey(paramsData, 'onlyActive');
2887
2892
  const includeCountry = this.getValueByKey(paramsData, 'filterProductBasedOnCustomerCountry');
2893
+ const programId = this.getValueByKey(paramsData, "programId");
2888
2894
  var currentUser = JSON.parse(localStorage.getItem('currentUser'));
2889
2895
  let headers;
2890
2896
  if (currentUser && currentUser.Tokens && currentUser.Tokens.AccessToken) {
@@ -2903,6 +2909,7 @@ class MaterialSelectComponent extends MaterialComponent {
2903
2909
  const ensearchQuery = this.commonService.scrumble(searchQuery);
2904
2910
  const encodeIncludeCountry = this.commonService.scrumble(includeCountry);
2905
2911
  let enactive = this.commonService.scrumble(onlyActive);
2912
+ const enprogramId = this.commonService.scrumble(programId);
2906
2913
  //Check if enactive is undefined, null, or blank
2907
2914
  if (enactive === undefined || enactive === null || enactive === '') {
2908
2915
  enactive = this.commonService.scrumble(true); // Set default value to true
@@ -2923,6 +2930,9 @@ class MaterialSelectComponent extends MaterialComponent {
2923
2930
  const hostname = window.location.hostname;
2924
2931
  const baseApiUrl = baseUrlMapping[btoa(hostname)] || null;
2925
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
+ }
2926
2936
  // Only add includeCountryId if it has a valid value
2927
2937
  if (encodeIncludeCountry !== null && encodeIncludeCountry !== undefined && this.isFilterProductBasedOnCustomerCountryValid(this.instance.component.data)) {
2928
2938
  url += `&filterProductBasedOnCustomerCountry=${encodeIncludeCountry}`;
@@ -3507,7 +3517,7 @@ class AddOnProductsComponent {
3507
3517
  this.priceTweek = data.dropdownsFlag?.priceTweek || "Price";
3508
3518
  this.productTweek = data.dropdownsFlag?.productTweek || "Product Name";
3509
3519
  this.quantityTweek = data.dropdownsFlag?.quantityTweek || "Quantity";
3510
- this.showCost = data.dropdownsFlag.showDialogCost;
3520
+ this.showCost = data.dropdownsFlag?.showDialogCost;
3511
3521
  this.categoryTweek = data.dropdownsFlag?.categoryTweek || "Category Name";
3512
3522
  this.subCategoryTweek = data.dropdownsFlag?.subCategoryTweek || "Sub Category";
3513
3523
  this.inventoryTweek = data.dropdownsFlag?.inventoryTweek || "Inventory";
@@ -4066,6 +4076,8 @@ class AddOnProductsComponent {
4066
4076
  }
4067
4077
  updateActiveFiltersCount() {
4068
4078
  this.activeFiltersCount = 0;
4079
+ if (this.searchQuery !== '')
4080
+ this.activeFiltersCount++;
4069
4081
  if (this.form.get('dropdownLevel1').value)
4070
4082
  this.activeFiltersCount++;
4071
4083
  if (this.form.get('dropdownLevel2').value)
@@ -4104,14 +4116,17 @@ class AddOnProductsComponent {
4104
4116
  this.levelFourId = 0;
4105
4117
  this.pageNumber = 1;
4106
4118
  this.pageSize = 20;
4119
+ this.form.controls['searchProductName'].setValue('');
4120
+ this.searchQuery = '';
4121
+ this.dataSource.data = [];
4122
+ this.spinnerFlag = false;
4107
4123
  this.updateActiveFiltersCount();
4108
- if (this.searchQuery === '') {
4109
- this.dataSource.data = [];
4110
- this.spinnerFlag = false;
4111
- }
4112
- else {
4113
- this.getProducts(false);
4114
- }
4124
+ // if (this.searchQuery === '') {
4125
+ // this.dataSource.data = [];
4126
+ // this.spinnerFlag = false;
4127
+ // } else {
4128
+ // this.getProducts(false);
4129
+ // }
4115
4130
  }
4116
4131
  shouldResetTable(search, levelOneId, levelTwoId, levelThreeId, levelFourId) {
4117
4132
  return search === '' && levelOneId === 0 && levelTwoId === 0 && levelThreeId === 0 && levelFourId === 0;
@@ -4401,7 +4416,7 @@ class MaterialDataGridComponent extends MaterialNestedComponent {
4401
4416
  width: '90%',
4402
4417
  maxWidth: '1000px',
4403
4418
  autoFocus: false,
4404
- data: { dropdownsFlag: { showDialogInventory: this.showDialogInventory, showInventory: this.showInventory, inventoryTweek: this.inventoryTweek, quantityTweek: this.quantityTweek, subCategoryTweek: this.subCategoryTweek, categoryTweek: this.categoryTweek, productTweek: this.productTweek, costTweek: this.costTweek, skuTweek: this.skuTweek, priceTweek: this.priceTweek, showDialogCost: this.showDialogCost, showNewProductPicker: this.showNewProductPicker, showDialogSubCategory: this.showDialogSubCategory, showDialogSkuNumber: this.showDialogSkuNumber, showDialogCategory: this.showDialogCategory, showDialogPrice: this.showDialogPrice, showDialogQuantity: this.showDialogQuantity, dropdownL1: this.dropdownL1, dropdownL2: this.dropdownL2, dropdownL3: this.dropdownL3, dropdownL4: this.dropdownL4, dropdownL1Label: this.dropdownL1Label, dropdownL2Label: this.dropdownL2Label, dropdownL3Label: this.dropdownL3Label, dropdownL4Label: this.dropdownL4Label, checkSubmissionStatus: this.checkSubmissionStatus, priceDisable: this.isPriceDisable, showCost: this.showDialogCost }, selectedProducts: this.dataSourceNew }
4419
+ data: { dropdownsFlag: { showDialogInventory: this.showDialogInventory, showInventory: this.showInventory, inventoryTweek: this.inventoryTweek, quantityTweek: this.quantityTweek, subCategoryTweek: this.subCategoryTweek, categoryTweek: this.categoryTweek, productTweek: this.productTweek, costTweek: this.costTweek, skuTweek: this.skuTweek, priceTweek: this.priceTweek, showDialogCost: this.showDialogCost, showNewProductPicker: this.showNewProductPicker, showDialogSubCategory: this.showDialogSubCategory, showDialogSkuNumber: this.showDialogSkuNumber, showDialogCategory: this.showDialogCategory, showDialogPrice: this.showDialogPrice, showDialogQuantity: this.showDialogQuantity, dropdownL1: this.dropdownL1, dropdownL2: this.dropdownL2, dropdownL3: this.dropdownL3, dropdownL4: this.dropdownL4, dropdownL1Label: this.dropdownL1Label, dropdownL2Label: this.dropdownL2Label, dropdownL3Label: this.dropdownL3Label, dropdownL4Label: this.dropdownL4Label, checkSubmissionStatus: this.checkSubmissionStatus, priceDisable: this.isPriceDisable }, selectedProducts: this.dataSourceNew }
4405
4420
  })
4406
4421
  .afterClosed().subscribe(response => {
4407
4422
  this.instance.addRow();