@aggdirect/coolmap 2.4.9 → 2.5.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.
@@ -593,12 +593,14 @@ class AddRouteNavComponent {
593
593
  }
594
594
  getMaterialName(data) {
595
595
  let materialName = '';
596
+ let materialLabel = '';
596
597
  this.materialsList.map((res) => {
597
598
  if (res.sub_material_id === data.materials_id) {
598
599
  materialName = res.material;
600
+ materialLabel = res.label;
599
601
  }
600
602
  });
601
- return materialName;
603
+ return { materialName, materialLabel };
602
604
  }
603
605
  getRouteListForCoolMap() {
604
606
  this.utils.getData('routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res) => {
@@ -622,8 +624,8 @@ class AddRouteNavComponent {
622
624
  this.preventListUpdate = false;
623
625
  this.utils.clearOptions();
624
626
  this.routes.map((ele) => {
625
- ele.unit = this.getUnitName(ele);
626
- ele.material = this.getMaterialName(ele);
627
+ ele.label = this.getMaterialName(ele).materialLabel;
628
+ ele.material = this.getMaterialName(ele).materialName;
627
629
  this.utils.makeOptions(ele);
628
630
  });
629
631
  }
@@ -847,6 +849,7 @@ var CardElements;
847
849
  CardElements["route_name"] = "Name";
848
850
  CardElements["customer_name"] = "Customer";
849
851
  CardElements["material"] = "Material";
852
+ CardElements["label"] = "Material";
850
853
  CardElements["unit"] = "Type";
851
854
  CardElements["estimated_distance"] = "Distance";
852
855
  CardElements["estimated_time"] = "Travel Time";
@@ -929,12 +932,14 @@ class JobCodeComponent {
929
932
  }
930
933
  getMaterialName(data) {
931
934
  let materialName = '';
935
+ let materialLabel = '';
932
936
  this.materialsList.map((res) => {
933
937
  if (res.sub_material_id === data.materials_id) {
934
938
  materialName = res.material;
939
+ materialLabel = res.label;
935
940
  }
936
941
  });
937
- return materialName;
942
+ return { materialName, materialLabel };
938
943
  }
939
944
  getRouteListForCoolMap() {
940
945
  this.utils.getData('routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res) => {
@@ -956,7 +961,8 @@ class JobCodeComponent {
956
961
  this.preventListUpdate = false;
957
962
  this.routes.map((ele) => {
958
963
  ele.unit = this.getUnitName(ele);
959
- ele.material = this.getMaterialName(ele);
964
+ ele.label = this.getMaterialName(ele).materialLabel;
965
+ ele.material = this.getMaterialName(ele).materialName;
960
966
  this.utils.makeOptions(ele);
961
967
  });
962
968
  this.masterRoutes = this.routes;
@@ -1314,7 +1320,7 @@ class AddRouteComponent {
1314
1320
  pickup_location: this.addRouteForm.get('pickup_location')?.value,
1315
1321
  delivery_location: this.addRouteForm.get('delivery_location')?.value,
1316
1322
  route_name: this.addRouteForm.get('route_name')?.value,
1317
- material: materialDetails?.material, unit: unit?.type
1323
+ material: materialDetails?.label, unit: unit?.type
1318
1324
  }).then((res) => { this.preventSave = true; });
1319
1325
  });
1320
1326
  }