contentoh-components-library 21.0.78 → 21.0.81

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 (27) hide show
  1. package/dist/components/atoms/GeneralInput/index.js +27 -4
  2. package/dist/components/atoms/GeneralInput/styles.js +5 -2
  3. package/dist/components/atoms/ScreenHeader/styles.js +1 -1
  4. package/dist/components/atoms/VerticalSideMenuMainPage/index.js +1 -2
  5. package/dist/components/molecules/RegistrationSecondStep/index.js +0 -1
  6. package/dist/components/molecules/TagAndInput/index.js +15 -5
  7. package/dist/components/molecules/TagAndInput/styles.js +10 -2
  8. package/dist/components/organisms/InputGroup/index.js +6 -4
  9. package/dist/components/organisms/InputGroup/styles.js +1 -1
  10. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +32 -39
  11. package/dist/global-files/data.js +0 -1
  12. package/package.json +1 -1
  13. package/src/components/atoms/GeneralInput/index.js +24 -1
  14. package/src/components/atoms/GeneralInput/styles.js +25 -0
  15. package/src/components/atoms/ScreenHeader/styles.js +5 -0
  16. package/src/components/atoms/VerticalSideMenuMainPage/index.js +0 -1
  17. package/src/components/molecules/GalleryElement/index.js +4 -4
  18. package/src/components/molecules/RegistrationSecondStep/index.js +0 -1
  19. package/src/components/molecules/StatusAsignationInfo/index.js +1 -0
  20. package/src/components/molecules/TagAndInput/index.js +8 -1
  21. package/src/components/molecules/TagAndInput/styles.js +28 -0
  22. package/src/components/organisms/InputGroup/index.js +3 -1
  23. package/src/components/organisms/InputGroup/styles.js +2 -2
  24. package/src/components/pages/ProviderProductEdition/index.js +42 -18
  25. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +23 -15
  26. package/src/components/pages/RetailerProductEdition/index.js +48 -22
  27. package/src/global-files/data.js +0 -1
@@ -36,7 +36,10 @@ var GeneralInput = function GeneralInput(_ref) {
36
36
  setUpdatedDescriptions = _ref.setUpdatedDescriptions,
37
37
  maxChar = _ref.maxChar,
38
38
  isRequired = _ref.isRequired,
39
- version = _ref.version;
39
+ version = _ref.version,
40
+ _ref$optionList = _ref.optionList,
41
+ optionList = _ref$optionList === void 0 ? [] : _ref$optionList,
42
+ description = _ref.description;
40
43
 
41
44
  var _useState = (0, _react.useState)({
42
45
  value: inputValue
@@ -90,9 +93,27 @@ var GeneralInput = function GeneralInput(_ref) {
90
93
 
91
94
  setRequiredEmpty(isRequired && (((_textValue$value = textValue.value) === null || _textValue$value === void 0 ? void 0 : _textValue$value.length) === 0 || textValue.value === undefined));
92
95
  }, [textValue]);
93
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
96
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
94
97
  isRequired: requiredEmpty,
95
- children: inputType === "checkbox" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.CheckBox, {
98
+ children: [(optionList === null || optionList === void 0 ? void 0 : optionList.length) > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
99
+ id: "dropdown".concat(inputId) //disabled={!enableInputs}
100
+ ,
101
+ onChange: function onChange(e) {
102
+ return onHandleChange(e);
103
+ },
104
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
105
+ value: "",
106
+ selected: true,
107
+ disabled: true,
108
+ children: description
109
+ }), JSON.parse(optionList || "[]").map(function (element) {
110
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
111
+ value: element,
112
+ selected: element === textValue.value ? "selected" : "",
113
+ children: element
114
+ }, element);
115
+ })]
116
+ }, "dropdownK".concat(inputId)) : inputType === "checkbox" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.CheckBox, {
96
117
  id: inputId,
97
118
  onChange: function onChange(e) {
98
119
  return onHandleChange(e);
@@ -121,7 +142,9 @@ var GeneralInput = function GeneralInput(_ref) {
121
142
  setUpdatedDescriptions: setUpdatedDescriptions,
122
143
  maxChar: maxChar,
123
144
  isRequired: isRequired
124
- })
145
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
146
+ children: description
147
+ })]
125
148
  });
126
149
  };
127
150
 
