@bjsdistribution/dms-client-return 0.1.6-prod → 0.1.7-prod

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.
@@ -13580,15 +13580,17 @@ var Flex$3 = /*#__PURE__*/styled.div(_templateObject$2d || (_templateObject$2d =
13580
13580
 
13581
13581
  var _templateObject$2e, _templateObject2$1F;
13582
13582
  function OrderTemplate(_ref) {
13583
- var _orderStaticData$canc, _orderDetails$order_c;
13583
+ var _orderStaticData$canc, _orderDetails$order_c, _routeInfoData$order_, _routeInfoData$order_2, _routeInfoData$order_3;
13584
13584
  var orderDetails = _ref.orderDetails,
13585
13585
  routeInfoData = _ref.routeInfoData;
13586
13586
  var _useOrderNotify = useOrderNotify(),
13587
13587
  setOrderCount = _useOrderNotify[1];
13588
- var precall = false;
13588
+ // const precall = false;
13589
13589
  var _useOrderStaticData = useOrderStaticData(),
13590
13590
  orderStaticData = _useOrderStaticData[0];
13591
13591
  var statusVal = routeInfoData == null ? void 0 : routeInfoData.status_value;
13592
+ var _useClientPortal = useClientPortal(),
13593
+ isClientPortal = _useClientPortal[0];
13592
13594
  var unholdReasons = orderStaticData == null || (_orderStaticData$canc = orderStaticData.cancellation_reasons) == null ? void 0 : _orderStaticData$canc.map(function (x) {
13593
13595
  return {
13594
13596
  id: x == null ? void 0 : x.id,
@@ -13615,12 +13617,19 @@ function OrderTemplate(_ref) {
13615
13617
  isEnroute: true,
13616
13618
  isPreCall: true,
13617
13619
  isConfirmed: true,
13618
- isPostcode: true
13620
+ isPostcode: true,
13621
+ isSubcontracted: true,
13622
+ isRouted: true,
13623
+ isOnSite: true,
13624
+ isFailed: true
13619
13625
  }),
13620
13626
  alertVisibility = _useState[0],
13621
13627
  setAlertVisibility = _useState[1];
13622
- useEffect(function () {
13623
- }, [precall]);
13628
+ // useEffect(() => {
13629
+ // if (precall) {
13630
+ // setOrderCount(prevCount => prevCount + 1);
13631
+ // }
13632
+ // }, [precall]);
13624
13633
  //on close alert functionality
13625
13634
  var onCloseAlert = function onCloseAlert(alertType) {
13626
13635
  setAlertVisibility(function (prev) {
@@ -13629,11 +13638,26 @@ function OrderTemplate(_ref) {
13629
13638
  });
13630
13639
  setOrderCount(0);
13631
13640
  };
13632
- return React.createElement(React.Fragment, null, statusVal == 'on hold' && (alertVisibility == null ? void 0 : alertVisibility.isHoldVisible) && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13641
+ return React.createElement(React.Fragment, null, !isClientPortal && (routeInfoData == null || (_routeInfoData$order_ = routeInfoData.order_red_cross_alerts) == null ? void 0 : _routeInfoData$order_.length) > 0 && React.createElement(FlagAlert, {
13642
+ type: "error",
13643
+ title: "",
13644
+ description: React.createElement(FlagsStyle, null, React.createElement("div", {
13645
+ className: "redCross"
13646
+ }, React.createElement("div", {
13647
+ className: "spanStyle",
13648
+ dangerouslySetInnerHTML: {
13649
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_red_cross_alerts
13650
+ }
13651
+ }))),
13652
+ showOkButton: false,
13653
+ onClose: function onClose() {
13654
+ return onCloseAlert('isPostcode');
13655
+ }
13656
+ }), statusVal == 'on hold' && (alertVisibility == null ? void 0 : alertVisibility.isHoldVisible) && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13633
13657
  type: "warn",
13634
13658
  title: React.createElement("div", {
13635
13659
  dangerouslySetInnerHTML: {
13636
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13660
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13637
13661
  }
13638
13662
  }),
13639
13663
  description: '',
@@ -13645,7 +13669,7 @@ function OrderTemplate(_ref) {
13645
13669
  type: "success",
13646
13670
  title: React.createElement("div", {
13647
13671
  dangerouslySetInnerHTML: {
13648
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13672
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13649
13673
  }
13650
13674
  }),
13651
13675
  description: '',
@@ -13653,11 +13677,11 @@ function OrderTemplate(_ref) {
13653
13677
  onClose: function onClose() {
13654
13678
  return onCloseAlert('isCompleted');
13655
13679
  }
13656
- })), precall , statusVal == 'outstanding' && alertVisibility.isOutstanding && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13680
+ })), statusVal == 'outstanding' && alertVisibility.isOutstanding && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13657
13681
  type: "release",
13658
13682
  title: React.createElement("div", {
13659
13683
  dangerouslySetInnerHTML: {
13660
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13684
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13661
13685
  }
13662
13686
  }),
13663
13687
  description: "",
@@ -13669,7 +13693,7 @@ function OrderTemplate(_ref) {
13669
13693
  type: "info",
13670
13694
  title: React.createElement("div", {
13671
13695
  dangerouslySetInnerHTML: {
13672
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13696
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13673
13697
  }
13674
13698
  }),
13675
13699
  description: "",
@@ -13681,7 +13705,7 @@ function OrderTemplate(_ref) {
13681
13705
  type: "info",
13682
13706
  title: React.createElement("div", {
13683
13707
  dangerouslySetInnerHTML: {
13684
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13708
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13685
13709
  }
13686
13710
  }),
13687
13711
  description: "",
@@ -13690,10 +13714,10 @@ function OrderTemplate(_ref) {
13690
13714
  return onCloseAlert('isAwaitingRoute');
13691
13715
  }
13692
13716
  })), statusVal == 'cancelled' && alertVisibility.isCancelled && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13693
- type: "error",
13717
+ type: "info",
13694
13718
  title: React.createElement("div", {
13695
13719
  dangerouslySetInnerHTML: {
13696
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13720
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13697
13721
  }
13698
13722
  }),
13699
13723
  description: reason,
@@ -13701,11 +13725,35 @@ function OrderTemplate(_ref) {
13701
13725
  onClose: function onClose() {
13702
13726
  return onCloseAlert('isCancelled');
13703
13727
  }
13728
+ })), statusVal == 'confirmed' && alertVisibility.isConfirmed && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13729
+ type: "info",
13730
+ title: React.createElement("div", {
13731
+ dangerouslySetInnerHTML: {
13732
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13733
+ }
13734
+ }),
13735
+ description: "",
13736
+ showOkButton: false,
13737
+ onClose: function onClose() {
13738
+ return onCloseAlert('isConfirmed');
13739
+ }
13740
+ })), statusVal == 'subcontracted' && alertVisibility.isSubcontracted && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13741
+ type: "info",
13742
+ title: React.createElement("div", {
13743
+ dangerouslySetInnerHTML: {
13744
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13745
+ }
13746
+ }),
13747
+ description: "",
13748
+ showOkButton: false,
13749
+ onClose: function onClose() {
13750
+ return onCloseAlert('isRouted');
13751
+ }
13704
13752
  })), statusVal == 'enroute' && alertVisibility.isEnroute && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13705
