thm-p3-configurator 0.0.338 → 0.0.339

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.
@@ -44,7 +44,8 @@ function _interopRequireWildcard(e, r) {
44
44
  const TextAreaInput = _ref => {
45
45
  let {
46
46
  placeholder = '',
47
- initialValue,
47
+ initialValue = '',
48
+ value,
48
49
  name,
49
50
  onClick,
50
51
  isDisabled,
@@ -54,9 +55,15 @@ const TextAreaInput = _ref => {
54
55
  label,
55
56
  errorMessage
56
57
  } = _ref;
57
- const [value, setValue] = (0, _react.useState)(initialValue);
58
+ const [localValue, setLocalValue] = (0, _react.useState)(initialValue);
59
+ const displayValue = value !== undefined ? value : localValue;
60
+ (0, _react.useEffect)(() => {
61
+ if (initialValue) {
62
+ setLocalValue(initialValue);
63
+ }
64
+ }, [initialValue]);
58
65
  const handleChange = newValue => {
59
- setValue(newValue);
66
+ setLocalValue(newValue);
60
67
  onChange(newValue);
61
68
  };
62
69
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -72,7 +79,7 @@ const TextAreaInput = _ref => {
72
79
  type: 'textarea',
73
80
  form: form,
74
81
  onClick: onClick,
75
- value: value,
82
+ value: displayValue,
76
83
  disabled: isDisabled,
77
84
  onChange: e => handleChange(e.target.value),
78
85
  required: isRequired,
@@ -198,7 +198,7 @@ const getEmptyCustomerState = () => ({
198
198
  zakelijkContactEMailadres: ''
199
199
  });
200
200
  const InternalAppointmentForm = _ref => {
201
- var _branchTypes$byId$aut, _authSession$branch;
201
+ var _branchTypes$byId$aut, _authSession$branch, _contextCustomer$note2;
202
202
  let {
203
203
  onSubmit = payload => {},
204
204
  isError = false,
@@ -481,7 +481,7 @@ const InternalAppointmentForm = _ref => {
481
481
  const handleSubmit = async function handleSubmit() {
482
482
  let appointmentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants__.DOSSIER_TYPES.PlannedAppointment;
483
483
  try {
484
- var _customer$kvkNumber, _customer$vatNumber, _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _customer$note, _customer$zipCode, _customer$companyName, _customer$kvkNumber2, _customer$vatNumber2, _ref3;
484
+ var _customer$kvkNumber, _customer$vatNumber, _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _contextCustomer$note, _customer$zipCode, _customer$companyName, _customer$kvkNumber2, _customer$vatNumber2, _ref3;
485
485
  setErrors({});
486
486
  if (!model) {
487
487
  // Note: this does not throw on error.
@@ -552,7 +552,7 @@ const InternalAppointmentForm = _ref => {
552
552
  countryId: (_customer$countryId = customer === null || customer === void 0 ? void 0 : customer.countryId) !== null && _customer$countryId !== void 0 ? _customer$countryId : undefined,
553
553
  city: (_customer$city = customer === null || customer === void 0 ? void 0 : customer.city) !== null && _customer$city !== void 0 ? _customer$city : undefined,
554
554
  email: (_customer$email = customer === null || customer === void 0 ? void 0 : customer.email) !== null && _customer$email !== void 0 ? _customer$email : undefined,
555
- note: (_customer$note = customer === null || customer === void 0 ? void 0 : customer.note) !== null && _customer$note !== void 0 ? _customer$note : undefined,
555
+ note: (_contextCustomer$note = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note) !== null && _contextCustomer$note !== void 0 ? _contextCustomer$note : undefined,
556
556
  zipCode: (_customer$zipCode = customer === null || customer === void 0 ? void 0 : customer.zipCode) !== null && _customer$zipCode !== void 0 ? _customer$zipCode : undefined,
557
557
  companyName: activeOwnershipType !== _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij ? (_customer$companyName = customer === null || customer === void 0 ? void 0 : customer.companyName) !== null && _customer$companyName !== void 0 ? _customer$companyName : undefined : undefined,
558
558
  kvkNumber: (_customer$kvkNumber2 = customer === null || customer === void 0 ? void 0 : customer.kvkNumber) !== null && _customer$kvkNumber2 !== void 0 ? _customer$kvkNumber2 : undefined,
@@ -1579,7 +1579,7 @@ const InternalAppointmentForm = _ref => {
1579
1579
  className: (0, _helpers__.withStyle)('col-12 col-md-6')
1580
1580
  }, /*#__PURE__*/_react.default.createElement(_TextAreaInput.default, {
1581
1581
  placeholder: "",
1582
- initialValue: contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note,
1582
+ value: (_contextCustomer$note2 = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note) !== null && _contextCustomer$note2 !== void 0 ? _contextCustomer$note2 : '',
1583
1583
  name: "note",
1584
1584
  onChange: value => dispatch({
1585
1585
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
@@ -185,7 +185,7 @@ const internalQuotationFormSchema = (0, _yup.object)({
185
185
  })
186
186
  });
187
187
  const InternalQuotationForm = _ref => {
188
- var _branchTypes$byId$aut, _authSession$branch;
188
+ var _branchTypes$byId$aut, _authSession$branch, _contextCustomer$note2;
189
189
  let {
190
190
  onSubmit = payload => {},
191
191
  isError = false,
@@ -1014,7 +1014,7 @@ const InternalQuotationForm = _ref => {
1014
1014
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['chassisNumber']
1015
1015
  }), /*#__PURE__*/_react.default.createElement(_TextAreaInput.default, {
1016
1016
  placeholder: "",
1017
- value: contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note,
1017
+ value: (_contextCustomer$note2 = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note) !== null && _contextCustomer$note2 !== void 0 ? _contextCustomer$note2 : '',
1018
1018
  name: "note",
1019
1019
  onChange: value => dispatch({
1020
1020
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
@@ -129,6 +129,7 @@ const InternalSessionEditPage = props => {
129
129
  const hydrateOrderSessionByDossier = (0, _react.useCallback)(async dossierById => {
130
130
  try {
131
131
  var _dossierById$akkoordO, _orderRes$data, _orderRes$data2, _session$discountCode, _session$customer, _sessionProducts$sele;
132
+ console.log('dossierById', dossierById);
132
133
  const session = (0, _dossier.parseDossierToOrderSession)(dossierById);
133
134
  session.customerAgreed = (_dossierById$akkoordO = dossierById === null || dossierById === void 0 ? void 0 : dossierById.akkoordOpmerkingen) !== null && _dossierById$akkoordO !== void 0 ? _dossierById$akkoordO : false;
134
135
  const orderRes = await _authenticatedProxyApi.authenticatedProxyApi.getOrder(new URLSearchParams((0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, session), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.338",
3
+ "version": "0.0.339",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",