contentoh-components-library 21.0.98 → 21.1.1

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.
Files changed (25) hide show
  1. package/dist/components/atoms/GeneralInput/index.js +13 -7
  2. package/dist/components/atoms/GenericModal/styles.js +1 -1
  3. package/dist/components/atoms/InputFormatter/index.js +23 -20
  4. package/dist/components/atoms/InputFormatter/styles.js +1 -1
  5. package/dist/components/molecules/LoginPasswordStrength/index.js +8 -13
  6. package/dist/components/molecules/TagAndInput/index.js +7 -3
  7. package/dist/components/organisms/FullProductNameHeader/index.js +1 -1
  8. package/dist/components/pages/ChangePasswordLogin/index.js +12 -35
  9. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +115 -61
  10. package/dist/components/pages/ProviderProductEdition/index.js +9 -16
  11. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -53
  12. package/dist/components/pages/RetailerProductEdition/index.js +56 -31
  13. package/package.json +1 -1
  14. package/src/components/atoms/GeneralInput/index.js +15 -6
  15. package/src/components/atoms/GenericModal/styles.js +1 -1
  16. package/src/components/atoms/InputFormatter/index.js +18 -16
  17. package/src/components/atoms/InputFormatter/styles.js +1 -0
  18. package/src/components/molecules/LoginPasswordStrength/index.js +6 -16
  19. package/src/components/molecules/TagAndInput/index.js +8 -1
  20. package/src/components/organisms/FullProductNameHeader/index.js +5 -1
  21. package/src/components/pages/ChangePasswordLogin/index.js +1 -2
  22. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +130 -62
  23. package/src/components/pages/ProviderProductEdition/index.js +9 -11
  24. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +41 -55
  25. package/src/components/pages/RetailerProductEdition/index.js +51 -10
@@ -39,7 +39,8 @@ var GeneralInput = function GeneralInput(_ref) {
39
39
  version = _ref.version,
40
40
  _ref$optionList = _ref.optionList,
41
41
  optionList = _ref$optionList === void 0 ? [] : _ref$optionList,
42
- description = _ref.description;
42
+ description = _ref.description,
43
+ inputOnChange = _ref.inputOnChange;
43
44
 
44
45
  var _useState = (0, _react.useState)({
45
46
  value: inputValue
@@ -55,14 +56,15 @@ var GeneralInput = function GeneralInput(_ref) {
55
56
 
56
57
  var onHandleChange = function onHandleChange(evt) {
57
58
  if (validateInput) {
59
+ console.log("here");
58
60
  setTextValue({
59
61
  value: validateInput(evt, position, inputsArray)
60
62
  });
61
- } else {
63
+ } else if (updatedDatasheets || updatedDescriptions || inputType === "textarea") {
62
64
  setTextValue({
63
65
  value: inputType === "checkbox" ? evt.target.checked : evt.target.value
64
66
  });
65
- var dataSave = updatedDatasheets.slice();
67
+ var dataSave = updatedDatasheets === null || updatedDatasheets === void 0 ? void 0 : updatedDatasheets.slice();
66
68
  if (dataSave.length === 0) dataSave.push({
67
69
  articleId: articleId,
68
70
  versionId: version,
@@ -85,6 +87,11 @@ var GeneralInput = function GeneralInput(_ref) {
85
87
  });
86
88
  }
87
89
  setUpdatedDatasheets(dataSave);
90
+ } else {
91
+ setTextValue({
92
+ value: evt.target.value
93
+ });
94
+ inputOnChange && inputOnChange(evt);
88
95
  }
89
96
  };
90
97
 
@@ -103,15 +110,14 @@ var GeneralInput = function GeneralInput(_ref) {
103
110
  },
104
111
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
105
112
  value: "",
106
- selected: true,
107
113
  disabled: true,
108
114
  children: description
109
- }), JSON.parse(optionList || "[]").map(function (element) {
115
+ }), JSON.parse(optionList || "[]").map(function (element, index) {
110
116
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
111
117
  value: element,
112
- selected: element === textValue.value ? "selected" : "",
118
+ defaultValue: element === textValue.value ? "selected" : "",
113
119
  children: element
114
- }, element);
120
+ }, element + "-" + index);
115
121
  })]
