thm-p3-configurator 0.0.170 → 0.0.172

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.
@@ -23,7 +23,8 @@ const ProductTableEditableRow = _ref => {
23
23
  extraCells = [],
24
24
  onEdit,
25
25
  onRemove,
26
- isDisabled
26
+ isDisabled,
27
+ canAlterQuantity = true
27
28
  } = _ref;
28
29
  return /*#__PURE__*/_react.default.createElement("tr", {
29
30
  className: (0, _helpers__.withStyle)('cart__table-product')
@@ -41,7 +42,7 @@ const ProductTableEditableRow = _ref => {
41
42
  className: (0, _helpers__.withStyle)('row mt-0 flex-row flex-md-column flex-wrap flex-md-nowrap')
42
43
  }, /*#__PURE__*/_react.default.createElement("div", {
43
44
  className: (0, _helpers__.withStyle)('d-flex col-12 align-items-center')
44
- }, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
45
+ }, canAlterQuantity && /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
45
46
  defaultValue: productAmount,
46
47
  isDisabled: false,
47
48
  onChange: onEdit,
@@ -24,7 +24,8 @@ function _interopRequireDefault(e) {
24
24
  const ProductTable = _ref => {
25
25
  let {
26
26
  staticProducts = [],
27
- editableProducts = []
27
+ editableProducts = [],
28
+ canAlterQuantity = true
28
29
  } = _ref;
29
30
  const {
30
31
  selectedBranch
@@ -82,6 +83,7 @@ const ProductTable = _ref => {
82
83
  amount
83
84
  } = _ref3;
84
85
  return /*#__PURE__*/_react.default.createElement(_ProductTableEditableRow.default, {
86
+ canAlterQuantity: canAlterQuantity,
85
87
  productTitle: title,
86
88
  productImage: image,
87
89
  extraCells: [{}, {}, {}, {
@@ -3,12 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.ORDER_SESSION_KEY = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCATION_TYPE = exports.LOCATION_CHANGE_BUTTON_LABEL = exports.LOCALE = exports.LEASE_TYPE_ID = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.CONFIGURATOR_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
6
+ exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.STATUS_ASSESSMENT = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.ORDER_SESSION_KEY = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCATION_TYPE = exports.LOCATION_CHANGE_BUTTON_LABEL = exports.LOCALE = exports.LEASE_TYPE_ID = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.CONFIGURATOR_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
7
7
  const DOSSIER_TYPES = exports.DOSSIER_TYPES = {
8
8
  Quotation: 'quotation',
9
9
  AppointmentRequest: 'appointment-request',
10
10
  PlannedAppointment: 'appointment'
11
11
  };
12
+ const STATUS_ASSESSMENT = exports.STATUS_ASSESSMENT = {
13
+ Open: 'Open'
14
+ };
12
15
  const USER_GEOLOCATION_KEY = exports.USER_GEOLOCATION_KEY = '_userGeolocation';
13
16
  const FORM_ERROR_MESSAGES = exports.FORM_ERROR_MESSAGES = {
14
17
  required: 'Verplicht',
@@ -61,6 +61,7 @@ const DiscountProductsSelector = () => {
61
61
  executionAnswer2,
62
62
  priceCalculationDate,
63
63
  discountCode,
64
+ canAlterQuantity,
64
65
  selectedDiscountedProducts,
65
66
  discountsInitialized
66
67
  }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
@@ -118,6 +119,9 @@ const DiscountProductsSelector = () => {
118
119
  if (!(discountProducts !== null && discountProducts !== void 0 && discountProducts.length)) {
119
120
  return null;
120
121
  }
122
+ if (!canAlterQuantity) {
123
+ return /*#__PURE__*/_react.default.createElement("p", null, "Kan niet meer gekozen worden als de afspraak al verwerkt wordt.");
124
+ }
121
125
  return /*#__PURE__*/_react.default.createElement("ol", null, discountProducts === null || discountProducts === void 0 ? void 0 : discountProducts.map(product => {
122
126
  const selectedProductAmount = selectedDiscountedProducts.find(selectedProduct => (selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.articleNumber) === (product === null || product === void 0 ? void 0 : product.articleNumber));
123
127
  return /*#__PURE__*/_react.default.createElement("li", {
@@ -76,7 +76,8 @@ function _interopRequireWildcard(e, r) {
76
76
  const ProductCartSide = () => {
77
77
  const formula = (0, _FormulaContext.useFormula)();
78
78
  const [isToggled, setIsToggled] = (0, _react.useState)(false);
79
- const [{
79
+ const [order, dispatch] = (0, _OrderSessionContext.useOrderSession)();
80
+ const {
80
81
  licensePlate,
81
82
  model,
82
83
  executionAnswer1,
@@ -87,8 +88,9 @@ const ProductCartSide = () => {
87
88
  selectedCombiset,
88
89
  selectedBoardComputer,
89
90
  selectedExtras,
91
+ canAlterQuantity,
90
92
  selectedBranch
91
- }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
93
+ } = order;
92
94
  const cartInput = (0, _product.validateCartInput)([{
93
95
  articleNumber: selectedCableset,
94
96
  quantity: 1
@@ -235,6 +237,7 @@ const ProductCartSide = () => {
235
237
  const quantity = selectedExtras[product.articleNumber] || 1;
236
238
  const price = isToggled ? purchasePrice : salesPrice;
237
239
  return /*#__PURE__*/_react.default.createElement(_ProductTableEditableRow.default, {
240
+ canAlterQuantity: canAlterQuantity,
238
241
  key: product.articleNumber,
239
242
  productTitle: product.name,
240
243
  productImage: product !== null && product !== void 0 && (_product$images3 = product.images) !== null && _product$images3 !== void 0 && _product$images3[0] ? (0, _image.getImageFromHyper)({
@@ -138,6 +138,7 @@ const ProductCartTable = () => {
138
138
  selectedBoardComputer,
139
139
  selectedExtras,
140
140
  executionAnswer1,
141
+ canAlterQuantity,
141
142
  executionAnswer2,
142
143
  discountAmount,
143
144
  discountPercentage,
@@ -390,6 +391,7 @@ const ProductCartTable = () => {
390
391
  marginPercentage
391
392
  } = product.priceInfo;
392
393
  return /*#__PURE__*/_react.default.createElement(_ProductTableEditableRow.default, {
394
+ canAlterQuantity: canAlterQuantity,
393
395
  key: product.articleNumber,
394
396
  productTitle: product.name,
395
397
  productImage: product !== null && product !== void 0 && (_product$images3 = product.images) !== null && _product$images3 !== void 0 && _product$images3[0] ? (0, _image.getImageFromHyper)({
@@ -36,6 +36,7 @@ const InternalCancelDossierEdit = () => {
36
36
  shouldForceReset: true
37
37
  }
38
38
  });
39
+ sessionStorage.removeItem('__public_order');
39
40
  switch (existingDossierType) {
40
41
  case 'appointment':
41
42
  history.push("/afspraken/".concat(existingDossierId));
@@ -20,6 +20,7 @@ require("core-js/modules/esnext.iterator.find.js");
20
20
  require("core-js/modules/esnext.iterator.reduce.js");
21
21
  require("core-js/modules/esnext.iterator.some.js");
22
22
  require("core-js/modules/web.dom-collections.iterator.js");
23
+ var _constants__ = require("../__constants__");
23
24
  function ownKeys(e, r) {
24
25
  var t = Object.keys(e);
25
26
  if (Object.getOwnPropertySymbols) {
@@ -67,9 +68,10 @@ function _toPrimitive(t, r) {
67
68
  * @description Covnerts an existing hyper dossier object into a local order session
68
69
  */
69
70
  const parseDossierToOrderSession = exports.parseDossierToOrderSession = function parseDossierToOrderSession() {
70
- var _dossier$kanaal, _dossier$kanaalPartne, _dossier$kanaalHoofka, _dossier$statusDossie, _dossier$statusDossie2, _dossier$vestiging, _dossier$typeEigendom, _dossier$klant, _dossier$klant2, _dossier$klant3, _dossier$klant4, _dossier$klant5, _dossier$klant$postal, _dossier$klant6, _dossier$klant$city, _dossier$klant7, _dossier$klant$street, _dossier$klant8, _dossier$klant$huisnu, _dossier$klant9, _dossier$anwbId, _dossier$bedrijfsnaam, _dossier$kvkNummer, _dossier$btwNummer;
71
+ var _dossier$statusBeoord, _dossier$kanaal, _dossier$kanaalPartne, _dossier$kanaalHoofka, _dossier$statusDossie, _dossier$statusDossie2, _dossier$vestiging, _dossier$typeEigendom, _dossier$klant, _dossier$klant2, _dossier$klant3, _dossier$klant4, _dossier$klant5, _dossier$klant$postal, _dossier$klant6, _dossier$klant$city, _dossier$klant7, _dossier$klant$street, _dossier$klant8, _dossier$klant$huisnu, _dossier$klant9, _dossier$anwbId, _dossier$bedrijfsnaam, _dossier$kvkNummer, _dossier$btwNummer;
71
72
  let dossier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
72
73
  return {
74
+ canAlterQuantity: (dossier === null || dossier === void 0 || (_dossier$statusBeoord = dossier.statusBeoordeling) === null || _dossier$statusBeoord === void 0 ? void 0 : _dossier$statusBeoord.title) === _constants__.STATUS_ASSESSMENT.Open,
73
75
  licensePlate: dossier === null || dossier === void 0 ? void 0 : dossier.kenteken,
74
76
  model: dossier !== null && dossier !== void 0 && dossier.kenteken ? null : dossier === null || dossier === void 0 ? void 0 : dossier.model,
75
77
  // Note: only fill in when license plate is empty
@@ -123,7 +123,6 @@ const InternalSessionEditPage = props => {
123
123
  dossierId: props === null || props === void 0 || (_props$match = props.match) === null || _props$match === void 0 || (_props$match = _props$match.params) === null || _props$match === void 0 ? void 0 : _props$match.id,
124
124
  dossierType: dossierType
125
125
  });
126
- console.log('dossierById', dossierById);
127
126
  const [_, dispatch] = (0, _OrderSessionContext.useOrderSession)();
128
127
  const history = (0, _reactRouter.useHistory)();
129
128
  const hydrateOrderSessionByDossier = (0, _react.useCallback)(async dossierById => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.170",
3
+ "version": "0.0.172",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",