contentoh-components-library 21.1.62 → 21.1.65
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/.env.development +1 -0
- package/.env.production +1 -0
- package/dist/assets/images/versionSelector/acceptIcon.svg +3 -0
- package/dist/assets/images/versionSelector/addVersion.svg +5 -0
- package/dist/assets/images/versionSelector/closeVersionSelector.svg +4 -0
- package/dist/assets/images/versionSelector/createVersion.svg +3 -0
- package/dist/assets/images/versionSelector/nullIcon.svg +3 -0
- package/dist/assets/images/versionSelector/versionSelected.svg +3 -0
- package/dist/components/atoms/GeneralButton/index.js +3 -1
- package/dist/components/atoms/GeneralButton/styles.js +2 -2
- package/dist/components/atoms/Select/VersionSelect.js +37 -0
- package/dist/components/atoms/Select/index.js +4 -3
- package/dist/components/atoms/Select/style.js +10 -4
- package/dist/components/atoms/SliderToolTip/styles.js +2 -2
- package/dist/components/molecules/StatusAsignationInfo/index.js +9 -1
- package/dist/components/molecules/VersionItem/VersionItem.stories.js +28 -0
- package/dist/components/molecules/VersionItem/index.js +64 -0
- package/dist/components/molecules/VersionItem/styles.js +20 -0
- package/dist/components/organisms/CreateVersion/CreateVersion.stories.js +31 -0
- package/dist/components/organisms/CreateVersion/RenderChilds.js +157 -0
- package/dist/components/organisms/CreateVersion/index.js +170 -0
- package/dist/components/organisms/CreateVersion/styles.js +28 -0
- package/dist/components/organisms/FullTabsMenu/index.js +6 -2
- package/dist/components/organisms/VersionSelector/VersionSelector.stories.js +32 -0
- package/dist/components/organisms/VersionSelector/index.js +129 -0
- package/dist/components/organisms/VersionSelector/styles.js +20 -0
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +78 -104
- package/dist/components/pages/ProviderProductEdition/index.js +35 -16
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +49 -56
- package/dist/components/pages/RetailerProductEdition/index.js +46 -15
- package/dist/global-files/customHooks.js +35 -0
- package/dist/global-files/global-styles.css +1 -0
- package/package.json +1 -1
- package/src/assets/images/versionSelector/acceptIcon.svg +3 -0
- package/src/assets/images/versionSelector/addVersion.svg +5 -0
- package/src/assets/images/versionSelector/closeVersionSelector.svg +4 -0
- package/src/assets/images/versionSelector/createVersion.svg +3 -0
- package/src/assets/images/versionSelector/nullIcon.svg +3 -0
- package/src/assets/images/versionSelector/versionSelected.svg +3 -0
- package/src/components/atoms/GeneralButton/index.js +2 -0
- package/src/components/atoms/GeneralButton/styles.js +18 -0
- package/src/components/atoms/Select/VersionSelect.js +25 -0
- package/src/components/atoms/Select/index.js +1 -1
- package/src/components/atoms/Select/style.js +19 -0
- package/src/components/atoms/SliderToolTip/styles.js +18 -14
- package/src/components/molecules/StatusAsignationInfo/index.js +10 -1
- package/src/components/molecules/VersionItem/VersionItem.stories.js +14 -0
- package/src/components/molecules/VersionItem/index.js +47 -0
- package/src/components/molecules/VersionItem/styles.js +32 -0
- package/src/components/organisms/CreateVersion/CreateVersion.stories.js +14 -0
- package/src/components/organisms/CreateVersion/RenderChilds.js +137 -0
- package/src/components/organisms/CreateVersion/index.js +88 -0
- package/src/components/organisms/CreateVersion/styles.js +79 -0
- package/src/components/organisms/FullTabsMenu/index.js +5 -1
- package/src/components/organisms/VersionSelector/VersionSelector.stories.js +15 -0
- package/src/components/organisms/VersionSelector/index.js +75 -0
- package/src/components/organisms/VersionSelector/styles.js +28 -0
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +97 -134
- package/src/components/pages/ProviderProductEdition/index.js +19 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +49 -56
- package/src/components/pages/RetailerProductEdition/index.js +28 -2
- package/src/global-files/customHooks.js +26 -0
- package/src/global-files/global-styles.css +1 -0
|
@@ -16,171 +16,134 @@ ProviderProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
19
|
+
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5ZTQ0OGMwZS0xOGVkLTRlYWYtOWY4OC0zYjMxOTdkNGEyZmQiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjllNDQ4YzBlLTE4ZWQtNGVhZi05Zjg4LTNiMzE5N2Q0YTJmZCIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiI5ODg5YTFhYi1mMTljLTRiNzQtYjQ5Ni0xZDM3YzZjY2U3YmQiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1NjQzMTQ5OCwibmFtZSI6IkdlcnNvbiBNYXJ0w61uZXoiLCJwaG9uZV9udW1iZXIiOiIrNTIxMjMxMjMxMjMiLCJleHAiOjE2NTY0MzUwOTgsImlhdCI6MTY1NjQzMTQ5OCwiZW1haWwiOiJnbWFydGluZXpAY29udGVudG9oLmNvbSJ9.qMBMYKxcaQrXT-3373y3K4eX73vgRApuFsT9-FVl9AuP_BKy51nHReEvwWHO4SMVpFxf3eHoQhUHG2PTl8qlvnoXlLqfCdgJEnq5DMFIOqcs_WzUHfb3k4r3y66DMzPwQI0aEk35ZYsAvkxd9m6Ax9fwJBuMCpb3jf7Az0SBpDvUgT7iRvS2b09UTwkW3ZIxfnaUE4uoqacoTUm7239AjuNe5Qh3UZl0rVvZ-mnh3SmAcNpxl-RtUEdcw4gO0MbIch39gIJ_1CcvBxXR2tVSUILZWfbpXI2ubA_sQZ0VJy5kWpe4pYF5beJISZ7sZ0Fzrv2ftE7poEtueYloftRfng",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
country: "México",
|
|
36
|
-
id_category: "2143",
|
|
37
|
-
id_article: 55118,
|
|
38
|
-
name: "FOCO BLUETOOTH SPOT PHILIPS 6 WATTS 300 LÚMENES MULTICOLOR",
|
|
39
|
-
upc: "145582",
|
|
40
|
-
},
|
|
41
|
-
retailers: [
|
|
42
|
-
{
|
|
43
|
-
id: 58,
|
|
44
|
-
name: "The Home Depot Golden",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: 59,
|
|
48
|
-
name: "The Home Depot Platinum",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: 60,
|
|
52
|
-
name: "The Home Depot Resizing",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: 61,
|
|
56
|
-
name: "Home Depot TAB",
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
services: {
|
|
60
|
-
datasheets: 1,
|
|
61
|
-
descriptions: 1,
|
|
62
|
-
images: 1,
|
|
63
|
-
},
|
|
64
|
-
id_article: 55118,
|
|
24
|
+
id_article: 76145,
|
|
25
|
+
id_category: "700",
|
|
26
|
+
name: "prod 8 LCR",
|
|
27
|
+
upc: "8484161",
|
|
28
|
+
timestamp: "2022-07-11T15:28:44.000Z",
|
|
29
|
+
status: "NULL",
|
|
30
|
+
categoryName:
|
|
31
|
+
"Salud y Belleza|Cuidado Facial|Cremas, Mascarillas y Tratamientos",
|
|
32
|
+
asignations: [],
|
|
33
|
+
version: 3,
|
|
34
|
+
version_status: "R",
|
|
65
35
|
retailersAvailable: [
|
|
66
36
|
{
|
|
67
|
-
id:
|
|
68
|
-
name: "
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
name: "The Home Depot Platinum",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: 60,
|
|
76
|
-
name: "The Home Depot Resizing",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 61,
|
|
80
|
-
name: "Home Depot TAB",
|
|
37
|
+
id: 12,
|
|
38
|
+
name: "La Comer",
|
|
39
|
+
country: "México",
|
|
40
|
+
id_region: 1,
|
|
41
|
+
active: 1,
|
|
81
42
|
},
|
|
82
43
|
],
|
|
44
|
+
missing: {},
|
|
83
45
|
},
|
|
84
46
|
productToEdit: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
product:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
name: "FOCO BLUETOOTH SPOT PHILIPS 6 WATTS 300 LÚMENES MULTICOLOR",
|
|
103
|
-
upc: "145582",
|
|
104
|
-
},
|
|
105
|
-
retailers: [
|
|
106
|
-
{
|
|
107
|
-
id: 58,
|
|
108
|
-
name: "The Home Depot Golden",
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
id: 59,
|
|
112
|
-
name: "The Home Depot Platinum",
|
|
47
|
+
idCategory: "2999",
|
|
48
|
+
ArticleId: 69031,
|
|
49
|
+
product: [
|
|
50
|
+
{
|
|
51
|
+
orderId: 1829,
|
|
52
|
+
id_category: "2999",
|
|
53
|
+
status: "AC",
|
|
54
|
+
datasheet_status: "NS",
|
|
55
|
+
prio: "none",
|
|
56
|
+
version: 2,
|
|
57
|
+
description_status: "NS",
|
|
58
|
+
images_status: "AC",
|
|
59
|
+
brand: null,
|
|
60
|
+
missing: {
|
|
61
|
+
datasheet: 0,
|
|
62
|
+
descriptions: 0,
|
|
63
|
+
images: 0,
|
|
113
64
|
},
|
|
114
|
-
{
|
|
115
|
-
|
|
116
|
-
|
|
65
|
+
article: {
|
|
66
|
+
category: "RESIZING|RESIZING|RESIZING",
|
|
67
|
+
company_name: "The Home Depot Resize",
|
|
68
|
+
id_category: "2999",
|
|
69
|
+
id_article: 69031,
|
|
70
|
+
name: "RESIZING",
|
|
71
|
+
timestamp: "2022-06-23T15:53:54.000Z",
|
|
72
|
+
upc: "130994",
|
|
117
73
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
74
|
+
retailers: [
|
|
75
|
+
{
|
|
76
|
+
id: 60,
|
|
77
|
+
name: "The Home Depot Resizing",
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
services: {
|
|
81
|
+
datasheets: 0,
|
|
82
|
+
descriptions: 0,
|
|
83
|
+
images: 1,
|
|
121
84
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
85
|
+
checked: false,
|
|
86
|
+
retailersAvailable: [
|
|
87
|
+
{
|
|
88
|
+
id: 60,
|
|
89
|
+
name: "The Home Depot Resizing",
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
id_article: 69031,
|
|
93
|
+
categoryName: "RESIZING|RESIZING|RESIZING",
|
|
94
|
+
version_status: "AC",
|
|
127
95
|
},
|
|
128
|
-
|
|
129
|
-
retailersAvailable: [
|
|
130
|
-
{
|
|
131
|
-
id: 58,
|
|
132
|
-
name: "The Home Depot Golden",
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
id: 59,
|
|
136
|
-
name: "The Home Depot Platinum",
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
id: 60,
|
|
140
|
-
name: "The Home Depot Resizing",
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: 61,
|
|
144
|
-
name: "Home Depot TAB",
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
},
|
|
96
|
+
],
|
|
148
97
|
},
|
|
149
98
|
location: {
|
|
150
99
|
product: { articleId: 109485, versionId: 3 },
|
|
151
100
|
state: { origin: "Contentoh" },
|
|
152
101
|
},
|
|
153
102
|
user: {
|
|
154
|
-
id_user:
|
|
155
|
-
name: "
|
|
156
|
-
last_name: "
|
|
157
|
-
email: "
|
|
158
|
-
position: "
|
|
159
|
-
telephone: "+
|
|
103
|
+
id_user: 1287,
|
|
104
|
+
name: "Gerson",
|
|
105
|
+
last_name: "Martinez",
|
|
106
|
+
email: "gmartinez@contentoh.com",
|
|
107
|
+
position: "Cuenta financiada",
|
|
108
|
+
telephone: "+525551234567",
|
|
160
109
|
country: "México",
|
|
161
|
-
id_company:
|
|
162
|
-
id_cognito: "
|
|
110
|
+
id_company: 819,
|
|
111
|
+
id_cognito: "9e448c0e-18ed-4eaf-9f88-3b3197d4a2fd",
|
|
163
112
|
birth_Date: null,
|
|
164
113
|
about_me: null,
|
|
165
114
|
zip_code: null,
|
|
166
115
|
address: null,
|
|
167
116
|
job: null,
|
|
168
|
-
id_stripe:
|
|
117
|
+
id_stripe: null,
|
|
169
118
|
id_role: 0,
|
|
170
119
|
active: 1,
|
|
171
120
|
is_retailer: 0,
|
|
172
121
|
email_notify: 1,
|
|
173
122
|
membership: {
|
|
174
|
-
id:
|
|
175
|
-
start_date: "
|
|
176
|
-
end_date: "
|
|
177
|
-
planID:
|
|
178
|
-
plan: "
|
|
179
|
-
name: "Plan
|
|
180
|
-
user_limit: "
|
|
181
|
-
products_limit: "
|
|
123
|
+
id: 799,
|
|
124
|
+
start_date: "2022-06-19T15:48:09.000Z",
|
|
125
|
+
end_date: "2023-06-19T15:48:09.000Z",
|
|
126
|
+
planID: 6,
|
|
127
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
128
|
+
name: "Plan Small",
|
|
129
|
+
user_limit: "10",
|
|
130
|
+
products_limit: "1000",
|
|
182
131
|
type: "Enterprise",
|
|
183
132
|
},
|
|
184
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
133
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-1287/1287.png?1656431499310",
|
|
185
134
|
},
|
|
186
|
-
|
|
135
|
+
company: {
|
|
136
|
+
id_company: 1,
|
|
137
|
+
trade_name: "COMPANY DEV",
|
|
138
|
+
company_name: "COMPANY DEV",
|
|
139
|
+
rfc: null,
|
|
140
|
+
adress: "",
|
|
141
|
+
about_company: "...",
|
|
142
|
+
telephone: "",
|
|
143
|
+
web_site: "",
|
|
144
|
+
zip_code: "",
|
|
145
|
+
email: null,
|
|
146
|
+
social_link: "",
|
|
147
|
+
is_retailer: 0,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
@@ -40,6 +40,8 @@ import Slide1_2 from "../../../assets/images/sliderToolTip/slide2.svg";
|
|
|
40
40
|
import Slide1_3 from "../../../assets/images/sliderToolTip/slide3.svg";
|
|
41
41
|
import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
|
|
42
42
|
import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
|
|
43
|
+
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
44
|
+
import { closeModals } from "../../../global-files/customHooks";
|
|
43
45
|
|
|
44
46
|
const reducerImages = (state, action) => {
|
|
45
47
|
let { values, attrForImgs } = state;
|
|
@@ -88,6 +90,7 @@ export const ProviderProductEdition = ({
|
|
|
88
90
|
revision = false,
|
|
89
91
|
setShowContentohRequestModal,
|
|
90
92
|
showSurvey,
|
|
93
|
+
company,
|
|
91
94
|
}) => {
|
|
92
95
|
const [activeTab, setActiveTab] = useState("Descripción");
|
|
93
96
|
const [activeImage, setActiveImage] = useState();
|
|
@@ -208,6 +211,8 @@ export const ProviderProductEdition = ({
|
|
|
208
211
|
const [modalViewTextArea, setModalViewTextArea] = useState(false);
|
|
209
212
|
const [socketType, setSocketType] = useState(null);
|
|
210
213
|
const [saving, setSaving] = useState(loading);
|
|
214
|
+
const [showVersionSelector, setShowVersionSelector] =
|
|
215
|
+
closeModals("version-selector");
|
|
211
216
|
|
|
212
217
|
useEffect(() => {
|
|
213
218
|
checkAll && setSelectedImages(images.values);
|
|
@@ -218,7 +223,7 @@ export const ProviderProductEdition = ({
|
|
|
218
223
|
product?.id_article || product?.article?.id_article,
|
|
219
224
|
product?.article?.company_name || product?.categoryName,
|
|
220
225
|
parseInt(product?.article?.id_category || product?.id_category),
|
|
221
|
-
|
|
226
|
+
version
|
|
222
227
|
);
|
|
223
228
|
|
|
224
229
|
//Converts the data inside the datasheets object to array
|
|
@@ -306,6 +311,7 @@ export const ProviderProductEdition = ({
|
|
|
306
311
|
};
|
|
307
312
|
|
|
308
313
|
useEffect(async () => {
|
|
314
|
+
setLoading(true);
|
|
309
315
|
sessionStorage.setItem("user", JSON.stringify(user));
|
|
310
316
|
loadData();
|
|
311
317
|
getCart();
|
|
@@ -328,7 +334,7 @@ export const ProviderProductEdition = ({
|
|
|
328
334
|
break;
|
|
329
335
|
}
|
|
330
336
|
setStatusArray(arr);
|
|
331
|
-
}, [product]);
|
|
337
|
+
}, [product, version]);
|
|
332
338
|
|
|
333
339
|
const loadAssignations = (currentProduct) => {
|
|
334
340
|
setAssig(product?.asignations);
|
|
@@ -1181,6 +1187,8 @@ export const ProviderProductEdition = ({
|
|
|
1181
1187
|
setAssignation={setAssignation}
|
|
1182
1188
|
isRetailer={isRetailer}
|
|
1183
1189
|
showSaveButton={enableActions(product.version_status)}
|
|
1190
|
+
version={version}
|
|
1191
|
+
setShowVersionSelector={setShowVersionSelector}
|
|
1184
1192
|
onClickSave={() => {
|
|
1185
1193
|
switch (activeTab) {
|
|
1186
1194
|
case "Descripción":
|
|
@@ -1439,6 +1447,15 @@ export const ProviderProductEdition = ({
|
|
|
1439
1447
|
textArea={false}
|
|
1440
1448
|
/>
|
|
1441
1449
|
)}
|
|
1450
|
+
{showVersionSelector && (
|
|
1451
|
+
<VersionSelector
|
|
1452
|
+
modalId={"version-selector"}
|
|
1453
|
+
articleId={product.id_article}
|
|
1454
|
+
setVersion={setVersion}
|
|
1455
|
+
companyName={company.company_name}
|
|
1456
|
+
currentVersion={version}
|
|
1457
|
+
/>
|
|
1458
|
+
)}
|
|
1442
1459
|
</Container>
|
|
1443
1460
|
);
|
|
1444
1461
|
};
|
|
@@ -16,76 +16,69 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhNmM0ZDNkNi0yNGE0LTQxZDQtYWQwZi1kMDg3NDM4YWI1YjYiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6ImE2YzRkM2Q2LTI0YTQtNDFkNC1hZDBmLWQwODc0MzhhYjViNiIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJmZTM3NjZmNS0zY2E0LTQ2N2MtOTIxMS0yM2Y0NWQ1ZWU4NjgiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY1ODk5MTc2NSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY1ODk5NTM2NSwiaWF0IjoxNjU4OTkxNzY1LCJlbWFpbCI6ImV0Y0Bjb250ZW50b2guY29tIn0.bQDE_eVpwSBWXqgbX2bicpPTgAoG8mfeA_P0l92vBWV0Q7m7llCNOmLvaaZn-EtYNf3xjVH8pGivJGT5KMOLl9adBl8TnUxD0IS2BJp0wB3m3l79BFAswLbfCAFb-x0XJw4LznnnrlN12ZF-9sPcE4s8RXRxw2cSX3Lt4pdJqi8sOG_DNu3BvxmML3Ckv23aK82zWzskXQb_gNdTM2mqi7SvxvE87yb4X_5cfvP6QtA6hEh1jezbHWdzPDxKkme0ZdVOpqEb3c1JMSIP06EQ9NfnXVt0S19hz6kfppC2laFEwrK2M8tO8EH06k2qlSk3Hp5b6Ga3BACvKAWnfOnC1A",
|
|
20
20
|
productSelected: {
|
|
21
21
|
services: {
|
|
22
22
|
datasheets: 1,
|
|
23
23
|
descriptions: 1,
|
|
24
24
|
images: 1,
|
|
25
25
|
},
|
|
26
|
-
orderId:
|
|
27
|
-
status: "
|
|
28
|
-
datasheet_status: "
|
|
26
|
+
orderId: 131,
|
|
27
|
+
status: "AA",
|
|
28
|
+
datasheet_status: "AA",
|
|
29
29
|
prio: "none",
|
|
30
30
|
version: 2,
|
|
31
|
-
description_status: "
|
|
32
|
-
images_status: "
|
|
31
|
+
description_status: "AA",
|
|
32
|
+
images_status: "AA",
|
|
33
33
|
article: {
|
|
34
|
-
id_article:
|
|
35
|
-
id_category: "
|
|
36
|
-
name: "
|
|
37
|
-
upc: "
|
|
38
|
-
timestamp: "2022-07-
|
|
39
|
-
id_user:
|
|
34
|
+
id_article: 76201,
|
|
35
|
+
id_category: "632",
|
|
36
|
+
name: "DEMO SB BAA PLAY CR SM FP PANDAS",
|
|
37
|
+
upc: "7501816169170",
|
|
38
|
+
timestamp: "2022-07-25T20:42:40.000Z",
|
|
39
|
+
id_user: 119,
|
|
40
40
|
status: "NULL",
|
|
41
41
|
active: 1,
|
|
42
|
-
company_id:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
id_description_facilitator: 1252,
|
|
54
|
-
id_images_especialist: 1251,
|
|
55
|
-
id_images_facilitator: 1286,
|
|
56
|
-
id_auditor: 1254,
|
|
42
|
+
company_id: 841,
|
|
43
|
+
company_name: "Financiado Bodega",
|
|
44
|
+
country: "México",
|
|
45
|
+
id_order: 131,
|
|
46
|
+
id_datasheet_especialist: 54,
|
|
47
|
+
id_datasheet_facilitator: 52,
|
|
48
|
+
id_description_especialist: 54,
|
|
49
|
+
id_description_facilitator: 52,
|
|
50
|
+
id_images_especialist: 55,
|
|
51
|
+
id_images_facilitator: 53,
|
|
52
|
+
id_auditor: 30,
|
|
57
53
|
id_recepcionist: null,
|
|
58
|
-
category: "
|
|
59
|
-
missingAttributes:
|
|
54
|
+
category: "Ropa, Accesorios, Fragancias y Joyería|Ropa Bebés|Bebé Niña",
|
|
55
|
+
missingAttributes: 0,
|
|
60
56
|
missingDescriptions: 0,
|
|
61
57
|
missingImages: 0,
|
|
62
58
|
},
|
|
63
59
|
retailers: [
|
|
64
60
|
{
|
|
65
|
-
id:
|
|
66
|
-
name: "
|
|
67
|
-
country: "México",
|
|
68
|
-
id_region: 1,
|
|
69
|
-
active: 1,
|
|
61
|
+
id: 13,
|
|
62
|
+
name: "Soriana",
|
|
70
63
|
},
|
|
71
64
|
],
|
|
72
|
-
country:
|
|
73
|
-
upc: "
|
|
65
|
+
country: "México",
|
|
66
|
+
upc: "7501816169170",
|
|
74
67
|
},
|
|
75
68
|
location: {
|
|
76
69
|
product: { articleId: 109485, versionId: 3 },
|
|
77
70
|
},
|
|
78
71
|
user: {
|
|
79
|
-
id_user:
|
|
80
|
-
name: "
|
|
81
|
-
last_name: "
|
|
82
|
-
email: "
|
|
83
|
-
position:
|
|
72
|
+
id_user: 51,
|
|
73
|
+
name: "ADMIN PRUEBA",
|
|
74
|
+
last_name: "",
|
|
75
|
+
email: "etc@contentoh.com",
|
|
76
|
+
position: null,
|
|
84
77
|
telephone: null,
|
|
85
|
-
country:
|
|
86
|
-
id_company:
|
|
87
|
-
id_cognito: "
|
|
88
|
-
birth_Date:
|
|
78
|
+
country: null,
|
|
79
|
+
id_company: 2,
|
|
80
|
+
id_cognito: "a6c4d3d6-24a4-41d4-ad0f-d087438ab5b6",
|
|
81
|
+
birth_Date: null,
|
|
89
82
|
about_me: null,
|
|
90
83
|
zip_code: null,
|
|
91
84
|
address: null,
|
|
@@ -94,18 +87,18 @@ RetailerProductEditionDefault.args = {
|
|
|
94
87
|
id_role: 1,
|
|
95
88
|
active: 1,
|
|
96
89
|
is_retailer: 0,
|
|
97
|
-
email_notify:
|
|
90
|
+
email_notify: 0,
|
|
98
91
|
membership: {
|
|
99
|
-
id:
|
|
100
|
-
start_date: "
|
|
101
|
-
end_date: "
|
|
102
|
-
planID:
|
|
103
|
-
plan: "
|
|
104
|
-
name: "Plan
|
|
105
|
-
user_limit: "
|
|
106
|
-
products_limit: "
|
|
107
|
-
type: "
|
|
92
|
+
id: 2,
|
|
93
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
94
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
95
|
+
planID: 1,
|
|
96
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
97
|
+
name: "Plan Free",
|
|
98
|
+
user_limit: "1",
|
|
99
|
+
products_limit: "3",
|
|
100
|
+
type: "PyMES",
|
|
108
101
|
},
|
|
109
|
-
src: "https://content-management-profile
|
|
102
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-51/51.png?1658991766462",
|
|
110
103
|
},
|
|
111
104
|
};
|
|
@@ -31,6 +31,9 @@ import { Loading } from "../../atoms/Loading";
|
|
|
31
31
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
32
|
import { getNewStatus } from "../../../global-files/data";
|
|
33
33
|
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
34
|
+
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
35
|
+
import { closeModals } from "../../../global-files/customHooks";
|
|
36
|
+
import { CreateVersion } from "../../organisms/CreateVersion";
|
|
34
37
|
|
|
35
38
|
const reducerImages = (state, action) => {
|
|
36
39
|
let { values, attrForImgs } = state;
|
|
@@ -165,6 +168,9 @@ export const RetailerProductEdition = ({
|
|
|
165
168
|
const [servicesStatus, setServicesStatus] = useState([]);
|
|
166
169
|
const [saving, setSaving] = useState(loading);
|
|
167
170
|
const isAuditor = user.id_role === 6;
|
|
171
|
+
const [showVersionSelector, setShowVersionSelector] =
|
|
172
|
+
closeModals("version-selector");
|
|
173
|
+
const [showCreateVersion, setShowCreateVersion] = useState(false);
|
|
168
174
|
|
|
169
175
|
useEffect(() => {
|
|
170
176
|
checkAll && setSelectedImages(images.values);
|
|
@@ -176,7 +182,7 @@ export const RetailerProductEdition = ({
|
|
|
176
182
|
product?.article?.id_article,
|
|
177
183
|
product?.article?.category,
|
|
178
184
|
parseInt(product?.article?.id_category),
|
|
179
|
-
|
|
185
|
+
version
|
|
180
186
|
);
|
|
181
187
|
//Converts the data inside the datasheets object to array
|
|
182
188
|
setServices(services);
|
|
@@ -250,6 +256,7 @@ export const RetailerProductEdition = ({
|
|
|
250
256
|
};
|
|
251
257
|
|
|
252
258
|
useEffect(async () => {
|
|
259
|
+
setLoading(true);
|
|
253
260
|
loadData();
|
|
254
261
|
getComments();
|
|
255
262
|
setUserGroups(await fetchUsers(token));
|
|
@@ -271,7 +278,7 @@ export const RetailerProductEdition = ({
|
|
|
271
278
|
break;
|
|
272
279
|
}
|
|
273
280
|
setStatusArray(arr);
|
|
274
|
-
}, [product]);
|
|
281
|
+
}, [product, version]);
|
|
275
282
|
|
|
276
283
|
const loadAssignations = (currentProduct) => {
|
|
277
284
|
setAssig({
|
|
@@ -1267,6 +1274,8 @@ export const RetailerProductEdition = ({
|
|
|
1267
1274
|
setAssignation={setAssignation}
|
|
1268
1275
|
isRetailer={isRetailer}
|
|
1269
1276
|
showSaveButton={auditorAssigned() || userAssigned()}
|
|
1277
|
+
version={version}
|
|
1278
|
+
setShowVersionSelector={setShowVersionSelector}
|
|
1270
1279
|
onClickSave={() => {
|
|
1271
1280
|
switch (activeTab) {
|
|
1272
1281
|
case "Descripción":
|
|
@@ -1447,6 +1456,23 @@ export const RetailerProductEdition = ({
|
|
|
1447
1456
|
onClick={() => setMessage("")}
|
|
1448
1457
|
/>
|
|
1449
1458
|
)}
|
|
1459
|
+
{showVersionSelector && (
|
|
1460
|
+
<VersionSelector
|
|
1461
|
+
modalId={"version-selector"}
|
|
1462
|
+
articleId={product.article.id_article}
|
|
1463
|
+
setVersion={setVersion}
|
|
1464
|
+
companyName={product.article.company_name}
|
|
1465
|
+
currentVersion={version}
|
|
1466
|
+
setShowCreateVersion={setShowCreateVersion}
|
|
1467
|
+
/>
|
|
1468
|
+
)}
|
|
1469
|
+
{showCreateVersion && (
|
|
1470
|
+
<CreateVersion
|
|
1471
|
+
idArticle={product.article.id_article}
|
|
1472
|
+
version={version}
|
|
1473
|
+
setShowCreateVersion={setShowCreateVersion}
|
|
1474
|
+
/>
|
|
1475
|
+
)}
|
|
1450
1476
|
</Container>
|
|
1451
1477
|
);
|
|
1452
1478
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
|
|
4
|
+
export const closeModals = (id) => {
|
|
5
|
+
const [showModal, setShowModal] = useState(false);
|
|
6
|
+
|
|
7
|
+
const closeModal = (e) => {
|
|
8
|
+
if (
|
|
9
|
+
(!e.target.closest(`#${id}`) ||
|
|
10
|
+
e.target.closest("#close-button") ||
|
|
11
|
+
e.target.closest("#add-version")) &&
|
|
12
|
+
showModal
|
|
13
|
+
) {
|
|
14
|
+
document.removeEventListener("click", closeModal);
|
|
15
|
+
setShowModal(false);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (showModal) {
|
|
21
|
+
document.addEventListener("click", closeModal);
|
|
22
|
+
}
|
|
23
|
+
}, [showModal]);
|
|
24
|
+
|
|
25
|
+
return [showModal, setShowModal];
|
|
26
|
+
};
|