116
122
  }, "dropdownK".concat(inputId)) : inputType === "checkbox" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.CheckBox, {
117
123
  id: inputId,
@@ -17,6 +17,6 @@ var _genericModalClose = _interopRequireDefault(require("../../../assets/images/
17
17
 
18
18
  var _templateObject;
19
19
 
20
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n background-color: rgba(59, 59, 59, 0.53);\n backdrop-filter: blur(4px);\n top: 0;\n left: 0;\n z-index: 100;\n\n h2 {\n overflow: initial;\n }\n\n .global-styles {\n background-color: ", ";\n height: auto;\n width: auto;\n position: relative;\n border-radius: 15px;\n padding: 40px;\n text-align: center;\n .close-button {\n background-image: url(", ");\n background-color: transparent;\n width: 14px;\n height: 14px;\n cursor: pointer;\n border: none;\n position: absolute;\n right: 20px;\n top: 20px;\n }\n .general-white-button {\n width: 160px;\n height: 40px;\n color: ", ";\n border: 1px solid ", ";\n background-color: transparent;\n & + * {\n margin-left: 45px;\n height: 40px;\n width: 161px;\n }\n }\n\n &.log-out {\n padding-bottom: 60px;\n img {\n & + * {\n margin-top: 20px;\n }\n }\n .with-bold-text {\n font-size: 24px;\n & + * {\n margin-top: 20px;\n }\n }\n }\n\n &.delete-product {\n img {\n height: 50px;\n width: 56px;\n & + * {\n margin-top: 30px;\n }\n }\n .product-name-header,\n .retailer-name-header {\n & + * {\n margin-top: 30px;\n }\n }\n }\n\n &.product-edition {\n padding-top: 50px;\n .product-name-header {\n & + * {\n margin-top: 25px;\n }\n }\n }\n\n &.send-invitation {\n width: 604px;\n img {\n & + * {\n margin-top: 40px;\n }\n }\n p {\n font-family: ", ";\n font-style: normal;\n font-size: 24px;\n color: ", ";\n line-height: 28px;\n span {\n font-family: ", ";\n }\n }\n }\n\n &.upload-image {\n width: 430px;\n padding: 50px;\n img {\n & + * {\n margin-top: 33px;\n }\n }\n .input-name-header {\n & + * {\n margin-top: 20px;\n }\n }\n .list-container {\n & + .general-button-default {\n margin-top: 40px;\n }\n }\n }\n }\n"])), _variables.GlobalColors.white, _variables.GlobalColors.deep_gray, _genericModalClose.default, _variables.GlobalColors.s2, _variables.GlobalColors.white, _variables.FontFamily.Raleway_500, _variables.GlobalColors.white, _variables.FontFamily.Raleway_700);
20
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n height: 100%;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n background-color: rgba(59, 59, 59, 0.53);\n backdrop-filter: blur(4px);\n top: 0;\n left: 0;\n z-index: 100;\n\n h2 {\n overflow: initial;\n }\n\n .global-styles {\n background-color: ", ";\n height: auto;\n width: 500px;\n position: relative;\n border-radius: 15px;\n padding: 40px;\n text-align: center;\n .close-button {\n background-image: url(", ");\n background-color: transparent;\n width: 14px;\n height: 14px;\n cursor: pointer;\n border: none;\n position: absolute;\n right: 20px;\n top: 20px;\n }\n .general-white-button {\n width: 160px;\n height: 40px;\n color: ", ";\n border: 1px solid ", ";\n background-color: transparent;\n & + * {\n margin-left: 45px;\n height: 40px;\n width: 161px;\n }\n }\n\n &.log-out {\n padding-bottom: 60px;\n img {\n & + * {\n margin-top: 20px;\n }\n }\n .with-bold-text {\n font-size: 24px;\n & + * {\n margin-top: 20px;\n }\n }\n }\n\n &.delete-product {\n img {\n height: 50px;\n width: 56px;\n & + * {\n margin-top: 30px;\n }\n }\n .product-name-header,\n .retailer-name-header {\n & + * {\n margin-top: 30px;\n }\n }\n }\n\n &.product-edition {\n padding-top: 50px;\n .product-name-header {\n & + * {\n margin-top: 25px;\n }\n }\n }\n\n &.send-invitation {\n width: 604px;\n img {\n & + * {\n margin-top: 40px;\n }\n }\n p {\n font-family: ", ";\n font-style: normal;\n font-size: 24px;\n color: ", ";\n line-height: 28px;\n span {\n font-family: ", ";\n }\n }\n }\n\n &.upload-image {\n width: 430px;\n padding: 50px;\n img {\n & + * {\n margin-top: 33px;\n }\n }\n .input-name-header {\n & + * {\n margin-top: 20px;\n }\n }\n .list-container {\n & + .general-button-default {\n margin-top: 40px;\n }\n }\n }\n }\n"])), _variables.GlobalColors.white, _variables.GlobalColors.deep_gray, _genericModalClose.default, _variables.GlobalColors.s2, _variables.GlobalColors.white, _variables.FontFamily.Raleway_500, _variables.GlobalColors.white, _variables.FontFamily.Raleway_700);
21
21
 
22
22
  exports.Container = Container;
@@ -98,18 +98,27 @@ var InputFormatter = function InputFormatter(_ref) {
98
98
 
99
99
  setCharsCounter(h.getLength() - 1);
100
100
  value = valueFormater(value);
101
- var idInput = inputId;
102
- var dataSave = updatedDescriptions === null || updatedDescriptions === void 0 ? void 0 : updatedDescriptions.slice();
103
-
104
- if (dataSave.length > 0) {
105
- if (dataSave.filter(function (e) {
106
- return e.attributeId === idInput;
107
- }).length > 0) {
108
- dataSave.forEach(function (e) {
109
- if (e.attributeId === idInput) {
110
- e.value = value;
111
- }
112
- });
101
+
102
+ if (updatedDescriptions) {
103
+ var idInput = inputId;
104
+ var dataSave = updatedDescriptions === null || updatedDescriptions === void 0 ? void 0 : updatedDescriptions.slice();
105
+
106
+ if ((dataSave === null || dataSave === void 0 ? void 0 : dataSave.length) > 0) {
107
+ if (dataSave.filter(function (e) {
108
+ return e.attributeId === idInput;
109
+ }).length > 0) {
110
+ dataSave.forEach(function (e) {
111
+ if (e.attributeId === idInput) {
112
+ e.value = value;
113
+ }
114
+ });
115
+ } else {
116
+ dataSave.push({
117
+ articleId: articleId,
118
+ attributeId: idInput,
119
+ value: value
120
+ });
121
+ }
113
122
  } else {
114
123
  dataSave.push({
115
124
  articleId: articleId,
@@ -117,15 +126,9 @@ var InputFormatter = function InputFormatter(_ref) {
117
126
  value: value
118
127
  });
119
128
  }
120
- } else {
121
- dataSave.push({
122
- articleId: articleId,
123
- attributeId: idInput,
124
- value: value
125
- });
126
- }
127
129
 
128
- setUpdatedDescriptions(dataSave);
130
+ setUpdatedDescriptions(dataSave);
131
+ }
129
132
  };
130
133
 
131
134
  var getSelection = function getSelection(range, a, b) {
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .quill {\n border: 1px solid\n ", ";\n position: relative;\n border-radius: 2px;\n\n .ql-toolbar {\n background-color: ", ";\n position: absolute;\n z-index: 10;\n border: 1px solid ", ";\n width: 45px;\n height: 45px;\n border-radius: 4px;\n visibility: ", ";\n top: ", "px;\n left: ", "px;\n }\n\n .ql-container {\n border: none;\n font-family: ", ";\n color: ", ";\n strong {\n font-family: ", ";\n }\n }\n }\n .description-limit {\n font-size: 12px;\n font-family: ", ";\n color: ", ";\n text-align: right;\n }\n"])), function (_ref) {
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .quill {\n background-color: ", ";\n border: 1px solid\n ", ";\n position: relative;\n border-radius: 2px;\n\n .ql-toolbar {\n background-color: ", ";\n position: absolute;\n z-index: 10;\n border: 1px solid ", ";\n width: 45px;\n height: 45px;\n border-radius: 4px;\n visibility: ", ";\n top: ", "px;\n left: ", "px;\n }\n\n .ql-container {\n border: none;\n font-family: ", ";\n color: ", ";\n strong {\n font-family: ", ";\n }\n }\n }\n .description-limit {\n font-size: 12px;\n font-family: ", ";\n color: ", ";\n text-align: right;\n }\n"])), _variables.GlobalColors.white, function (_ref) {
19
19
  var focus = _ref.focus,
20
20
  isRequired = _ref.isRequired;
21
21
  return focus ? _variables.GlobalColors.magenta_s2 : isRequired ? "red" : _variables.GlobalColors.s3;
@@ -31,32 +31,26 @@ var LoginPasswordStrength = function LoginPasswordStrength(_ref) {
31
31
  var upperCaseLetters = /[A-Z]/g;
32
32
  var numbers = /[0-9]/g;
33
33
  var specialChar = /[‘!’,‘@’,‘#’,‘$’,‘%’,‘^’,‘&’,‘*’]/g;
34
- (0, _react.useEffect)(function () {
35
- var inputValue = document.getElementById("newPasswordInput");
36
- inputValue.addEventListener("input", function (e) {
37
- updateInfo(e, e.target.value);
38
- }, false);
39
- }, []);
40
-
41
- var updateInfo = function updateInfo(e, newValue) {
34
+
35
+ var updateInfo = function updateInfo(e) {
42
36
  switch (e.target.id) {
43
37
  case "newPasswordInput":
44
38
  setPasswordStrength(0);
45
39
 
46
- if (newValue.length >= 8) {
40
+ if (e.target.value.length >= 8) {
47
41
  setPasswordStrength(function (passwordStrength) {
48
42
  return passwordStrength + 1;
49
43
  });
50
44
  } //Verificar si la contraseña contiene mayuscula, numeros y un caracter especial
51
45
 
52
46
 
53
- newValue.match(upperCaseLetters) && setPasswordStrength(function (passwordStrength) {
47
+ e.target.value.match(upperCaseLetters) && setPasswordStrength(function (passwordStrength) {
54
48
  return passwordStrength + 1;
55
49
  });
56
- newValue.match(numbers) && setPasswordStrength(function (passwordStrength) {
50
+ e.target.value.match(numbers) && setPasswordStrength(function (passwordStrength) {
57
51
  return passwordStrength + 1;
58
52
  });
59
- newValue.match(specialChar) && setPasswordStrength(function (passwordStrength) {
53
+ e.target.value.match(specialChar) && setPasswordStrength(function (passwordStrength) {
60
54
  return passwordStrength + 1;
61
55
  });
62
56
  break;
@@ -73,7 +67,8 @@ var LoginPasswordStrength = function LoginPasswordStrength(_ref) {
73
67
  inputType: "password",
74
68
  inputId: "newPasswordInput",
75
69
  label: "Ingrese su nueva contraseña",
76
- isRequired: required
70
+ isRequired: required,
71
+ inputOnChange: updateInfo
77
72
  }), emptyPassword && /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
78
73
  children: "La contrase\xF1a debe ser minimo de 8 caracteres"
79
74
  })]
@@ -33,7 +33,9 @@ var TagAndInput = function TagAndInput(_ref) {
33
33
  maxChar = _ref.maxChar,
34
34
  required = _ref.required,
35
35
  optionList = _ref.optionList,
36
- description = _ref.description;
36
+ description = _ref.description,
37
+ inputOnChange = _ref.inputOnChange,
38
+ color = _ref.color;
37
39
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
38
40
  inputType: inputType,
39
41
  className: "input-container",
@@ -41,7 +43,8 @@ var TagAndInput = function TagAndInput(_ref) {
41
43
  className: "title-container",
42
44
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
43
45
  text: label,
44
- headerType: "input-name-header"
46
+ headerType: "input-name-header",
47
+ color: color
45
48
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
46
49
  className: "tooltip",
47
50
  children: label
@@ -65,7 +68,8 @@ var TagAndInput = function TagAndInput(_ref) {
65
68
  maxChar: maxChar,
66
69
  required: required,
67
70
  optionList: optionList,
68
- description: description
71
+ description: description,
72
+ inputOnChange: inputOnChange
69
73
  })]
70
74
  }, "generalTagInput-".concat(inputType));
71
75
  };
@@ -55,7 +55,7 @@ var FullProductNameHeader = function FullProductNameHeader(_ref) {
55
55
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
56
56
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductNameHeader.ProductNameHeader, {
57
57
  productName: (headerData === null || headerData === void 0 ? void 0 : (_headerData$article = headerData.article) === null || _headerData$article === void 0 ? void 0 : _headerData$article.name) || (headerData === null || headerData === void 0 ? void 0 : headerData.name),
58
- statusType: (headerData === null || headerData === void 0 ? void 0 : headerData.version_status) || (headerData === null || headerData === void 0 ? void 0 : headerData.status),
58
+ statusType: (headerData === null || headerData === void 0 ? void 0 : headerData.version_status) || (headerData === null || headerData === void 0 ? void 0 : headerData.status) || (headerData === null || headerData === void 0 ? void 0 : headerData.article_status),
59
59
  percent: percent === null || percent === void 0 ? void 0 : percent.toFixed(0),
60
60
  priority: headerData === null || headerData === void 0 ? void 0 : headerData.prio,
61
61
  date: new Date((headerData === null || headerData === void 0 ? void 0 : (_headerData$article2 = headerData.article) === null || _headerData$article2 === void 0 ? void 0 : _headerData$article2.timestamp) || (headerData === null || headerData === void 0 ? void 0 : headerData.timestamp)).toLocaleDateString()
@@ -7,10 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.ChangePasswordLogin = void 0;
9
9
 
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
-
12
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
13
-
14
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
15
11
 
16
12
  var _styles = require("./styles");
@@ -55,37 +51,18 @@ var ChangePasswordLogin = function ChangePasswordLogin(_ref) {
55
51
  matchPasswords = _useState6[0],
56
52
  setMatchPasswords = _useState6[1];
57
53
 
58
- var validate = /*#__PURE__*/function () {
59
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
60
- var password, confirmPassword;
61
- return _regenerator.default.wrap(function _callee$(_context) {
62
- while (1) {
63
- switch (_context.prev = _context.next) {
64
- case 0:
65
- e.preventDefault();
66
- password = document.querySelector("#newPasswordInput").value;
67
- password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
68
- confirmPassword = document.querySelector("#confirmPasswordInput").value;
69
- confirmPassword === "" ? setEmptyConfirmPassword(true) : setEmptyConfirmPassword(false);
70
-
71
- if (password === confirmPassword) {
72
- setMatchPasswords(true);
73
- } else {
74
- setMatchPasswords(false);
75
- }
76
-
77
- case 6:
78
- case "end":
79
- return _context.stop();
80
- }
81
- }
82
- }, _callee);
83
- }));
84
-
85
- return function validate(_x) {
86
- return _ref2.apply(this, arguments);
87
- };
88
- }();
54
+ var validate = function validate(e) {
55
+ var password = document.querySelector("#newPasswordInput").value;
56
+ password.length < 8 ? setEmptyPassword(true) : setEmptyPassword(false);
57
+ var confirmPassword = document.querySelector("#confirmPasswordInput").value;
58
+ confirmPassword === "" ? setEmptyConfirmPassword(true) : setEmptyConfirmPassword(false);
59
+
60
+ if (password === confirmPassword) {
61
+ setMatchPasswords(true);
62
+ } else {
63
+ setMatchPasswords(false);
64
+ }
65
+ };
89
66
 
90
67
  var loginRight = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LogoImage.LogoImage, {}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
91
68
  className: "credenciales",
@@ -31,61 +31,115 @@ ProviderProductEditionDefault.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: false
33
33
  },
34
- token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJhZWQzMzEyZi1kZGYyLTQ2ZTAtOTgyNS1lODU2ZDM0ODYwNzMiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1Mzk1NzQ3MiwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2NTM5NjEwNzIsImlhdCI6MTY1Mzk1NzQ3MiwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.Fq4bWu0irZ3NHDU2MOXBJZaqQlzbXwrS6YY2_GBG0Nq8z5gNmKr8LFcjBvD1mYj6sO6BHPrh0yzAOtlQMVOFAeXXRZ524Um_rpECWKDUD8IjCKUIgbqQos_YB-09zetlsmIE6Pd29UxDuwrN7zWqzzTuKGUnNhfC8uS3_tG9fi4TxNY0TY8Jwuk9uo0LlOjiIb28mL06B98EWTFbuze5J0AADfa_p0zEqYMyAIn4kYouIOt8eqOVFfZ4piEJMMcbwwaPwVTpy8e6FSLHrQeCa054ZJCvdGQLKhN1Ceue77voFINI9umnEIExAp_w2miOwzJjuk6E1ALf2LWo-Rz_qg",
34
+ token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJhOTZjN2YxMi0wYjI5LTRkMzctOWMxOS1mMDAzMWFiMGY2N2EiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NTQ5MjkzNiwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjU1NDk2NTM2LCJpYXQiOjE2NTU0OTI5MzYsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.Rg3hxEzGy4pSDcG-q5lXRZWBoBiXQQKCdpRtAChvQuGM5GaQySgBW0YUEIXcLuwMbWSzj3RWJ4ZTY8NZvUhYIRbGqnIhB82FP41YCcYF7BYDilr4pZzeqEjx6U4_jR4HtbmkFfscyg0Q1VINNHTj1b0n1xLNMiE6rM7hY3eWFFhyvXn5OIH_5fZaHjYRe2uBDnF6Ogx1Za2z8DzyKkR2-QjVo4l-f64Egc5EfYWm6_3gZ1gkRGLxa7HfQXNUs0ds7Ifkx4QYHggUQdkrNdmGeYGxqZFYgG5a4LWZ-17E6x5yL87LhH-oErepE6xe6oyy-DnHaf7rWnRPqxSuilW5lQ",
35
35
  articleId: 238,
36
36
  category: 846,
37
37
  version: 2,
38
38
  productSelected: {
39
- id_article: 35319,
40
- id_category: "2146",
41
- name: "FOCO LED A19 (60W) LUZ AMARILLA",
42
- upc: "120873",
43
- timestamp: "2022-06-14T15:31:50.000Z",
44
- status: "NULL",
45
- categoryName: "ILUMINACIÓN|FOCOS|LEDS",
46
- asignations: [],
39
+ orderId: 14,
40
+ article_status: "AP",
41
+ datasheet_status: "AC",
42
+ description_status: "AC",
43
+ images_status: "AP",
44
+ prio: "none",
47
45
  version: 2,
48
- version_status: "AA",
49
- retailersAvailable: [{
50
- id: 58,
51
- name: "The Home Depot Golden",
46
+ brand: null,
47
+ article: {
48
+ category: "ILUMINACIÓN|FOCOS|LEDS",
49
+ company_name: "COMPANY DEV",
52
50
  country: "México",
53
- id_region: 1,
54
- active: 1
51
+ id_category: "2146",
52
+ id_article: 35705,
53
+ name: "FOCO LED A19 (60W) LUZ AMARILLA",
54
+ upc: "12087311111"
55
+ },
56
+ retailers: [{
57
+ id: 58,
58
+ name: "The Home Depot Golden"
59
+ }, {
60
+ id: 59,
61
+ name: "The Home Depot Platinum"
62
+ }, {
63
+ id: 60,
64
+ name: "The Home Depot Resizing"
65
+ }, {
66
+ id: 61,
67
+ name: "Home Depot TAB"
55
68
  }],
56
- missing: {
57
- datasheet: 33,
58
- description: 0,
59
- image: 23
60
- }
69
+ services: {
70
+ datasheets: 1,
71
+ descriptions: 1,
72
+ images: 1
73
+ },
74
+ id_article: 35705,
75
+ retailersAvailable: [{
76
+ id: 58,
77
+ name: "The Home Depot Golden"
78
+ }, {
79
+ id: 59,
80
+ name: "The Home Depot Platinum"
81
+ }, {
82
+ id: 60,
83
+ name: "The Home Depot Resizing"
84
+ }, {
85
+ id: 61,
86
+ name: "Home Depot TAB"
87
+ }]
61
88
  },
62
89
  productToEdit: {
90
+ ArticleId: 35705,
63
91
  idCategory: "2146",
64
- ArticleId: 35319,
65
- product: [{
66
- id_article: 35319,
67
- id_category: "2146",
68
- name: "FOCO LED A19 (60W) LUZ AMARILLA",
69
- upc: "120873",
70
- timestamp: "2022-06-14T15:31:50.000Z",
71
- status: "NULL",
72
- categoryName: "ILUMINACIÓN|FOCOS|LEDS",
73
- asignations: [],
92
+ product: {
93
+ orderId: 14,
94
+ article_status: "AP",
95
+ datasheet_status: "AC",
96
+ description_status: "AC",
97
+ images_status: "AP",
98
+ prio: "none",
74
99
  version: 2,
75
- version_status: "AA",
76
- retailersAvailable: [{
77
- id: 58,
78
- name: "The Home Depot Golden",
100
+ brand: null,
101
+ article: {
102
+ category: "ILUMINACIÓN|FOCOS|LEDS",
103
+ company_name: "COMPANY DEV",
79
104
  country: "México",
80
- id_region: 1,
81
- active: 1
105
+ id_category: "2146",
106
+ id_article: 35705,
107
+ name: "FOCO LED A19 (60W) LUZ AMARILLA",
108
+ upc: "12087311111"
109
+ },
110
+ retailers: [{
111
+ id: 58,
112
+ name: "The Home Depot Golden"
113
+ }, {
114
+ id: 59,
115
+ name: "The Home Depot Platinum"
116
+ }, {
117
+ id: 60,
118
+ name: "The Home Depot Resizing"
119
+ }, {
120
+ id: 61,
121
+ name: "Home Depot TAB"
82
122
  }],
83
- missing: {
84
- datasheet: 33,
85
- description: 0,
86
- image: 23
87
- }
88
- }]
123
+ services: {
124
+ datasheets: 1,
125
+ descriptions: 1,
126
+ images: 1
127
+ },
128
+ id_article: 35705,
129
+ retailersAvailable: [{
130
+ id: 58,
131
+ name: "The Home Depot Golden"
132
+ }, {
133
+ id: 59,
134
+ name: "The Home Depot Platinum"
135
+ }, {
136
+ id: 60,
137
+ name: "The Home Depot Resizing"
138
+ }, {
139
+ id: 61,
140
+ name: "Home Depot TAB"
141
+ }]
142
+ }
89
143
  },
90
144
  location: {
91
145
  product: {
@@ -93,39 +147,39 @@ ProviderProductEditionDefault.args = {
93
147
  versionId: 3
94
148
  },
95
149
  state: {
96
- origin: "RequestWithContentoh"
150
+ origin: "Contentoh"
97
151
  }
98
152
  },
99
153
  user: {
100
- id_user: 28,
101
- name: "Proveedor",
102
- last_name: "Colgate",
103
- email: "ilopez@contentoh.com",
104
- position: "Prueba Admin",
154
+ id_user: 59,
155
+ name: "The Home",
156
+ last_name: "Depot",
157
+ email: "cadena.ismael@allfreemail.net",
158
+ position: "Admin",
105
159
  telephone: "+523111366336",
106
160
  country: "México",
107
- id_company: 1,
108
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
161
+ id_company: 7,
162
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
109
163
  birth_Date: null,
110
164
  about_me: null,
111
165
  zip_code: null,
112
166
  address: null,
113
167
  job: null,
114
- id_stripe: "cus_KuEt6R6vwmN09f",
168
+ id_stripe: "",
115
169
  id_role: 0,
116
170
  active: 1,
117
- is_retailer: 0,
171
+ is_retailer: 1,
118
172
  membership: {
119
- id: 38,
120
- start_date: "2022-01-18T17:25:35.000Z",
121
- end_date: "2023-01-18T17:25:35.000Z",
122
- planID: 8,
123
- plan: "prod_KtlhECVSFG2iro",
124
- name: "Plan Pro",
125
- user_limit: "20",
126
- products_limit: "5000",
173
+ id: 24,
174
+ start_date: "2021-11-23T03:35:50.000Z",
175
+ end_date: "2022-11-23T03:35:50.000Z",
176
+ planID: 9,
177
+ plan: "prod_KtlkzZVGq6bRTO",
178
+ name: "Plan Enterprise Full",
179
+ user_limit: "30",
180
+ products_limit: "10000",
127
181
  type: "Enterprise"
128
182
  },
129
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655246340910"
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655492937526"
130
184
  }
131
185
  };
@@ -478,14 +478,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
478
478
  case 2:
479
479
  services = _context2.sent;
480
480
  //Converts the data inside the datasheets object to array
481
- setServices(services); //setActiveRetailer(product?.retailers[0]);
481
+ setServices(services);
482
+ getServices(); //setActiveRetailer(product?.retailers[0]);
482
483
 
483
484
  setImages({
484
485
  action: "init",
485
486
  init: services[2]
486
487
  });
487
488
  if (((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
488
- setActiveRetailer(product.retailers ? product.retailers[0] : product.retailersAvailable[0]);
489
489
  (0, _data2.getPercentage)({
490
490
  data: [product]
491
491
  }).then(function (res) {
@@ -621,12 +621,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
621
621
  while (1) {
622
622
  switch (_context5.prev = _context5.next) {
623
623
  case 0:
624
- loadData(); // getPercentage({ data: [product] }).then((res) =>
624
+ loadData();
625
+ setActiveRetailer(product.retailers ? product.retailers[0] : product.retailersAvailable[0]); // getPercentage({ data: [product] }).then((res) =>
625
626
  // setPercentages(res)
626
627
  // );
627
628
 
628
629
  getCart();
629
- getServices();
630
630
  _context5.t0 = setUserGroups;
631
631
  _context5.next = 6;
632
632
  return (0, _data2.fetchUsers)(token);
@@ -1696,8 +1696,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1696
1696
  sessionStorage.setItem("productEdit", JSON.stringify(prod));
1697
1697
  setProduct(prod);
1698
1698
  setShowGenericModal && setShowGenericModal(false);
1699
+ loadData();
1699
1700
 
1700
- case 13:
1701
+ case 14:
1701
1702
  case "end":
1702
1703
  return _context14.stop();
1703
1704
  }
@@ -1950,7 +1951,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1950
1951
  onClick: function onClick() {
1951
1952
  //setModalSent(true);
1952
1953
  sendEvaluation();
1953
- setMessage("\xA1Evaluaci\xF3n de ".concat(translateConcept(), " completada!"));
1954
+ setMessage("\xA1Evaluaci\xF3n de ".concat(activeTab, " completada!"));
1954
1955
  }
1955
1956
  })]
1956
1957
  }) : revision ? null : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -1960,15 +1961,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1960
1961
  children: "Los atributos son requeridos por las plataformas de las cadenas, es muy importante completar los campos requeridos ya que pueden rechazar el producto por falta de informaci\xF3n."
1961
1962
  })
1962
1963
  }), inCart ? /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
1963
- type: "button",
1964
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactRouterDom.Link, {
1965
- to: "/checkout",
1966
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1967
- children: "Articulo en carrito"
1968
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
1969
- children: "Ir a checkout"
1970
- })]
1971
- })
1964
+ type: "button"
1972
1965
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1973
1966
  onClick: function onClick() {
1974
1967
  setShowContentohRequestModal && setShowContentohRequestModal(true);
@@ -1981,7 +1974,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1981
1974
  }), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImageModal.ProductImageModal, {
1982
1975
  images: images,
1983
1976
  setShowModal: setShowModal
1984
- }), message.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
1977
+ }), message.length > 0 && !showSurvey && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
1985
1978
  buttonType: componentsArray.length > 0 && "delete-product",
1986
1979
  componentsArray: componentsArray.length > 0 ? componentsArray : [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1987
1980
  src: _genericModalCheck.default,