@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.
@@ -13588,15 +13588,17 @@ var Flex$3 = /*#__PURE__*/styled__default.div(_templateObject$2d || (_templateOb
13588
13588
 
13589
13589
  var _templateObject$2e, _templateObject2$1F;
13590
13590
  function OrderTemplate(_ref) {
13591
- var _orderStaticData$canc, _orderDetails$order_c;
13591
+ var _orderStaticData$canc, _orderDetails$order_c, _routeInfoData$order_, _routeInfoData$order_2, _routeInfoData$order_3;
13592
13592
  var orderDetails = _ref.orderDetails,
13593
13593
  routeInfoData = _ref.routeInfoData;
13594
13594
  var _useOrderNotify = useOrderNotify(),
13595
13595
  setOrderCount = _useOrderNotify[1];
13596
- var precall = false;
13596
+ // const precall = false;
13597
13597
  var _useOrderStaticData = useOrderStaticData(),
13598
13598
  orderStaticData = _useOrderStaticData[0];
13599
13599
  var statusVal = routeInfoData == null ? void 0 : routeInfoData.status_value;
13600
+ var _useClientPortal = useClientPortal(),
13601
+ isClientPortal = _useClientPortal[0];
13600
13602
  var unholdReasons = orderStaticData == null || (_orderStaticData$canc = orderStaticData.cancellation_reasons) == null ? void 0 : _orderStaticData$canc.map(function (x) {
13601
13603
  return {
13602
13604
  id: x == null ? void 0 : x.id,
@@ -13623,12 +13625,19 @@ function OrderTemplate(_ref) {
13623
13625
  isEnroute: true,
13624
13626
  isPreCall: true,
13625
13627
  isConfirmed: true,
13626
- isPostcode: true
13628
+ isPostcode: true,
13629
+ isSubcontracted: true,
13630
+ isRouted: true,
13631
+ isOnSite: true,
13632
+ isFailed: true
13627
13633
  }),
13628
13634
  alertVisibility = _useState[0],
13629
13635
  setAlertVisibility = _useState[1];
13630
- React.useEffect(function () {
13631
- }, [precall]);
13636
+ // useEffect(() => {
13637
+ // if (precall) {
13638
+ // setOrderCount(prevCount => prevCount + 1);
13639
+ // }
13640
+ // }, [precall]);
13632
13641
  //on close alert functionality
13633
13642
  var onCloseAlert = function onCloseAlert(alertType) {
13634
13643
  setAlertVisibility(function (prev) {
@@ -13637,11 +13646,26 @@ function OrderTemplate(_ref) {
13637
13646
  });
13638
13647
  setOrderCount(0);
13639
13648
  };
13640
- return React__default.createElement(React__default.Fragment, null, statusVal == 'on hold' && (alertVisibility == null ? void 0 : alertVisibility.isHoldVisible) && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13649
+ return React__default.createElement(React__default.Fragment, null, !isClientPortal && (routeInfoData == null || (_routeInfoData$order_ = routeInfoData.order_red_cross_alerts) == null ? void 0 : _routeInfoData$order_.length) > 0 && React__default.createElement(dmsComponentLibrary.FlagAlert, {
13650
+ type: "error",
13651
+ title: "",
13652
+ description: React__default.createElement(FlagsStyle, null, React__default.createElement("div", {
13653
+ className: "redCross"
13654
+ }, React__default.createElement("div", {
13655
+ className: "spanStyle",
13656
+ dangerouslySetInnerHTML: {
13657
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_red_cross_alerts
13658
+ }
13659
+ }))),
13660
+ showOkButton: false,
13661
+ onClose: function onClose() {
13662
+ return onCloseAlert('isPostcode');
13663
+ }
13664
+ }), statusVal == 'on hold' && (alertVisibility == null ? void 0 : alertVisibility.isHoldVisible) && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13641
13665
  type: "warn",
13642
13666
  title: React__default.createElement("div", {
13643
13667
  dangerouslySetInnerHTML: {
13644
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13668
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13645
13669
  }
13646
13670
  }),
13647
13671
  description: '',
@@ -13653,7 +13677,7 @@ function OrderTemplate(_ref) {
13653
13677
  type: "success",
13654
13678
  title: React__default.createElement("div", {
13655
13679
  dangerouslySetInnerHTML: {
13656
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13680
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13657
13681
  }
13658
13682
  }),
13659
13683
  description: '',
@@ -13661,11 +13685,11 @@ function OrderTemplate(_ref) {
13661
13685
  onClose: function onClose() {
13662
13686
  return onCloseAlert('isCompleted');
13663
13687
  }
13664
- })), precall , statusVal == 'outstanding' && alertVisibility.isOutstanding && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13688
+ })), statusVal == 'outstanding' && alertVisibility.isOutstanding && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13665
13689
  type: "release",
13666
13690
  title: React__default.createElement("div", {
13667
13691
  dangerouslySetInnerHTML: {
13668
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13692
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13669
13693
  }
13670
13694
  }),
13671
13695
  description: "",
@@ -13677,7 +13701,7 @@ function OrderTemplate(_ref) {
13677
13701
  type: "info",
13678
13702
  title: React__default.createElement("div", {
13679
13703
  dangerouslySetInnerHTML: {
13680
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13704
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13681
13705
  }
13682
13706
  }),
13683
13707
  description: "",
@@ -13689,7 +13713,7 @@ function OrderTemplate(_ref) {
13689
13713
  type: "info",
13690
13714
  title: React__default.createElement("div", {
13691
13715
  dangerouslySetInnerHTML: {
13692
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13716
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13693
13717
  }
13694
13718
  }),
13695
13719
  description: "",
@@ -13698,10 +13722,10 @@ function OrderTemplate(_ref) {
13698
13722
  return onCloseAlert('isAwaitingRoute');
13699
13723
  }
13700
13724
  })), statusVal == 'cancelled' && alertVisibility.isCancelled && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13701
- type: "error",
13725
+ type: "info",
13702
13726
  title: React__default.createElement("div", {
13703
13727
  dangerouslySetInnerHTML: {
13704
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13728
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13705
13729
  }
13706
13730
  }),
13707
13731
  description: reason,
@@ -13709,11 +13733,35 @@ function OrderTemplate(_ref) {
13709
13733
  onClose: function onClose() {
13710
13734
  return onCloseAlert('isCancelled');
13711
13735
  }
13736
+ })), statusVal == 'confirmed' && alertVisibility.isConfirmed && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13737
+ type: "info",
13738
+ title: React__default.createElement("div", {
13739
+ dangerouslySetInnerHTML: {
13740
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13741
+ }
13742
+ }),
13743
+ description: "",
13744
+ showOkButton: false,
13745
+ onClose: function onClose() {
13746
+ return onCloseAlert('isConfirmed');
13747
+ }
13748
+ })), statusVal == 'subcontracted' && alertVisibility.isSubcontracted && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13749
+ type: "info",
13750
+ title: React__default.createElement("div", {
13751
+ dangerouslySetInnerHTML: {
13752
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13753
+ }
13754
+ }),
13755
+ description: "",
13756
+ showOkButton: false,
13757
+ onClose: function onClose() {
13758
+ return onCloseAlert('isRouted');
13759
+ }
13712
13760
  })), statusVal == 'enroute' && alertVisibility.isEnroute && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13713
