contentoh-components-library 21.3.33 → 21.3.34
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/CustomSelectItem/index.js +1 -1
- package/dist/components/atoms/InputText/index.js +1 -1
- package/dist/components/atoms/ProductPercentCard/index.js +1 -1
- package/dist/components/atoms/Select/index.js +1 -1
- package/dist/components/molecules/ButtonDownloadFile/index.js +1 -1
- package/dist/components/molecules/CarouselImagesLogin/index.js +2 -2
- package/dist/components/molecules/ImageTooltip/index.js +7 -21
- package/dist/components/molecules/ProductNameHeader/index.js +0 -1
- package/dist/components/molecules/SelectV2/index.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +6 -5
- package/dist/components/organisms/Chat/ChatLists/index.js +2 -2
- package/dist/components/organisms/Chat/ContentChat/index.js +85 -49
- package/dist/components/organisms/Chat/Footer/index.js +21 -22
- package/dist/components/organisms/Chat/index.js +1 -1
- package/dist/components/organisms/FullProductNameHeader/index.js +7 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +9 -6
- package/dist/global-files/handle_http.js +33 -31
- package/package.json +1 -1
- package/src/components/atoms/CustomSelectItem/index.js +2 -1
- package/src/components/atoms/InputText/index.js +1 -1
- package/src/components/atoms/ProductPercentCard/index.js +2 -2
- package/src/components/atoms/Select/index.js +1 -1
- package/src/components/molecules/ButtonDownloadFile/index.js +1 -1
- package/src/components/molecules/CarouselImagesLogin/index.js +2 -2
- package/src/components/molecules/ImageTooltip/index.js +7 -17
- package/src/components/molecules/ProductNameHeader/index.js +0 -1
- package/src/components/molecules/SelectV2/index.js +1 -1
- package/src/components/organisms/Chat/Chat.stories.js +5 -4
- package/src/components/organisms/Chat/ChatLists/index.js +2 -2
- package/src/components/organisms/Chat/ContentChat/index.js +35 -28
- package/src/components/organisms/Chat/Footer/index.js +4 -8
- package/src/components/organisms/Chat/index.js +1 -1
- package/src/components/organisms/FullProductNameHeader/index.js +8 -3
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +11 -5
- package/src/global-files/handle_http.js +11 -13
|
@@ -166,7 +166,7 @@ export const Chat = (props) => {
|
|
|
166
166
|
|
|
167
167
|
// convertir user TECH a NORMAL si es el propietario del ticket
|
|
168
168
|
let isUserTech = currentUser.isUserTech;
|
|
169
|
-
if (isUserTech && currentUser.id
|
|
169
|
+
if (isUserTech && currentUser.id === ticketOwnerUserId) {
|
|
170
170
|
isUserTech = false;
|
|
171
171
|
}
|
|
172
172
|
setData({
|
|
@@ -19,6 +19,7 @@ export const FullProductNameHeader = ({
|
|
|
19
19
|
showApproveRejectAll,
|
|
20
20
|
}) => {
|
|
21
21
|
const [retailers, setRetailers] = useState([]);
|
|
22
|
+
|
|
22
23
|
useEffect(() => {
|
|
23
24
|
const rtls = headerData?.retailers || headerData?.retailersAvailable;
|
|
24
25
|
servicesData &&
|
|
@@ -33,6 +34,12 @@ export const FullProductNameHeader = ({
|
|
|
33
34
|
});
|
|
34
35
|
setRetailers(rtls);
|
|
35
36
|
}, [servicesData]);
|
|
37
|
+
|
|
38
|
+
const getTime = (date) => {
|
|
39
|
+
if (!date) return "";
|
|
40
|
+
return new Date(date).toLocaleDateString();
|
|
41
|
+
};
|
|
42
|
+
|
|
36
43
|
return (
|
|
37
44
|
<Container>
|
|
38
45
|
<ProductNameHeader
|
|
@@ -45,9 +52,7 @@ export const FullProductNameHeader = ({
|
|
|
45
52
|
percentRequired={percent}
|
|
46
53
|
percent={percent?.toFixed(0)}
|
|
47
54
|
priority={headerData?.prio}
|
|
48
|
-
date={
|
|
49
|
-
headerData?.article?.timestamp || headerData?.timestamp
|
|
50
|
-
).toLocaleDateString()}
|
|
55
|
+
date={getTime(headerData?.article?.timestamp || headerData?.timestamp)}
|
|
51
56
|
/>
|
|
52
57
|
<div className="features-bar-container">
|
|
53
58
|
<FeaturesBar
|
|
@@ -12,11 +12,11 @@ export const ProviderProductEditionDefault = Template.bind({});
|
|
|
12
12
|
ProviderProductEditionDefault.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.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJlZjViNDQzYi02ODc0LTQ2NGQtOWZiZS00Y2UwNWU4ZDQ3YTEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY4MDAzODYyNiwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjgwMDQyMjI1LCJpYXQiOjE2ODAwMzg2MjYsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.rhufpJdUaJOpiKtXJgNoDq863ecFnLp63c9_6NeEbpYYNN19d_xac8aZADN-QMpkmz1oxtqfxf_-JN5jMJexi9gJCRb9O7-xL75v_G9UjdmE8sRA6qRNb_tFUCt1oee_ulgqm_2wTjb7qGMGvY1eb1J1IX2pBYKnBy64KM6J5xFfZ57ac_bGruYhCzUexPBWyZKc5ckoY2zJqK5m5Ok7ds0m1hC0t-eQSGX_8KMsGQKiHevQ07cZUQ9mxOGVweRuAqITNx8fVmpD9QTpoZJJ5STVVcKO2CS0ltyE_DNlyejO7mZqbKvGEeLYc4ga0nozK9aP8H2cN_topT0d4JZ5rA",
|
|
20
20
|
articleId: 238,
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
@@ -59,7 +59,13 @@ ProviderProductEditionDefault.args = {
|
|
|
59
59
|
],
|
|
60
60
|
},
|
|
61
61
|
location: {
|
|
62
|
-
|
|
62
|
+
pathname: "/EditProducts",
|
|
63
|
+
search: "",
|
|
64
|
+
hash: "",
|
|
65
|
+
state: {
|
|
66
|
+
withChat: true,
|
|
67
|
+
},
|
|
68
|
+
key: "24vwut",
|
|
63
69
|
},
|
|
64
70
|
user: {
|
|
65
71
|
id_user: 59,
|
|
@@ -93,7 +99,7 @@ ProviderProductEditionDefault.args = {
|
|
|
93
99
|
products_limit: "500",
|
|
94
100
|
type: "PyMES",
|
|
95
101
|
},
|
|
96
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?
|
|
102
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1680038627077",
|
|
97
103
|
},
|
|
98
104
|
company: {
|
|
99
105
|
id_company: 817,
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const objToQueryString = (obj) => {
|
|
4
|
+
if (!Object.values(obj).length) return null;
|
|
5
|
+
return Object.entries(obj)
|
|
6
|
+
.map(
|
|
7
|
+
([key, value]) => `${key}=${encodeURIComponent(JSON.stringify(value))}`
|
|
8
|
+
)
|
|
9
|
+
.join("&");
|
|
10
|
+
};
|
|
11
|
+
|
|
4
12
|
/**
|
|
5
13
|
* funcion que realiza un axios GET
|
|
6
14
|
*
|
|
@@ -10,10 +18,7 @@ import axios from "axios";
|
|
|
10
18
|
* body: {} | undefined ,
|
|
11
19
|
* message: string,
|
|
12
20
|
* errorDetail: string
|
|
13
|
-
* }> }
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
//============================================================
|
|
21
|
+
* }> } */
|
|
17
22
|
export const fetchGET = (
|
|
18
23
|
endpoint = "",
|
|
19
24
|
paramsQuery = {},
|
|
@@ -21,16 +26,9 @@ export const fetchGET = (
|
|
|
21
26
|
) => {
|
|
22
27
|
return new Promise(async (response) => {
|
|
23
28
|
try {
|
|
24
|
-
let URL = endpoint
|
|
29
|
+
let URL = `${endpoint}?${objToQueryString(paramsQuery)}`;
|
|
25
30
|
const keysParamsQuery = Object.keys(paramsQuery);
|
|
26
31
|
// agregar cada param query a la URL
|
|
27
|
-
keysParamsQuery.forEach((key, index) => {
|
|
28
|
-
if (index == 0) {
|
|
29
|
-
URL += `?${key}=${paramsQuery[key]}`;
|
|
30
|
-
} else {
|
|
31
|
-
URL += `&${key}=${paramsQuery[key]}`;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
32
|
const respHTTPjson = await axios.get(URL, { headers: paramsHeaders });
|
|
35
33
|
// verificar si existe un error en la peticion realizada
|
|
36
34
|
if (respHTTPjson.status !== 200) {
|