contentoh-components-library 21.3.24 → 21.3.26
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/molecules/GalleryElement/index.js +3 -3
- package/dist/components/molecules/HeaderTop/styles.js +1 -1
- package/dist/components/organisms/Chat/Chat.stories.js +3 -1
- package/dist/components/organisms/Chat/ContainerItems/index.js +26 -34
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +3 -1
- package/dist/components/organisms/Chat/index.js +6 -1
- package/package.json +1 -1
- package/src/components/molecules/GalleryElement/index.js +1 -1
- package/src/components/molecules/HeaderTop/styles.js +2 -4
- package/src/components/organisms/Chat/Chat.stories.js +3 -1
- package/src/components/organisms/Chat/ContainerItems/index.js +40 -39
- package/src/components/organisms/Chat/ContainerItems/styles.js +24 -4
- package/src/components/organisms/Chat/ContentChat/index.js +11 -8
- package/src/components/organisms/Chat/index.js +4 -1
|
@@ -26,7 +26,7 @@ var _Select = _interopRequireDefault(require("../../atoms/Select"));
|
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
|
|
28
28
|
var GalleryElement = function GalleryElement(_ref) {
|
|
29
|
-
var _auditImages$values$n;
|
|
29
|
+
var _auditImages$values$n, _auditImages$values$n2;
|
|
30
30
|
|
|
31
31
|
var _ref$validation = _ref.validation,
|
|
32
32
|
validation = _ref$validation === void 0 ? "null-button" : _ref$validation,
|
|
@@ -92,7 +92,7 @@ var GalleryElement = function GalleryElement(_ref) {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
95
|
-
className: "".concat(gridLayout ? "grid-gallery" : "row-gallery", " ").concat(!isEquals(image.uuid, auditImages === null || auditImages === void 0 ? void 0 : auditImages.values[number]
|
|
95
|
+
className: "".concat(gridLayout ? "grid-gallery" : "row-gallery", " ").concat(compare && !isEquals(image === null || image === void 0 ? void 0 : image.uuid, auditImages === null || auditImages === void 0 ? void 0 : (_auditImages$values$n = auditImages.values[number]) === null || _auditImages$values$n === void 0 ? void 0 : _auditImages$values$n.uuid) ? "audit-class" : ""),
|
|
96
96
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
97
97
|
className: "buttons-container",
|
|
98
98
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.CheckBox, {
|
|
@@ -105,7 +105,7 @@ var GalleryElement = function GalleryElement(_ref) {
|
|
|
105
105
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
106
106
|
className: "image-container",
|
|
107
107
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductImage.ProductImage, {
|
|
108
|
-
img: compare ? auditImages === null || auditImages === void 0 ? void 0 : (_auditImages$values$
|
|
108
|
+
img: compare ? auditImages === null || auditImages === void 0 ? void 0 : (_auditImages$values$n2 = auditImages.values[number]) === null || _auditImages$values$n2 === void 0 ? void 0 : _auditImages$values$n2.src : image === null || image === void 0 ? void 0 : image.src,
|
|
109
109
|
altText: image === null || image === void 0 ? void 0 : image.altText,
|
|
110
110
|
imageType: "catalogue-image-".concat(gridLayout ? "big" : "small", "-size")
|
|
111
111
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -13,6 +13,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n .buttons-top {\n display: flex;\n align-items: center;\n padding-top: 10px;\n }\n\n .buttons-container {\n display: flex;\n\n button {\n width: 30px;\n height: 30px;\n border: 1px solid #f0f0f0;\n background-size: 20px;\n padding: 0;\n\n & + * {\n margin-left: 10px;\n }\n }\n }\n"])));
|
|
17
17
|
|
|
18
18
|
exports.Container = Container;
|
|
@@ -132,6 +132,7 @@ chatTicket_userNORMAL.args = {
|
|
|
132
132
|
id: 104,
|
|
133
133
|
ticketOwnerUserId: 49,
|
|
134
134
|
statusTicket: "IN_PROGRESS",
|
|
135
|
+
ticketCompany: 817,
|
|
135
136
|
currentUser: {
|
|
136
137
|
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI2YmI0NzExMi03ZTNiLTRjYzUtYmVhZS02MzMxZjEwYjk3MzIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2NTYxNjI0MSwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjY1NjE5ODQxLCJpYXQiOjE2NjU2MTYyNDEsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.gi1Jiua_O175vHLy-CYXOR945IRcObIj5j1LNk4_EhcKPz-MzPnfWDLH7L3sTiNS-VUhIRtAhtUVPUSYv0oP1qfJwFHomerxJvYgJge8SLWPjL6yGBnTxAvHVbuLU8kcaoZup2eNMV6XOIAEBAHeCDm4vW0rYWwfrKADPyYGZQF2si14o3wtgSMX5a4ccxGwikT3to3HttWBhmJs_I1Xr_BvBxePc4WghjQr5GVGbq8vhr4HwdkTmlcJAnQsc_fmIdbJ_ACyTa1wr343KYYOQVwBjAmZDa6rU16y0yTr_J4IVWY3aS5UpBEBHy4XE0c76UaN-_DcGiVl4ayWQIUz8A",
|
|
137
138
|
id: 59,
|
|
@@ -147,8 +148,9 @@ chatTicket_userTECH.args = {
|
|
|
147
148
|
chatType: "ticket",
|
|
148
149
|
chatContainerType: "fixed",
|
|
149
150
|
chatData: {
|
|
150
|
-
id:
|
|
151
|
+
id: 130,
|
|
151
152
|
ticketOwnerUserId: 49,
|
|
153
|
+
ticketCompany: 817,
|
|
152
154
|
statusTicket: "IN_PROGRESS",
|
|
153
155
|
currentUser: {
|
|
154
156
|
token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNTkyN2Y4ZS1jYmY3LTQ5MjItOWUwOS1lNjllYzBiMjczMWEiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImY1OTI3ZjhlLWNiZjctNDkyMi05ZTA5LWU2OWVjMGIyNzMxYSIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI5M2FkOTM5Yy04MzJjLTQ4NWItOWUzMS0yN2MxNzBjMDk1NWEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2OTY2MjU5MiwibmFtZSI6IklzbWFlbCBMb3BleiIsInBob25lX251bWJlciI6Iis1MjMxMTEzNjYzMzYiLCJleHAiOjE2Njk2NjYxOTIsImlhdCI6MTY2OTY2MjU5MiwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.hhdlQk-ljHpyZPRoG02YcvPow8jpm9coZfmEuZ29vIVX7bX5k05Ss3FkaT0dYNr2qEvqZHHqH61oJvx4xr2i6z2c3xEZxyJZFR-Cc_skhH0UwGXbCH9up5PW1aipY5rL45E42R7GKSGmB5Z-B7vxe2NcL-ZojYZkXNZ7Gx_lM8Vpq-XsFLJ4nCJlH7vx9D4SkREN3lLfYIIgqNrxJ_wqfqvcqexwRJfnr76ZqCuDR4dTWsES2Lf5D8Wa_wkQAjQNdzP7ai28l9fRyCSwkTxvamdJkx7p-tssOL5pAnCsKkD22UN-09c1bhuGrgfKWUV4awbptfjvHS7TSq0bWiv4gQ",
|
|
@@ -45,6 +45,8 @@ var _ImagePreview = require("../../../atoms/ImagePreview");
|
|
|
45
45
|
|
|
46
46
|
var _handle_userTech = require("../../../../global-files/handle_userTech");
|
|
47
47
|
|
|
48
|
+
var _awsAmplify = require("aws-amplify");
|
|
49
|
+
|
|
48
50
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
49
51
|
|
|
50
52
|
var ContainerItems = function ContainerItems(props) {
|
|
@@ -54,7 +56,8 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
54
56
|
activeCompanyId = props.activeCompanyId,
|
|
55
57
|
chatType = props.chatType,
|
|
56
58
|
showBtnLoadMore = props.showBtnLoadMore,
|
|
57
|
-
onClickBtnLoadMore = props.onClickBtnLoadMore
|
|
59
|
+
onClickBtnLoadMore = props.onClickBtnLoadMore,
|
|
60
|
+
ticketCompany = props.ticketCompany;
|
|
58
61
|
|
|
59
62
|
var _useState = (0, _react.useState)(0),
|
|
60
63
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -81,10 +84,19 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
81
84
|
setModalAlert = _useState8[1];
|
|
82
85
|
|
|
83
86
|
var containerList = (0, _react.useRef)(null);
|
|
87
|
+
var containerItems = (0, _react.useRef)(null);
|
|
84
88
|
(0, _react.useEffect)(function () {
|
|
85
89
|
if (!items) return;
|
|
86
90
|
if (["merchant_product", "order_product"].includes(chatType)) renderItems();else if (chatType === "ticket") renderItemsTicket();else setCustomItems([]);
|
|
87
91
|
}, [items]);
|
|
92
|
+
(0, _react.useEffect)(function () {
|
|
93
|
+
var containerScroll = document.getElementById("ulItems");
|
|
94
|
+
if (customItems.length) setTimeout(function () {
|
|
95
|
+
containerScroll.lastElementChild.scrollIntoView({
|
|
96
|
+
block: "start"
|
|
97
|
+
});
|
|
98
|
+
}, 1);
|
|
99
|
+
}, [customItems]);
|
|
88
100
|
|
|
89
101
|
var updateScroll = function updateScroll() {
|
|
90
102
|
var containerScroll = document.getElementById("containerItems");
|
|
@@ -163,9 +175,9 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
163
175
|
});
|
|
164
176
|
};
|
|
165
177
|
|
|
166
|
-
var renderMessage = function renderMessage(item) {
|
|
178
|
+
var renderMessage = function renderMessage(item, differentCompany) {
|
|
167
179
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
168
|
-
className: "item-message",
|
|
180
|
+
className: "item-message ".concat(differentCompany ? "different-company" : ""),
|
|
169
181
|
children: [" ", item.value, " "]
|
|
170
182
|
});
|
|
171
183
|
};
|
|
@@ -285,6 +297,7 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
285
297
|
};
|
|
286
298
|
|
|
287
299
|
var getUserCreatedItem = function getUserCreatedItem(ownMessage, item, lastUserId) {
|
|
300
|
+
var differentCompany = currentUser.companyId !== users[item.userId].companyId;
|
|
288
301
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Slide, {
|
|
289
302
|
id: "itemScroll-" + item.id,
|
|
290
303
|
direction: ownMessage ? "left" : "right",
|
|
@@ -293,7 +306,7 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
293
306
|
container: containerList.current,
|
|
294
307
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
295
308
|
className: (ownMessage ? "own-message " : "") + (lastUserId === item.userId ? "sameUser" : ""),
|
|
296
|
-
children: [lastUserId !== item.userId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageTooltip.ImageTooltip, {
|
|
309
|
+
children: [item.type !== "statusTicket" && lastUserId !== item.userId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageTooltip.ImageTooltip, {
|
|
297
310
|
className: "container-imgUser",
|
|
298
311
|
sizeLoading: 25,
|
|
299
312
|
colorLoading: undefined,
|
|
@@ -310,7 +323,7 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
310
323
|
className: "label-nameUser",
|
|
311
324
|
children: users[item.userId].name
|
|
312
325
|
})
|
|
313
|
-
}), item.type === "message" ? renderMessage(item) : item.type === "comment" ? renderComment(item) : item.type === "img" ? renderImg(item) : item.type === "file" ? renderFile(item, ownMessage) : item.type === "statusTicket" ? renderStatusTicket(item) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
326
|
+
}), item.type === "message" ? renderMessage(item, differentCompany) : item.type === "comment" ? renderComment(item) : item.type === "img" ? renderImg(item) : item.type === "file" ? renderFile(item, ownMessage) : item.type === "statusTicket" && [ticketCompany, 254].includes(currentUser.companyId) ? renderStatusTicket(item) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
314
327
|
className: "label-time",
|
|
315
328
|
children: (0, _utils.getTime)(item.date)
|
|
316
329
|
})]
|
|
@@ -369,21 +382,8 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
369
382
|
|
|
370
383
|
var ownMessage = false; // CHAT MERCHANT ARTICLE
|
|
371
384
|
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
ownMessage = true;
|
|
375
|
-
}
|
|
376
|
-
} // CHAT ORDER ARTICLE
|
|
377
|
-
else if (chatType === "order_product") {
|
|
378
|
-
if (currentUser.companyId === users[item.userId].companyId) {
|
|
379
|
-
if (activeCompanyId && activeCompanyId === currentUser.companyId) {
|
|
380
|
-
if (item.userId === currentUser.id) {
|
|
381
|
-
ownMessage = true;
|
|
382
|
-
}
|
|
383
|
-
} else {
|
|
384
|
-
ownMessage = true;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
385
|
+
if (currentUser.id === item.userId) {
|
|
386
|
+
ownMessage = true;
|
|
387
387
|
} // renderizar tipo de item
|
|
388
388
|
|
|
389
389
|
|
|
@@ -409,7 +409,7 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
409
409
|
|
|
410
410
|
if (!date) {
|
|
411
411
|
date = (0, _utils.getFullDate)(new Date(item.date));
|
|
412
|
-
jsxItems.push(renderGrayLabel(date, "itemDate-".concat(countDate++)));
|
|
412
|
+
[ticketCompany, 254].includes(currentUser.companyId) && jsxItems.push(renderGrayLabel(date, "itemDate-".concat(countDate++)));
|
|
413
413
|
lastUserId = undefined;
|
|
414
414
|
} else {
|
|
415
415
|
var newDate = (0, _utils.getFullDate)(new Date(item.date));
|
|
@@ -432,23 +432,14 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
432
432
|
// acomodo del item (left o right)
|
|
433
433
|
|
|
434
434
|
|
|
435
|
-
var ownMessage = false;
|
|
435
|
+
var ownMessage = false;
|
|
436
436
|
|
|
437
|
-
if (currentUser.
|
|
438
|
-
|
|
439
|
-
} // user normal
|
|
440
|
-
else {
|
|
441
|
-
if (!(0, _handle_userTech.isUserTech)(users[item.userId].isUserTech)) {
|
|
442
|
-
if (currentUser.companyId === users[item.userId].companyId) {
|
|
443
|
-
ownMessage = true;
|
|
444
|
-
}
|
|
445
|
-
} else if (currentUser.id === item.userId) {
|
|
446
|
-
ownMessage = true;
|
|
447
|
-
}
|
|
437
|
+
if (currentUser.id === item.userId) {
|
|
438
|
+
ownMessage = true;
|
|
448
439
|
} // renderizar tipo de item
|
|
449
440
|
|
|
450
441
|
|
|
451
|
-
jsxItems.push(getUserCreatedItem(ownMessage, item, lastUserId));
|
|
442
|
+
jsxItems.push(getUserCreatedItem(ownMessage, item, lastUserId, index === 0));
|
|
452
443
|
lastUserId = item.userId;
|
|
453
444
|
}
|
|
454
445
|
|
|
@@ -458,6 +449,7 @@ var ContainerItems = function ContainerItems(props) {
|
|
|
458
449
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
459
450
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
460
451
|
id: "containerItems",
|
|
452
|
+
ref: containerItems,
|
|
461
453
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
462
454
|
className: "btn-loadMore",
|
|
463
455
|
children: showBtnLoadMore && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
@@ -15,6 +15,6 @@ var _variables = require("../../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n max-height: 100%;\n flex-grow: 2;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n background: white;\n padding: 15px 11px;\n overflow: auto;\n //border: 1px solid red;\n\n .btn-loadMore {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n flex-grow: 2;\n\n .container-btnLoadMore {\n border-radius: 10px;\n .button {\n padding: 5px 10px;\n border: none;\n gap: 10px;\n font-family: ", ";\n .icon,\n .iconLoading {\n font-size: 10px;\n }\n }\n }\n }\n\n // lista de items\n > ul {\n --marginUserValue: 10px;\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 0px;\n\n // items cambio de estatus general del article\n // items cambio de estatus en servicio del article\n .label-statusArticle,\n .label-statusService {\n width: 100%;\n padding: 10px;\n border-radius: 10px;\n display: grid;\n place-items: center;\n cursor: default;\n\n text-align: left;\n font-family: ", ", sans-serif;\n color: white;\n font-size: 12px;\n\n .label {\n text-align: left;\n font-family: ", ", sans-serif;\n color: white;\n font-size: 12px;\n white-space: pre-wrap;\n cursor: inherit;\n }\n }\n .label-statusArticle {\n background-color: #85bc5b;\n }\n .label-statusService {\n background-color: #8a6caa;\n }\n\n // cada item dentro de la lista (fechas|message|img|file|status...)\n li {\n width: 90%;\n padding: 0px;\n margin: 16px 0px 0px 0px;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n flex-wrap: nowrap;\n gap: var(--marginUserValue);\n align-items: center;\n align-self: flex-start;\n //border: 1px solid blue;\n\n &.sameUser {\n margin: 2px 0px 0px 0px;\n padding: 0px 0px 0px calc(34px + var(--marginUserValue))
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n max-height: 100%;\n flex-grow: 2;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n gap: 8px;\n background: white;\n padding: 15px 11px;\n overflow: auto;\n //border: 1px solid red;\n\n .btn-loadMore {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n flex-grow: 2;\n\n .container-btnLoadMore {\n border-radius: 10px;\n .button {\n padding: 5px 10px;\n border: none;\n gap: 10px;\n font-family: ", ";\n .icon,\n .iconLoading {\n font-size: 10px;\n }\n }\n }\n }\n\n // lista de items\n > ul {\n --marginUserValue: 10px;\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 0px;\n\n // items cambio de estatus general del article\n // items cambio de estatus en servicio del article\n .label-statusArticle,\n .label-statusService {\n width: 100%;\n padding: 10px;\n border-radius: 10px;\n display: grid;\n place-items: center;\n cursor: default;\n\n text-align: left;\n font-family: ", ", sans-serif;\n color: white;\n font-size: 12px;\n\n .label {\n text-align: left;\n font-family: ", ", sans-serif;\n color: white;\n font-size: 12px;\n white-space: pre-wrap;\n cursor: inherit;\n }\n }\n .label-statusArticle {\n background-color: #85bc5b;\n }\n .label-statusService {\n background-color: #8a6caa;\n }\n\n // cada item dentro de la lista (fechas|message|img|file|status...)\n li {\n width: 90%;\n padding: 0px;\n margin: 16px 0px 0px 0px;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n flex-wrap: nowrap;\n gap: var(--marginUserValue);\n align-items: center;\n align-self: flex-start;\n //border: 1px solid blue;\n\n & > label:first-child,\n .item-img {\n margin: 0px 0px 0px 44px;\n }\n\n &.sameUser {\n margin: 2px 0px 0px 0px;\n /* padding: 0px 0px 0px calc(34px + var(--marginUserValue)); */\n }\n\n // items gray label (para fechas)\n &.label-gray {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 0px; //0px calc(34px + var(--marginUserValue));\n\n .separator {\n flex-grow: 2;\n min-width: 35px;\n border: 0.3px solid #f0f0f0;\n }\n label {\n padding: 4px 15px;\n text-align: center;\n font-family: ", ", sans-serif;\n color: #b3b3b3;\n font-size: 10px;\n }\n }\n\n // container ImageTooltip del user de un item\n .container-imgUser {\n display: grid;\n place-items: center;\n width: 34px;\n min-width: min-content;\n border-radius: 50%;\n overflow: hidden;\n align-self: flex-start;\n margin: 0;\n }\n .icon-imgUser.fill {\n padding: 0px;\n width: 34px;\n height: 34px;\n color: #9d9d9d;\n border-color: #9d9d9d;\n border-width: 2px;\n }\n .tooltip-imgUser {\n .label-nameUser {\n font-family: ", ", sans-serif;\n color: #262626;\n font-size: 12px;\n text-align: center;\n }\n }\n\n // items de tipo message, comment y file\n .item-message,\n .item-comment,\n .item-file,\n .item-statusTicket {\n border-radius: 10px;\n padding: 10px;\n font-family: ", ", sans-serif;\n font-size: 12px;\n text-align: left;\n white-space: pre-line;\n color: white;\n word-break: break-word;\n }\n .item-message,\n .item-comment,\n .item-file {\n background-color: #8386ee;\n }\n .item-statusTicket {\n background-color: #85bc5b;\n }\n\n .item-message {\n &.different-company {\n border: 1px solid #e33aa9;\n }\n }\n /*\n .item-comment {\n background-color: #5e61b2;\n }\n */\n\n // items de tipo img\n .item-img {\n display: grid;\n place-items: center;\n background-color: #f7f7f7;\n border-radius: 10px;\n overflow: hidden;\n max-width: 60%;\n max-height: 300px;\n\n .container-ImagePreview {\n max-height: inherit;\n\n > .img {\n max-height: inherit;\n }\n\n .label-nameImg {\n .iconDefaultImg {\n border-radius: 0px;\n border: none;\n padding: 0px;\n color: #8386ee;\n }\n }\n }\n }\n\n // items de tipo file\n .item-file {\n width: auto;\n max-width: 70%;\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n\n .btnDownloadFileItem {\n width: 28px;\n min-width: 28px;\n height: 28px;\n min-height: 28px;\n }\n\n // nameFile solo 1 linea\n .label-nameFileShort {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n flex-grow: 2;\n cursor: default;\n font-family: ", ", sans-serif;\n font-size: 12px;\n text-align: center;\n color: white;\n }\n }\n\n // label hora del item\n .label-time {\n min-width: fit-content;\n color: #c7c7c7;\n font-family: ", ", sans-serif;\n font-size: 9px;\n }\n\n & > .label-time:first-child {\n display: none;\n }\n\n // items del currentUser\n &.own-message {\n align-self: flex-end;\n flex-direction: row-reverse;\n\n /* &.sameUser {\n padding: 0px calc(34px + var(--marginUserValue)) 0px 0px;\n } */\n\n .item-message,\n .item-comment {\n color: #262626;\n }\n .item-message,\n .item-comment,\n .item-file {\n background-color: #f0f0f0;\n }\n\n & > .item-message:first-child {\n margin: 0px 40px 0px 0px;\n }\n /*\n .item-comment {\n background-color: #d7d7d7;\n }\n */\n\n // items de tipo img\n .item-img {\n .container-ImagePreview {\n .label-nameImg {\n .iconDefaultImg {\n color: #c9c7c7;\n }\n }\n }\n }\n\n // items de tipo file\n .item-file {\n .btnDownloadFileItem {\n .iconFile,\n .container-btnDownload .buttonMUI .icon {\n color: #262626;\n }\n }\n\n // nameFile solo 1 linea\n .label-nameFileShort {\n color: #262626;\n }\n }\n }\n\n // items neutrales (center aligned)\n &.itemNeutral {\n width: 100%;\n\n .itemStatus {\n width: 100%;\n padding: 10px;\n border-radius: 10px;\n display: grid;\n place-items: center;\n cursor: default;\n text-align: center;\n font-family: ", ", sans-serif;\n color: white;\n font-size: 12px;\n line-height: 1.2;\n white-space: pre-wrap;\n\n &.ticket {\n color: white;\n background-color: #85bc5b;\n }\n }\n }\n }\n }\n\n .content-chat {\n ::-webkit-scrollbar {\n width: 0;\n }\n }\n"])), _variables.FontFamily.RobotoRegular, _variables.FontFamily.RobotoRegular, _variables.FontFamily.RobotoRegular, _variables.FontFamily.RobotoMedium, _variables.FontFamily.RobotoMedium, _variables.FontFamily.RobotoRegular, _variables.FontFamily.RobotoRegular, _variables.FontFamily.RobotoRegular, _variables.FontFamily.RobotoRegular);
|
|
19
19
|
|
|
20
20
|
exports.Container = Container;
|
|
@@ -55,7 +55,8 @@ var ContentChat = function ContentChat(props) {
|
|
|
55
55
|
dataChat = props.dataChat,
|
|
56
56
|
showBtnClose = props.showBtnClose,
|
|
57
57
|
onClickBtnClose = props.onClickBtnClose,
|
|
58
|
-
showPopUpChat = props.showPopUpChat
|
|
58
|
+
showPopUpChat = props.showPopUpChat,
|
|
59
|
+
ticketCompany = props.ticketCompany;
|
|
59
60
|
|
|
60
61
|
var _useState = (0, _react.useState)({}),
|
|
61
62
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -1410,6 +1411,7 @@ var ContentChat = function ContentChat(props) {
|
|
|
1410
1411
|
showBtnLoadMore: enabledLoadMore,
|
|
1411
1412
|
chatType: chatType,
|
|
1412
1413
|
activeCompanyId: activeCompanyId,
|
|
1414
|
+
ticketCompany: ticketCompany,
|
|
1413
1415
|
currentUser: ["merchant_product", "order_product"].includes(chatType) ? currentUser : dataChat.currentUser,
|
|
1414
1416
|
onClickBtnLoadMore: chatType === "merchant_product" ? getLoadMoreMerchantProduct : chatType === "order_product" ? getLoadMoreOrderProduct : getLoadMoreTicket
|
|
1415
1417
|
});
|
|
@@ -45,6 +45,9 @@ var Chat = function Chat(props) {
|
|
|
45
45
|
data = _useState4[0],
|
|
46
46
|
setData = _useState4[1];
|
|
47
47
|
|
|
48
|
+
var _ref = chatData || {},
|
|
49
|
+
ticketCompany = _ref.ticketCompany;
|
|
50
|
+
|
|
48
51
|
(0, _react.useEffect)(function () {
|
|
49
52
|
switch (chatType) {
|
|
50
53
|
case "merchant_product":
|
|
@@ -212,7 +215,8 @@ var Chat = function Chat(props) {
|
|
|
212
215
|
chatType: chatType === null || chatType === void 0 ? void 0 : chatType.toLowerCase(),
|
|
213
216
|
chatContainerType: "fixed",
|
|
214
217
|
dataChat: data,
|
|
215
|
-
showBtnClose: false
|
|
218
|
+
showBtnClose: false,
|
|
219
|
+
ticketCompany: ticketCompany
|
|
216
220
|
})
|
|
217
221
|
});
|
|
218
222
|
} else {
|
|
@@ -240,6 +244,7 @@ var Chat = function Chat(props) {
|
|
|
240
244
|
dataChat: data,
|
|
241
245
|
showPopUpChat: showPopUpChat,
|
|
242
246
|
showBtnClose: true,
|
|
247
|
+
ticketCompany: ticketCompany,
|
|
243
248
|
onClickBtnClose: function onClickBtnClose() {
|
|
244
249
|
setShowPopUpChat(false);
|
|
245
250
|
}
|
package/package.json
CHANGED
|
@@ -64,7 +64,7 @@ export const GalleryElement = ({
|
|
|
64
64
|
return (
|
|
65
65
|
<Container
|
|
66
66
|
className={`${gridLayout ? "grid-gallery" : "row-gallery"} ${
|
|
67
|
-
!isEquals(image
|
|
67
|
+
compare && !isEquals(image?.uuid, auditImages?.values[number]?.uuid)
|
|
68
68
|
? "audit-class"
|
|
69
69
|
: ""
|
|
70
70
|
}`}
|
|
@@ -3,12 +3,11 @@ import styled from "styled-components";
|
|
|
3
3
|
export const Container = styled.div`
|
|
4
4
|
display: flex;
|
|
5
5
|
justify-content: space-between;
|
|
6
|
-
<<<<<<< HEAD
|
|
7
6
|
.buttons-top {
|
|
8
7
|
display: flex;
|
|
9
8
|
align-items: center;
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
padding-top: 10px;
|
|
10
|
+
}
|
|
12
11
|
|
|
13
12
|
.buttons-container {
|
|
14
13
|
display: flex;
|
|
@@ -24,6 +23,5 @@ export const Container = styled.div`
|
|
|
24
23
|
margin-left: 10px;
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
>>>>>>> versionManager
|
|
28
26
|
}
|
|
29
27
|
`;
|
|
@@ -117,6 +117,7 @@ chatTicket_userNORMAL.args = {
|
|
|
117
117
|
id: 104,
|
|
118
118
|
ticketOwnerUserId: 49,
|
|
119
119
|
statusTicket: "IN_PROGRESS",
|
|
120
|
+
ticketCompany: 817,
|
|
120
121
|
currentUser: {
|
|
121
122
|
token:
|
|
122
123
|
"eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hMM2N1MWUzQ09zWExVRnc9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI1ODg0YWUzNC01OWQ2LTQ0NTQtYjk4ZS04MjE1MThiY2MzYTciLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfWE1aUWRxa0dqIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6IjU4ODRhZTM0LTU5ZDYtNDQ1NC1iOThlLTgyMTUxOGJjYzNhNyIsImNvZ25pdG86cm9sZXMiOlsiYXJuOmF3czppYW06Ojg5ODY3MDIzMjgwNzpyb2xlXC9jb250ZW50b2gtZGV2LXVzLWVhc3QtMS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiI2YmI0NzExMi03ZTNiLTRjYzUtYmVhZS02MzMxZjEwYjk3MzIiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2NTYxNjI0MSwibmFtZSI6IkNhZGVuYSBJc21hZWwiLCJwaG9uZV9udW1iZXIiOiIrNTIzMTExMzY2MzM2IiwiZXhwIjoxNjY1NjE5ODQxLCJpYXQiOjE2NjU2MTYyNDEsImVtYWlsIjoiY2FkZW5hLmlzbWFlbEBhbGxmcmVlbWFpbC5uZXQifQ.gi1Jiua_O175vHLy-CYXOR945IRcObIj5j1LNk4_EhcKPz-MzPnfWDLH7L3sTiNS-VUhIRtAhtUVPUSYv0oP1qfJwFHomerxJvYgJge8SLWPjL6yGBnTxAvHVbuLU8kcaoZup2eNMV6XOIAEBAHeCDm4vW0rYWwfrKADPyYGZQF2si14o3wtgSMX5a4ccxGwikT3to3HttWBhmJs_I1Xr_BvBxePc4WghjQr5GVGbq8vhr4HwdkTmlcJAnQsc_fmIdbJ_ACyTa1wr343KYYOQVwBjAmZDa6rU16y0yTr_J4IVWY3aS5UpBEBHy4XE0c76UaN-_DcGiVl4ayWQIUz8A",
|
|
@@ -133,8 +134,9 @@ chatTicket_userTECH.args = {
|
|
|
133
134
|
chatType: "ticket",
|
|
134
135
|
chatContainerType: "fixed",
|
|
135
136
|
chatData: {
|
|
136
|
-
id:
|
|
137
|
+
id: 130,
|
|
137
138
|
ticketOwnerUserId: 49,
|
|
139
|
+
ticketCompany: 817,
|
|
138
140
|
statusTicket: "IN_PROGRESS",
|
|
139
141
|
currentUser: {
|
|
140
142
|
token:
|
|
@@ -23,6 +23,7 @@ import { Slide, Zoom } from "@mui/material";
|
|
|
23
23
|
import { useRef } from "react";
|
|
24
24
|
import { ImagePreview } from "../../../atoms/ImagePreview";
|
|
25
25
|
import { isUserTech } from "../../../../global-files/handle_userTech";
|
|
26
|
+
import { container } from "aws-amplify";
|
|
26
27
|
|
|
27
28
|
export const ContainerItems = (props) => {
|
|
28
29
|
const {
|
|
@@ -39,6 +40,7 @@ export const ContainerItems = (props) => {
|
|
|
39
40
|
chatType, // string
|
|
40
41
|
showBtnLoadMore, // boolean
|
|
41
42
|
onClickBtnLoadMore, // () => {}
|
|
43
|
+
ticketCompany, // id de la comañía que creó el ticket
|
|
42
44
|
} = props;
|
|
43
45
|
const [scrollHeight, setScrollHeight] = useState(0);
|
|
44
46
|
const [btnLoadMoreLoading, setBtnLoadMoreLoading] = useState(false);
|
|
@@ -49,7 +51,7 @@ export const ContainerItems = (props) => {
|
|
|
49
51
|
message: "",
|
|
50
52
|
});
|
|
51
53
|
const containerList = useRef(null);
|
|
52
|
-
|
|
54
|
+
const containerItems = useRef(null);
|
|
53
55
|
|
|
54
56
|
useEffect(() => {
|
|
55
57
|
if (!items) return;
|
|
@@ -58,6 +60,16 @@ export const ContainerItems = (props) => {
|
|
|
58
60
|
else setCustomItems([]);
|
|
59
61
|
}, [items]);
|
|
60
62
|
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const containerScroll = document.getElementById("ulItems");
|
|
65
|
+
if (customItems.length)
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
containerScroll.lastElementChild.scrollIntoView({
|
|
68
|
+
block: "start",
|
|
69
|
+
});
|
|
70
|
+
}, 1);
|
|
71
|
+
}, [customItems]);
|
|
72
|
+
|
|
61
73
|
const updateScroll = () => {
|
|
62
74
|
const containerScroll = document.getElementById("containerItems");
|
|
63
75
|
if (containerScroll) {
|
|
@@ -133,8 +145,17 @@ export const ContainerItems = (props) => {
|
|
|
133
145
|
);
|
|
134
146
|
};
|
|
135
147
|
|
|
136
|
-
const renderMessage = (item) => {
|
|
137
|
-
return
|
|
148
|
+
const renderMessage = (item, differentCompany) => {
|
|
149
|
+
return (
|
|
150
|
+
<label
|
|
151
|
+
className={`item-message ${
|
|
152
|
+
differentCompany ? "different-company" : ""
|
|
153
|
+
}`}
|
|
154
|
+
>
|
|
155
|
+
{" "}
|
|
156
|
+
{item.value}{" "}
|
|
157
|
+
</label>
|
|
158
|
+
);
|
|
138
159
|
};
|
|
139
160
|
|
|
140
161
|
const renderComment = (item) => {
|
|
@@ -270,6 +291,8 @@ export const ContainerItems = (props) => {
|
|
|
270
291
|
};
|
|
271
292
|
|
|
272
293
|
const getUserCreatedItem = (ownMessage, item, lastUserId) => {
|
|
294
|
+
const differentCompany =
|
|
295
|
+
currentUser.companyId !== users[item.userId].companyId;
|
|
273
296
|
return (
|
|
274
297
|
<Slide
|
|
275
298
|
id={"itemScroll-" + item.id}
|
|
@@ -286,7 +309,7 @@ export const ContainerItems = (props) => {
|
|
|
286
309
|
}
|
|
287
310
|
>
|
|
288
311
|
{/* img del user */}
|
|
289
|
-
{lastUserId !== item.userId && (
|
|
312
|
+
{item.type !== "statusTicket" && lastUserId !== item.userId && (
|
|
290
313
|
<ImageTooltip
|
|
291
314
|
className={"container-imgUser"}
|
|
292
315
|
sizeLoading={25}
|
|
@@ -311,14 +334,15 @@ export const ContainerItems = (props) => {
|
|
|
311
334
|
)}
|
|
312
335
|
|
|
313
336
|
{item.type === "message"
|
|
314
|
-
? renderMessage(item)
|
|
337
|
+
? renderMessage(item, differentCompany)
|
|
315
338
|
: item.type === "comment"
|
|
316
339
|
? renderComment(item)
|
|
317
340
|
: item.type === "img"
|
|
318
341
|
? renderImg(item)
|
|
319
342
|
: item.type === "file"
|
|
320
343
|
? renderFile(item, ownMessage)
|
|
321
|
-
: item.type === "statusTicket"
|
|
344
|
+
: item.type === "statusTicket" &&
|
|
345
|
+
[ticketCompany, 254].includes(currentUser.companyId)
|
|
322
346
|
? renderStatusTicket(item)
|
|
323
347
|
: null}
|
|
324
348
|
|
|
@@ -375,22 +399,8 @@ export const ContainerItems = (props) => {
|
|
|
375
399
|
// acomodo del item (left o right)
|
|
376
400
|
let ownMessage = false;
|
|
377
401
|
// CHAT MERCHANT ARTICLE
|
|
378
|
-
if (
|
|
379
|
-
|
|
380
|
-
ownMessage = true;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
// CHAT ORDER ARTICLE
|
|
384
|
-
else if (chatType === "order_product") {
|
|
385
|
-
if (currentUser.companyId === users[item.userId].companyId) {
|
|
386
|
-
if (activeCompanyId && activeCompanyId === currentUser.companyId) {
|
|
387
|
-
if (item.userId === currentUser.id) {
|
|
388
|
-
ownMessage = true;
|
|
389
|
-
}
|
|
390
|
-
} else {
|
|
391
|
-
ownMessage = true;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
402
|
+
if (currentUser.id === item.userId) {
|
|
403
|
+
ownMessage = true;
|
|
394
404
|
}
|
|
395
405
|
|
|
396
406
|
// renderizar tipo de item
|
|
@@ -405,14 +415,14 @@ export const ContainerItems = (props) => {
|
|
|
405
415
|
let countDate = 1;
|
|
406
416
|
let lastUserId = undefined;
|
|
407
417
|
|
|
408
|
-
|
|
409
418
|
// recorrido de los items (del mas viejo al mas reciente)
|
|
410
419
|
for (let index = items.length - 1; index >= 0; index--) {
|
|
411
420
|
const item = items[index];
|
|
412
421
|
// manejo de las etiquetas fechas
|
|
413
422
|
if (!date) {
|
|
414
423
|
date = getFullDate(new Date(item.date));
|
|
415
|
-
|
|
424
|
+
[ticketCompany, 254].includes(currentUser.companyId) &&
|
|
425
|
+
jsxItems.push(renderGrayLabel(date, `itemDate-${countDate++}`));
|
|
416
426
|
lastUserId = undefined;
|
|
417
427
|
} else {
|
|
418
428
|
let newDate = getFullDate(new Date(item.date));
|
|
@@ -435,23 +445,14 @@ export const ContainerItems = (props) => {
|
|
|
435
445
|
|
|
436
446
|
// acomodo del item (left o right)
|
|
437
447
|
let ownMessage = false;
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (isUserTech(users[item.userId].isUserTech)) ownMessage = true;
|
|
441
|
-
}
|
|
442
|
-
// user normal
|
|
443
|
-
else {
|
|
444
|
-
if (!isUserTech(users[item.userId].isUserTech)) {
|
|
445
|
-
if (currentUser.companyId === users[item.userId].companyId) {
|
|
446
|
-
ownMessage = true;
|
|
447
|
-
}
|
|
448
|
-
} else if (currentUser.id === item.userId) {
|
|
449
|
-
ownMessage = true;
|
|
450
|
-
}
|
|
448
|
+
if (currentUser.id === item.userId) {
|
|
449
|
+
ownMessage = true;
|
|
451
450
|
}
|
|
452
451
|
|
|
453
452
|
// renderizar tipo de item
|
|
454
|
-
jsxItems.push(
|
|
453
|
+
jsxItems.push(
|
|
454
|
+
getUserCreatedItem(ownMessage, item, lastUserId, index === 0)
|
|
455
|
+
);
|
|
455
456
|
lastUserId = item.userId;
|
|
456
457
|
}
|
|
457
458
|
|
|
@@ -460,7 +461,7 @@ export const ContainerItems = (props) => {
|
|
|
460
461
|
|
|
461
462
|
return (
|
|
462
463
|
<>
|
|
463
|
-
<Container id="containerItems">
|
|
464
|
+
<Container id="containerItems" ref={containerItems}>
|
|
464
465
|
<div className="btn-loadMore">
|
|
465
466
|
{showBtnLoadMore && (
|
|
466
467
|
<ButtonV2
|
|
@@ -93,9 +93,14 @@ export const Container = styled.div`
|
|
|
93
93
|
align-self: flex-start;
|
|
94
94
|
//border: 1px solid blue;
|
|
95
95
|
|
|
96
|
+
& > label:first-child,
|
|
97
|
+
.item-img {
|
|
98
|
+
margin: 0px 0px 0px 44px;
|
|
99
|
+
}
|
|
100
|
+
|
|
96
101
|
&.sameUser {
|
|
97
102
|
margin: 2px 0px 0px 0px;
|
|
98
|
-
padding: 0px 0px 0px calc(34px + var(--marginUserValue));
|
|
103
|
+
/* padding: 0px 0px 0px calc(34px + var(--marginUserValue)); */
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
// items gray label (para fechas)
|
|
@@ -130,6 +135,7 @@ export const Container = styled.div`
|
|
|
130
135
|
border-radius: 50%;
|
|
131
136
|
overflow: hidden;
|
|
132
137
|
align-self: flex-start;
|
|
138
|
+
margin: 0;
|
|
133
139
|
}
|
|
134
140
|
.icon-imgUser.fill {
|
|
135
141
|
padding: 0px;
|
|
@@ -160,7 +166,7 @@ export const Container = styled.div`
|
|
|
160
166
|
text-align: left;
|
|
161
167
|
white-space: pre-line;
|
|
162
168
|
color: white;
|
|
163
|
-
|
|
169
|
+
word-break: break-word;
|
|
164
170
|
}
|
|
165
171
|
.item-message,
|
|
166
172
|
.item-comment,
|
|
@@ -170,6 +176,12 @@ export const Container = styled.div`
|
|
|
170
176
|
.item-statusTicket {
|
|
171
177
|
background-color: #85bc5b;
|
|
172
178
|
}
|
|
179
|
+
|
|
180
|
+
.item-message {
|
|
181
|
+
&.different-company {
|
|
182
|
+
border: 1px solid #e33aa9;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
173
185
|
/*
|
|
174
186
|
.item-comment {
|
|
175
187
|
background-color: #5e61b2;
|
|
@@ -242,14 +254,18 @@ export const Container = styled.div`
|
|
|
242
254
|
font-size: 9px;
|
|
243
255
|
}
|
|
244
256
|
|
|
257
|
+
& > .label-time:first-child {
|
|
258
|
+
display: none;
|
|
259
|
+
}
|
|
260
|
+
|
|
245
261
|
// items del currentUser
|
|
246
262
|
&.own-message {
|
|
247
263
|
align-self: flex-end;
|
|
248
264
|
flex-direction: row-reverse;
|
|
249
265
|
|
|
250
|
-
&.sameUser {
|
|
266
|
+
/* &.sameUser {
|
|
251
267
|
padding: 0px calc(34px + var(--marginUserValue)) 0px 0px;
|
|
252
|
-
}
|
|
268
|
+
} */
|
|
253
269
|
|
|
254
270
|
.item-message,
|
|
255
271
|
.item-comment {
|
|
@@ -260,6 +276,10 @@ export const Container = styled.div`
|
|
|
260
276
|
.item-file {
|
|
261
277
|
background-color: #f0f0f0;
|
|
262
278
|
}
|
|
279
|
+
|
|
280
|
+
& > .item-message:first-child {
|
|
281
|
+
margin: 0px 40px 0px 0px;
|
|
282
|
+
}
|
|
263
283
|
/*
|
|
264
284
|
.item-comment {
|
|
265
285
|
background-color: #d7d7d7;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ReactHowler from
|
|
1
|
+
import ReactHowler from "react-howler";
|
|
2
2
|
import { Container } from "./styles";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { NotFound } from "../../../atoms/NotFound";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isStringEmpty,
|
|
16
16
|
isValidNaturalNumber,
|
|
17
17
|
} from "../../../../global-files/utils";
|
|
18
|
-
import newMessage from "../../../../assets/sounds/newMessage.mp3"
|
|
18
|
+
import newMessage from "../../../../assets/sounds/newMessage.mp3";
|
|
19
19
|
|
|
20
20
|
export const ContentChat = (props) => {
|
|
21
21
|
const {
|
|
@@ -25,6 +25,7 @@ export const ContentChat = (props) => {
|
|
|
25
25
|
showBtnClose, // boolean
|
|
26
26
|
onClickBtnClose, // () => {}
|
|
27
27
|
showPopUpChat, // boolean
|
|
28
|
+
ticketCompany, // id de la compañía que creó el ticket
|
|
28
29
|
} = props;
|
|
29
30
|
const [companies, setCompanies] = useState({}); /* {
|
|
30
31
|
companyId: {
|
|
@@ -539,7 +540,7 @@ export const ContentChat = (props) => {
|
|
|
539
540
|
newSingleChat.items = addNewItemsChat(
|
|
540
541
|
newSingleChat.items,
|
|
541
542
|
response.body.items,
|
|
542
|
-
fromUpdate
|
|
543
|
+
fromUpdate
|
|
543
544
|
);
|
|
544
545
|
newSingleChat.statusChat = response.body.data.statusChat;
|
|
545
546
|
|
|
@@ -715,7 +716,11 @@ export const ContentChat = (props) => {
|
|
|
715
716
|
return items;
|
|
716
717
|
};
|
|
717
718
|
|
|
718
|
-
const addNewItemsChat = (
|
|
719
|
+
const addNewItemsChat = (
|
|
720
|
+
currentItems = [],
|
|
721
|
+
newItems = [],
|
|
722
|
+
fromUpdate = false
|
|
723
|
+
) => {
|
|
719
724
|
let itemsId = {};
|
|
720
725
|
currentItems.forEach((item) => {
|
|
721
726
|
itemsId[item.id] = item;
|
|
@@ -824,6 +829,7 @@ export const ContentChat = (props) => {
|
|
|
824
829
|
showBtnLoadMore={enabledLoadMore}
|
|
825
830
|
chatType={chatType}
|
|
826
831
|
activeCompanyId={activeCompanyId}
|
|
832
|
+
ticketCompany={ticketCompany}
|
|
827
833
|
currentUser={
|
|
828
834
|
["merchant_product", "order_product"].includes(chatType)
|
|
829
835
|
? currentUser
|
|
@@ -910,10 +916,7 @@ export const ContentChat = (props) => {
|
|
|
910
916
|
{/* body */}
|
|
911
917
|
{renderBodyChat()}
|
|
912
918
|
</Container>
|
|
913
|
-
<ReactHowler
|
|
914
|
-
src={newMessage}
|
|
915
|
-
playing={playSound}
|
|
916
|
-
/>
|
|
919
|
+
<ReactHowler src={newMessage} playing={playSound} />
|
|
917
920
|
</>
|
|
918
921
|
);
|
|
919
922
|
};
|
|
@@ -24,6 +24,8 @@ export const Chat = (props) => {
|
|
|
24
24
|
const [showPopUpChat, setShowPopUpChat] = useState(false);
|
|
25
25
|
const [data, setData] = useState();
|
|
26
26
|
|
|
27
|
+
const { ticketCompany } = chatData || {};
|
|
28
|
+
|
|
27
29
|
useEffect(() => {
|
|
28
30
|
switch (chatType) {
|
|
29
31
|
case "merchant_product":
|
|
@@ -122,7 +124,6 @@ export const Chat = (props) => {
|
|
|
122
124
|
statusTicket, // (string) "IN_PROGRESS" | "PENDING" | "COMPLETED"
|
|
123
125
|
ticketOwnerUserId, // number
|
|
124
126
|
} = chatData;
|
|
125
|
-
|
|
126
127
|
// validar el token del usuario conectado
|
|
127
128
|
if (isStringEmpty(currentUser?.token)) {
|
|
128
129
|
setDataError("Tu identificación de usuario no fue especificado");
|
|
@@ -195,6 +196,7 @@ export const Chat = (props) => {
|
|
|
195
196
|
chatContainerType="fixed"
|
|
196
197
|
dataChat={data}
|
|
197
198
|
showBtnClose={false}
|
|
199
|
+
ticketCompany={ticketCompany}
|
|
198
200
|
/>
|
|
199
201
|
</ContainerFixed>
|
|
200
202
|
);
|
|
@@ -223,6 +225,7 @@ export const Chat = (props) => {
|
|
|
223
225
|
dataChat={data}
|
|
224
226
|
showPopUpChat={showPopUpChat}
|
|
225
227
|
showBtnClose={true}
|
|
228
|
+
ticketCompany={ticketCompany}
|
|
226
229
|
onClickBtnClose={() => {
|
|
227
230
|
setShowPopUpChat(false);
|
|
228
231
|
}}
|