contentoh-components-library 21.1.88 → 21.1.91
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.
- package/dist/components/atoms/InputFormatter/index.js +4 -3
- package/dist/components/atoms/Select/index.js +1 -1
- package/dist/components/molecules/TableHeader/index.js +6 -2
- package/dist/components/organisms/ImageDataTable/index.js +6 -2
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +120 -71
- package/dist/components/pages/ProviderProductEdition/index.js +61 -7
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +30 -30
- package/dist/components/pages/RetailerProductEdition/index.js +61 -11
- package/package.json +1 -1
- package/src/components/atoms/InputFormatter/index.js +4 -7
- package/src/components/atoms/Select/index.js +1 -1
- package/src/components/molecules/TableHeader/index.js +4 -0
- package/src/components/organisms/ImageDataTable/index.js +4 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +144 -87
- package/src/components/pages/ProviderProductEdition/index.js +46 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +30 -31
- package/src/components/pages/RetailerProductEdition/index.js +40 -4
|
@@ -62,7 +62,8 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
62
62
|
var maxLength = maxChar ? maxChar : 999;
|
|
63
63
|
|
|
64
64
|
var getValue = function getValue(value) {
|
|
65
|
-
|
|
65
|
+
console.log(value);
|
|
66
|
+
var temp = value.replace(/\n/gm, "<br>").replace(/\&(nbsp;|amp;)/gm, " ");
|
|
66
67
|
return temp;
|
|
67
68
|
}; //const quillRef = useRef();
|
|
68
69
|
|
|
@@ -74,7 +75,7 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
var valueFormater = function valueFormater(value) {
|
|
77
|
-
return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(
|
|
78
|
+
return value.replace(/<\/p><p>/gm, "\n").replace(/<\/?br>|<\/?p>/gm, "").replace(/\&(nbsp;|amp;)/gm, " ");
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
var _onChange = function onChange(valueInput, delta, user, h) {
|
|
@@ -82,7 +83,7 @@ var InputFormatter = function InputFormatter(_ref) {
|
|
|
82
83
|
|
|
83
84
|
try {
|
|
84
85
|
if (h.getLength() - 1 <= maxLength) {
|
|
85
|
-
var unformattedText = valueInput.replace(/<li.*?>/gm, " - ").replace(/<\/li>/gm, "\n").replace(/<\/p><p>/gm, "\n").replaceAll(/<\/?(?!\/?strong).*?>/gm, "").replace(
|
|
86
|
+
var unformattedText = valueInput.replace(/<li.*?>/gm, " - ").replace(/<\/li>/gm, "\n").replace(/<\/p><p>/gm, "\n").replaceAll(/<\/?(?!\/?strong).*?>/gm, "").replace(/\&(nbsp;|amp;)/gm, " ");
|
|
86
87
|
setInputValue(valueInput);
|
|
87
88
|
value = unformattedText;
|
|
88
89
|
} else {
|
|
@@ -16,7 +16,7 @@ function Select(props) {
|
|
|
16
16
|
id: props.id,
|
|
17
17
|
width: props.width,
|
|
18
18
|
onChange: props.onChange,
|
|
19
|
-
|
|
19
|
+
value: props.valueSelected ? props.valueSelected : "",
|
|
20
20
|
className: props.className,
|
|
21
21
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
22
22
|
value: "",
|
|
@@ -22,7 +22,9 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
22
22
|
setAssignation = _ref.setAssignation,
|
|
23
23
|
isRetailer = _ref.isRetailer,
|
|
24
24
|
onClickSave = _ref.onClickSave,
|
|
25
|
-
showSaveButton = _ref.showSaveButton
|
|
25
|
+
showSaveButton = _ref.showSaveButton,
|
|
26
|
+
version = _ref.version,
|
|
27
|
+
setShowVersionSelector = _ref.setShowVersionSelector;
|
|
26
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
27
29
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
28
30
|
text: (activeImage === null || activeImage === void 0 ? void 0 : activeImage.name) || "-",
|
|
@@ -34,7 +36,9 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
34
36
|
setAssignation: setAssignation,
|
|
35
37
|
isRetailer: isRetailer,
|
|
36
38
|
onClickSave: onClickSave,
|
|
37
|
-
showSaveButton: showSaveButton
|
|
39
|
+
showSaveButton: showSaveButton,
|
|
40
|
+
version: version,
|
|
41
|
+
setShowVersionSelector: setShowVersionSelector
|
|
38
42
|
})]
|
|
39
43
|
});
|
|
40
44
|
};
|
|
@@ -32,7 +32,9 @@ var ImageDataTable = function ImageDataTable(_ref) {
|
|
|
32
32
|
setAssignation = _ref.setAssignation,
|
|
33
33
|
isRetailer = _ref.isRetailer,
|
|
34
34
|
onClickSave = _ref.onClickSave,
|
|
35
|
-
showSaveButton = _ref.showSaveButton
|
|
35
|
+
showSaveButton = _ref.showSaveButton,
|
|
36
|
+
version = _ref.version,
|
|
37
|
+
setShowVersionSelector = _ref.setShowVersionSelector;
|
|
36
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
37
39
|
darkMode: darkMode,
|
|
38
40
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TableHeader.TableHeader, {
|
|
@@ -42,7 +44,9 @@ var ImageDataTable = function ImageDataTable(_ref) {
|
|
|
42
44
|
setAssignation: setAssignation,
|
|
43
45
|
isRetailer: isRetailer,
|
|
44
46
|
showSaveButton: showSaveButton,
|
|
45
|
-
onClickSave: onClickSave
|
|
47
|
+
onClickSave: onClickSave,
|
|
48
|
+
version: version,
|
|
49
|
+
setShowVersionSelector: setShowVersionSelector
|
|
46
50
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles2.Container, {
|
|
47
51
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
48
52
|
headerType: "table-row-text",
|
|
@@ -31,75 +31,107 @@ ProviderProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": true,
|
|
32
32
|
Imágenes: true
|
|
33
33
|
},
|
|
34
|
-
token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.
|
|
34
|
+
token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhYmUxODhlMi0yNWIxLTRhMTktODY3Mi0wZDRiYzExYTliZjIiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImFiZTE4OGUyLTI1YjEtNGExOS04NjcyLTBkNGJjMTFhOWJmMiIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJiZTE5OWE0ZS1lYTYwLTQwYTktODIwNC02ODZlOWI1ODczMGQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1OTUzOTczMiwibmFtZSI6IlJldGFpbGVyIEFjYyIsInBob25lX251bWJlciI6Iis1MjMxMTExMTExMTEiLCJleHAiOjE2NTk1NDMzMzIsImlhdCI6MTY1OTUzOTczMiwiZW1haWwiOiJyZXRhaWxlclRoZEBBbGxGcmVlTWFpbC5uZXQifQ.HSIFFKD5jkoRPzh9uxNUnXkkp6IX7iKeOqRePrzin-XlG7KauuoHvv7M-dWGJB_xRg-C1uGIG7gKOFP7oM3BGuVqrlIzs-z3uKNSBz0raq3-tRUHRMKo30HGwdh9Q8X8F9RAEZ0-lpIoTCoMS4ua6OJVG_qPRGJHVF2_mzAxof81oHHj5tv-SC6lrJYc5UqDj97y_e-rGakVyVV7VXeKAJlnmw4y52_WDlbOq3W2e_wI8NuNiiEBYXgWSm5j_rzB4-BuF3nUNheKpimZEn1wTULHLo-Izj_WPdPS1l5yTi9oF09QZht_Te0o3SZliBPKgVcH8cycReoACukbY2BPPQ",
|
|
35
35
|
articleId: 238,
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
categoryName: "Salud y Belleza|Cuidado Facial|Cremas, Mascarillas y Tratamientos",
|
|
46
|
-
asignations: [],
|
|
39
|
+
orderId: 1936,
|
|
40
|
+
article_status: "AP",
|
|
41
|
+
datasheet_status: "NS",
|
|
42
|
+
description_status: "NS",
|
|
43
|
+
images_status: "AP",
|
|
44
|
+
prio: "none",
|
|
47
45
|
version: 3,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
brand: null,
|
|
47
|
+
article: {
|
|
48
|
+
category: "Herramientas|Herramientas Manuales|Espátulas y Llanas",
|
|
49
|
+
company_name: "TRUPER SA DE CV",
|
|
50
|
+
id_company: 301,
|
|
51
|
+
country: null,
|
|
52
|
+
id_category: "2125",
|
|
53
|
+
id_article: 28099,
|
|
54
|
+
name: 'Espátula flexible, mango de madera, 6"',
|
|
55
|
+
upc: "90364"
|
|
56
|
+
},
|
|
57
|
+
retailers: [{
|
|
58
|
+
id: 58,
|
|
59
|
+
name: "The Home Depot Golden"
|
|
60
|
+
}, {
|
|
61
|
+
id: 59,
|
|
62
|
+
name: "The Home Depot Platinum"
|
|
55
63
|
}],
|
|
56
|
-
|
|
64
|
+
services: {
|
|
65
|
+
datasheets: 0,
|
|
66
|
+
descriptions: 0,
|
|
67
|
+
images: 1
|
|
68
|
+
},
|
|
69
|
+
statusByRetailer: {
|
|
70
|
+
59: {
|
|
71
|
+
images: "AP"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
retailersWithService: ["59"],
|
|
75
|
+
checked: false,
|
|
76
|
+
id_article: 28099,
|
|
77
|
+
retailersAvailable: [{
|
|
78
|
+
id: 58,
|
|
79
|
+
name: "The Home Depot Golden"
|
|
80
|
+
}, {
|
|
81
|
+
id: 59,
|
|
82
|
+
name: "The Home Depot Platinum"
|
|
83
|
+
}]
|
|
57
84
|
},
|
|
58
85
|
productToEdit: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
product:
|
|
62
|
-
orderId:
|
|
63
|
-
|
|
64
|
-
status: "AC",
|
|
86
|
+
ArticleId: 28099,
|
|
87
|
+
idCategory: "2125",
|
|
88
|
+
product: {
|
|
89
|
+
orderId: 1936,
|
|
90
|
+
article_status: "AP",
|
|
65
91
|
datasheet_status: "NS",
|
|
66
|
-
prio: "none",
|
|
67
|
-
version: 2,
|
|
68
92
|
description_status: "NS",
|
|
69
|
-
images_status: "
|
|
93
|
+
images_status: "AP",
|
|
94
|
+
prio: "none",
|
|
95
|
+
version: 3,
|
|
70
96
|
brand: null,
|
|
71
|
-
missing: {
|
|
72
|
-
datasheet: 0,
|
|
73
|
-
descriptions: 0,
|
|
74
|
-
images: 0
|
|
75
|
-
},
|
|
76
97
|
article: {
|
|
77
|
-
category: "
|
|
78
|
-
company_name: "
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
98
|
+
category: "Herramientas|Herramientas Manuales|Espátulas y Llanas",
|
|
99
|
+
company_name: "TRUPER SA DE CV",
|
|
100
|
+
id_company: 301,
|
|
101
|
+
country: null,
|
|
102
|
+
id_category: "2125",
|
|
103
|
+
id_article: 28099,
|
|
104
|
+
name: 'Espátula flexible, mango de madera, 6"',
|
|
105
|
+
upc: "90364"
|
|
84
106
|
},
|
|
85
107
|
retailers: [{
|
|
86
|
-
id:
|
|
87
|
-
name: "The Home Depot
|
|
108
|
+
id: 58,
|
|
109
|
+
name: "The Home Depot Golden"
|
|
110
|
+
}, {
|
|
111
|
+
id: 59,
|
|
112
|
+
name: "The Home Depot Platinum"
|
|
88
113
|
}],
|
|
89
114
|
services: {
|
|
90
115
|
datasheets: 0,
|
|
91
116
|
descriptions: 0,
|
|
92
117
|
images: 1
|
|
93
118
|
},
|
|
119
|
+
statusByRetailer: {
|
|
120
|
+
59: {
|
|
121
|
+
images: "AP"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
retailersWithService: ["59"],
|
|
94
125
|
checked: false,
|
|
126
|
+
id_article: 28099,
|
|
95
127
|
retailersAvailable: [{
|
|
96
|
-
id:
|
|
97
|
-
name: "The Home Depot
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
128
|
+
id: 58,
|
|
129
|
+
name: "The Home Depot Golden"
|
|
130
|
+
}, {
|
|
131
|
+
id: 59,
|
|
132
|
+
name: "The Home Depot Platinum"
|
|
133
|
+
}]
|
|
134
|
+
}
|
|
103
135
|
},
|
|
104
136
|
location: {
|
|
105
137
|
state: {
|
|
@@ -107,15 +139,15 @@ ProviderProductEditionDefault.args = {
|
|
|
107
139
|
}
|
|
108
140
|
},
|
|
109
141
|
user: {
|
|
110
|
-
id_user:
|
|
111
|
-
name: "
|
|
112
|
-
last_name: "
|
|
113
|
-
email: "
|
|
114
|
-
position: "
|
|
115
|
-
telephone: "+
|
|
142
|
+
id_user: 1237,
|
|
143
|
+
name: "The Home",
|
|
144
|
+
last_name: "Depot",
|
|
145
|
+
email: "retailerThd@AllFreeMail.net",
|
|
146
|
+
position: "Retailer",
|
|
147
|
+
telephone: "+523111111111",
|
|
116
148
|
country: "México",
|
|
117
|
-
id_company:
|
|
118
|
-
id_cognito: "
|
|
149
|
+
id_company: 817,
|
|
150
|
+
id_cognito: "abe188e2-25b1-4a19-8672-0d4bc11a9bf2",
|
|
119
151
|
birth_Date: null,
|
|
120
152
|
about_me: null,
|
|
121
153
|
zip_code: null,
|
|
@@ -124,12 +156,12 @@ ProviderProductEditionDefault.args = {
|
|
|
124
156
|
id_stripe: null,
|
|
125
157
|
id_role: 0,
|
|
126
158
|
active: 1,
|
|
127
|
-
is_retailer:
|
|
159
|
+
is_retailer: 1,
|
|
128
160
|
email_notify: 1,
|
|
129
161
|
membership: {
|
|
130
|
-
id:
|
|
131
|
-
start_date: "2022-06-
|
|
132
|
-
end_date: "2023-06-
|
|
162
|
+
id: 798,
|
|
163
|
+
start_date: "2022-06-19T04:25:07.000Z",
|
|
164
|
+
end_date: "2023-06-19T04:25:07.000Z",
|
|
133
165
|
planID: 6,
|
|
134
166
|
plan: "prod_KvGd6YSTJyR3AP",
|
|
135
167
|
name: "Plan Small",
|
|
@@ -137,20 +169,37 @@ ProviderProductEditionDefault.args = {
|
|
|
137
169
|
products_limit: "1000",
|
|
138
170
|
type: "Enterprise"
|
|
139
171
|
},
|
|
140
|
-
src: "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
172
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-1237/1237.png?1659539733360"
|
|
141
173
|
},
|
|
142
174
|
company: {
|
|
143
|
-
id_company:
|
|
144
|
-
trade_name: "
|
|
145
|
-
company_name: "
|
|
146
|
-
rfc:
|
|
147
|
-
adress: "",
|
|
148
|
-
about_company:
|
|
149
|
-
telephone:
|
|
150
|
-
web_site:
|
|
151
|
-
zip_code:
|
|
175
|
+
id_company: 817,
|
|
176
|
+
trade_name: "Retailer acc",
|
|
177
|
+
company_name: "Retailer acc",
|
|
178
|
+
rfc: "ASER12345",
|
|
179
|
+
adress: "Av. Insurgentes",
|
|
180
|
+
about_company: null,
|
|
181
|
+
telephone: null,
|
|
182
|
+
web_site: null,
|
|
183
|
+
zip_code: null,
|
|
152
184
|
email: null,
|
|
153
|
-
social_link:
|
|
154
|
-
is_retailer:
|
|
185
|
+
social_link: null,
|
|
186
|
+
is_retailer: 1,
|
|
187
|
+
retailers: [{
|
|
188
|
+
id: 58,
|
|
189
|
+
name: "The Home Depot Golden",
|
|
190
|
+
country: "México"
|
|
191
|
+
}, {
|
|
192
|
+
id: 59,
|
|
193
|
+
name: "The Home Depot Platinum",
|
|
194
|
+
country: "México"
|
|
195
|
+
}, {
|
|
196
|
+
id: 60,
|
|
197
|
+
name: "The Home Depot Resizing",
|
|
198
|
+
country: "México"
|
|
199
|
+
}, {
|
|
200
|
+
id: 61,
|
|
201
|
+
name: "Home Depot TAB",
|
|
202
|
+
country: "México"
|
|
203
|
+
}]
|
|
155
204
|
}
|
|
156
205
|
};
|
|
@@ -15,10 +15,10 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
15
15
|
|
|
16
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
17
17
|
|
|
18
|
-
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
19
|
-
|
|
20
18
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
21
19
|
|
|
20
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
21
|
+
|
|
22
22
|
var _styles = require("./styles");
|
|
23
23
|
|
|
24
24
|
var _HeaderTop = require("../../molecules/HeaderTop");
|
|
@@ -104,12 +104,27 @@ var _CreateVersion = require("../../organisms/CreateVersion");
|
|
|
104
104
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
105
105
|
|
|
106
106
|
var reducerImages = function reducerImages(state, action) {
|
|
107
|
+
var _action$init, _action$init$inputsBy;
|
|
108
|
+
|
|
107
109
|
var values = state.values,
|
|
108
|
-
attrForImgs = state.attrForImgs
|
|
110
|
+
attrForImgs = state.attrForImgs,
|
|
111
|
+
inputsByRetailer = state.inputsByRetailer;
|
|
109
112
|
|
|
110
113
|
switch (action.action) {
|
|
111
114
|
case "init":
|
|
112
|
-
|
|
115
|
+
var newInputsByRetailer = {};
|
|
116
|
+
action === null || action === void 0 ? void 0 : (_action$init = action.init) === null || _action$init === void 0 ? void 0 : (_action$init$inputsBy = _action$init.inputsByRetailer) === null || _action$init$inputsBy === void 0 ? void 0 : _action$init$inputsBy.forEach(function (inputs) {
|
|
117
|
+
inputs === null || inputs === void 0 ? void 0 : inputs.forEach(function (input) {
|
|
118
|
+
if (!newInputsByRetailer["".concat(input.id_retailer)]) newInputsByRetailer["".concat(input.id_retailer)] = [];
|
|
119
|
+
newInputsByRetailer["".concat(input.id_retailer)].push(input);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
inputsByRetailer = newInputsByRetailer;
|
|
123
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, action.init), {}, {
|
|
124
|
+
inputsByRetailer: inputsByRetailer,
|
|
125
|
+
valuesInitial: action.init.values,
|
|
126
|
+
inputsInitial: action.init.inputs
|
|
127
|
+
});
|
|
113
128
|
|
|
114
129
|
case "addImg":
|
|
115
130
|
values = [].concat((0, _toConsumableArray2.default)(values), [action.img]);
|
|
@@ -124,7 +139,14 @@ var reducerImages = function reducerImages(state, action) {
|
|
|
124
139
|
});
|
|
125
140
|
|
|
126
141
|
case "changeAttrValue":
|
|
127
|
-
attrForImgs
|
|
142
|
+
var index = attrForImgs.general.findIndex(function (f) {
|
|
143
|
+
return f.id = action.id;
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
if (index !== -1) {
|
|
147
|
+
attrForImgs.general[index].value = action.value;
|
|
148
|
+
}
|
|
149
|
+
|
|
128
150
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state), {}, {
|
|
129
151
|
attrForImgs: attrForImgs,
|
|
130
152
|
values: values
|
|
@@ -138,6 +160,32 @@ var reducerImages = function reducerImages(state, action) {
|
|
|
138
160
|
values: values
|
|
139
161
|
});
|
|
140
162
|
|
|
163
|
+
case "orderImages":
|
|
164
|
+
{
|
|
165
|
+
var _inputsByRetailer$act;
|
|
166
|
+
|
|
167
|
+
var _inputsByRetailer = state.inputsByRetailer,
|
|
168
|
+
valuesInitial = state.valuesInitial,
|
|
169
|
+
inputsInitial = state.inputsInitial,
|
|
170
|
+
inputs = state.inputs;
|
|
171
|
+
var orderedImages = [];
|
|
172
|
+
var imageIdArray = [];
|
|
173
|
+
action.retailerId && ((_inputsByRetailer$act = _inputsByRetailer[action.retailerId]) === null || _inputsByRetailer$act === void 0 ? void 0 : _inputsByRetailer$act.filter(function (input) {
|
|
174
|
+
imageIdArray.push(input.id_image);
|
|
175
|
+
valuesInitial.forEach(function (value) {
|
|
176
|
+
if (value.image_id === input.id_image) orderedImages.push(value);
|
|
177
|
+
});
|
|
178
|
+
}));
|
|
179
|
+
inputs = inputsInitial === null || inputsInitial === void 0 ? void 0 : inputsInitial.filter(function (input) {
|
|
180
|
+
return imageIdArray.includes(input.id);
|
|
181
|
+
});
|
|
182
|
+
values = orderedImages.length > 0 ? orderedImages : valuesInitial;
|
|
183
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state), {}, {
|
|
184
|
+
values: values,
|
|
185
|
+
inputs: inputs
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
141
189
|
default:
|
|
142
190
|
return state;
|
|
143
191
|
}
|
|
@@ -692,6 +740,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
692
740
|
|
|
693
741
|
(0, _react.useEffect)(function () {
|
|
694
742
|
loadInputs();
|
|
743
|
+
setImages({
|
|
744
|
+
action: "orderImages",
|
|
745
|
+
retailerId: activeRetailer.id
|
|
746
|
+
});
|
|
695
747
|
}, [servicesData, activeRetailer, services]);
|
|
696
748
|
|
|
697
749
|
var thumbs = function thumbs() {
|
|
@@ -1636,7 +1688,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1636
1688
|
var _product$services;
|
|
1637
1689
|
|
|
1638
1690
|
return (product === null || product === void 0 ? void 0 : (_product$services = product.services) === null || _product$services === void 0 ? void 0 : _product$services.images) === 1 && updateImages();
|
|
1639
|
-
}
|
|
1691
|
+
},
|
|
1692
|
+
setShowVersionSelector: setShowVersionSelector,
|
|
1693
|
+
version: version
|
|
1640
1694
|
})]
|
|
1641
1695
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1642
1696
|
className: "product-information",
|
|
@@ -1766,7 +1820,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1766
1820
|
}
|
|
1767
1821
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1768
1822
|
tabsSections: tabsSections,
|
|
1769
|
-
status: activeRetailer.id && retailerStatus ? retailerStatus[activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id][getConcept(activeTab)] || "NS" : "-",
|
|
1823
|
+
status: activeRetailer !== null && activeRetailer !== void 0 && activeRetailer.id && retailerStatus && retailerStatus[activeRetailer.id] ? retailerStatus[activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id][getConcept(activeTab)] || "NS" : "-",
|
|
1770
1824
|
activeTab: activeTab,
|
|
1771
1825
|
setActiveTab: setActiveTab,
|
|
1772
1826
|
setImageLayout: setImageLayout,
|
|
@@ -31,49 +31,49 @@ RetailerProductEditionDefault.args = {
|
|
|
31
31
|
"Ficha técnica": false,
|
|
32
32
|
Imágenes: false
|
|
33
33
|
},
|
|
34
|
-
token: "
|
|
34
|
+
token: "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIyM2EzZjQ5Ni00ZTM4LTRlMTItOWJmNS03ZjkwYjc3YTJmMzUiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6IjIzYTNmNDk2LTRlMzgtNGUxMi05YmY1LTdmOTBiNzdhMmYzNSIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiJiYjY1ODZhYS02MzQ5LTQ2ZDgtOTk1Ni00ZGQ3NGEzY2FmODYiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1OTY0OTAyOCwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1OTY1MjYyOCwiaWF0IjoxNjU5NjQ5MDI4LCJlbWFpbCI6ImxhZGlib2g3ODVAbWkxNjYuY29tIn0.OWVf7QX5rQpQAPmqhwGG14kDJhuG051MjYdv6TVMoEi5LrwmamTk8RJiDqgLTOZOgadlQoAHq27w5LnbYqDfQRqJYfj0kh0qTg2lA7xIZCCd-ljvvMtW6XGmd2_XoEhGkrjnZkniBiOaYSpNW_qTV0FiuWNh4enI7k4kl3x48QEPG9Jd7-4q4I21xVEBD1hy_TYhKQzS7H0FP487W89qOMZhOfmyVQkEQjjuzfedJTunm5SmF1AVA7Dvt2bcBMQOPrcB3c5veUtsxf7ta9yS9wGlb8vfcizczNaN5OLATNjdfHMnEUdOYiEBmnOXzcsnnz4mykearBqYEwp3-3XijA",
|
|
35
35
|
productSelected: {
|
|
36
36
|
services: {
|
|
37
37
|
datasheets: 1,
|
|
38
38
|
descriptions: 1,
|
|
39
39
|
images: 1
|
|
40
40
|
},
|
|
41
|
-
orderId:
|
|
42
|
-
status: "
|
|
43
|
-
datasheet_status: "
|
|
41
|
+
orderId: 2012,
|
|
42
|
+
status: "ACA",
|
|
43
|
+
datasheet_status: "ACA",
|
|
44
44
|
prio: "none",
|
|
45
45
|
version: 2,
|
|
46
|
-
description_status: "
|
|
47
|
-
images_status: "
|
|
46
|
+
description_status: "ACA",
|
|
47
|
+
images_status: "ACA",
|
|
48
48
|
article: {
|
|
49
|
-
id_article:
|
|
50
|
-
id_category: "
|
|
51
|
-
name: "
|
|
52
|
-
upc: "
|
|
53
|
-
timestamp: "2022-
|
|
54
|
-
id_user:
|
|
49
|
+
id_article: 77106,
|
|
50
|
+
id_category: "2898",
|
|
51
|
+
name: "INFLABLE CATRINA 2.13M HALLOWEEN",
|
|
52
|
+
upc: "163556",
|
|
53
|
+
timestamp: "2022-07-07T17:01:17.000Z",
|
|
54
|
+
id_user: 1195,
|
|
55
55
|
status: "NULL",
|
|
56
56
|
active: 1,
|
|
57
|
-
company_id:
|
|
57
|
+
company_id: 657,
|
|
58
58
|
SKU: null,
|
|
59
59
|
Descripcion: null,
|
|
60
60
|
Proveedor: null,
|
|
61
61
|
id_proveedor: 0,
|
|
62
62
|
company_name: "",
|
|
63
63
|
country: null,
|
|
64
|
-
id_order:
|
|
64
|
+
id_order: 2012,
|
|
65
65
|
id_datasheet_especialist: 1248,
|
|
66
66
|
id_datasheet_facilitator: 1252,
|
|
67
|
-
id_description_especialist:
|
|
67
|
+
id_description_especialist: 334,
|
|
68
68
|
id_description_facilitator: 1252,
|
|
69
|
-
id_images_especialist:
|
|
69
|
+
id_images_especialist: 1250,
|
|
70
70
|
id_images_facilitator: 1286,
|
|
71
71
|
id_auditor: 1254,
|
|
72
72
|
id_recepcionist: null,
|
|
73
|
-
category: "
|
|
74
|
-
missingAttributes:
|
|
75
|
-
missingDescriptions:
|
|
76
|
-
missingImages:
|
|
73
|
+
category: "Hallowen|Decoración e Inflables|Decoración e Inflables",
|
|
74
|
+
missingAttributes: 3,
|
|
75
|
+
missingDescriptions: 0,
|
|
76
|
+
missingImages: -2
|
|
77
77
|
},
|
|
78
78
|
retailers: [{
|
|
79
79
|
id: 58,
|
|
@@ -83,7 +83,7 @@ RetailerProductEditionDefault.args = {
|
|
|
83
83
|
active: 1
|
|
84
84
|
}],
|
|
85
85
|
country: null,
|
|
86
|
-
upc: "
|
|
86
|
+
upc: "163556"
|
|
87
87
|
},
|
|
88
88
|
location: {
|
|
89
89
|
product: {
|
|
@@ -92,16 +92,16 @@ RetailerProductEditionDefault.args = {
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
user: {
|
|
95
|
-
id_user:
|
|
96
|
-
name: "
|
|
97
|
-
last_name: "
|
|
98
|
-
email: "
|
|
99
|
-
position: "
|
|
95
|
+
id_user: 425,
|
|
96
|
+
name: "Auditor QA",
|
|
97
|
+
last_name: " ",
|
|
98
|
+
email: "ladiboh785@mi166.com",
|
|
99
|
+
position: "Tester",
|
|
100
100
|
telephone: null,
|
|
101
|
-
country:
|
|
101
|
+
country: null,
|
|
102
102
|
id_company: 254,
|
|
103
|
-
id_cognito: "
|
|
104
|
-
birth_Date:
|
|
103
|
+
id_cognito: "23a3f496-4e38-4e12-9bf5-7f90b77a2f35",
|
|
104
|
+
birth_Date: null,
|
|
105
105
|
about_me: null,
|
|
106
106
|
zip_code: null,
|
|
107
107
|
address: null,
|
|
@@ -122,6 +122,6 @@ RetailerProductEditionDefault.args = {
|
|
|
122
122
|
products_limit: "1000",
|
|
123
123
|
type: "Enterprise"
|
|
124
124
|
},
|
|
125
|
-
src: "https://content-management-profile-prod.s3.amazonaws.com/id-
|
|
125
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-425/425.png?1659649029658"
|
|
126
126
|
}
|
|
127
127
|
};
|