ngx-render-material-forms 1.8.6 → 1.8.8

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.
@@ -3393,6 +3393,10 @@ class AddOnProductsComponent {
3393
3393
  this.dropdownL3Label = '';
3394
3394
  this.dropdownL4Label = '';
3395
3395
  this.dropDownCount = 0;
3396
+ this.levelOneId = '';
3397
+ this.levelTwoId = '';
3398
+ this.levelThreeId = '';
3399
+ this.levelFourId = '';
3396
3400
  this.disablePrice = true;
3397
3401
  this.checkSubmissionStatus = false;
3398
3402
  this.showCategory = data.dropdownsFlag.showDialogCategory;
@@ -3695,7 +3699,7 @@ class AddOnProductsComponent {
3695
3699
  this.filteredDropdownTwo = [];
3696
3700
  this.filteredDropdownThree = [];
3697
3701
  this.filteredDropdownFour = [];
3698
- if (this.dropdownL2) {
3702
+ if (this.dropdownL2 && this.levelOneId) {
3699
3703
  this.loadDropdownL2(this.levelOneId);
3700
3704
  }
3701
3705
  }
@@ -3704,8 +3708,7 @@ class AddOnProductsComponent {
3704
3708
  this.form.get('dropdownLevel3').setValue(null);
3705
3709
  this.form.get('dropdownLevel4').setValue(null);
3706
3710
  this.filteredDropdownThree = [];
3707
- this.filteredDropdownFour = [];
3708
- if (this.dropdownL3) {
3711
+ if (this.dropdownL3 && this.levelOneId && this.levelTwoId) {
3709
3712
  this.loadDropdownL3(this.levelOneId, this.levelTwoId);
3710
3713
  }
3711
3714
  }
@@ -3713,7 +3716,7 @@ class AddOnProductsComponent {
3713
3716
  this.levelThreeId = selectedValue;
3714
3717
  this.form.get('dropdownLevel4').setValue(null);
3715
3718
  this.filteredDropdownFour = [];
3716
- if (this.dropdownL4) {
3719
+ if (this.dropdownL4 && this.levelOneId && this.levelTwoId && this.levelThreeId) {
3717
3720
  this.loadDropdownL4(this.levelOneId, this.levelTwoId, this.levelThreeId);
3718
3721
  }
3719
3722
  }
@@ -4040,7 +4043,8 @@ class MaterialDataGridComponent extends MaterialNestedComponent {
4040
4043
  if (!this.showSubcategory) {
4041
4044
  this.removeColumn('subCategory');
4042
4045
  }
4043
- localStorage.setItem(`selectedProducts-${this.dealId}`, JSON.stringify(response.data.items.selectedProducts));
4046
+ const selectedProductsCopy = JSON.parse(JSON.stringify(response.data.items.selectedProducts));
4047
+ localStorage.setItem(`selectedProducts-${this.dealId}`, JSON.stringify(this.addPriceProperty(selectedProductsCopy)));
4044
4048
  this.dataSourceNew = response.data.items.selectedProducts;
4045
4049
  this.showDataGrid = true;
4046
4050
  this.instance.component.defaultValue = response.data.items.selectedProducts;
@@ -4056,6 +4060,14 @@ class MaterialDataGridComponent extends MaterialNestedComponent {
4056
4060
  this.dataSource.data = [...this.dataSource.data];
4057
4061
  }
4058
4062
  }
4063
+ addPriceProperty(selectedProducts) {
4064
+ return selectedProducts.map(products => {
4065
+ return {
4066
+ ...products,
4067
+ priceDisable: true
4068
+ };
4069
+ });
4070
+ }
4059
4071
  checkRowsNumber() {
4060
4072
  while (this.instance.rows.length < this.dataSource.data.length) {
4061
4073
  this.instance.addRow();