13753
  type: "info",
13706
13754
  title: React.createElement("div", {
13707
13755
  dangerouslySetInnerHTML: {
13708
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13756
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13709
13757
  }
13710
13758
  }),
13711
13759
  description: "",
@@ -13713,26 +13761,90 @@ function OrderTemplate(_ref) {
13713
13761
  onClose: function onClose() {
13714
13762
  return onCloseAlert('isEnroute');
13715
13763
  }
13716
- })), statusVal == 'confirmed' && alertVisibility.isConfirmed && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13764
+ })), statusVal == 'routed' && alertVisibility.isRouted && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13717
13765
  type: "info",
13718
13766
  title: React.createElement("div", {
13719
13767
  dangerouslySetInnerHTML: {
13720
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13768
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13721
13769
  }
13722
13770
  }),
13723
13771
  description: "",
13724
13772
  showOkButton: false,
13725
13773
  onClose: function onClose() {
13726
- return onCloseAlert('isConfirmed');
13774
+ return onCloseAlert('isRouted');
13775
+ }
13776
+ })), statusVal == 'precalled' && alertVisibility.isPreCall && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13777
+ type: "info",
13778
+ title: React.createElement("div", {
13779
+ dangerouslySetInnerHTML: {
13780
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13781
+ }
13782
+ }),
13783
+ description: "",
13784
+ showOkButton: false,
13785
+ onClose: function onClose() {
13786
+ return onCloseAlert('isPreCall');
13787
+ }
13788
+ })), statusVal == 'on site' && alertVisibility.isOnSite && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13789
+ type: "info",
13790
+ title: React.createElement("div", {
13791
+ dangerouslySetInnerHTML: {
13792
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13793
+ }
13794
+ }),
13795
+ description: "",
13796
+ showOkButton: false,
13797
+ onClose: function onClose() {
13798
+ return onCloseAlert('isOnSite');
13799
+ }
13800
+ })), statusVal == 'failed' && alertVisibility.isFailed && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
13801
+ type: "info",
13802
+ title: React.createElement("div", {
13803
+ dangerouslySetInnerHTML: {
13804
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13805
+ }
13806
+ }),
13807
+ description: "",
13808
+ showOkButton: false,
13809
+ onClose: function onClose() {
13810
+ return onCloseAlert('isFailed');
13811
+ }
13812
+ })), !isClientPortal && (routeInfoData == null || (_routeInfoData$order_2 = routeInfoData.order_warnings_alerts) == null ? void 0 : _routeInfoData$order_2.length) > 0 && React.createElement(FlagAlert, {
13813
+ type: "warn",
13814
+ title: "",
13815
+ description: React.createElement(FlagsStyle, null, React.createElement("div", {
13816
+ className: ""
13817
+ }, React.createElement("div", {
13818
+ dangerouslySetInnerHTML: {
13819
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_warnings_alerts
13820
+ }
13821
+ }))),
13822
+ showOkButton: false,
13823
+ onClose: function onClose() {
13824
+ return onCloseAlert('isPostcode');
13825
+ }
13826
+ }), !isClientPortal && (routeInfoData == null || (_routeInfoData$order_3 = routeInfoData.order_green_check_alerts) == null ? void 0 : _routeInfoData$order_3.length) > 0 && React.createElement(FlagAlert, {
13827
+ type: "success",
13828
+ title: "",
13829
+ description: React.createElement(FlagsStyle, null, React.createElement("div", {
13830
+ className: ""
13831
+ }, React.createElement("div", {
13832
+ dangerouslySetInnerHTML: {
13833
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_green_check_alerts
13834
+ }
13835
+ }))),
13836
+ showOkButton: false,
13837
+ onClose: function onClose() {
13838
+ return onCloseAlert('isPostcode');
13727
13839
  }
13728
- })), (routeInfoData == null ? void 0 : routeInfoData.same_postcode_orders) && alertVisibility.isPostcode && React.createElement(FlagAlert, {
13840
+ }), !isClientPortal && (routeInfoData == null ? void 0 : routeInfoData.same_postcode_orders) && alertVisibility.isPostcode && React.createElement(FlagAlert, {
13729
13841
  type: "info",
13730
13842
  title: "",
13731
13843
  description: React.createElement(FlagsStyle, null, React.createElement("div", {
13732
13844
  className: "postcode-alert-content"
13733
13845
  }, React.createElement("div", {
13734
13846
  dangerouslySetInnerHTML: {
13735
- __html: routeInfoData.same_postcode_orders
13847
+ __html: routeInfoData == null ? void 0 : routeInfoData.same_postcode_orders
13736
13848
  }
13737
13849
  }))),
13738
13850
  showOkButton: false,
@@ -13741,7 +13853,7 @@ function OrderTemplate(_ref) {
13741
13853
  }
13742
13854
  }));
