thm-p3-configurator 0.0.246 → 0.0.248

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.
@@ -54,7 +54,7 @@ const InternalAppointmentSuccessModal = _ref => {
54
54
  } = _ref;
55
55
  const history = (0, _reactRouter.useHistory)();
56
56
  const [anchorEl, setAnchorEl] = (0, _react.useState)();
57
- const [_, dispatch] = (0, _OrderSessionContext.useOrderSession)();
57
+ const [orderSession, dispatch] = (0, _OrderSessionContext.useOrderSession)();
58
58
  const queryClient = (0, _reactQuery.useQueryClient)();
59
59
  const isAppointmentRequest = appointmentType === 'appointment-request';
60
60
  const {
@@ -83,8 +83,10 @@ const InternalAppointmentSuccessModal = _ref => {
83
83
 
84
84
  // Redirect to detail page if entityId is available, otherwise fallback to overview
85
85
  if (entityId) {
86
- history.push(isAppointmentRequest ? "/afspraak-aanvragen/".concat(entityId) : "/afspraken/".concat(entityId));
87
- history.push(isAppointmentRequest ? "/afspraak-aanvragen/".concat(entityId) : "/afspraken/".concat(entityId));
86
+ const branchId = orderSession.selectedBranch;
87
+ const baseUrl = isAppointmentRequest ? "/afspraak-aanvragen/".concat(entityId) : "/afspraken/".concat(entityId);
88
+ const url = branchId ? "".concat(baseUrl, "?branchId=").concat(branchId) : baseUrl;
89
+ history.push(url);
88
90
  } else {
89
91
  history.push(isAppointmentRequest ? '/afspraak-aanvragen' : '/afspraken');
90
92
  }
@@ -102,7 +104,7 @@ const InternalAppointmentSuccessModal = _ref => {
102
104
  isOpen: isOpen,
103
105
  title: isAppointmentRequest ? 'De afspraakaanvraag is gemaakt!' : 'De afspraak is gemaakt!',
104
106
  size: "wide",
105
- primaryButtonText: isAppointmentRequest ? 'Naar aanvragen overzicht' : 'Naar afspraken overzicht',
107
+ primaryButtonText: isAppointmentRequest ? 'Naar dossier' : 'Naar dossier',
106
108
  secondaryButtonText: 'Naar dashboard',
107
109
  onPrimaryButtonClicked: handlePrimaryButtonClicked,
108
110
  onSecondaryButtonClicked: handleSecondaryButtonClicked
@@ -54,7 +54,7 @@ const InternalQuotationSuccessModal = _ref => {
54
54
  } = _ref;
55
55
  const history = (0, _reactRouter.useHistory)();
56
56
  const [anchorEl, setAnchorEl] = (0, _react.useState)();
57
- const [_, dispatch] = (0, _OrderSessionContext.useOrderSession)();
57
+ const [orderSession, dispatch] = (0, _OrderSessionContext.useOrderSession)();
58
58
  const queryClient = (0, _reactQuery.useQueryClient)();
59
59
  const {
60
60
  resetQuotationCreation
@@ -82,7 +82,9 @@ const InternalQuotationSuccessModal = _ref => {
82
82
 
83
83
  // Redirect to detail page if entityId is available, otherwise fallback to overview
84
84
  if (entityId) {
85
- history.push("/offertes/".concat(entityId));
85
+ const branchId = orderSession.selectedBranch;
86
+ const url = branchId ? "/offertes/".concat(entityId, "?branchId=").concat(branchId) : "/offertes/".concat(entityId);
87
+ history.push(url);
86
88
  } else {
87
89
  history.push('/offertes');
88
90
  }
@@ -100,7 +102,7 @@ const InternalQuotationSuccessModal = _ref => {
100
102
  isOpen: isOpen,
101
103
  title: 'De offerte is verstuurd!',
102
104
  size: "wide",
103
- primaryButtonText: 'Naar offertes overzicht ',
105
+ primaryButtonText: 'Naar dossier',
104
106
  secondaryButtonText: 'Naar dashboard',
105
107
  onPrimaryButtonClicked: handlePrimaryButtonClicked,
106
108
  onSecondaryButtonClicked: handleSecondaryButtonClicked
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/web.dom-collections.iterator.js");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ require("core-js/modules/web.dom-collections.iterator.js");
7
9
  var _react = _interopRequireDefault(require("react"));
8
10
  var _reactRouter = require("react-router");
9
11
  var _Modal = _interopRequireDefault(require("../../__components__/Modal"));
12
+ var _OrderSessionContext = require("../../__context__/OrderSessionContext");
10
13
  var _helpers__ = require("../../__helpers__");
11
14
  function _interopRequireDefault(e) {
12
15
  return e && e.__esModule ? e : {
@@ -19,21 +22,33 @@ const InternalSingleOrderSuccessModal = _ref => {
19
22
  entityId
20
23
  } = _ref;
21
24
  const history = (0, _reactRouter.useHistory)();
25
+ const [orderSession, dispatch] = (0, _OrderSessionContext.useOrderSession)();
22
26
  const handlePrimaryButtonClicked = () => {
23
27
  // Redirect to detail page if entityId is available, otherwise fallback to overview
24
28
  if (entityId) {
25
- history.push("/losse-orders/".concat(entityId));
29
+ const branchId = orderSession.selectedBranch;
30
+ const url = branchId ? "/losse-orders/".concat(entityId, "?branchId=").concat(branchId) : "/losse-orders/".concat(entityId);
31
+ history.push(url);
26
32
  } else {
27
33
  history.push('/losse-orders');
28
34
  }
29
35
  };
36
+ const handleSecondaryButtonClicked = () => {
37
+ dispatch({
38
+ type: _OrderSessionContext.orderSessionActions.INITIALIZE_NEW_ORDER,
39
+ payload: {
40
+ shouldForceReset: true
41
+ }
42
+ });
43
+ history.push('/dashboard');
44
+ };
30
45
  return /*#__PURE__*/_react.default.createElement(_Modal.default, {
31
46
  isOpen: isOpen,
32
47
  title: 'Bestelling succesvol',
33
48
  size: "wide",
34
- onSecondaryButtonClicked: () => history.push('/dashboard'),
49
+ onSecondaryButtonClicked: handleSecondaryButtonClicked,
35
50
  secondaryButtonText: 'Naar dashboard',
36
- primaryButtonText: 'Naar losse orders',
51
+ primaryButtonText: 'Naar dossier',
37
52
  onPrimaryButtonClicked: handlePrimaryButtonClicked
38
53
  }, /*#__PURE__*/_react.default.createElement("p", null, "De bestelling is succesvol gemaakt."), /*#__PURE__*/_react.default.createElement("p", {
39
54
  className: (0, _helpers__.withStyle)('mb-0')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.246",
3
+ "version": "0.0.248",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",