contentoh-components-library 21.3.53 → 21.3.54
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 +2 -0
- package/dist/components/atoms/ButtonV2/styles.js +1 -1
- package/dist/components/atoms/Status/styles.js +1 -1
- package/dist/components/atoms/VerticalSideMenuMainPage/index.js +18 -23
- package/dist/components/atoms/VerticalSideMenuMainPage/styles.js +4 -4
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +68 -11
- package/dist/components/organisms/Chat/Chat.stories.js +21 -1
- package/dist/components/organisms/Chat/ContainerItems/index.js +19 -3
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +343 -191
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +48 -3
- package/dist/components/organisms/DashboardMetric/dashboardMetricUtils.js +27 -0
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/GlobalModal/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/styles.js +1 -1
- package/dist/components/organisms/OrderDetail/utils/Table/styles.js +1 -1
- package/dist/components/pages/Dashboard/Dashboard.stories.js +31 -50
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +198 -81
- package/dist/components/pages/ProviderProductEdition/index.js +725 -429
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +72 -89
- package/dist/components/pages/RetailerProductEdition/index.js +267 -278
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/index.js +13 -0
- package/package.json +7 -6
- package/src/components/atoms/ButtonV2/styles.js +1 -1
- package/src/components/atoms/Status/styles.js +4 -0
- package/src/components/atoms/VerticalSideMenuMainPage/index.js +18 -22
- package/src/components/atoms/VerticalSideMenuMainPage/styles.js +3 -4
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/organisms/Chat/Chat.stories.js +21 -0
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +10 -2
- package/src/components/organisms/Chat/ContentChat/index.js +81 -6
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +47 -3
- package/src/components/organisms/DashboardMetric/dashboardMetricUtils.js +18 -1
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/GlobalModal/styles.js +10 -0
- package/src/components/organisms/OrderDetail/index.js +1 -0
- package/src/components/organisms/OrderDetail/styles.js +1 -1
- package/src/components/organisms/OrderDetail/utils/Table/styles.js +0 -1
- package/src/components/organisms/TableResizable/TableResizable.stories.js +17 -0
- package/src/components/organisms/TableResizable/index.js +119 -0
- package/src/components/organisms/TableResizable/styles.js +133 -0
- package/src/components/organisms/TableResizable/utils.js +46 -0
- package/src/components/pages/Dashboard/Dashboard.stories.js +31 -55
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +214 -88
- package/src/components/pages/ProviderProductEdition/index.js +323 -160
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +75 -91
- package/src/components/pages/RetailerProductEdition/index.js +111 -137
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/index.js +1 -0
|
@@ -107,6 +107,10 @@ export const Container = styled.div`
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
+
#modal-message-box {
|
|
111
|
+
width: 400px;
|
|
112
|
+
height: 100px;
|
|
113
|
+
}
|
|
110
114
|
.container {
|
|
111
115
|
width: 100%;
|
|
112
116
|
height: 100%;
|
|
@@ -115,4 +119,4 @@ export const Container = styled.div`
|
|
|
115
119
|
width: 100%;
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
|
-
`;
|
|
122
|
+
`;
|
|
@@ -12,142 +12,126 @@ export const RetailerProductEditionDefault = Template.bind({});
|
|
|
12
12
|
RetailerProductEditionDefault.args = {
|
|
13
13
|
tabsSections: {
|
|
14
14
|
Descripción: true,
|
|
15
|
-
"Ficha técnica":
|
|
16
|
-
Imágenes:
|
|
15
|
+
"Ficha técnica": false,
|
|
16
|
+
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.
|
|
19
|
+
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5YTIxMzEyOC02NDgyLTRjMTYtYTRiNi02ZTY0ZjIyNWIxYmQiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwiY29nbml0bzp1c2VybmFtZSI6IjlhMjEzMTI4LTY0ODItNGMxNi1hNGI2LTZlNjRmMjI1YjFiZCIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI5OGE0NzYxMy04ZGIyLTRlZjUtYjA0Mi01ZDU3MWRkZjIwMWIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4Mzg3NTIyNiwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTY4Mzg3ODgyNiwiaWF0IjoxNjgzODc1MjI2LCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.EtgmT_THMx-Zy_zB5yZK4gz6TXNTVVJEKFt5X0JK2UkGVrp_q_92YCEuejS4n976fyTez0jkwOee6IkVHLV71uZWRBDFt-3Yw4ZxfsZYPNJWhoHXGNxhMU8MCkSntfu597esBTk-VsUpstT5R7L-WJfN8viE7R-qVo-42RlPTG0TFrWA9q0oTcqjv8vbxLpOBUjiEpjmqRhg4blJZwgkGNta6MOlw1vfmisOVbo9wMvqwnCZ9xx9KMKoH9U4uNObK_JomjbvPmTmkcUXsE-wGSD7XcoSwtuhBngLC7-jiu1u8MvL_ff5Z0Qp70sSpLdUglcSS8d1Xf7j_fcZuJ5jKA",
|
|
20
20
|
productSelected: {
|
|
21
|
+
orderId: 15142,
|
|
22
|
+
status: "CA",
|
|
23
|
+
datasheet_status: "CA",
|
|
24
|
+
prio: "none",
|
|
25
|
+
version: 3,
|
|
26
|
+
description_status: "AC",
|
|
27
|
+
images_status: "CA",
|
|
28
|
+
brand: "Garnier",
|
|
29
|
+
retailerOrder: 0,
|
|
30
|
+
missing: {
|
|
31
|
+
datasheet: null,
|
|
32
|
+
descriptions: null,
|
|
33
|
+
images: null,
|
|
34
|
+
},
|
|
21
35
|
services: {
|
|
22
36
|
datasheets: 1,
|
|
23
37
|
descriptions: 1,
|
|
24
38
|
images: 1,
|
|
25
39
|
},
|
|
26
|
-
orderId: 14606,
|
|
27
|
-
status: "AS",
|
|
28
|
-
datasheet_status: "CA",
|
|
29
|
-
prio: "none",
|
|
30
|
-
version: 3,
|
|
31
|
-
description_status: "CA",
|
|
32
|
-
images_status: "AS",
|
|
33
|
-
statusByRetailer: {
|
|
34
|
-
4: {
|
|
35
|
-
datasheet: "AC",
|
|
36
|
-
description: "CA",
|
|
37
|
-
images: "AS",
|
|
38
|
-
},
|
|
39
|
-
5: {
|
|
40
|
-
datasheet: "CA",
|
|
41
|
-
description: "CA",
|
|
42
|
-
images: "AS",
|
|
43
|
-
},
|
|
44
|
-
6: {
|
|
45
|
-
description: "CA",
|
|
46
|
-
images: "AS",
|
|
47
|
-
datasheet: "CA",
|
|
48
|
-
},
|
|
49
|
-
12: {
|
|
50
|
-
datasheet: "CA",
|
|
51
|
-
description: "CA",
|
|
52
|
-
images: "AS",
|
|
53
|
-
},
|
|
54
|
-
17: {
|
|
55
|
-
datasheet: "CA",
|
|
56
|
-
description: "AC",
|
|
57
|
-
images: "AS",
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
40
|
article: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
upc: "7509546078915",
|
|
65
|
-
timestamp: "2023-03-10T20:19:15.000Z",
|
|
66
|
-
id_user: 28,
|
|
67
|
-
status: "NULL",
|
|
68
|
-
active: 1,
|
|
69
|
-
company_id: 1005,
|
|
70
|
-
SKU: null,
|
|
71
|
-
Descripcion: null,
|
|
72
|
-
Proveedor: null,
|
|
73
|
-
id_proveedor: 0,
|
|
74
|
-
company_name: "CRS Transformaciones",
|
|
41
|
+
category:
|
|
42
|
+
"Salud y Belleza|Cuidado del Cabello|Shampoos y Acondicionadores",
|
|
43
|
+
company_name: "GRUPO BRAHMA",
|
|
75
44
|
country: "México",
|
|
76
|
-
|
|
45
|
+
id_category: "697",
|
|
77
46
|
id_datasheet_especialist: 54,
|
|
78
47
|
id_datasheet_facilitator: 52,
|
|
79
48
|
id_description_especialist: 54,
|
|
80
49
|
id_description_facilitator: 52,
|
|
81
50
|
id_images_especialist: 55,
|
|
82
51
|
id_images_facilitator: 53,
|
|
52
|
+
id_order: 15142,
|
|
53
|
+
id_article: 39270,
|
|
83
54
|
id_auditor: 37,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
missingAttributes: 0,
|
|
88
|
-
missingDescriptions: 0,
|
|
89
|
-
missingImages: 0,
|
|
55
|
+
name: "Acondicionador Garnier Fructis 650 ml",
|
|
56
|
+
timestamp: "2023-03-27T18:37:48.000Z",
|
|
57
|
+
upc: "750955287656712",
|
|
90
58
|
},
|
|
91
59
|
retailers: [
|
|
92
60
|
{
|
|
93
|
-
id:
|
|
94
|
-
name: "
|
|
61
|
+
id: 12,
|
|
62
|
+
name: "La Comer",
|
|
63
|
+
image:
|
|
64
|
+
"https://content-management-images.s3.amazonaws.com/retailers/12.png",
|
|
65
|
+
services: ["CA", "CA", "AC", "NA", "NA", "NA", "NA", "NA", "NA"],
|
|
66
|
+
percentage: 100,
|
|
95
67
|
},
|
|
96
68
|
{
|
|
97
|
-
id:
|
|
98
|
-
name: "
|
|
69
|
+
id: 29,
|
|
70
|
+
name: "Farmacias del Ahorro",
|
|
71
|
+
image:
|
|
72
|
+
"https://content-management-images.s3.amazonaws.com/retailers/29.png",
|
|
73
|
+
services: ["NA", "NA", "NA", "CA", "CA", "CA", "NA", "NA", "NA"],
|
|
74
|
+
percentage: 100,
|
|
99
75
|
},
|
|
100
76
|
{
|
|
101
|
-
id:
|
|
102
|
-
name: "
|
|
77
|
+
id: 63,
|
|
78
|
+
name: "DAX",
|
|
79
|
+
image:
|
|
80
|
+
"https://content-management-images.s3.amazonaws.com/retailers/63.png",
|
|
81
|
+
services: ["NA", "NA", "NA", "NA", "NA", "NA", "AC", "AC", "CA"],
|
|
82
|
+
percentage: 83,
|
|
103
83
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
84
|
+
],
|
|
85
|
+
statusByRetailer: {
|
|
86
|
+
12: {
|
|
87
|
+
datasheet: "CA",
|
|
88
|
+
description: "CA",
|
|
107
89
|
},
|
|
108
|
-
{
|
|
109
|
-
|
|
110
|
-
|
|
90
|
+
29: {
|
|
91
|
+
datasheet: "CA",
|
|
92
|
+
description: "CA",
|
|
111
93
|
},
|
|
112
|
-
|
|
113
|
-
country: "México",
|
|
114
|
-
upc: "7509546078915",
|
|
94
|
+
},
|
|
115
95
|
},
|
|
116
96
|
location: {
|
|
117
97
|
product: { articleId: 354, versionId: 3 },
|
|
98
|
+
state: {
|
|
99
|
+
withChat: true,
|
|
100
|
+
chatType: "product_status",
|
|
101
|
+
},
|
|
118
102
|
},
|
|
119
103
|
user: {
|
|
120
|
-
id_user:
|
|
121
|
-
name: "
|
|
122
|
-
last_name: "",
|
|
123
|
-
email: "
|
|
124
|
-
position: "",
|
|
104
|
+
id_user: 37,
|
|
105
|
+
name: "José",
|
|
106
|
+
last_name: "Castañeda",
|
|
107
|
+
email: "ismael97lopez@gmail.com",
|
|
108
|
+
position: "Auditor",
|
|
125
109
|
telephone: "",
|
|
126
|
-
country: "",
|
|
110
|
+
country: "México",
|
|
127
111
|
id_company: 2,
|
|
128
|
-
id_cognito: "
|
|
112
|
+
id_cognito: "9a213128-6482-4c16-a4b6-6e64f225b1bd",
|
|
129
113
|
birth_Date: null,
|
|
130
114
|
about_me: "",
|
|
131
115
|
zip_code: "",
|
|
132
116
|
address: "",
|
|
133
117
|
job: "",
|
|
134
118
|
id_stripe: "",
|
|
135
|
-
id_role:
|
|
119
|
+
id_role: 6,
|
|
136
120
|
active: 1,
|
|
137
121
|
is_retailer: 0,
|
|
138
122
|
email_notify: 1,
|
|
139
123
|
is_user_tech: null,
|
|
140
124
|
membership: {
|
|
141
|
-
id:
|
|
142
|
-
start_date: "
|
|
143
|
-
end_date: "
|
|
144
|
-
planID:
|
|
145
|
-
plan: "
|
|
146
|
-
name: "Plan
|
|
147
|
-
user_limit: "
|
|
148
|
-
products_limit: "
|
|
149
|
-
type: "
|
|
125
|
+
id: 2,
|
|
126
|
+
start_date: "2021-11-05T02:35:12.000Z",
|
|
127
|
+
end_date: "2022-11-05T02:34:49.000Z",
|
|
128
|
+
planID: 1,
|
|
129
|
+
plan: "prod_KtkvuFFLpOdP6e",
|
|
130
|
+
name: "Plan Free",
|
|
131
|
+
user_limit: "1",
|
|
132
|
+
products_limit: "3",
|
|
133
|
+
type: "PyMES",
|
|
150
134
|
},
|
|
151
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
135
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-37/37.png?1683875228327",
|
|
152
136
|
},
|
|
153
137
|
};
|
|
@@ -24,15 +24,20 @@ import descriptionSent from "../../../assets/images/modalsSVGs/descriptionSent.s
|
|
|
24
24
|
import imagesSent from "../../../assets/images/modalsSVGs/uploadingImages.svg";
|
|
25
25
|
import { TagAndInput } from "../../molecules/TagAndInput/index";
|
|
26
26
|
import { Button } from "../../atoms/GeneralButton";
|
|
27
|
-
import { Commentary } from "../../atoms/Commentary";
|
|
28
27
|
import { GenericModal } from "../../atoms/GenericModal";
|
|
29
28
|
import { ScreenHeader } from "../../atoms/ScreenHeader";
|
|
30
29
|
import { Loading } from "../../atoms/Loading";
|
|
31
30
|
import succes from "../../../assets/images/genericModal/genericModalCheck.svg";
|
|
32
|
-
import errorModal from "../../../assets/images/genericModal/errorModal.svg";
|
|
33
31
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
34
32
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
35
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
getAuditVersion,
|
|
35
|
+
getInputsData,
|
|
36
|
+
createMessage,
|
|
37
|
+
sendMessage,
|
|
38
|
+
} from "./utils";
|
|
39
|
+
import { Modal } from "../../organisms/Modal";
|
|
40
|
+
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
36
41
|
|
|
37
42
|
const reducerImages = (state, action) => {
|
|
38
43
|
let { values, attrForImgs, inputsByRetailer } = state;
|
|
@@ -132,6 +137,7 @@ export const RetailerProductEdition = ({
|
|
|
132
137
|
const [datasheets, setDatasheets] = useState([]);
|
|
133
138
|
const [images, setImages] = useReducer(reducerImages, {});
|
|
134
139
|
const [showModal, setShowModal] = useState(false);
|
|
140
|
+
const [showRejectModal, setShowRejectModal] = useState(false);
|
|
135
141
|
const { getRootProps, getInputProps } = useDropzone({
|
|
136
142
|
accept: "image/*",
|
|
137
143
|
noKeyboard: true,
|
|
@@ -218,6 +224,7 @@ export const RetailerProductEdition = ({
|
|
|
218
224
|
const [auditDescriptions, setAuditDescriptions] = useState([]);
|
|
219
225
|
const [auditImages, setAuditImages] = useState([]);
|
|
220
226
|
const [compare, setCompare] = useState(false);
|
|
227
|
+
const [valRejAll, setValRejAll] = useState(false);
|
|
221
228
|
|
|
222
229
|
useEffect(async () => {
|
|
223
230
|
const { id_article } = product?.article || {};
|
|
@@ -752,7 +759,7 @@ export const RetailerProductEdition = ({
|
|
|
752
759
|
const adminFacilitatorCanEvaluate =
|
|
753
760
|
retailerStatus === "IE" && [1, 4, 5].includes(user.id_role);
|
|
754
761
|
const adminAuditorCanEvaluate =
|
|
755
|
-
["AC", "RP", "RCA"].includes(retailerStatus) &&
|
|
762
|
+
["AC", "RP", "RCA", "SAC"].includes(retailerStatus) &&
|
|
756
763
|
[1, 6].includes(user.id_role);
|
|
757
764
|
return adminFacilitatorCanEvaluate || adminAuditorCanEvaluate;
|
|
758
765
|
};
|
|
@@ -855,6 +862,25 @@ export const RetailerProductEdition = ({
|
|
|
855
862
|
const { newStatus, newOrderStatus, newArticleStatus } = JSON.parse(
|
|
856
863
|
res.data.body
|
|
857
864
|
);
|
|
865
|
+
const messageToChat = createMessage(
|
|
866
|
+
product.retailers,
|
|
867
|
+
activeRetailer.id,
|
|
868
|
+
evalStatus,
|
|
869
|
+
newStatus,
|
|
870
|
+
activeTab
|
|
871
|
+
);
|
|
872
|
+
|
|
873
|
+
const data = {
|
|
874
|
+
paramsBody: {
|
|
875
|
+
id: product.article.id_article,
|
|
876
|
+
version: version,
|
|
877
|
+
items: [{ type: "status", value: messageToChat }],
|
|
878
|
+
retailerId: activeRetailer.id,
|
|
879
|
+
status: product.status,
|
|
880
|
+
},
|
|
881
|
+
paramsHeader: { Authorization: token },
|
|
882
|
+
};
|
|
883
|
+
await sendMessage(data);
|
|
858
884
|
if (newOrderStatus) productTemp.status = newArticleStatus[articleId];
|
|
859
885
|
productTemp[`${concept}_status`] = newStatus;
|
|
860
886
|
await loadData();
|
|
@@ -897,35 +923,19 @@ export const RetailerProductEdition = ({
|
|
|
897
923
|
return product?.article[`id_auditor`] === user.id_user;
|
|
898
924
|
};
|
|
899
925
|
|
|
900
|
-
const createComment = async (
|
|
901
|
-
let concept = "";
|
|
902
|
-
switch (activeTab) {
|
|
903
|
-
case "Ficha técnica":
|
|
904
|
-
concept = "datasheet";
|
|
905
|
-
break;
|
|
906
|
-
case "Imágenes":
|
|
907
|
-
concept = "images";
|
|
908
|
-
break;
|
|
909
|
-
|
|
910
|
-
default:
|
|
911
|
-
concept = "description";
|
|
912
|
-
break;
|
|
913
|
-
}
|
|
926
|
+
const createComment = async (messages = [], retailerId) => {
|
|
914
927
|
const data = {
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
922
|
-
headers: {
|
|
923
|
-
Authorization: token,
|
|
928
|
+
paramsBody: {
|
|
929
|
+
id: product.article.id_article,
|
|
930
|
+
version: version,
|
|
931
|
+
items: messages,
|
|
932
|
+
retailerId: retailerId,
|
|
933
|
+
status: product.status,
|
|
924
934
|
},
|
|
925
|
-
|
|
926
|
-
|
|
935
|
+
paramsHeader: { Authorization: token },
|
|
936
|
+
};
|
|
927
937
|
setMessage("");
|
|
928
|
-
|
|
938
|
+
return sendMessage(data);
|
|
929
939
|
};
|
|
930
940
|
|
|
931
941
|
const getRequired = (services) => {
|
|
@@ -1208,6 +1218,8 @@ export const RetailerProductEdition = ({
|
|
|
1208
1218
|
break;
|
|
1209
1219
|
}
|
|
1210
1220
|
|
|
1221
|
+
const messages = [];
|
|
1222
|
+
|
|
1211
1223
|
servicesData?.forEach((ret) => {
|
|
1212
1224
|
if (conceptArray.includes(ret.service)) {
|
|
1213
1225
|
let data = {
|
|
@@ -1218,6 +1230,21 @@ export const RetailerProductEdition = ({
|
|
|
1218
1230
|
evalStatus: product[`${ret.service}_status`],
|
|
1219
1231
|
retailerId: ret.id_retailer,
|
|
1220
1232
|
};
|
|
1233
|
+
if (product[`${ret.service}_status`] !== "NS") {
|
|
1234
|
+
const message = createMessage(
|
|
1235
|
+
product.retailers,
|
|
1236
|
+
ret.id_retailer,
|
|
1237
|
+
product[`${ret.service}_status`],
|
|
1238
|
+
`${result}A`,
|
|
1239
|
+
ret.service
|
|
1240
|
+
);
|
|
1241
|
+
messages.push(
|
|
1242
|
+
createComment(
|
|
1243
|
+
[{ type: "status", value: message }],
|
|
1244
|
+
ret.id_retailer
|
|
1245
|
+
)
|
|
1246
|
+
);
|
|
1247
|
+
}
|
|
1221
1248
|
evaluationArray.push(
|
|
1222
1249
|
axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
|
|
1223
1250
|
headers: {
|
|
@@ -1228,8 +1255,6 @@ export const RetailerProductEdition = ({
|
|
|
1228
1255
|
}
|
|
1229
1256
|
});
|
|
1230
1257
|
|
|
1231
|
-
await Promise.all(evaluationArray);
|
|
1232
|
-
|
|
1233
1258
|
conceptArray?.forEach((concept) => {
|
|
1234
1259
|
let data = {
|
|
1235
1260
|
articleId: product.article.id_article,
|
|
@@ -1249,13 +1274,14 @@ export const RetailerProductEdition = ({
|
|
|
1249
1274
|
const productTemp = product;
|
|
1250
1275
|
productTemp.status = `${result}A`;
|
|
1251
1276
|
productTemp.datasheet_status =
|
|
1252
|
-
productTemp.datasheet_status === "
|
|
1277
|
+
productTemp.datasheet_status === "NS" ? "NS" : `${result}A`;
|
|
1253
1278
|
productTemp.description_status =
|
|
1254
|
-
productTemp.description_status === "
|
|
1279
|
+
productTemp.description_status === "NS" ? "NS" : `${result}A`;
|
|
1255
1280
|
productTemp.images_status =
|
|
1256
|
-
productTemp.images_status === "
|
|
1281
|
+
productTemp.images_status === "NS" ? "NS" : `${result}A`;
|
|
1257
1282
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
1258
1283
|
setProduct(productTemp);
|
|
1284
|
+
const messagesResponse = await Promise.all(messages);
|
|
1259
1285
|
|
|
1260
1286
|
await loadData();
|
|
1261
1287
|
} catch (error) {
|
|
@@ -1271,8 +1297,10 @@ export const RetailerProductEdition = ({
|
|
|
1271
1297
|
setCompare={setCompare}
|
|
1272
1298
|
isAuditor={[1, 6].includes(user.id_role)}
|
|
1273
1299
|
withChat={location?.state?.withChat}
|
|
1274
|
-
|
|
1300
|
+
chatType={location?.state?.chatType}
|
|
1301
|
+
productSelected={product}
|
|
1275
1302
|
token={token}
|
|
1303
|
+
activeRetailer={activeRetailer}
|
|
1276
1304
|
/>
|
|
1277
1305
|
<div className="data-container">
|
|
1278
1306
|
<div className="image-data-panel">
|
|
@@ -1312,36 +1340,7 @@ export const RetailerProductEdition = ({
|
|
|
1312
1340
|
sendToFacilitator("A");
|
|
1313
1341
|
}}
|
|
1314
1342
|
reject={() => {
|
|
1315
|
-
|
|
1316
|
-
setMessage("Rechazado");
|
|
1317
|
-
setComponentsArray([
|
|
1318
|
-
<img src={errorModal} />,
|
|
1319
|
-
<ScreenHeader
|
|
1320
|
-
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1321
|
-
headerType={"input-name-header"}
|
|
1322
|
-
color={"white"}
|
|
1323
|
-
/>,
|
|
1324
|
-
<TagAndInput
|
|
1325
|
-
label={"Caja de Comentario"}
|
|
1326
|
-
inputType={"textarea"}
|
|
1327
|
-
inputId={"modal-commentary-box"}
|
|
1328
|
-
index={0}
|
|
1329
|
-
color={"white"}
|
|
1330
|
-
/>,
|
|
1331
|
-
<Button
|
|
1332
|
-
buttonType={"general-default-button"}
|
|
1333
|
-
label={"Enviar comentario"}
|
|
1334
|
-
onClick={(e) =>
|
|
1335
|
-
createComment(
|
|
1336
|
-
e,
|
|
1337
|
-
document.querySelector(
|
|
1338
|
-
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1339
|
-
).innerHTML,
|
|
1340
|
-
activeTab
|
|
1341
|
-
)
|
|
1342
|
-
}
|
|
1343
|
-
/>,
|
|
1344
|
-
]);
|
|
1343
|
+
setShowRejectModal(true);
|
|
1345
1344
|
}}
|
|
1346
1345
|
showApproveRejectAll={
|
|
1347
1346
|
approveRejectAllButtons() && (auditorAssigned() || userAssigned())
|
|
@@ -1351,36 +1350,8 @@ export const RetailerProductEdition = ({
|
|
|
1351
1350
|
}
|
|
1352
1351
|
approveAll={() => validateAll("A")}
|
|
1353
1352
|
rejectAll={() => {
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
setComponentsArray([
|
|
1357
|
-
<img src={errorModal} />,
|
|
1358
|
-
<ScreenHeader
|
|
1359
|
-
text={"Agrega tu comentarios para enviar el rechazo"}
|
|
1360
|
-
headerType={"input-name-header"}
|
|
1361
|
-
color={"white"}
|
|
1362
|
-
/>,
|
|
1363
|
-
<TagAndInput
|
|
1364
|
-
label={"Caja de Comentario"}
|
|
1365
|
-
inputType={"textarea"}
|
|
1366
|
-
inputId={"modal-commentary-box"}
|
|
1367
|
-
index={0}
|
|
1368
|
-
color={"white"}
|
|
1369
|
-
/>,
|
|
1370
|
-
<Button
|
|
1371
|
-
buttonType={"general-default-button"}
|
|
1372
|
-
label={"Enviar comentario"}
|
|
1373
|
-
onClick={(e) =>
|
|
1374
|
-
createComment(
|
|
1375
|
-
e,
|
|
1376
|
-
document.querySelector(
|
|
1377
|
-
"#modal-commentary-box .ql-container .ql-editor > p"
|
|
1378
|
-
).innerHTML,
|
|
1379
|
-
activeTab
|
|
1380
|
-
)
|
|
1381
|
-
}
|
|
1382
|
-
/>,
|
|
1383
|
-
]);
|
|
1353
|
+
setShowRejectModal(true);
|
|
1354
|
+
setValRejAll(true);
|
|
1384
1355
|
}}
|
|
1385
1356
|
/>
|
|
1386
1357
|
<FullTabsMenu
|
|
@@ -1501,47 +1472,6 @@ export const RetailerProductEdition = ({
|
|
|
1501
1472
|
{(userAssigned(activeTab) || auditorAssigned()) &&
|
|
1502
1473
|
product[`${getConcept(activeTab)}_status`] !== "NS" && (
|
|
1503
1474
|
<div className="commentary-box">
|
|
1504
|
-
{!comment ? (
|
|
1505
|
-
<div className="commentary">
|
|
1506
|
-
<TagAndInput
|
|
1507
|
-
label={"Caja de Comentario"}
|
|
1508
|
-
inputType={"textarea"}
|
|
1509
|
-
inputCols={80}
|
|
1510
|
-
inputRows={4}
|
|
1511
|
-
inputId={"commentary-box"}
|
|
1512
|
-
index={0}
|
|
1513
|
-
/>
|
|
1514
|
-
<div className="buttons-box">
|
|
1515
|
-
<Button
|
|
1516
|
-
buttonType={"general-transparent-button"}
|
|
1517
|
-
label={"Enviar comentario"}
|
|
1518
|
-
onClick={(e) =>
|
|
1519
|
-
createComment(
|
|
1520
|
-
e,
|
|
1521
|
-
document.querySelector(
|
|
1522
|
-
"#commentary-box .ql-container .ql-editor > p"
|
|
1523
|
-
).innerHTML,
|
|
1524
|
-
activeTab
|
|
1525
|
-
)
|
|
1526
|
-
}
|
|
1527
|
-
/>
|
|
1528
|
-
</div>
|
|
1529
|
-
</div>
|
|
1530
|
-
) : (
|
|
1531
|
-
<div className="feedback-box">
|
|
1532
|
-
<Commentary
|
|
1533
|
-
comment={comment?.message?.replace(/<.*?\/?>/gm, "")}
|
|
1534
|
-
reviewed={crossComment}
|
|
1535
|
-
/>
|
|
1536
|
-
<Button
|
|
1537
|
-
buttonType={"circular-button accept-button"}
|
|
1538
|
-
onClick={async () => {
|
|
1539
|
-
setCrossComment(true);
|
|
1540
|
-
commentRevised();
|
|
1541
|
-
}}
|
|
1542
|
-
/>
|
|
1543
|
-
</div>
|
|
1544
|
-
)}
|
|
1545
1475
|
{[7, 8].includes(user.id_role) && (
|
|
1546
1476
|
<Button
|
|
1547
1477
|
buttonType={
|
|
@@ -1599,6 +1529,50 @@ export const RetailerProductEdition = ({
|
|
|
1599
1529
|
jwt={token}
|
|
1600
1530
|
/>
|
|
1601
1531
|
)}
|
|
1532
|
+
{showRejectModal && (
|
|
1533
|
+
<Modal
|
|
1534
|
+
title={"Agregar mensaje de rechazo"}
|
|
1535
|
+
show={showRejectModal}
|
|
1536
|
+
customComponent={
|
|
1537
|
+
<TagAndInput
|
|
1538
|
+
label={"Caja de Comentario"}
|
|
1539
|
+
inputType={"textarea"}
|
|
1540
|
+
inputId={"modal-message-box"}
|
|
1541
|
+
index={0}
|
|
1542
|
+
color={"white"}
|
|
1543
|
+
/>
|
|
1544
|
+
}
|
|
1545
|
+
buttons={[
|
|
1546
|
+
<ButtonV2
|
|
1547
|
+
key={"btn-Cancelar"}
|
|
1548
|
+
type={"white"}
|
|
1549
|
+
label={"Cancelar"}
|
|
1550
|
+
size={12}
|
|
1551
|
+
onClick={() => {
|
|
1552
|
+
setShowRejectModal(false);
|
|
1553
|
+
}}
|
|
1554
|
+
/>,
|
|
1555
|
+
<ButtonV2
|
|
1556
|
+
key={"btn-Aceptar"}
|
|
1557
|
+
type={"pink"}
|
|
1558
|
+
label={"Aceptar"}
|
|
1559
|
+
size={12}
|
|
1560
|
+
onClick={async () => {
|
|
1561
|
+
const body = document.querySelector(
|
|
1562
|
+
"#modal-message-box .ql-container .ql-editor > p"
|
|
1563
|
+
).innerHTML;
|
|
1564
|
+
const messages = [
|
|
1565
|
+
{ type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
|
|
1566
|
+
];
|
|
1567
|
+
await createComment(messages, activeRetailer.id);
|
|
1568
|
+
valRejAll ? validateAll("R") : sendToFacilitator("R");
|
|
1569
|
+
setMessage("Rechazado");
|
|
1570
|
+
setShowRejectModal(false);
|
|
1571
|
+
}}
|
|
1572
|
+
/>,
|
|
1573
|
+
]}
|
|
1574
|
+
/>
|
|
1575
|
+
)}
|
|
1602
1576
|
</Container>
|
|
1603
1577
|
);
|
|
1604
1578
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import { fetchPOST } from "../../../global-files/handle_http";
|
|
2
3
|
|
|
3
4
|
export const getAuditVersion = async (articleId, setState, token) => {
|
|
4
5
|
const auditResponse = await axios.get(
|
|
@@ -32,3 +33,39 @@ export const getInputsData = (
|
|
|
32
33
|
setDescriptionState(descriptions);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
36
|
+
|
|
37
|
+
export const translateService = (tab) => {
|
|
38
|
+
switch (tab) {
|
|
39
|
+
case "description":
|
|
40
|
+
case "Descripción":
|
|
41
|
+
return "Descripciones";
|
|
42
|
+
case "datasheet":
|
|
43
|
+
case "Ficha técnica":
|
|
44
|
+
return "Fichas técnicas";
|
|
45
|
+
case "images":
|
|
46
|
+
case "Imágenes":
|
|
47
|
+
return "Imágenes";
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const createMessage = (
|
|
52
|
+
retailers,
|
|
53
|
+
idRetailer,
|
|
54
|
+
oldStatus,
|
|
55
|
+
newStatus,
|
|
56
|
+
service
|
|
57
|
+
) => {
|
|
58
|
+
const [retailer] = retailers?.filter((ret) => ret.id === idRetailer) || [];
|
|
59
|
+
return `${translateService(service)} de ${
|
|
60
|
+
retailer.name
|
|
61
|
+
} |${oldStatus}| a |${newStatus}`;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const sendMessage = async (data) => {
|
|
65
|
+
const { paramsBody, paramsHeader } = data;
|
|
66
|
+
return fetchPOST(
|
|
67
|
+
process.env.REACT_APP_CREATE_MESSAGES,
|
|
68
|
+
paramsBody,
|
|
69
|
+
paramsHeader
|
|
70
|
+
);
|
|
71
|
+
};
|
package/src/index.js
CHANGED
|
@@ -78,6 +78,7 @@ export * from "./components/organisms/Chat/index";
|
|
|
78
78
|
export * from "./components/organisms/Modal/index";
|
|
79
79
|
export * from "./components/organisms/OrderDetail/index";
|
|
80
80
|
export * from "./components/organisms/RangeCalendar";
|
|
81
|
+
export * from "./components/organisms/TableResizable";
|
|
81
82
|
|
|
82
83
|
//pages
|
|
83
84
|
export * from "./components/pages/ChangePasswordLogin";
|