@@ -15,12 +15,15 @@ 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 width: 100%;\n\n > div {\n label {\n &:before {\n outline: 1px solid ", ";\n }\n }\n }\n\n input,\n textarea {\n width: 100%;\n border: 1px solid\n ", ";\n\n font-family: ", ";\n color: ", ";\n font-weight: normal;\n font-size: 12px;\n line-height: 15px;\n padding: 10px;\n outline: none;\n border-radius: 2px;\n resize: none;\n\n &:focus {\n border: 1px solid ", ";\n }\n }\n"])), function (_ref) {
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n\n > div {\n label {\n &:before {\n outline: 1px solid ", ";\n }\n }\n }\n\n input,\n textarea {\n width: 100%;\n border: 1px solid\n ", ";\n\n font-family: ", ";\n color: ", ";\n font-weight: normal;\n font-size: 12px;\n line-height: 15px;\n padding: 10px;\n outline: none;\n border-radius: 2px;\n resize: none;\n\n &:focus {\n border: 1px solid ", ";\n }\n }\n\n select {\n background: #fafafa;\n outline: none;\n border: 1px solid\n ", ";\n width: 100%;\n cursor: pointer;\n font-family: ", ";\n color: ", ";\n font-size: 12px;\n line-height: 21px;\n padding: 10px;\n border-right: 2px solid #e33aa9;\n\n &:focus {\n border: 1px solid ", ";\n }\n }\n\n p {\n font-family: ", ";\n font-size: 11px;\n color: ", ";\n }\n"])), function (_ref) {
19
19
  var isRequired = _ref.isRequired;
20
20
  return isRequired ? "red" : "none";
21
21
  }, function (_ref2) {
22
22
  var isRequired = _ref2.isRequired;
23
23
  return isRequired ? "red" : "".concat(_variables.GlobalColors.s2);
24
- }, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2);
24
+ }, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2, function (_ref3) {
25
+ var isRequired = _ref3.isRequired;
26
+ return isRequired ? "red" : "".concat(_variables.GlobalColors.s2);
27
+ }, _variables.FontFamily.AvenirNext, _variables.GlobalColors.s4, _variables.GlobalColors.magenta_s2, _variables.FontFamily.Raleway, _variables.GlobalColors.s4);
25
28
 
26
29
  exports.Container = Container;
@@ -15,7 +15,7 @@ var _variables = require("../../../global-files/variables");
15
15
 
16
16
  var _templateObject;
17
17
 
18
- var Container = _styledComponents.default.h2(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-family: ", ";\n font-style: normal;\n font-size: 36px;\n line-height: 42px;\n font-feature-settings: \"pnum\" on, \"lnum\" on;\n color: ", ";\n\n &.with-bold-text {\n span {\n font-family: ", ";\n }\n }\n\n &.product-name-header {\n font-size: 24px;\n line-height: 36px;\n font-weight: 500;\n letter-spacing: -0.015em;\n color: ", ";\n }\n\n &.retailer-name-header {\n font-size: 18px;\n font-weight: 400;\n line-height: 19px;\n color: ", ";\n }\n\n &.input-name-header {\n font-size: 14px;\n line-height: 19px;\n font-weight: 400;\n color: ", ";\n }\n\n &.date-header {\n font-family: ", ";\n color: ", ";\n font-size: 13px;\n font-weight: 400;\n line-height: 18px;\n }\n\n &.table-row-text {\n font-family: ", ";\n color: ", ";\n font-weight: 400;\n font-size: 11px;\n line-height: 18px;\n\n &:last-child {\n min-width: 50px;\n text-align: center;\n }\n }\n\n &.gray-table-row {\n font-family: ", ";\n font-weight: 400;\n font-size: 11px;\n line-height: 19px;\n color: ", ";\n background-color: ", ";\n padding: 1px 3px;\n border-radius: 3px;\n min-width: 50px;\n text-align: center;\n }\n &.header-and-paragraph {\n font-family: ", ";\n font-size: 36px;\n color: ", ";\n p {\n font-family: ", ";\n font-size: 14px;\n color: ", ";\n letter-spacing: -0.015em;\n }\n }\n"])), function (props) {
18
+ var Container = _styledComponents.default.h2(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-family: ", ";\n font-style: normal;\n font-size: 36px;\n line-height: 42px;\n font-feature-settings: \"pnum\" on, \"lnum\" on;\n color: ", ";\n position: relative;\n\n &.with-bold-text {\n span {\n font-family: ", ";\n }\n }\n\n &.product-name-header {\n font-size: 24px;\n line-height: 36px;\n font-weight: 500;\n letter-spacing: -0.015em;\n color: ", ";\n }\n\n &.retailer-name-header {\n font-size: 18px;\n font-weight: 400;\n line-height: 19px;\n color: ", ";\n }\n\n &.input-name-header {\n font-size: 14px;\n line-height: 19px;\n height: 19px;\n max-width: 100%;\n font-weight: 400;\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &.date-header {\n font-family: ", ";\n color: ", ";\n font-size: 13px;\n font-weight: 400;\n line-height: 18px;\n }\n\n &.table-row-text {\n font-family: ", ";\n color: ", ";\n font-weight: 400;\n font-size: 11px;\n line-height: 18px;\n\n &:last-child {\n min-width: 50px;\n text-align: center;\n }\n }\n\n &.gray-table-row {\n font-family: ", ";\n font-weight: 400;\n font-size: 11px;\n line-height: 19px;\n color: ", ";\n background-color: ", ";\n padding: 1px 3px;\n border-radius: 3px;\n min-width: 50px;\n text-align: center;\n }\n &.header-and-paragraph {\n font-family: ", ";\n font-size: 36px;\n color: ", ";\n p {\n font-family: ", ";\n font-size: 14px;\n color: ", ";\n letter-spacing: -0.015em;\n }\n }\n"])), function (props) {
19
19
  return props.fontFamily;
20
20
  }, function (props) {
21
21
  return props.color;
@@ -37,8 +37,7 @@ var VerticalSideMenuMainPage = function VerticalSideMenuMainPage() {
37
37
  trueBar = _useState2[0],
38
38
  setTrueBar = _useState2[1];
39
39
 
40
- var active = function active() {
41
- console.log(window.location.href); //document.getElementById("slidea1").style.border= "1px solid rgb(227, 58, 169)";
40
+ var active = function active() {//document.getElementById("slidea1").style.border= "1px solid rgb(227, 58, 169)";
42
41
  };
43
42
 
44
43
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
@@ -62,7 +62,6 @@ var RegistrationSecondStep = function RegistrationSecondStep(props) {
62
62
  !privacyCheck && (valid = false);
63
63
 
64
64
  if (valid) {
65
- console.log(valid);
66
65
  nuevoUsuario.password = password;
67
66
  sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoUsuario));
68
67
  valid && props.setPaso(3);
@@ -31,13 +31,21 @@ var TagAndInput = function TagAndInput(_ref) {
31
31
  inputCols = _ref.inputCols,
32
32
  inputRows = _ref.inputRows,
33
33
  maxChar = _ref.maxChar,
34
- required = _ref.required;
34
+ required = _ref.required,
35
+ optionList = _ref.optionList,
36
+ description = _ref.description;
35
37
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
36
38
  inputType: inputType,
37
39
  className: "input-container",
38
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
39
- text: label,
40
- headerType: "input-name-header"
40
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
41
+ className: "title-container",
42
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ScreenHeader, {
43
+ text: label,
44
+ headerType: "input-name-header"
45
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
46
+ className: "tooltip",
47
+ children: label
48
+ })]
41
49
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.GeneralInput, {
42
50
  inputId: inputId,
43
51
  inputType: inputType,
@@ -55,7 +63,9 @@ var TagAndInput = function TagAndInput(_ref) {
55
63
  inputCols: inputCols,
56
64
  inputRows: inputRows,
57
65
  maxChar: maxChar,
58
- required: required
66
+ required: required,
67
+ optionList: optionList,
68
+ description: description
59
69
  })]
60
70
  }, "generalTagInput-".concat(inputType));