13761
  type: "info",
13714
13762
  title: React__default.createElement("div", {
13715
13763
  dangerouslySetInnerHTML: {
13716
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13764
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13717
13765
  }
13718
13766
  }),
13719
13767
  description: "",
@@ -13721,26 +13769,90 @@ function OrderTemplate(_ref) {
13721
13769
  onClose: function onClose() {
13722
13770
  return onCloseAlert('isEnroute');
13723
13771
  }
13724
- })), statusVal == 'confirmed' && alertVisibility.isConfirmed && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13772
+ })), statusVal == 'routed' && alertVisibility.isRouted && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13725
13773
  type: "info",
13726
13774
  title: React__default.createElement("div", {
13727
13775
  dangerouslySetInnerHTML: {
13728
- __html: routeInfoData == null ? void 0 : routeInfoData.order_alert
13776
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13729
13777
  }
13730
13778
  }),
13731
13779
  description: "",
13732
13780
  showOkButton: false,
13733
13781
  onClose: function onClose() {
13734
- return onCloseAlert('isConfirmed');
13782
+ return onCloseAlert('isRouted');
13783
+ }
13784
+ })), statusVal == 'precalled' && alertVisibility.isPreCall && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13785
+ type: "info",
13786
+ title: React__default.createElement("div", {
13787
+ dangerouslySetInnerHTML: {
13788
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13789
+ }
13790
+ }),
13791
+ description: "",
13792
+ showOkButton: false,
13793
+ onClose: function onClose() {
13794
+ return onCloseAlert('isPreCall');
13795
+ }
13796
+ })), statusVal == 'on site' && alertVisibility.isOnSite && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13797
+ type: "info",
13798
+ title: React__default.createElement("div", {
13799
+ dangerouslySetInnerHTML: {
13800
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13801
+ }
13802
+ }),
13803
+ description: "",
13804
+ showOkButton: false,
13805
+ onClose: function onClose() {
13806
+ return onCloseAlert('isOnSite');
13807
+ }
13808
+ })), statusVal == 'failed' && alertVisibility.isFailed && React__default.createElement(StyledAlert, null, React__default.createElement(dmsComponentLibrary.FlagAlert, {
13809
+ type: "info",
13810
+ title: React__default.createElement("div", {
13811
+ dangerouslySetInnerHTML: {
13812
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_info_alerts
13813
+ }
13814
+ }),
13815
+ description: "",
13816
+ showOkButton: false,
13817
+ onClose: function onClose() {
13818
+ return onCloseAlert('isFailed');
13819
+ }
13820
+ })), !isClientPortal && (routeInfoData == null || (_routeInfoData$order_2 = routeInfoData.order_warnings_alerts) == null ? void 0 : _routeInfoData$order_2.length) > 0 && React__default.createElement(dmsComponentLibrary.FlagAlert, {
13821
+ type: "warn",
13822
+ title: "",
13823
+ description: React__default.createElement(FlagsStyle, null, React__default.createElement("div", {
13824
+ className: ""
13825
+ }, React__default.createElement("div", {
13826
+ dangerouslySetInnerHTML: {
13827
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_warnings_alerts
13828
+ }
13829
+ }))),
13830
+ showOkButton: false,
13831
+ onClose: function onClose() {
13832
+ return onCloseAlert('isPostcode');
13833
+ }
13834
+ }), !isClientPortal && (routeInfoData == null || (_routeInfoData$order_3 = routeInfoData.order_green_check_alerts) == null ? void 0 : _routeInfoData$order_3.length) > 0 && React__default.createElement(dmsComponentLibrary.FlagAlert, {
13835
+ type: "success",
13836
+ title: "",
13837
+ description: React__default.createElement(FlagsStyle, null, React__default.createElement("div", {
13838
+ className: ""
13839
+ }, React__default.createElement("div", {
13840
+ dangerouslySetInnerHTML: {
13841
+ __html: routeInfoData == null ? void 0 : routeInfoData.order_green_check_alerts
13842
+ }
13843
+ }))),
13844
+ showOkButton: false,
13845
+ onClose: function onClose() {
13846
+ return onCloseAlert('isPostcode');
13735
13847
  }
13736
- })), (routeInfoData == null ? void 0 : routeInfoData.same_postcode_orders) && alertVisibility.isPostcode && React__default.createElement(dmsComponentLibrary.FlagAlert, {
13848
+ }), !isClientPortal && (routeInfoData == null ? void 0 : routeInfoData.same_postcode_orders) && alertVisibility.isPostcode && React__default.createElement(dmsComponentLibrary.FlagAlert, {
13737
13849
  type: "info",
13738
13850
  title: "",
13739
13851
  description: React__default.createElement(FlagsStyle, null, React__default.createElement("div", {
13740
13852
  className: "postcode-alert-content"
13741
13853
  }, React__default.createElement("div", {
13742
13854
  dangerouslySetInnerHTML: {
13743
- __html: routeInfoData.same_postcode_orders
13855
+ __html: routeInfoData == null ? void 0 : routeInfoData.same_postcode_orders
13744
13856
  }
13745
13857
  }))),
13746
13858
  showOkButton: false,
@@ -13749,7 +13861,7 @@ function OrderTemplate(_ref) {
13749
13861
  }
13750
13862
  }));
13751
13863
  }
13752
- var FlagsStyle = /*#__PURE__*/styled__default.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"])));
13864
+ var FlagsStyle = /*#__PURE__*/styled__default.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"])));
13753
13865
  var StyledAlert = /*#__PURE__*/styled__default.div(_templateObject2$1F || (_templateObject2$1F = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 5px;\n"])));
13754
13866
 
13755
13867
  var _templateObject$2f, _templateObject2$1G, _templateObject3$Z;