13743
13855
  }
13744
- var FlagsStyle = /*#__PURE__*/styled.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .postcode-alert-content {\n > div {\n > h4 {\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n }\n ul {\n }\n\n li {\n border-radius: 6px;\n list-style-type: none;\n > a {\n color: #6396e5;\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n text-decoration: none;\n }\n > strong {\n > a {\n color: #6396e5;\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n text-decoration: none;\n }\n }\n }\n\n li.outstanding strong,\n li.awaiting_confirmation strong,\n li.awaiting_route strong {\n font-family: Roboto, sans-serif;\n font-size: 14px;\n font-weight: 600;\n line-height: 24px;\n font-style: normal;\n }\n li.routed strong {\n margin-left: 5px;\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n\n li.outstanding strong {\n color: #e95252;\n }\n li.awaiting_confirmation strong {\n color: #6396e5;\n }\n li.awaiting_route strong {\n color: #36a053;\n }\n li.confirmed strong {\n color: #36a053;\n }\n li.enroute strong {\n color: #36a053;\n }\n li.cancelled strong {\n color: #e95252;\n }\n li.complete strong {\n color: #36a053;\n }\n li.on_hold strong {\n color: #feba30;\n }\n li.routed strong {\n color: #3a3630;\n }\n span {\n margin-left: 5px;\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n }\n"])));
13856
+ var FlagsStyle = /*#__PURE__*/styled.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .redCross {\n font-size: 13px;\n margin-top: 4px;\n }\n .postcode-alert-content {\n > div {\n > h4 {\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n }\n ul {\n margin-bottom: 0;\n }\n\n li {\n border-radius: 6px;\n list-style-type: none;\n > a {\n color: #6396e5;\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n text-decoration: none;\n }\n > strong {\n > a {\n color: #6396e5;\n\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n text-decoration: none;\n }\n }\n }\n\n li.outstanding strong,\n li.awaiting_confirmation strong,\n li.awaiting_route strong {\n font-family: Roboto, sans-serif;\n font-size: 14px;\n font-weight: 600;\n line-height: 24px;\n font-style: normal;\n }\n li.routed strong {\n margin-left: 5px;\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n\n li.outstanding strong {\n color: #e95252;\n }\n li.awaiting_confirmation strong {\n color: #6396e5;\n }\n li.awaiting_route strong {\n color: #36a053;\n }\n li.confirmed strong {\n color: #36a053;\n }\n li.enroute strong {\n color: #36a053;\n }\n li.cancelled strong {\n color: #e95252;\n }\n li.complete strong {\n color: #36a053;\n }\n li.on_hold strong {\n color: #feba30;\n }\n li.routed strong {\n color: #3a3630;\n }\n span {\n margin-left: 5px;\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n }\n"])));
13745
13857
  var StyledAlert = /*#__PURE__*/styled.div(_templateObject2$1F || (_templateObject2$1F = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 5px;\n"])));
13746
13858
 
13747
13859
  var _templateObject$2f, _templateObject2$1G, _templateObject3$Z;