contentoh-components-library 21.4.63 → 21.4.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/dist/components/atoms/Avatar/index.js +3 -2
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/styles.js +1 -1
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/molecules/BoxAttribute/index.js +3 -3
- package/dist/components/molecules/BoxAttribute/styles.js +1 -1
- package/dist/components/molecules/BoxButtons/index.js +0 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +68 -11
- package/dist/components/molecules/SignInLogin/index.js +36 -28
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
- package/dist/components/organisms/Chat/Chat.stories.js +27 -8
- 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 +350 -197
- package/dist/components/organisms/Chat/Footer/index.js +48 -39
- package/dist/components/organisms/Chat/index.js +49 -4
- package/dist/components/organisms/Chat/styles.js +1 -1
- package/dist/components/organisms/DashboardMetric/index.js +12 -6
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/InputGroup/index.js +1 -10
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/pages/Dashboard/Dashboard.stories.js +33 -36
- package/dist/components/pages/Dashboard/index.js +34 -8
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +3 -3
- package/dist/components/pages/ProviderProductEdition/index.js +120 -144
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +7 -3
- package/dist/components/pages/RetailerProductEdition/index.js +279 -277
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +61 -2
- package/dist/global-files/data.js +11 -3
- package/dist/global-files/variables.js +5 -1
- package/dist/index.js +201 -58
- package/package.json +2 -1
- package/src/components/atoms/Avatar/index.js +8 -2
- package/src/components/atoms/CheckBox/styles.js +2 -0
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +76 -0
- package/src/components/atoms/ImageCarousel/index.js +103 -0
- package/src/components/atoms/ImageCarousel/styles.js +79 -0
- package/src/components/atoms/InputFormatter/styles.js +2 -1
- package/src/components/atoms/PercentTag/PercentTag.stories.js +7 -0
- package/src/components/atoms/PercentTag/index.js +9 -0
- package/src/components/atoms/PercentTag/styles.js +69 -0
- package/src/components/atoms/RatingStars/RatingStars.stories.js +10 -0
- package/src/components/atoms/RatingStars/index.js +31 -0
- package/src/components/atoms/RatingStars/styles.js +28 -0
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +36 -0
- package/src/components/atoms/RetailerCatalog/index.js +49 -0
- package/src/components/atoms/RetailerCatalog/styles.js +30 -0
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +15 -0
- package/src/components/atoms/RetailerOption/index.js +53 -0
- package/src/components/atoms/RetailerOption/styles.js +41 -0
- package/src/components/atoms/RetailersList/RetailersList.stories.js +33 -0
- package/src/components/atoms/RetailersList/index.js +20 -0
- package/src/components/atoms/RetailersList/styles.js +19 -0
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/atoms/TabSection/styles.js +1 -1
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +67 -0
- package/src/components/atoms/UserCatalog/index.js +100 -0
- package/src/components/atoms/UserCatalog/styles.js +24 -0
- package/src/components/atoms/UserOption/UserOption.stories.js +25 -0
- package/src/components/atoms/UserOption/index.js +95 -0
- package/src/components/atoms/UserOption/styles.js +61 -0
- package/src/components/atoms/UserSelector/UserSelector.stories.js +25 -0
- package/src/components/atoms/UserSelector/index.js +86 -0
- package/src/components/atoms/UserSelector/styles.js +55 -0
- package/src/components/molecules/BoxAttribute/index.js +32 -25
- package/src/components/molecules/BoxAttribute/styles.js +1 -1
- package/src/components/molecules/BoxButtons/index.js +23 -22
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/GridItem/GridItem.stories.js +126 -0
- package/src/components/molecules/GridItem/index.js +105 -0
- package/src/components/molecules/GridItem/styles.js +104 -0
- package/src/components/molecules/HeaderItem/ColumnItem.js +9 -0
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +24 -0
- package/src/components/molecules/HeaderItem/index.js +26 -0
- package/src/components/molecules/HeaderItem/styles.js +27 -0
- package/src/components/molecules/HeaderTop/index.js +52 -6
- package/src/components/molecules/RowItem/ColumnItem.js +9 -0
- package/src/components/molecules/RowItem/RowItem.stories.js +5660 -0
- package/src/components/molecules/RowItem/index.js +45 -0
- package/src/components/molecules/RowItem/styles.js +40 -0
- package/src/components/molecules/SignInLogin/index.js +11 -11
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +1 -2
- package/src/components/molecules/TagAndInput/index.js +6 -5
- package/src/components/organisms/Chat/Chat.stories.js +27 -7
- package/src/components/organisms/Chat/ContainerItems/index.js +18 -2
- package/src/components/organisms/Chat/ContainerItems/styles.js +14 -2
- package/src/components/organisms/Chat/ContentChat/index.js +88 -12
- package/src/components/organisms/Chat/Footer/index.js +11 -0
- package/src/components/organisms/Chat/index.js +46 -4
- package/src/components/organisms/Chat/styles.js +4 -0
- package/src/components/organisms/DashboardMetric/index.js +6 -3
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/GridProducts/GridProducts.stories.js +5485 -0
- package/src/components/organisms/GridProducts/index.js +50 -0
- package/src/components/organisms/GridProducts/styles.js +14 -0
- package/src/components/organisms/GridProducts/utils.js +111 -0
- package/src/components/organisms/InputGroup/index.js +131 -119
- package/src/components/organisms/Modal/styles.js +4 -1
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +6 -16
- package/src/components/pages/Dashboard/Dashboard.stories.js +33 -38
- package/src/components/pages/Dashboard/index.js +31 -5
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +100 -83
- package/src/components/pages/ProviderProductEdition/index.js +100 -131
- package/src/components/pages/ProviderProductEdition/styles.js +5 -1
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +6 -2
- package/src/components/pages/RetailerProductEdition/index.js +114 -145
- package/src/components/pages/RetailerProductEdition/styles.js +4 -0
- package/src/components/pages/RetailerProductEdition/utils.js +37 -0
- package/src/global-files/data.js +7 -13
- package/src/global-files/variables.js +4 -0
- package/src/index.js +11 -0
|
@@ -40,6 +40,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
40
40
|
const [applicantsFilter, setApplicantsFilter] = useState([]);
|
|
41
41
|
const [totalCount, setTotalCount] = useState(0);
|
|
42
42
|
const [isProviderFinanced] = useState(company?.financedRetailers?.length > 0);
|
|
43
|
+
const [trades, setTrades] = useState([]);
|
|
44
|
+
const [tradesSelected, setTradesSelected] = useState([]);
|
|
43
45
|
|
|
44
46
|
const loadProductVersions = async (queryObject) => {
|
|
45
47
|
const keys = Object.keys(queryObject);
|
|
@@ -84,9 +86,10 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
84
86
|
const isRetailer = user.is_retailer && company.retailers;
|
|
85
87
|
const isProvider = !user.is_retailer && user.id_role === 0;
|
|
86
88
|
const isCollaborator = user.id_role > 0;
|
|
87
|
-
const { ordersBydate, ordersByStatus } =
|
|
89
|
+
const { ordersBydate, ordersByStatus, ordersByActive, companyTrades } =
|
|
88
90
|
(await loadProductVersions(orderByStatus)) || {};
|
|
89
91
|
|
|
92
|
+
if (trades.length === 0) setTrades(companyTrades);
|
|
90
93
|
const { total = 0, R = 0, PA = 0, Ex = 0, ACA = 0 } = ordersByStatus;
|
|
91
94
|
let productsFinished = 0;
|
|
92
95
|
if (isRetailer) productsFinished = Ex;
|
|
@@ -100,6 +103,8 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
100
103
|
: prev,
|
|
101
104
|
0
|
|
102
105
|
);
|
|
106
|
+
|
|
107
|
+
const registeredProducts = ordersByActive.registered;
|
|
103
108
|
let metricsArray = [
|
|
104
109
|
metricsData[0]
|
|
105
110
|
? metricsData[0]
|
|
@@ -107,6 +112,7 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
107
112
|
];
|
|
108
113
|
|
|
109
114
|
metricsArray.push(
|
|
115
|
+
{ label: "Productos activos", value: registeredProducts },
|
|
110
116
|
{ label: "Productos filtrados", value: total },
|
|
111
117
|
{ label: "Productos sin asignar", value: PA + R },
|
|
112
118
|
{ label: "Productos en proceso", value: inProcess },
|
|
@@ -229,14 +235,23 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
229
235
|
startDate: startDate,
|
|
230
236
|
endDate: endDate,
|
|
231
237
|
};
|
|
232
|
-
companyId.length > 0
|
|
233
|
-
retailerId.length > 0
|
|
234
|
-
categoryId.length > 0
|
|
238
|
+
if (companyId.length > 0) queryObject["companyId"] = companyId.join(",");
|
|
239
|
+
if (retailerId.length > 0) queryObject["retailerId"] = retailerId.join(",");
|
|
240
|
+
if (categoryId.length > 0) queryObject["categoryId"] = categoryId.join(",");
|
|
241
|
+
if (tradesSelected.length > 0)
|
|
242
|
+
queryObject["trades"] = encodeURIComponent(tradesSelected.join(","));
|
|
235
243
|
applicantsFilter.length > 0 &&
|
|
236
244
|
(queryObject["requestedBy"] = applicantsFilter.join(","));
|
|
237
245
|
|
|
238
246
|
await loadProductsByStatus(queryObject, true);
|
|
239
|
-
}, [
|
|
247
|
+
}, [
|
|
248
|
+
companyId,
|
|
249
|
+
retailerId,
|
|
250
|
+
categoryId,
|
|
251
|
+
datesRange,
|
|
252
|
+
applicantsFilter,
|
|
253
|
+
tradesSelected,
|
|
254
|
+
]);
|
|
240
255
|
|
|
241
256
|
return loading ? (
|
|
242
257
|
<Loading />
|
|
@@ -301,6 +316,17 @@ export const Dashboard = ({ jwt, user, company }) => {
|
|
|
301
316
|
defaultOption="Todos los solicitantes"
|
|
302
317
|
/>
|
|
303
318
|
)}
|
|
319
|
+
{user.id_role === 0 && trades?.length > 0 && (
|
|
320
|
+
<CustomSelect
|
|
321
|
+
showSearchBar={true}
|
|
322
|
+
options={trades}
|
|
323
|
+
selectLabel="Todas las marcas"
|
|
324
|
+
placeHolder="Buscar marca"
|
|
325
|
+
customSelectId="trade-select"
|
|
326
|
+
parameterArray={tradesSelected}
|
|
327
|
+
setParameterArray={setTradesSelected}
|
|
328
|
+
/>
|
|
329
|
+
)}
|
|
304
330
|
</div>
|
|
305
331
|
<div className="metric-cards">
|
|
306
332
|
{metricsData.map((metric, index) => (
|
|
@@ -21,39 +21,41 @@ ProviderProductEditionDefault.args = {
|
|
|
21
21
|
category: 287,
|
|
22
22
|
version: 1,
|
|
23
23
|
productSelected: {
|
|
24
|
-
id_article:39550,
|
|
25
|
-
upc:43654697,
|
|
26
|
-
name:"Campana de Cocina",
|
|
27
|
-
timestamp:"2023-08-04T22:23:40.000Z",
|
|
28
|
-
categoryName:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{name:"The Home Depot
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
id_article: 39550,
|
|
25
|
+
upc: 43654697,
|
|
26
|
+
name: "Campana de Cocina",
|
|
27
|
+
timestamp: "2023-08-04T22:23:40.000Z",
|
|
28
|
+
categoryName:
|
|
29
|
+
"Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
|
|
30
|
+
id_category: 287,
|
|
31
|
+
version: 1,
|
|
32
|
+
retailersAvailable: [
|
|
33
|
+
{ name: "The Home Depot Golden", id: 58 },
|
|
34
|
+
{ name: "The Home Depot Onboarding", id: 68 },
|
|
35
|
+
],
|
|
36
|
+
percentage: "89",
|
|
37
|
+
},
|
|
36
38
|
productToEdit: {
|
|
37
|
-
idCategory:287,
|
|
38
|
-
ArticleId:39550,
|
|
39
|
-
product:[
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
percentage:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
39
|
+
idCategory: 287,
|
|
40
|
+
ArticleId: 39550,
|
|
41
|
+
product: [
|
|
42
|
+
{
|
|
43
|
+
id_article: 39550,
|
|
44
|
+
upc: 43654697,
|
|
45
|
+
name: "Campana de Cocina",
|
|
46
|
+
timestamp: "2023-08-04T22:23:40.000Z",
|
|
47
|
+
categoryName:
|
|
48
|
+
"Ferretería|Ferretería General|Tornillos, Tuercas y Arandelas",
|
|
49
|
+
id_category: 287,
|
|
50
|
+
version: 1,
|
|
51
|
+
retailersAvailable: [
|
|
52
|
+
{ name: "The Home Depot Golden", id: 58, percentage: 100 },
|
|
53
|
+
{ name: "The Home Depot Onboarding", id: 68, percentage: 78 },
|
|
54
|
+
],
|
|
55
|
+
percentage: "89",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
57
59
|
location: {
|
|
58
60
|
pathname: "/EditProducts",
|
|
59
61
|
search: "",
|
|
@@ -66,57 +68,72 @@ ProviderProductEditionDefault.args = {
|
|
|
66
68
|
key: "24vwut",
|
|
67
69
|
},
|
|
68
70
|
user: {
|
|
69
|
-
id_user:191,
|
|
70
|
-
name:"Demo",
|
|
71
|
-
last_name:"Demo",
|
|
72
|
-
email:"merchants24feb@allfreemail.net",
|
|
73
|
-
position:"Test",
|
|
74
|
-
telephone:"+52123456789",
|
|
75
|
-
country:"México",
|
|
76
|
-
id_company:923,
|
|
77
|
-
id_cognito:"c3cd160c-76c2-497c-9357-5ef949307e1e",
|
|
78
|
-
birth_Date:null,
|
|
79
|
-
about_me:null,
|
|
80
|
-
zip_code:null,
|
|
81
|
-
address:null,
|
|
82
|
-
job:null,
|
|
83
|
-
id_stripe:null,
|
|
84
|
-
id_role:0,
|
|
85
|
-
active:1,
|
|
86
|
-
is_retailer:0,
|
|
87
|
-
email_notify:1,
|
|
88
|
-
is_user_tech:null,
|
|
89
|
-
membership:
|
|
90
|
-
|
|
91
|
-
start_date:"2023-02-24T18:14:43.000Z",
|
|
92
|
-
end_date:"2024-02-24T18:14:43.000Z",
|
|
93
|
-
planID:8,
|
|
94
|
-
plan:"prod_KtlhECVSFG2iro",
|
|
95
|
-
name:"Plan Pro",
|
|
96
|
-
user_limit:"50",
|
|
97
|
-
products_limit:"5000",
|
|
98
|
-
type:"Enterprise"
|
|
99
|
-
|
|
71
|
+
id_user: 191,
|
|
72
|
+
name: "Demo",
|
|
73
|
+
last_name: "Demo",
|
|
74
|
+
email: "merchants24feb@allfreemail.net",
|
|
75
|
+
position: "Test",
|
|
76
|
+
telephone: "+52123456789",
|
|
77
|
+
country: "México",
|
|
78
|
+
id_company: 923,
|
|
79
|
+
id_cognito: "c3cd160c-76c2-497c-9357-5ef949307e1e",
|
|
80
|
+
birth_Date: null,
|
|
81
|
+
about_me: null,
|
|
82
|
+
zip_code: null,
|
|
83
|
+
address: null,
|
|
84
|
+
job: null,
|
|
85
|
+
id_stripe: null,
|
|
86
|
+
id_role: 0,
|
|
87
|
+
active: 1,
|
|
88
|
+
is_retailer: 0,
|
|
89
|
+
email_notify: 1,
|
|
90
|
+
is_user_tech: null,
|
|
91
|
+
membership: {
|
|
92
|
+
id: 114,
|
|
93
|
+
start_date: "2023-02-24T18:14:43.000Z",
|
|
94
|
+
end_date: "2024-02-24T18:14:43.000Z",
|
|
95
|
+
planID: 8,
|
|
96
|
+
plan: "prod_KtlhECVSFG2iro",
|
|
97
|
+
name: "Plan Pro",
|
|
98
|
+
user_limit: "50",
|
|
99
|
+
products_limit: "5000",
|
|
100
|
+
type: "Enterprise",
|
|
101
|
+
},
|
|
102
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-191/191.png?1697171804447",
|
|
103
|
+
},
|
|
100
104
|
company: {
|
|
101
|
-
id_company:923,
|
|
102
|
-
trade_name:"Demo",
|
|
103
|
-
company_name:"Demo",
|
|
104
|
-
rfc:"Demo",
|
|
105
|
-
adress:"Demo",
|
|
106
|
-
about_company:null,
|
|
107
|
-
telephone:null,
|
|
108
|
-
web_site:null,
|
|
109
|
-
zip_code:null,
|
|
110
|
-
email:null,
|
|
111
|
-
social_link:null,
|
|
112
|
-
is_retailer:0,
|
|
113
|
-
financedRetailers:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
105
|
+
id_company: 923,
|
|
106
|
+
trade_name: "Demo",
|
|
107
|
+
company_name: "Demo",
|
|
108
|
+
rfc: "Demo",
|
|
109
|
+
adress: "Demo",
|
|
110
|
+
about_company: null,
|
|
111
|
+
telephone: null,
|
|
112
|
+
web_site: null,
|
|
113
|
+
zip_code: null,
|
|
114
|
+
email: null,
|
|
115
|
+
social_link: null,
|
|
116
|
+
is_retailer: 0,
|
|
117
|
+
financedRetailers: [
|
|
118
|
+
{
|
|
119
|
+
id: 68,
|
|
120
|
+
name: "The Home Depot Onboarding",
|
|
121
|
+
country: "México",
|
|
122
|
+
id_region: 1,
|
|
123
|
+
active: 1,
|
|
124
|
+
flow: 1,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
retailers: [
|
|
128
|
+
{
|
|
129
|
+
id: 68,
|
|
130
|
+
name: "The Home Depot Onboarding",
|
|
131
|
+
country: "México",
|
|
132
|
+
id_region: 1,
|
|
133
|
+
active: 1,
|
|
134
|
+
flow: 1,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
},
|
|
121
138
|
showSurvey: (v) => v && alert("se muestra"),
|
|
122
139
|
};
|
|
@@ -39,6 +39,10 @@ import Slide1_4 from "../../../assets/images/sliderToolTip/slide4.svg";
|
|
|
39
39
|
import Slide1_5 from "../../../assets/images/sliderToolTip/slide5.svg";
|
|
40
40
|
import { VersionSelector } from "../../organisms/VersionSelector";
|
|
41
41
|
import { useCloseModal } from "../../../global-files/customHooks";
|
|
42
|
+
import { createMessage, sendMessage } from "../RetailerProductEdition/utils";
|
|
43
|
+
import { Modal } from "../../organisms/Modal";
|
|
44
|
+
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
45
|
+
import { Box } from "../../organisms/Box";
|
|
42
46
|
|
|
43
47
|
const reducerImages = (state, action) => {
|
|
44
48
|
let { values, attrForImgs, inputsByRetailer } = state;
|
|
@@ -215,6 +219,7 @@ export const ProviderProductEdition = ({
|
|
|
215
219
|
const isRetailer = user?.is_retailer;
|
|
216
220
|
const [loading, setLoading] = useState(true);
|
|
217
221
|
const [validatedAll, setValidatedAll] = useState(false);
|
|
222
|
+
const [showRejectModal, setShowRejectModal] = useState(false);
|
|
218
223
|
|
|
219
224
|
const [origin, setOrigin] = useState({
|
|
220
225
|
"Ficha técnica": null,
|
|
@@ -344,28 +349,6 @@ export const ProviderProductEdition = ({
|
|
|
344
349
|
(type) => {
|
|
345
350
|
const formatter = new Intl.ListFormat("es", { type: "conjunction" });
|
|
346
351
|
switch (type) {
|
|
347
|
-
case "error":
|
|
348
|
-
setGlobalModal({
|
|
349
|
-
message: `${activeTab} rechazada`,
|
|
350
|
-
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
351
|
-
img: errorModal,
|
|
352
|
-
textArea: true,
|
|
353
|
-
button1: {
|
|
354
|
-
name: "Enviar",
|
|
355
|
-
action: (e) => {
|
|
356
|
-
const textArea = document.querySelector("#area");
|
|
357
|
-
if (textArea.value) {
|
|
358
|
-
textArea.style.border = "none";
|
|
359
|
-
createComment(e, textArea.value);
|
|
360
|
-
showGlobalModal("commentsSent");
|
|
361
|
-
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
362
|
-
} else {
|
|
363
|
-
textArea.style.border = "2px solid red";
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
});
|
|
368
|
-
break;
|
|
369
352
|
case "generic":
|
|
370
353
|
setGlobalModal(dataGenericModal);
|
|
371
354
|
break;
|
|
@@ -526,7 +509,9 @@ export const ProviderProductEdition = ({
|
|
|
526
509
|
);
|
|
527
510
|
setServicesData(parsedResponse);
|
|
528
511
|
}
|
|
529
|
-
|
|
512
|
+
retailers &&
|
|
513
|
+
!activeRetailer.id &&
|
|
514
|
+
setActiveRetailer(active ? active : retailers[0]);
|
|
530
515
|
};
|
|
531
516
|
|
|
532
517
|
const isRevision = () => {
|
|
@@ -602,7 +587,7 @@ export const ProviderProductEdition = ({
|
|
|
602
587
|
});
|
|
603
588
|
}
|
|
604
589
|
setProduct(productTemp);
|
|
605
|
-
setActivePercentage(retailers[0]?.percentage);
|
|
590
|
+
retailers && setActivePercentage(retailers[0]?.percentage);
|
|
606
591
|
}, [percentages]);
|
|
607
592
|
|
|
608
593
|
const loadInputs = () => {
|
|
@@ -862,33 +847,21 @@ export const ProviderProductEdition = ({
|
|
|
862
847
|
return "images";
|
|
863
848
|
}
|
|
864
849
|
};
|
|
850
|
+
|
|
865
851
|
|
|
866
|
-
const createComment = async (
|
|
867
|
-
let concept = "";
|
|
868
|
-
switch (activeTab) {
|
|
869
|
-
case "Ficha técnica":
|
|
870
|
-
concept = "datasheet";
|
|
871
|
-
break;
|
|
872
|
-
case "Imágenes":
|
|
873
|
-
concept = "images";
|
|
874
|
-
break;
|
|
875
|
-
|
|
876
|
-
default:
|
|
877
|
-
concept = "description";
|
|
878
|
-
break;
|
|
879
|
-
}
|
|
852
|
+
const createComment = async (messages = [], retailerId) => {
|
|
880
853
|
const data = {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
await axios.post(`${process.env.REACT_APP_COMMENTS_ENDPOINT}`, data, {
|
|
888
|
-
headers: {
|
|
889
|
-
Authorization: token,
|
|
854
|
+
paramsBody: {
|
|
855
|
+
id: product.article.id_article || productEdit.ArticleId,
|
|
856
|
+
version: version,
|
|
857
|
+
items: messages,
|
|
858
|
+
retailerId: retailerId,
|
|
859
|
+
status: product.status || productEdit.product.status,
|
|
890
860
|
},
|
|
891
|
-
|
|
861
|
+
paramsHeader: { Authorization: token },
|
|
862
|
+
};
|
|
863
|
+
setMessage("");
|
|
864
|
+
return sendMessage(data);
|
|
892
865
|
};
|
|
893
866
|
|
|
894
867
|
useEffect(() => {
|
|
@@ -1224,8 +1197,6 @@ export const ProviderProductEdition = ({
|
|
|
1224
1197
|
|
|
1225
1198
|
const enableActions = (versionStatus) => {
|
|
1226
1199
|
try {
|
|
1227
|
-
if (user.is_retailer) return false;
|
|
1228
|
-
|
|
1229
1200
|
if (versionStatus) {
|
|
1230
1201
|
return ["AP", "ACA", "RCA", null].includes(versionStatus);
|
|
1231
1202
|
}
|
|
@@ -1309,8 +1280,7 @@ export const ProviderProductEdition = ({
|
|
|
1309
1280
|
return;
|
|
1310
1281
|
} else if (user.is_retailer) {
|
|
1311
1282
|
if (product.id_order || product.orderId) {
|
|
1312
|
-
|
|
1313
|
-
showGlobalModal("error");
|
|
1283
|
+
sendEvaluation("R");
|
|
1314
1284
|
} else {
|
|
1315
1285
|
setDataGenericModal((prev) => ({
|
|
1316
1286
|
...prev,
|
|
@@ -1322,8 +1292,7 @@ export const ProviderProductEdition = ({
|
|
|
1322
1292
|
showGlobalModal("generic");
|
|
1323
1293
|
}
|
|
1324
1294
|
} else {
|
|
1325
|
-
|
|
1326
|
-
showGlobalModal("error");
|
|
1295
|
+
sendEvaluation("R");
|
|
1327
1296
|
}
|
|
1328
1297
|
}
|
|
1329
1298
|
};
|
|
@@ -1333,6 +1302,7 @@ export const ProviderProductEdition = ({
|
|
|
1333
1302
|
<HeaderTop
|
|
1334
1303
|
setHeaderTop={setHeaderTop}
|
|
1335
1304
|
withChat={location?.state?.withChat}
|
|
1305
|
+
chatType={location?.state?.chatType}
|
|
1336
1306
|
productSelected={productSelected}
|
|
1337
1307
|
token={token}
|
|
1338
1308
|
activeRetailer={activeRetailer}
|
|
@@ -1411,7 +1381,7 @@ export const ProviderProductEdition = ({
|
|
|
1411
1381
|
} else if (user.is_retailer) {
|
|
1412
1382
|
if (product.id_order || product.orderId) {
|
|
1413
1383
|
setValidatedAll(true);
|
|
1414
|
-
|
|
1384
|
+
setShowRejectModal(true);
|
|
1415
1385
|
} else {
|
|
1416
1386
|
setDataGenericModal((prev) => ({
|
|
1417
1387
|
...prev,
|
|
@@ -1423,12 +1393,14 @@ export const ProviderProductEdition = ({
|
|
|
1423
1393
|
showGlobalModal("generic");
|
|
1424
1394
|
}
|
|
1425
1395
|
} else {
|
|
1396
|
+
setShowRejectModal(true);
|
|
1426
1397
|
setValidatedAll(true);
|
|
1427
|
-
showGlobalModal("error");
|
|
1428
1398
|
}
|
|
1429
1399
|
}}
|
|
1430
1400
|
approve={() => sendToEvaluation("A")}
|
|
1431
|
-
reject={() =>
|
|
1401
|
+
reject={() => {
|
|
1402
|
+
setShowRejectModal(true);
|
|
1403
|
+
}}
|
|
1432
1404
|
/>
|
|
1433
1405
|
<FullTabsMenu
|
|
1434
1406
|
tabsSections={tabsSections}
|
|
@@ -1531,6 +1503,7 @@ export const ProviderProductEdition = ({
|
|
|
1531
1503
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
1532
1504
|
articleId={product?.id_article}
|
|
1533
1505
|
version={version}
|
|
1506
|
+
isShowbox={false}
|
|
1534
1507
|
dinamicHeight={true}
|
|
1535
1508
|
/>
|
|
1536
1509
|
) : (
|
|
@@ -1557,87 +1530,41 @@ export const ProviderProductEdition = ({
|
|
|
1557
1530
|
</>
|
|
1558
1531
|
)}
|
|
1559
1532
|
</div>
|
|
1560
|
-
{isRevision() && getSectionStatus()
|
|
1561
|
-
<div className="
|
|
1562
|
-
|
|
1563
|
-
<
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
<
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
onClick={(e) =>
|
|
1577
|
-
createComment(
|
|
1578
|
-
e,
|
|
1579
|
-
document.querySelector(
|
|
1580
|
-
"#description-commentary-box-0 .ql-container .ql-editor > p"
|
|
1581
|
-
).innerHTML,
|
|
1582
|
-
activeTab
|
|
1583
|
-
)
|
|
1584
|
-
}
|
|
1585
|
-
/>
|
|
1586
|
-
</div>
|
|
1587
|
-
</div>
|
|
1533
|
+
{!(isRevision() && getSectionStatus()) && !revision && (
|
|
1534
|
+
<div className="required-inputs-message">
|
|
1535
|
+
<div>
|
|
1536
|
+
<p>
|
|
1537
|
+
Los atributos son requeridos por las plataformas de las
|
|
1538
|
+
cadenas, es muy importante completar los campos requeridos ya
|
|
1539
|
+
que pueden rechazar el producto por falta de información.
|
|
1540
|
+
</p>
|
|
1541
|
+
</div>
|
|
1542
|
+
{inCart ? (
|
|
1543
|
+
<button type="button">
|
|
1544
|
+
<Link to="/checkout">
|
|
1545
|
+
<p>Articulo en carrito</p>
|
|
1546
|
+
<p>Ir a checkout</p>
|
|
1547
|
+
</Link>
|
|
1548
|
+
</button>
|
|
1588
1549
|
) : (
|
|
1589
|
-
|
|
1590
|
-
<
|
|
1591
|
-
|
|
1592
|
-
|
|
1550
|
+
<>
|
|
1551
|
+
<SliderToolTip
|
|
1552
|
+
infoIcon={InfoIcon}
|
|
1553
|
+
slidefront={slidefront}
|
|
1554
|
+
iconSize={"big-image"}
|
|
1555
|
+
slidePosition={"top-slide"}
|
|
1593
1556
|
/>
|
|
1594
1557
|
<Button
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
commentRevised();
|
|
1558
|
+
onClick={() => {
|
|
1559
|
+
setShowContentohRequestModal &&
|
|
1560
|
+
setShowContentohRequestModal(true);
|
|
1599
1561
|
}}
|
|
1562
|
+
buttonType="general-default-button"
|
|
1563
|
+
label="Enviar a Content-oh!"
|
|
1600
1564
|
/>
|
|
1601
|
-
|
|
1565
|
+
</>
|
|
1602
1566
|
)}
|
|
1603
1567
|
</div>
|
|
1604
|
-
) : (
|
|
1605
|
-
!revision && (
|
|
1606
|
-
<div className="required-inputs-message">
|
|
1607
|
-
<div>
|
|
1608
|
-
<p>
|
|
1609
|
-
Los atributos son requeridos por las plataformas de las
|
|
1610
|
-
cadenas, es muy importante completar los campos requeridos
|
|
1611
|
-
ya que pueden rechazar el producto por falta de información.
|
|
1612
|
-
</p>
|
|
1613
|
-
</div>
|
|
1614
|
-
{inCart ? (
|
|
1615
|
-
<button type="button">
|
|
1616
|
-
<Link to="/checkout">
|
|
1617
|
-
<p>Articulo en carrito</p>
|
|
1618
|
-
<p>Ir a checkout</p>
|
|
1619
|
-
</Link>
|
|
1620
|
-
</button>
|
|
1621
|
-
) : (
|
|
1622
|
-
<>
|
|
1623
|
-
<SliderToolTip
|
|
1624
|
-
infoIcon={InfoIcon}
|
|
1625
|
-
slidefront={slidefront}
|
|
1626
|
-
iconSize={"big-image"}
|
|
1627
|
-
slidePosition={"top-slide"}
|
|
1628
|
-
/>
|
|
1629
|
-
<Button
|
|
1630
|
-
onClick={() => {
|
|
1631
|
-
setShowContentohRequestModal &&
|
|
1632
|
-
setShowContentohRequestModal(true);
|
|
1633
|
-
}}
|
|
1634
|
-
buttonType="general-default-button"
|
|
1635
|
-
label="Enviar a Content-oh!"
|
|
1636
|
-
/>
|
|
1637
|
-
</>
|
|
1638
|
-
)}
|
|
1639
|
-
</div>
|
|
1640
|
-
)
|
|
1641
1568
|
)}
|
|
1642
1569
|
</div>
|
|
1643
1570
|
</div>
|
|
@@ -1680,6 +1607,48 @@ export const ProviderProductEdition = ({
|
|
|
1680
1607
|
jwt={token}
|
|
1681
1608
|
/>
|
|
1682
1609
|
)}
|
|
1610
|
+
{showRejectModal && (
|
|
1611
|
+
<Modal
|
|
1612
|
+
title={"Agregar mensaje de rechazo"}
|
|
1613
|
+
show={showRejectModal}
|
|
1614
|
+
customComponent={
|
|
1615
|
+
<TagAndInput
|
|
1616
|
+
inputType={"textarea"}
|
|
1617
|
+
inputId={"modal-message-box"}
|
|
1618
|
+
index={0}
|
|
1619
|
+
color={"white"}
|
|
1620
|
+
/>
|
|
1621
|
+
}
|
|
1622
|
+
buttons={[
|
|
1623
|
+
<ButtonV2
|
|
1624
|
+
key={"btn-Cancelar"}
|
|
1625
|
+
type={"white"}
|
|
1626
|
+
label={"Cancelar"}
|
|
1627
|
+
size={12}
|
|
1628
|
+
onClick={() => {
|
|
1629
|
+
setShowRejectModal(false);
|
|
1630
|
+
}}
|
|
1631
|
+
/>,
|
|
1632
|
+
<ButtonV2
|
|
1633
|
+
key={"btn-Aceptar"}
|
|
1634
|
+
type={"pink"}
|
|
1635
|
+
label={"Aceptar"}
|
|
1636
|
+
size={12}
|
|
1637
|
+
onClick={async () => {
|
|
1638
|
+
const body = document.querySelector(
|
|
1639
|
+
"#modal-message-box .ql-container .ql-editor > p"
|
|
1640
|
+
).innerHTML;
|
|
1641
|
+
const messages = [
|
|
1642
|
+
{ type: "message", value: body?.replace(/<.*?\/?>/gm, "") },
|
|
1643
|
+
];
|
|
1644
|
+
await createComment(messages, activeRetailer.id);
|
|
1645
|
+
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
1646
|
+
setShowRejectModal(false);
|
|
1647
|
+
}}
|
|
1648
|
+
/>,
|
|
1649
|
+
]}
|
|
1650
|
+
/>
|
|
1651
|
+
)}
|
|
1683
1652
|
</Container>
|
|
1684
1653
|
);
|
|
1685
1654
|
};
|
|
@@ -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
|
+
`;
|
|
@@ -16,7 +16,7 @@ RetailerProductEditionDefault.args = {
|
|
|
16
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
21
|
services: {
|
|
22
22
|
datasheets: 1,
|
|
@@ -73,7 +73,11 @@ RetailerProductEditionDefault.args = {
|
|
|
73
73
|
upc: "7543453453",
|
|
74
74
|
},
|
|
75
75
|
location: {
|
|
76
|
-
product: { articleId:
|
|
76
|
+
product: { articleId: 354, versionId: 3 },
|
|
77
|
+
state: {
|
|
78
|
+
withChat: true,
|
|
79
|
+
chatType: "product_status",
|
|
80
|
+
},
|
|
77
81
|
},
|
|
78
82
|
user: {
|
|
79
83
|
id_user: 37,
|