61
71
  };
@@ -11,11 +11,19 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
11
11
 
12
12
  var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
+ var _variables = require("../../../global-files/variables");
15
+
14
16
  var _templateObject;
15
17
 
16
- var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n & > :first-child {\n & + * {\n margin-top: ", "px;\n }\n }\n"])), function (_ref) {
17
- var inputType = _ref.inputType;
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .title-container {\n position: relative;\n\n .tooltip {\n display: none;\n position: absolute;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: 14px;\n line-height: 19px;\n left: 0;\n top: 0;\n height: fit-content;\n transition: display 2s;\n }\n\n &:hover {\n .tooltip {\n display: block;\n }\n }\n }\n\n & > :first-child {\n & + * {\n margin-top: ", "px;\n }\n }\n & + * {\n margin-top: ", "px;\n }\n"])), _variables.GlobalColors.white, function (_ref) {
19
+ var color = _ref.color;
20
+ return color ? color : _variables.GlobalColors.s5;
21
+ }, _variables.FontFamily.Raleway, function (_ref2) {
22
+ var inputType = _ref2.inputType;
18
23
  return inputType !== "textarea" ? 4 : 15;
24
+ }, function (_ref3) {
25
+ var inputType = _ref3.inputType;
26
+ return inputType !== "textarea" ? 0 : 10;
19
27
  });
20
28
 
21
29
  exports.Container = Container;
@@ -28,7 +28,6 @@ var InputGroup = function InputGroup(_ref) {
28
28
  articleId = _ref.articleId,
29
29
  version = _ref.version,
30
30
  dinamicHeight = _ref.dinamicHeight;
31
- console.log(dataInputs, "dataInputs");
32
31
 
33
32
  var inputTypeValue = function inputTypeValue(type) {
34
33
  switch (type) {
@@ -51,7 +50,7 @@ var InputGroup = function InputGroup(_ref) {
51
50
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
52
51
  className: "inputs-container",
53
52
  children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs = inputGroup.inputs) === null || _inputGroup$inputs === void 0 ? void 0 : _inputGroup$inputs.map(function (input, index) {
54
- var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10;
53
+ var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _dataInputs$input11, _dataInputs$input12;
55
54
 
56
55
  return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
57
56
  inputId: (_dataInputs$input3 = dataInputs[input]) === null || _dataInputs$input3 === void 0 ? void 0 : _dataInputs$input3.id,
@@ -64,7 +63,9 @@ var InputGroup = function InputGroup(_ref) {
64
63
  isRequired: (_dataInputs$input8 = dataInputs[input]) === null || _dataInputs$input8 === void 0 ? void 0 : _dataInputs$input8.required,
65
64
  updatedDatasheets: updatedDatasheets,
66
65
  setUpdatedDatasheets: setUpdatedDatasheets,
67
- maxChar: (_dataInputs$input9 = dataInputs[input]) !== null && _dataInputs$input9 !== void 0 && _dataInputs$input9.max_chars ? (_dataInputs$input10 = dataInputs[input]) === null || _dataInputs$input10 === void 0 ? void 0 : _dataInputs$input10.max_chars : 999
66
+ maxChar: (_dataInputs$input9 = dataInputs[input]) !== null && _dataInputs$input9 !== void 0 && _dataInputs$input9.max_chars ? (_dataInputs$input10 = dataInputs[input]) === null || _dataInputs$input10 === void 0 ? void 0 : _dataInputs$input10.max_chars : 999,
67
+ optionList: (_dataInputs$input11 = dataInputs[input]) === null || _dataInputs$input11 === void 0 ? void 0 : _dataInputs$input11.option_list,
68
+ description: (_dataInputs$input12 = dataInputs[input]) === null || _dataInputs$input12 === void 0 ? void 0 : _dataInputs$input12.description
68
69
  }, index + "-" + ((_dataInputs$input = dataInputs[input]) === null || _dataInputs$input === void 0 ? void 0 : _dataInputs$input.value) + "-" + ((_dataInputs$input2 = dataInputs[input]) === null || _dataInputs$input2 === void 0 ? void 0 : _dataInputs$input2.id)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_TagAndInput.TagAndInput, {
69
70
  inputId: input.id,
70
71
  index: index,
@@ -78,7 +79,8 @@ var InputGroup = function InputGroup(_ref) {
78
79
  setUpdatedDescriptions: setUpdatedDescriptions,
79
80
  articleId: articleId,
80
81
  version: version,
81
- dinamicHeight: dinamicHeight
82
+ dinamicHeight: dinamicHeight,
83
+ description: input === null || input === void 0 ? void 0 : input.description
82
84
  }, index + "-" + (input === null || input === void 0 ? void 0 : input.value));
83
85
  })
84
86
  })]
@@ -15,6 +15,6 @@ 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 border: 1px solid ", ";\n border-radius: 6px;\n padding: 10px;\n width: 100%;\n\n .retailer-name-header {\n & + * {\n margin-top: 10px;\n }\n }\n &.datasheets-layout {\n padding-right: 0;\n\n .inputs-container {\n display: flex;\n flex-wrap: wrap;\n\n .input-container {\n flex: 1 1 20%;\n margin-right: 10px;\n min-width: 227px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n"])), _variables.GlobalColors.s2);
18
+ var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n border-radius: 6px;\n padding: 10px;\n width: 100%;\n\n .retailer-name-header {\n & + * {\n margin-top: 10px;\n }\n }\n &.datasheets-layout {\n padding-right: 0;\n\n .inputs-container {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 5px;\n\n .input-container {\n flex: 1 1 20%;\n min-width: 227px;\n display: flex;\n flex-direction: column;\n }\n }\n }\n\n & + * {\n margin-top: 15px;\n }\n"])), _variables.GlobalColors.s2);
19
19
 
20
20
  exports.Container = Container;
@@ -36,53 +36,46 @@ RetailerProductEditionDefault.args = {
36
36
  category: 846,
37
37
  version: 2,
38
38
  productSelected: {
39
- services: {
40
- datasheets: 1,
41
- descriptions: 1,
42
- images: 1
43
- },
44
- orderId: 152,
45
- status: "ASSIGNED",
46
- datasheet_status: "IN_PROGRESS",
39
+ orderId: 132,
40
+ id_category: "612",
41
+ status: "IN_PROGRESS",
42
+ datasheet_status: "QF",
47
43
  prio: "none",
48
- version: 3,
44
+ version: 2,
49
45
  description_status: "IN_PROGRESS",
50
46
  images_status: "IN_PROGRESS",
47
+ brand: null,
48
+ missing: {
49
+ datasheet: 0,
50
+ descriptions: 0,
51
+ images: 0
52
+ },
51
53
  article: {
52
- id_article: 343,
53
- id_category: "2898",
54
- name: "Producto prueba dos ",
55
- upc: "2004202212",
56
- timestamp: "2022-04-20T17:01:17.000Z",
57
- id_user: 28,
58
- status: "NULL",
59
- active: 1,
60
- company_id: 1,
54
+ category: "ROPA, ACCESORIOS, FRAGANCIAS Y JOYERÍA|ACCESORIOS|COLLARES",
61
55
  company_name: "COMPANY DEV",
62
- country: "México",
63
- id_order: 152,
64
- id_datasheet_especialist: 54,
65
- id_datasheet_facilitator: 52,
66
- id_description_especialist: 54,
67
- id_description_facilitator: 52,
68
- id_images_especialist: 55,
69
- id_images_facilitator: 53,
70
- id_auditor: 30,
71
- id_recepcionist: null,
72
- category: "HALLOWEN|DECORACIÓN E INFLABLES|DECORACIÓN E INFLABLES",
73
- missingAttributes: null,
74
- missingDescriptions: null,
75
- missingImages: null
56
+ id_category: "612",
57
+ id_article: 109490,
58
+ name: "Collar con dije letra ",
59
+ timestamp: "2022-05-05T16:45:49.000Z",
60
+ upc: "123434"
76
61
  },
77
62
  retailers: [{
78
- id: 58,
79
- name: "The Home Depot",
80
- country: "México",
81
- id_region: 1,
82
- active: 1
63
+ id: 2,
64
+ name: "Walmart Mercancías Generales"
65
+ }],
66
+ services: {
67
+ datasheets: 1,
68
+ descriptions: 1,
69
+ images: 1
70
+ },
71
+ checked: false,
72
+ retailersAvailable: [{
73
+ id: 2,
74
+ name: "Walmart Mercancías Generales"
83
75
  }],
84
- country: "México",
85
- upc: "2004202212"
76
+ id_article: 109490,
77
+ categoryName: "ROPA, ACCESORIOS, FRAGANCIAS Y JOYERÍA|ACCESORIOS|COLLARES",
78
+ version_status: "IN_PROGRESS"
86
79
  },
87
80
  location: {
88
81
  product: {
@@ -271,7 +271,6 @@ var getNewStatus = function getNewStatus(statusArray) {
271
271
  statusArray.forEach(function (element) {
272
272
  return lookupString += element + "/";
273
273
  });
274
- console.log(lookupString, "productTemp");
275
274
  if (lookupString.includes("RF")) return "RF";
276
275
  if (lookupString.includes("RA")) return "RA";
277
276
  if (lookupString.includes("RP")) return "RP";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.0.78",
3
+ "version": "21.0.81",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -21,6 +21,8 @@ export const GeneralInput = ({
21
21
  maxChar,
22
22
  isRequired,
23
23
  version,
24
+ optionList = [],
25
+ description,
24
26
  }) => {
25
27
  const [textValue, setTextValue] = useState({
26
28
  value: inputValue,
@@ -72,7 +74,27 @@ export const GeneralInput = ({
72
74
 
73
75
  return (
74
76
  <Container isRequired={requiredEmpty}>
75
- {inputType === "checkbox" ? (
77
+ {optionList?.length > 0 ? (
78
+ <select
79
+ key={`dropdownK${inputId}`}
80
+ id={`dropdown${inputId}`}
81
+ //disabled={!enableInputs}
82
+ onChange={(e) => onHandleChange(e)}
83
+ >
84
+ <option value="" selected disabled>
85
+ {description}
86
+ </option>
87
+ {JSON.parse(optionList || "[]").map((element) => (
88
+ <option
89
+ key={element}
90
+ value={element}
91
+ selected={element === textValue.value ? "selected" : ""}
92
+ >
93
+ {element}
94
+ </option>
95
+ ))}
96
+ </select>
97
+ ) : inputType === "checkbox" ? (
76
98
  <CheckBox
77
99
  id={inputId}
78
100
  onChange={(e) => onHandleChange(e)}
@@ -104,6 +126,7 @@ export const GeneralInput = ({
104
126
  isRequired={isRequired}
105
127
  />
106
128
  )}
129
+ <p>{description}</p>
107
130
  </Container>
108
131
  );
109
132
  };
@@ -32,4 +32,29 @@ export const Container = styled.div`
32
32
  border: 1px solid ${GlobalColors.magenta_s2};
33
33
  }
34
34
  }
35
+
36
+ select {
37
+ background: #fafafa;
38
+ outline: none;
39
+ border: 1px solid
40
+ ${({ isRequired }) => (isRequired ? "red" : `${GlobalColors.s2}`)};
41
+ width: 100%;
42
+ cursor: pointer;
43
+ font-family: ${FontFamily.AvenirNext};
44
+ color: ${GlobalColors.s4};
45
+ font-size: 12px;
46
+ line-height: 21px;
47
+ padding: 10px;
48
+ border-right: 2px solid #e33aa9;
49
+
50
+ &:focus {
51
+ border: 1px solid ${GlobalColors.magenta_s2};
52
+ }
53
+ }
54
+
55
+ p {
56
+ font-family: ${FontFamily.Raleway};
57
+ font-size: 11px;
58
+ color: ${GlobalColors.s4};
59
+ }
35
60
  `;
@@ -9,6 +9,7 @@ export const Container = styled.h2`
9
9
  line-height: 42px;
10
10
  font-feature-settings: "pnum" on, "lnum" on;
11
11
  color: ${(props) => props.color};
12
+ position: relative;
12
13
 
13
14
  &.with-bold-text {
14
15
  span {
@@ -34,8 +35,12 @@ export const Container = styled.h2`
34
35
  &.input-name-header {
35
36
  font-size: 14px;
36
37
  line-height: 19px;
38
+ height: 19px;
39
+ max-width: 100%;
37
40
  font-weight: 400;
38
41
  color: ${({ color }) => (color ? color : GlobalColors.s5)};
42
+ overflow: hidden;
43
+ text-overflow: ellipsis;
39
44
  }
40
45
 
41
46
  &.date-header {
@@ -11,7 +11,6 @@ import React, { useState, useEffect, useCallback } from "react";
11
11
  export const VerticalSideMenuMainPage = () => {
12
12
  const [trueBar, setTrueBar] = useState(false);
13
13
  const active = () => {
14
- console.log(window.location.href);
15
14
  //document.getElementById("slidea1").style.border= "1px solid rgb(227, 58, 169)";
16
15
  };
17
16
  return (
@@ -12,7 +12,7 @@ export const GalleryElement = ({
12
12
  gridLayout = false,
13
13
  id = "chk-default",
14
14
  label,
15
- index,
15
+ number,
16
16
  imageInputs,
17
17
  imageType,
18
18
  imagePackagingType,
@@ -83,7 +83,7 @@ export const GalleryElement = ({
83
83
  action: "changeImageInfo",
84
84
  attribute: "image_id",
85
85
  value: +e.target.value,
86
- index: index,
86
+ index: number,
87
87
  });
88
88
  }}
89
89
  />
@@ -97,7 +97,7 @@ export const GalleryElement = ({
97
97
  action: "changeImageInfo",
98
98
  attribute: "image_type",
99
99
  value: +e.target.value,
100
- index: index,
100
+ index: number,
101
101
  });
102
102
  }}
103
103
  />
@@ -111,7 +111,7 @@ export const GalleryElement = ({
111
111
  action: "changeImageInfo",
112
112
  attribute: "packing_type",
113
113
  value: +e.target.value,
114
- index: index,
114
+ index: number,
115
115
  });
116
116
  }}
117
117
  />
@@ -21,7 +21,6 @@ export const RegistrationSecondStep = (props) => {
21
21
  !termsCheck && (valid = false);
22
22
  !privacyCheck && (valid = false);
23
23
  if (valid) {
24
- console.log(valid)
25
24
  nuevoUsuario.password = password;
26
25
  sessionStorage.setItem("nuevoRegistro", JSON.stringify(nuevoUsuario));
27
26
  valid && props.setPaso(3);
@@ -40,6 +40,7 @@ export const StatusAsignationInfo = ({
40
40
 
41
41
  return (
42
42
  <Container id={id}>
43
+ {status !== "-" && <StatusTag statusType={status} ovalForm={true} />}
43
44
  {showSaveButton && (
44
45
  <Button
45
46
  buttonType={"circular-button save-button"}
@@ -21,6 +21,8 @@ export const TagAndInput = ({
21
21
  inputRows,
22
22
  maxChar,
23
23
  required,
24
+ optionList,
25
+ description,
24
26
  }) => {
25
27
  return (
26
28
  <Container
@@ -28,7 +30,10 @@ export const TagAndInput = ({
28
30
  className={"input-container"}
29
31
  key={`generalTagInput-${inputType}`}
30
32
  >
31
- <ScreenHeader text={label} headerType={"input-name-header"} />
33
+ <div className="title-container">
34
+ <ScreenHeader text={label} headerType={"input-name-header"} />
35
+ <span className="tooltip">{label}</span>
36
+ </div>
32
37
  <GeneralInput
33
38
  inputId={inputId}
34
39
  inputType={inputType}
@@ -47,6 +52,8 @@ export const TagAndInput = ({
47
52
  inputRows={inputRows}
48
53
  maxChar={maxChar}
49
54
  required={required}
55
+ optionList={optionList}
56
+ description={description}
50
57
  />
51
58
  </Container>
52
59
  );
@@ -1,9 +1,37 @@
1
1
  import styled from "styled-components";
2
+ import { FontFamily, GlobalColors } from "../../../global-files/variables";
2
3
 
3
4
  export const Container = styled.div`
5
+ .title-container {
6
+ position: relative;
7
+
8
+ .tooltip {
9
+ display: none;
10
+ position: absolute;
11
+ background-color: ${GlobalColors.white};
12
+ color: ${({ color }) => (color ? color : GlobalColors.s5)};
13
+ font-family: ${FontFamily.Raleway};
14
+ font-size: 14px;
15
+ line-height: 19px;
16
+ left: 0;
17
+ top: 0;
18
+ height: fit-content;
19
+ transition: display 2s;
20
+ }
21
+
22
+ &:hover {
23
+ .tooltip {
24
+ display: block;
25
+ }
26
+ }
27
+ }
28
+
4
29
  & > :first-child {
5
30
  & + * {
6
31
  margin-top: ${({ inputType }) => (inputType !== "textarea" ? 4 : 15)}px;
7
32
  }
8
33
  }
34
+ & + * {
35
+ margin-top: ${({ inputType }) => (inputType !== "textarea" ? 0 : 10)}px;
36
+ }
9
37
  `;
@@ -14,7 +14,6 @@ export const InputGroup = ({
14
14
  version,
15
15
  dinamicHeight,
16
16
  }) => {
17
- console.log(dataInputs, "dataInputs");
18
17
  const inputTypeValue = (type) => {
19
18
  switch (type) {
20
19
  case "Booleano":
@@ -68,6 +67,8 @@ export const InputGroup = ({
68
67
  ? dataInputs[input]?.max_chars
69
68
  : 999
70
69
  }
70
+ optionList={dataInputs[input]?.option_list}
71
+ description={dataInputs[input]?.description}
71
72
  />
72
73
  ) : (
73
74
  <TagAndInput
@@ -85,6 +86,7 @@ export const InputGroup = ({
85
86
  articleId={articleId}
86
87
  version={version}
87
88
  dinamicHeight={dinamicHeight}
89
+ description={input?.description}
88
90
  />
89
91
  )
90
92
  )}
@@ -18,14 +18,14 @@ export const Container = styled.div`
18
18
  .inputs-container {
19
19
  display: flex;
20
20
  flex-wrap: wrap;
21
+ width: 100%;
22
+ gap: 5px;
21
23
 
22
24
  .input-container {
23
25
  flex: 1 1 20%;
24
- margin-right: 10px;
25
26
  min-width: 227px;
26
27
  display: flex;
27
28
  flex-direction: column;
28
- justify-content: space-between;
29
29
  }
30
30
  }
31
31
  }
@@ -210,7 +210,7 @@ export const ProviderProductEdition = ({
210
210
  //setActiveRetailer(product?.retailers[0]);
211
211
  setImages({
212
212
  action: "init",
213
- init: services[2],
213
+ init: JSON.parse(sessionStorage.getItem("imagesList")) || services[2],
214
214
  });
215
215
  if (services[2]?.values?.length > 0) setActiveImage(0);
216
216
 
@@ -375,7 +375,8 @@ export const ProviderProductEdition = ({
375
375
  image={image}
376
376
  gridLayout={imageLayout}
377
377
  id={"gallery-element-" + index}
378
- index={index}
378
+ index={index + "-" + image.name}
379
+ number={index}
379
380
  imageType={imageType}
380
381
  imagePackagingType={imagePackagingType}
381
382
  imageInputs={imageInputs}
@@ -548,6 +549,7 @@ export const ProviderProductEdition = ({
548
549
  }
549
550
  );
550
551
  setMessage("Imágenes guardadas con éxito");
552
+ sessionStorage.removeItem("imagesList");
551
553
  loadData();
552
554
  } catch (error) {
553
555
  console.log(error);
@@ -940,23 +942,42 @@ export const ProviderProductEdition = ({
940
942
  };
941
943
 
942
944
  const deleteImages = () => {
943
- const data = {
944
- articleId: product.id_article,
945
- deleteImages: selectedImages,
946
- };
947
- try {
948
- axios.put(
949
- `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
950
- data,
951
- {
952
- headers: { Authorization: token },
953
- }
954
- );
955
- loadData();
956
- } catch (err) {
957
- console.log(err);
945
+ setLoading(true);
946
+ const imagesTemp = images;
947
+ const { values } = images;
948
+ const imgsInBack = [];
949
+
950
+ selectedImages.forEach((selectedImg) => {
951
+ if (selectedImg.id) imgsInBack.push(selectedImg);
952
+ });
953
+
954
+ const imgsLeft = values.filter(
955
+ (value) => selectedImages.indexOf(value) === -1
956
+ );
957
+
958
+ imagesTemp.values = imgsLeft;
959
+
960
+ if (imgsInBack.length > 0) {
961
+ const data = {
962
+ articleId: product.article.id_article,
963
+ deleteImages: selectedImages,
964
+ };
965
+ try {
966
+ axios.put(
967
+ `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
968
+ data,
969
+ {
970
+ headers: { Authorization: token },
971
+ }
972
+ );
973
+ } catch (err) {
974
+ console.log(err);
975
+ }
958
976
  }
977
+ sessionStorage.setItem("imagesList", JSON.stringify(imagesTemp));
978
+ loadData();
959
979
  setMessage("");
980
+ setComponentsArray([]);
960
981
  };
961
982
 
962
983
  const askToDeleteImages = () => {
@@ -979,7 +1000,10 @@ export const ProviderProductEdition = ({
979
1000
  key={"3"}
980
1001
  buttonType="general-button-default"
981
1002
  label={"Aceptar"}
982
- onClick={() => deleteImages()}
1003
+ onClick={() => {
1004
+ setMessage("");
1005
+ deleteImages();
1006
+ }}
983
1007
  />,
984
1008
  ]);
985
1009
  }
@@ -26,26 +26,26 @@ RetailerProductEditionDefault.args = {
26
26
  descriptions: 1,
27
27
  images: 1,
28
28
  },
29
- orderId: 152,
30
- status: "ASSIGNED",
29
+ orderId: 233,
30
+ status: "IN_PROGRESS",
31
31
  datasheet_status: "IN_PROGRESS",
32
32
  prio: "none",
33
- version: 3,
34
- description_status: "IN_PROGRESS",
35
- images_status: "IN_PROGRESS",
33
+ version: 2,
34
+ description_status: "QF",
35
+ images_status: "QF",
36
36
  article: {
37
- id_article: 343,
38
- id_category: "2898",
39
- name: "Producto prueba dos ",
40
- upc: "2004202212",
41
- timestamp: "2022-04-20T17:01:17.000Z",
37
+ id_article: 190965,
38
+ id_category: "697",
39
+ name: "Shampoo hidratante",
40
+ upc: "6545345",
41
+ timestamp: "2022-06-10T15:05:56.000Z",
42
42
  id_user: 28,
43
43
  status: "NULL",
44
44
  active: 1,
45
45
  company_id: 1,
46
46
  company_name: "COMPANY DEV",
47
47
  country: "México",
48
- id_order: 152,
48
+ id_order: 233,
49
49
  id_datasheet_especialist: 54,
50
50
  id_datasheet_facilitator: 52,
51
51
  id_description_especialist: 54,
@@ -54,22 +54,30 @@ RetailerProductEditionDefault.args = {
54
54
  id_images_facilitator: 53,
55
55
  id_auditor: 30,
56
56
  id_recepcionist: null,
57
- category: "HALLOWEN|DECORACIÓN E INFLABLES|DECORACIÓN E INFLABLES",
57
+ category:
58
+ "SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
58
59
  missingAttributes: null,
59
60
  missingDescriptions: null,
60
61
  missingImages: null,
61
62
  },
62
63
  retailers: [
63
64
  {
64
- id: 58,
65
- name: "The Home Depot",
65
+ id: 4,
66
+ name: "Walmart Super y Superama",
67
+ country: "México",
68
+ id_region: 1,
69
+ active: 1,
70
+ },
71
+ {
72
+ id: 26,
73
+ name: "Mercado Libre",
66
74
  country: "México",
67
75
  id_region: 1,
68
76
  active: 1,
69
77
  },
70
78
  ],
71
79
  country: "México",
72
- upc: "2004202212",
80
+ upc: "6545345",
73
81
  },
74
82
  location: {
75
83
  product: { articleId: 109485, versionId: 3 },
@@ -167,7 +167,7 @@ export const RetailerProductEdition = ({
167
167
  //setActiveRetailer(product?.retailers[0]);
168
168
  setImages({
169
169
  action: "init",
170
- init: services[2],
170
+ init: JSON.parse(sessionStorage.getItem("imagesList")) || services[2],
171
171
  });
172
172
  if (services[2]?.values?.length > 0) setActiveImage(0);
173
173
 
@@ -181,7 +181,9 @@ export const RetailerProductEdition = ({
181
181
 
182
182
  const getServices = async () => {
183
183
  const servicesResponse = await axios.get(
184
- `${process.env.REACT_APP_SERVICES_ENDPOINT}?articleId=${product?.article?.id_article}&orderId=${product?.article?.id_order}&end=true`
184
+ `${process.env.REACT_APP_SERVICES_ENDPOINT}?articleId=${
185
+ product?.article?.id_article
186
+ }&orderId=${product?.article?.id_order || product.orderId}&end=true`
185
187
  );
186
188
  const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
187
189
  setServicesData(parsedResponse);
@@ -357,7 +359,8 @@ export const RetailerProductEdition = ({
357
359
  image={image}
358
360
  gridLayout={imageLayout}
359
361
  id={"gallery-element-" + index}
360
- index={index}
362
+ index={index + "-" + image.name}
363
+ number={index}
361
364
  imageType={imageType}
362
365
  imagePackagingType={imagePackagingType}
363
366
  imageInputs={imageInputs}
@@ -531,6 +534,7 @@ export const RetailerProductEdition = ({
531
534
  }
532
535
  );
533
536
  setMessage("Imágenes guardadas con éxito");
537
+ sessionStorage.removeItem("imagesList");
534
538
  loadData();
535
539
  } catch (error) {
536
540
  console.log(error);
@@ -983,23 +987,42 @@ export const RetailerProductEdition = ({
983
987
  };
984
988
 
985
989
  const deleteImages = () => {
986
- const data = {
987
- articleId: product.article.id_article,
988
- deleteImages: selectedImages,
989
- };
990
- try {
991
- axios.put(
992
- `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
993
- data,
994
- {
995
- headers: { Authorization: token },
996
- }
997
- );
998
- loadData();
999
- } catch (err) {
1000
- console.log(err);
990
+ setLoading(true);
991
+ const imagesTemp = images;
992
+ const { values } = images;
993
+ const imgsInBack = [];
994
+
995
+ selectedImages.forEach((selectedImg) => {
996
+ if (selectedImg.id) imgsInBack.push(selectedImg);
997
+ });
998
+
999
+ const imgsLeft = values.filter(
1000
+ (value) => selectedImages.indexOf(value) === -1
1001
+ );
1002
+
1003
+ imagesTemp.values = imgsLeft;
1004
+
1005
+ if (imgsInBack.length > 0) {
1006
+ const data = {
1007
+ articleId: product.article.id_article,
1008
+ deleteImages: selectedImages,
1009
+ };
1010
+ try {
1011
+ axios.put(
1012
+ `${process.env.REACT_APP_ARTICLE_DATA_ENDPOINT}?image=true&version=${version}`,
1013
+ data,
1014
+ {
1015
+ headers: { Authorization: token },
1016
+ }
1017
+ );
1018
+ } catch (err) {
1019
+ console.log(err);
1020
+ }
1001
1021
  }
1022
+ sessionStorage.setItem("imagesList", JSON.stringify(imagesTemp));
1023
+ loadData();
1002
1024
  setMessage("");
1025
+ setComponentsArray([]);
1003
1026
  };
1004
1027
 
1005
1028
  const askToDeleteImages = () => {
@@ -1022,7 +1045,10 @@ export const RetailerProductEdition = ({
1022
1045
  key={"3"}
1023
1046
  buttonType="general-button-default"
1024
1047
  label={"Aceptar"}
1025
- onClick={() => deleteImages()}
1048
+ onClick={() => {
1049
+ setMessage("");
1050
+ deleteImages();
1051
+ }}
1026
1052
  />,
1027
1053
  ]);
1028
1054
  }
@@ -1127,13 +1153,13 @@ export const RetailerProductEdition = ({
1127
1153
  onClickSave={() => {
1128
1154
  switch (activeTab) {
1129
1155
  case "Descripción":
1130
- product?.services?.descriptions === 1 && saveDescriptions();
1156
+ product?.description_status !== "NS" && saveDescriptions();
1131
1157
  break;
1132
1158
  case "Ficha técnica":
1133
- product?.services?.datasheets === 1 && saveDatasheets();
1159
+ product?.datasheet_status !== "NS" && saveDatasheets();
1134
1160
  break;
1135
1161
  case "Imágenes":
1136
- product?.services?.images === 1 && updateImages();
1162
+ product?.images_status !== "NS" && updateImages();
1137
1163
  break;
1138
1164
 
1139
1165
  default:
@@ -183,7 +183,6 @@ export const fetchUsers = async (auth) => {
183
183
  export const getNewStatus = (statusArray) => {
184
184
  let lookupString = "";
185
185
  statusArray.forEach((element) => (lookupString += element + "/"));
186
- console.log(lookupString, "productTemp");
187
186
  if (lookupString.includes("RF")) return "RF";
188
187
  if (lookupString.includes("RA")) return "RA";
189
188
  if (lookupString.includes("RP")) return "RP";