ordering-ui-external 3.0.1 → 4.0.0
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/_bundles/{7.ordering-ui.b278a053085145d78d36.js → 7.ordering-ui.2b6bfdaa8b236eb288fa.js} +1 -1
- package/_bundles/{ordering-ui.b278a053085145d78d36.js → ordering-ui.2b6bfdaa8b236eb288fa.js} +2 -2
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +3 -3
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +4 -4
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +6 -5
- package/_modules/themes/five/src/components/Header/index.js +7 -6
- package/_modules/themes/five/src/components/Messages/MapMessages.js +80 -0
- package/_modules/themes/five/src/components/Messages/index.js +13 -67
- package/_modules/themes/five/src/components/MomentControl/index.js +2 -2
- package/_modules/themes/five/src/components/OrderDetails/index.js +4 -3
- package/_modules/themes/five/src/components/OrderDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/PaymentOptionWallet/index.js +2 -6
- package/_modules/themes/five/src/components/ProductForm/styles.js +1 -1
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +2 -2
- package/_modules/themes/five/src/components/ProductShare/styles.js +1 -1
- package/package.json +2 -2
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +1 -1
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +3 -3
- package/src/themes/five/src/components/BusinessPreorder/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +4 -4
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +4 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +8 -8
- package/src/themes/five/src/components/Header/index.js +3 -1
- package/src/themes/five/src/components/Messages/MapMessages.js +173 -0
- package/src/themes/five/src/components/Messages/index.js +13 -175
- package/src/themes/five/src/components/MomentControl/index.js +1 -1
- package/src/themes/five/src/components/OrderDetails/index.js +1 -1
- package/src/themes/five/src/components/OrderDetails/styles.js +1 -0
- package/src/themes/five/src/components/PaymentOptionWallet/index.js +2 -2
- package/src/themes/five/src/components/ProductForm/styles.js +1 -1
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +3 -1
- package/src/themes/five/src/components/ProductShare/styles.js +1 -1
- package/template/app.js +1 -1
- package/template/theme.json +2 -1
- /package/_bundles/{0.ordering-ui.b278a053085145d78d36.js → 0.ordering-ui.2b6bfdaa8b236eb288fa.js} +0 -0
- /package/_bundles/{1.ordering-ui.b278a053085145d78d36.js → 1.ordering-ui.2b6bfdaa8b236eb288fa.js} +0 -0
- /package/_bundles/{2.ordering-ui.b278a053085145d78d36.js → 2.ordering-ui.2b6bfdaa8b236eb288fa.js} +0 -0
- /package/_bundles/{4.ordering-ui.b278a053085145d78d36.js → 4.ordering-ui.2b6bfdaa8b236eb288fa.js} +0 -0
- /package/_bundles/{5.ordering-ui.b278a053085145d78d36.js → 5.ordering-ui.2b6bfdaa8b236eb288fa.js} +0 -0
- /package/_bundles/{6.ordering-ui.b278a053085145d78d36.js → 6.ordering-ui.2b6bfdaa8b236eb288fa.js} +0 -0
- /package/_bundles/{7.ordering-ui.b278a053085145d78d36.js.LICENSE.txt → 7.ordering-ui.2b6bfdaa8b236eb288fa.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.b278a053085145d78d36.js → 8.ordering-ui.2b6bfdaa8b236eb288fa.js} +0 -0
- /package/_bundles/{9.ordering-ui.b278a053085145d78d36.js → 9.ordering-ui.2b6bfdaa8b236eb288fa.js} +0 -0
- /package/_bundles/{ordering-ui.b278a053085145d78d36.js.LICENSE.txt → ordering-ui.2b6bfdaa8b236eb288fa.js.LICENSE.txt} +0 -0
|
@@ -21,7 +21,7 @@ var IconControl = _styledComponents.default.div(_templateObject2 || (_templateOb
|
|
|
21
21
|
return props.theme.colors.lightGray;
|
|
22
22
|
});
|
|
23
23
|
exports.IconControl = IconControl;
|
|
24
|
-
var Text = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n display: flex;\n font-weight: 300;\n color: #555;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0
|
|
24
|
+
var Text = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n display: flex;\n font-weight: 300;\n color: #555;\n overflow: hidden;\n text-overflow: ellipsis;\n margin: 0 8px;\n\n div {\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 14px;\n color: ", ";\n }\n\n span {\n margin-left: 10px;\n font-weight: 500;\n color: ", ";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ", "\n }\n\n ", "\n"])), function (props) {
|
|
25
25
|
return props.theme.colors.darkGray;
|
|
26
26
|
}, function (props) {
|
|
27
27
|
return props.theme.colors.primary;
|
|
@@ -33,7 +33,7 @@ var Text = _styledComponents.default.div(_templateObject4 || (_templateObject4 =
|
|
|
33
33
|
return noMargin && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n span {\n margin: 0;\n }\n "])));
|
|
34
34
|
});
|
|
35
35
|
exports.Text = Text;
|
|
36
|
-
var SubOptionThumbnail = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: inline-block;\n border-radius: 8px;\n background-image: url(", ");\n background-repeat: no-repeat, repeat;\n width: 40px;\n height: 40px;\n background-size: cover;\n object-fit: cover;\n background-position: center;\n justify-content: center;\n align-items: center;\n"])), function (_ref2) {
|
|
36
|
+
var SubOptionThumbnail = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: inline-block;\n border-radius: 8px;\n background-image: url(", ");\n background-repeat: no-repeat, repeat;\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n background-size: cover;\n object-fit: cover;\n background-position: center;\n justify-content: center;\n align-items: center;\n"])), function (_ref2) {
|
|
37
37
|
var src = _ref2.src;
|
|
38
38
|
return src;
|
|
39
39
|
});
|
|
@@ -10,7 +10,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
-
var IconShare = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n margin: 0px;\n top: 10px;\n font-size: 22px;\n right: 16px;\n left: 10px;\n z-index:
|
|
13
|
+
var IconShare = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n margin: 0px;\n top: 10px;\n font-size: 22px;\n right: 16px;\n left: 10px;\n z-index: 9999999;\n background: rgba(255,255,255,0.5);\n height: 30px;\n border-radius: 50%;\n width: 30px;\n svg {\n position: relative;\n cursor: pointer;\n color: #333;\n left: 3px;\n ", "\n }\n ", "\n\n\n @media(min-width: 769px){\n position: relative;\n left: 5px;\n top: 0;\n\n svg{\n position: static;\n }\n\n ", "\n }\n\n @media (min-width: 1201px) {\n position: sticky;\n width: 0;\n\n &:nth-child(1) > svg {\n background-color: white;\n padding: 5px;\n border-radius: 9px;\n margin: 5px 0px;\n }\n\n ", "\n }\n"])), function (props) {
|
|
14
14
|
var _props$theme;
|
|
15
15
|
return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n left: 0;\n right: 5px;\n "])));
|
|
16
16
|
}, function (props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"lodash": "^4.17.19",
|
|
88
88
|
"moment": "^2.29.4",
|
|
89
89
|
"nanoid": "^4.0.0",
|
|
90
|
-
"ordering-components-external": "3.0.
|
|
90
|
+
"ordering-components-external": "3.0.2",
|
|
91
91
|
"payment": "^2.4.6",
|
|
92
92
|
"polished": "^3.6.6",
|
|
93
93
|
"react-bootstrap-icons": "^1.7.2",
|
|
@@ -138,7 +138,7 @@ export const BusinessBasicInformation = (props) => {
|
|
|
138
138
|
const businessNameElement = document.getElementById('business_name')
|
|
139
139
|
if (businessNameElement) {
|
|
140
140
|
const limit = window.pageYOffset >= (businessNameElement?.offsetTop - 55) && window.pageYOffset > 0
|
|
141
|
-
if (limit
|
|
141
|
+
if (limit) {
|
|
142
142
|
const classAdded = businessNameElement.classList.contains('fixed-name')
|
|
143
143
|
!classAdded && businessNameElement.classList.add('fixed-name')
|
|
144
144
|
} else {
|
|
@@ -260,7 +260,7 @@ export const WrapperSearch = styled.div`
|
|
|
260
260
|
&.fixed-search {
|
|
261
261
|
left: 0;
|
|
262
262
|
width: 100vw;
|
|
263
|
-
z-index:
|
|
263
|
+
z-index: 10000;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
`
|
|
@@ -373,13 +373,13 @@ export const TitleWrapper = styled.div`
|
|
|
373
373
|
text-overflow: ellipsis;
|
|
374
374
|
background: ${({ theme }) => theme?.colors?.white};
|
|
375
375
|
&.fixed-name {
|
|
376
|
-
z-index:
|
|
376
|
+
z-index: 10001;
|
|
377
377
|
position: fixed;
|
|
378
378
|
top: 0;
|
|
379
379
|
padding: 10px 0;
|
|
380
380
|
font-size: 18px;
|
|
381
381
|
${({ isCustomLayout }) => !isCustomLayout ? css`
|
|
382
|
-
width: calc(100vw -
|
|
382
|
+
width: calc(100vw - 200px);
|
|
383
383
|
${props => props.theme?.rtl ? css`
|
|
384
384
|
right: 50px;
|
|
385
385
|
` : css`
|
|
@@ -77,7 +77,7 @@ const BusinessPreorderUI = (props) => {
|
|
|
77
77
|
const [timeList, setTimeList] = useState([])
|
|
78
78
|
const [isEnabled, setIsEnabled] = useState(false)
|
|
79
79
|
|
|
80
|
-
const is12Hours = configs?.
|
|
80
|
+
const is12Hours = configs?.general_hour_format?.value?.includes('hh:mm')
|
|
81
81
|
const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
|
|
82
82
|
const preOrderType = [
|
|
83
83
|
{ value: 'business_menu', content: <TypeContent>{t('BUSINESS_MENU', 'Business menu')}</TypeContent> },
|
|
@@ -135,12 +135,12 @@ const BusinessProductsCategoriesUI = (props) => {
|
|
|
135
135
|
|
|
136
136
|
let style0 = '.sticky-prod-cat {'
|
|
137
137
|
style0 += 'position: fixed !important;'
|
|
138
|
-
style0 += `top: ${
|
|
138
|
+
style0 += `top: ${useKioskApp ? '0px' : '56px'} !important;`
|
|
139
139
|
style0 += 'left: 0px !important;'
|
|
140
140
|
style0 += 'z-index: 9999 !important;'
|
|
141
|
-
style0 += 'padding: 5px 5px 0px
|
|
142
|
-
style0 +=
|
|
143
|
-
!disabledCustomWidth && (style0 += `width: calc(100% - ${useKioskApp ? '50px' : '
|
|
141
|
+
style0 += 'padding: 5px 5px 0px 20px !important;'
|
|
142
|
+
style0 += 'width: 100% !important;'
|
|
143
|
+
!disabledCustomWidth && (style0 += `width: calc(100% - ${useKioskApp ? '50px' : '0px'}) !important;`)
|
|
144
144
|
style0 += '}'
|
|
145
145
|
|
|
146
146
|
let style1 = '.sticky-search {'
|
|
@@ -193,7 +193,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
193
193
|
const backArrowElement = document.getElementById('back-arrow')
|
|
194
194
|
if (backArrowElement) {
|
|
195
195
|
const limit = window.pageYOffset >= backArrowElement?.offsetTop && window.pageYOffset > 0
|
|
196
|
-
if (limit
|
|
196
|
+
if (limit) {
|
|
197
197
|
const classAdded = backArrowElement.classList.contains('fixed-arrow')
|
|
198
198
|
!classAdded && backArrowElement.classList.add('fixed-arrow')
|
|
199
199
|
} else {
|
|
@@ -152,7 +152,7 @@ export const HeaderContent = styled.div`
|
|
|
152
152
|
position: fixed;
|
|
153
153
|
top: 0;
|
|
154
154
|
left: 0;
|
|
155
|
-
z-index:
|
|
155
|
+
z-index: 10001;
|
|
156
156
|
width: 100vw;
|
|
157
157
|
background-color: ${props => props.theme.colors.backgroundPage};
|
|
158
158
|
height: 56px;
|
|
@@ -163,6 +163,9 @@ export const HeaderContent = styled.div`
|
|
|
163
163
|
` : css`
|
|
164
164
|
padding-left: 10px;
|
|
165
165
|
`}
|
|
166
|
+
@media (min-width: 993px){
|
|
167
|
+
width: 100px;
|
|
168
|
+
}
|
|
166
169
|
}
|
|
167
170
|
`
|
|
168
171
|
export const OrderContextUIWrapper = styled.div`
|
package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js
CHANGED
|
@@ -235,13 +235,13 @@ const BusinessesListingUI = (props) => {
|
|
|
235
235
|
)}
|
|
236
236
|
</BusinessBanner>
|
|
237
237
|
)}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
238
|
+
<OrderProgress
|
|
239
|
+
isChew={isChew}
|
|
240
|
+
franchiseId={props.franchiseId}
|
|
241
|
+
userCustomerId={userCustomer?.id}
|
|
242
|
+
asDashboard={isCustomerMode}
|
|
243
|
+
isCustomerMode={isCustomerMode}
|
|
244
|
+
/>
|
|
245
245
|
{(configs?.business_listing_hide_image?.value !== '1' && isChew) && (
|
|
246
246
|
<BusinessHeroImg
|
|
247
247
|
bgimage={theme.images?.general?.businessHero}
|
|
@@ -269,7 +269,7 @@ const BusinessesListingUI = (props) => {
|
|
|
269
269
|
isCustomLayout={isCustomLayout}
|
|
270
270
|
placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
|
|
271
271
|
onSearch={handleChangeSearch}
|
|
272
|
-
handleCustomEnter={() => onRedirectPage({ page: 'business_search' })}
|
|
272
|
+
handleCustomEnter={() => configs?.advanced_business_search_enabled?.value === '1' ? onRedirectPage({ page: 'business_search' }) : null}
|
|
273
273
|
/>
|
|
274
274
|
)}
|
|
275
275
|
{!hideCities && citiesState?.cities?.length > 0 && (
|
|
@@ -332,7 +332,9 @@ export const Header = (props) => {
|
|
|
332
332
|
placeholder={t('SEARCH_BUSINESSES', 'Search Businesses')}
|
|
333
333
|
starbucksStyle
|
|
334
334
|
onSearch={(value) => setSearchValue(value)}
|
|
335
|
-
handleCustomEnter={() =>
|
|
335
|
+
handleCustomEnter={() => configState?.configs?.advanced_business_search_enabled?.value === '0' || businessSlug
|
|
336
|
+
? null
|
|
337
|
+
: events.emit('go_to_page', { page: 'business_search' })}
|
|
336
338
|
/>
|
|
337
339
|
</HeaderSearchMode>
|
|
338
340
|
)}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { BubbleBusines, BubbleConsole, BubbleCustomer, ChatImage, MessageBusiness, MessageConsole, MessageContentWrapper, MessageCreatedDate, MessageCustomer, MyName, TimeofSent, TimeofSentByAdmin } from './styles'
|
|
3
|
+
import { useLanguage, useSession, useUtils } from 'ordering-components-external'
|
|
4
|
+
|
|
5
|
+
export const MapMessages = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
messages,
|
|
8
|
+
messagesToShow,
|
|
9
|
+
order,
|
|
10
|
+
filterSpecialStatus,
|
|
11
|
+
handleModalImage,
|
|
12
|
+
getLevel,
|
|
13
|
+
business,
|
|
14
|
+
driver,
|
|
15
|
+
getLogisticTagStatus,
|
|
16
|
+
getStatus
|
|
17
|
+
} = props
|
|
18
|
+
const [, t] = useLanguage()
|
|
19
|
+
const [{ parseDate, parseTime }] = useUtils()
|
|
20
|
+
const [{ user }] = useSession()
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
{messages?.messages.map((message) => (
|
|
24
|
+
<React.Fragment key={message.id}>
|
|
25
|
+
{message.type === 1 && (
|
|
26
|
+
<MessageContentWrapper key={message.id}>
|
|
27
|
+
{message.change?.attribute !== 'driver_id' ? (
|
|
28
|
+
<>
|
|
29
|
+
<MessageCreatedDate>
|
|
30
|
+
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
31
|
+
</MessageCreatedDate>
|
|
32
|
+
<MessageConsole>
|
|
33
|
+
<BubbleConsole>
|
|
34
|
+
{t('ORDER', 'Order')} {' '}
|
|
35
|
+
<strong>{t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))}</strong> {' '}
|
|
36
|
+
{t('CHANGED_FROM', 'Changed from')} {' '}
|
|
37
|
+
{filterSpecialStatus.includes(message.change.attribute) ? (
|
|
38
|
+
<>
|
|
39
|
+
{message.change.old === null ? <strong>0</strong> : (
|
|
40
|
+
<>
|
|
41
|
+
<strong>{message.change.old}</strong> {' '}
|
|
42
|
+
</>
|
|
43
|
+
)}
|
|
44
|
+
<> {t('TO', 'to')} {' '} <strong>{message.change.new}</strong> {t('MINUTES', 'Minutes')}</>
|
|
45
|
+
</>
|
|
46
|
+
) : (
|
|
47
|
+
<>
|
|
48
|
+
{message.change.old !== null && (
|
|
49
|
+
<>
|
|
50
|
+
<strong>{message.change?.attribute === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.old, 10)) : t(getStatus(parseInt(message.change.old, 10)))}</strong> {' '}
|
|
51
|
+
</>
|
|
52
|
+
)}
|
|
53
|
+
<> {t('TO', 'to')} {' '} <strong>{message.change?.attribute === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.new, 10)) : t(getStatus(parseInt(message.change.new, 10)))}</strong> </>
|
|
54
|
+
</>
|
|
55
|
+
)}
|
|
56
|
+
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
57
|
+
</BubbleConsole>
|
|
58
|
+
</MessageConsole>
|
|
59
|
+
</>
|
|
60
|
+
) : (
|
|
61
|
+
<>
|
|
62
|
+
<MessageCreatedDate>
|
|
63
|
+
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
64
|
+
</MessageCreatedDate>
|
|
65
|
+
<MessageConsole>
|
|
66
|
+
<BubbleConsole>
|
|
67
|
+
{message.change.new ? (
|
|
68
|
+
<>
|
|
69
|
+
<strong>{message.driver?.name} {' '} {message.driver?.lastname && message.driver.lastname} </strong>
|
|
70
|
+
{t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')}
|
|
71
|
+
{message.comment && (<><br /> {message.comment.length}</>)}
|
|
72
|
+
</>
|
|
73
|
+
) : <>{t('DRIVER_UNASSIGNED', 'Driver unassigned')}</>}
|
|
74
|
+
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
75
|
+
</BubbleConsole>
|
|
76
|
+
</MessageConsole>
|
|
77
|
+
</>
|
|
78
|
+
)}
|
|
79
|
+
</MessageContentWrapper>
|
|
80
|
+
|
|
81
|
+
)}
|
|
82
|
+
{(messagesToShow?.messages?.length || (message?.can_see?.includes('2') && business) || (message?.can_see?.includes('4') && driver)) && (
|
|
83
|
+
<>
|
|
84
|
+
{message.type === 2 && user?.id === message.author_id && (
|
|
85
|
+
<MessageContentWrapper>
|
|
86
|
+
<MessageCreatedDate>
|
|
87
|
+
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
88
|
+
</MessageCreatedDate>
|
|
89
|
+
<MessageCustomer>
|
|
90
|
+
<BubbleCustomer>
|
|
91
|
+
<strong>
|
|
92
|
+
<MyName>
|
|
93
|
+
{message.author.name} ({order.customer_id === message.author.id ? getLevel(3) : getLevel(message.author.level)})
|
|
94
|
+
</MyName>
|
|
95
|
+
</strong>
|
|
96
|
+
{message.comment}
|
|
97
|
+
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
98
|
+
</BubbleCustomer>
|
|
99
|
+
</MessageCustomer>
|
|
100
|
+
</MessageContentWrapper>
|
|
101
|
+
)}
|
|
102
|
+
{message.type === 3 && user.id === message.author_id && (
|
|
103
|
+
<MessageContentWrapper>
|
|
104
|
+
<MessageCreatedDate>
|
|
105
|
+
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
106
|
+
</MessageCreatedDate>
|
|
107
|
+
<MessageCustomer>
|
|
108
|
+
<BubbleCustomer name='image'>
|
|
109
|
+
<strong>
|
|
110
|
+
<MyName>
|
|
111
|
+
{message.author.name} ({order.customer_id === message.author.id ? getLevel(3) : getLevel(message.author.level)})
|
|
112
|
+
</MyName>
|
|
113
|
+
</strong>
|
|
114
|
+
<ChatImage><img src={message.source} onClick={() => handleModalImage(message.source)} alt='chat-image' width='168px' height='300px' /></ChatImage>
|
|
115
|
+
{message.comment && (
|
|
116
|
+
<>
|
|
117
|
+
{message.comment}
|
|
118
|
+
</>
|
|
119
|
+
)}
|
|
120
|
+
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
121
|
+
</BubbleCustomer>
|
|
122
|
+
</MessageCustomer>
|
|
123
|
+
</MessageContentWrapper>
|
|
124
|
+
|
|
125
|
+
)}
|
|
126
|
+
{message.type === 2 && user?.id !== message.author_id && (
|
|
127
|
+
<MessageContentWrapper>
|
|
128
|
+
<MessageCreatedDate>
|
|
129
|
+
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
130
|
+
</MessageCreatedDate>
|
|
131
|
+
<MessageBusiness>
|
|
132
|
+
<BubbleBusines>
|
|
133
|
+
<strong>
|
|
134
|
+
<MyName>
|
|
135
|
+
{message.author.name} ({order.customer_id === message.author.id ? getLevel(3) : getLevel(message.author.level)})
|
|
136
|
+
</MyName>
|
|
137
|
+
</strong>
|
|
138
|
+
{message.comment}
|
|
139
|
+
<TimeofSentByAdmin>{parseTime(message.created_at)}</TimeofSentByAdmin>
|
|
140
|
+
</BubbleBusines>
|
|
141
|
+
</MessageBusiness>
|
|
142
|
+
</MessageContentWrapper>
|
|
143
|
+
)}
|
|
144
|
+
{message.type === 3 && user.id !== message.author_id && (
|
|
145
|
+
<MessageContentWrapper>
|
|
146
|
+
<MessageCreatedDate>
|
|
147
|
+
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
148
|
+
</MessageCreatedDate>
|
|
149
|
+
<MessageBusiness>
|
|
150
|
+
<BubbleBusines name='image'>
|
|
151
|
+
<strong>
|
|
152
|
+
<MyName>
|
|
153
|
+
{message.author.name} ({order.customer_id === message.author.id ? getLevel(3) : getLevel(message.author.level)})
|
|
154
|
+
</MyName>
|
|
155
|
+
</strong>
|
|
156
|
+
<ChatImage><img src={message.source} onClick={() => handleModalImage(message.source)} alt='chat-image' width='168px' height='300px' /></ChatImage>
|
|
157
|
+
{message.comment && (
|
|
158
|
+
<>
|
|
159
|
+
{message.comment}
|
|
160
|
+
</>
|
|
161
|
+
)}
|
|
162
|
+
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
163
|
+
</BubbleBusines>
|
|
164
|
+
</MessageBusiness>
|
|
165
|
+
</MessageContentWrapper>
|
|
166
|
+
)}
|
|
167
|
+
</>
|
|
168
|
+
)}
|
|
169
|
+
</React.Fragment>
|
|
170
|
+
))}
|
|
171
|
+
</>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
Messages as MessagesController,
|
|
5
5
|
useUtils,
|
|
6
6
|
useLanguage,
|
|
7
|
-
useSession,
|
|
8
7
|
useEvent
|
|
9
8
|
} from 'ordering-components-external'
|
|
10
9
|
import { useForm } from 'react-hook-form'
|
|
@@ -15,14 +14,10 @@ import {
|
|
|
15
14
|
HeaderProfile,
|
|
16
15
|
Image,
|
|
17
16
|
Chat,
|
|
18
|
-
BubbleCustomer,
|
|
19
17
|
MessageCustomer,
|
|
20
|
-
MyName,
|
|
21
18
|
MessageBusiness,
|
|
22
|
-
BubbleBusines,
|
|
23
19
|
SkeletonBubbleCustomer,
|
|
24
20
|
SkeletonBubbleBusiness,
|
|
25
|
-
ChatImage,
|
|
26
21
|
TimeofSent,
|
|
27
22
|
SendForm,
|
|
28
23
|
Send,
|
|
@@ -43,7 +38,6 @@ import {
|
|
|
43
38
|
InputWrapper,
|
|
44
39
|
MessageContentWrapper,
|
|
45
40
|
MessageCreatedDate,
|
|
46
|
-
TimeofSentByAdmin,
|
|
47
41
|
NotSendMessage,
|
|
48
42
|
QuickMessageWrapper,
|
|
49
43
|
ProfileMessageHeader,
|
|
@@ -63,6 +57,7 @@ import MdcCloseOctagonOutline from '@meronex/icons/mdc/MdcCloseOctagonOutline'
|
|
|
63
57
|
import { bytesConverter, getTraduction } from '../../../../../utils'
|
|
64
58
|
import { Alert } from '../Confirm'
|
|
65
59
|
import { Modal } from '../Modal'
|
|
60
|
+
import { MapMessages } from './MapMessages'
|
|
66
61
|
|
|
67
62
|
const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
|
|
68
63
|
|
|
@@ -90,7 +85,6 @@ const MessagesUI = (props) => {
|
|
|
90
85
|
const [, t] = useLanguage()
|
|
91
86
|
const { handleSubmit, register, errors, setValue } = useForm()
|
|
92
87
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
93
|
-
const [{ user }] = useSession()
|
|
94
88
|
const [events] = useEvent()
|
|
95
89
|
const [{ parseDate, parseTime }] = useUtils()
|
|
96
90
|
const buttonRef = useRef(null)
|
|
@@ -307,173 +301,6 @@ const MessagesUI = (props) => {
|
|
|
307
301
|
events.emit('go_to_page', { page: 'business', params: { business_slug: slug } })
|
|
308
302
|
}
|
|
309
303
|
|
|
310
|
-
const MapMessages = ({ messages }) => {
|
|
311
|
-
return (
|
|
312
|
-
<>
|
|
313
|
-
{props.beforeElements?.map((BeforeElement, i) => (
|
|
314
|
-
<React.Fragment key={i}>
|
|
315
|
-
{BeforeElement}
|
|
316
|
-
</React.Fragment>))}
|
|
317
|
-
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
318
|
-
<BeforeComponent key={i} {...props} />))}
|
|
319
|
-
{messages?.messages.map((message) => (
|
|
320
|
-
<React.Fragment key={message.id}>
|
|
321
|
-
{message.type === 1 && (
|
|
322
|
-
<MessageContentWrapper key={message.id}>
|
|
323
|
-
{message.change?.attribute !== 'driver_id' ? (
|
|
324
|
-
<>
|
|
325
|
-
<MessageCreatedDate>
|
|
326
|
-
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
327
|
-
</MessageCreatedDate>
|
|
328
|
-
<MessageConsole>
|
|
329
|
-
<BubbleConsole>
|
|
330
|
-
{t('ORDER', 'Order')} {' '}
|
|
331
|
-
<strong>{t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))}</strong> {' '}
|
|
332
|
-
{t('CHANGED_FROM', 'Changed from')} {' '}
|
|
333
|
-
{filterSpecialStatus.includes(message.change.attribute) ? (
|
|
334
|
-
<>
|
|
335
|
-
{message.change.old === null ? <strong>0</strong> : (
|
|
336
|
-
<>
|
|
337
|
-
<strong>{message.change.old}</strong> {' '}
|
|
338
|
-
</>
|
|
339
|
-
)}
|
|
340
|
-
<> {t('TO', 'to')} {' '} <strong>{message.change.new}</strong> {t('MINUTES', 'Minutes')}</>
|
|
341
|
-
</>
|
|
342
|
-
) : (
|
|
343
|
-
<>
|
|
344
|
-
{message.change.old !== null && (
|
|
345
|
-
<>
|
|
346
|
-
<strong>{message.change?.attribute === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.old, 10)) : t(getStatus(parseInt(message.change.old, 10)))}</strong> {' '}
|
|
347
|
-
</>
|
|
348
|
-
)}
|
|
349
|
-
<> {t('TO', 'to')} {' '} <strong>{message.change?.attribute === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.new, 10)) : t(getStatus(parseInt(message.change.new, 10)))}</strong> </>
|
|
350
|
-
</>
|
|
351
|
-
)}
|
|
352
|
-
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
353
|
-
</BubbleConsole>
|
|
354
|
-
</MessageConsole>
|
|
355
|
-
</>
|
|
356
|
-
) : (
|
|
357
|
-
<>
|
|
358
|
-
<MessageCreatedDate>
|
|
359
|
-
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
360
|
-
</MessageCreatedDate>
|
|
361
|
-
<MessageConsole>
|
|
362
|
-
<BubbleConsole>
|
|
363
|
-
{message.change.new ? (
|
|
364
|
-
<>
|
|
365
|
-
<strong>{message.driver?.name} {' '} {message.driver?.lastname && message.driver.lastname} </strong>
|
|
366
|
-
{t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')}
|
|
367
|
-
{message.comment && (<><br /> {message.comment.length}</>)}
|
|
368
|
-
</>
|
|
369
|
-
) : <>{t('DRIVER_UNASSIGNED', 'Driver unassigned')}</>}
|
|
370
|
-
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
371
|
-
</BubbleConsole>
|
|
372
|
-
</MessageConsole>
|
|
373
|
-
</>
|
|
374
|
-
)}
|
|
375
|
-
</MessageContentWrapper>
|
|
376
|
-
|
|
377
|
-
)}
|
|
378
|
-
{(messagesToShow?.messages?.length || (message?.can_see?.includes('2') && business) || (message?.can_see?.includes('4') && driver)) && (
|
|
379
|
-
<>
|
|
380
|
-
{message.type === 2 && user?.id === message.author_id && (
|
|
381
|
-
<MessageContentWrapper>
|
|
382
|
-
<MessageCreatedDate>
|
|
383
|
-
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
384
|
-
</MessageCreatedDate>
|
|
385
|
-
<MessageCustomer>
|
|
386
|
-
<BubbleCustomer>
|
|
387
|
-
<strong>
|
|
388
|
-
<MyName>
|
|
389
|
-
{message.author.name} ({order.customer_id === message.author.id ? getLevel(3) : getLevel(message.author.level)})
|
|
390
|
-
</MyName>
|
|
391
|
-
</strong>
|
|
392
|
-
{message.comment}
|
|
393
|
-
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
394
|
-
</BubbleCustomer>
|
|
395
|
-
</MessageCustomer>
|
|
396
|
-
</MessageContentWrapper>
|
|
397
|
-
)}
|
|
398
|
-
{message.type === 3 && user.id === message.author_id && (
|
|
399
|
-
<MessageContentWrapper>
|
|
400
|
-
<MessageCreatedDate>
|
|
401
|
-
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
402
|
-
</MessageCreatedDate>
|
|
403
|
-
<MessageCustomer>
|
|
404
|
-
<BubbleCustomer name='image'>
|
|
405
|
-
<strong>
|
|
406
|
-
<MyName>
|
|
407
|
-
{message.author.name} ({order.customer_id === message.author.id ? getLevel(3) : getLevel(message.author.level)})
|
|
408
|
-
</MyName>
|
|
409
|
-
</strong>
|
|
410
|
-
<ChatImage><img src={message.source} onClick={() => handleModalImage(message.source)} alt='chat-image' width='168px' height='300px' /></ChatImage>
|
|
411
|
-
{message.comment && (
|
|
412
|
-
<>
|
|
413
|
-
{message.comment}
|
|
414
|
-
</>
|
|
415
|
-
)}
|
|
416
|
-
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
417
|
-
</BubbleCustomer>
|
|
418
|
-
</MessageCustomer>
|
|
419
|
-
</MessageContentWrapper>
|
|
420
|
-
|
|
421
|
-
)}
|
|
422
|
-
{message.type === 2 && user?.id !== message.author_id && (
|
|
423
|
-
<MessageContentWrapper>
|
|
424
|
-
<MessageCreatedDate>
|
|
425
|
-
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
426
|
-
</MessageCreatedDate>
|
|
427
|
-
<MessageBusiness>
|
|
428
|
-
<BubbleBusines>
|
|
429
|
-
<strong>
|
|
430
|
-
<MyName>
|
|
431
|
-
{message.author.name} ({order.customer_id === message.author.id ? getLevel(3) : getLevel(message.author.level)})
|
|
432
|
-
</MyName>
|
|
433
|
-
</strong>
|
|
434
|
-
{message.comment}
|
|
435
|
-
<TimeofSentByAdmin>{parseTime(message.created_at)}</TimeofSentByAdmin>
|
|
436
|
-
</BubbleBusines>
|
|
437
|
-
</MessageBusiness>
|
|
438
|
-
</MessageContentWrapper>
|
|
439
|
-
)}
|
|
440
|
-
{message.type === 3 && user.id !== message.author_id && (
|
|
441
|
-
<MessageContentWrapper>
|
|
442
|
-
<MessageCreatedDate>
|
|
443
|
-
<span>{parseDate(message.created_at, { outputFormat: 'MMM DD, YYYY' })}</span>
|
|
444
|
-
</MessageCreatedDate>
|
|
445
|
-
<MessageBusiness>
|
|
446
|
-
<BubbleBusines name='image'>
|
|
447
|
-
<strong>
|
|
448
|
-
<MyName>
|
|
449
|
-
{message.author.name} ({order.customer_id === message.author.id ? getLevel(3) : getLevel(message.author.level)})
|
|
450
|
-
</MyName>
|
|
451
|
-
</strong>
|
|
452
|
-
<ChatImage><img src={message.source} onClick={() => handleModalImage(message.source)} alt='chat-image' width='168px' height='300px' /></ChatImage>
|
|
453
|
-
{message.comment && (
|
|
454
|
-
<>
|
|
455
|
-
{message.comment}
|
|
456
|
-
</>
|
|
457
|
-
)}
|
|
458
|
-
<TimeofSent>{parseTime(message.created_at)}</TimeofSent>
|
|
459
|
-
</BubbleBusines>
|
|
460
|
-
</MessageBusiness>
|
|
461
|
-
</MessageContentWrapper>
|
|
462
|
-
)}
|
|
463
|
-
</>
|
|
464
|
-
)}
|
|
465
|
-
</React.Fragment>
|
|
466
|
-
))}
|
|
467
|
-
{props.afterComponents?.map((AfterComponent, i) => (
|
|
468
|
-
<AfterComponent key={i} {...props} />))}
|
|
469
|
-
{props.afterElements?.map((AfterElement, i) => (
|
|
470
|
-
<React.Fragment key={i}>
|
|
471
|
-
{AfterElement}
|
|
472
|
-
</React.Fragment>))}
|
|
473
|
-
</>
|
|
474
|
-
)
|
|
475
|
-
}
|
|
476
|
-
|
|
477
304
|
return (
|
|
478
305
|
<MessagesContainer profileMessages={profileMessages}>
|
|
479
306
|
<MessagesLayoutWrapper>
|
|
@@ -657,7 +484,18 @@ const MessagesUI = (props) => {
|
|
|
657
484
|
<TimeofSent>{parseTime(order.created_at)}</TimeofSent>
|
|
658
485
|
</BubbleConsole>
|
|
659
486
|
</MessageConsole>
|
|
660
|
-
<MapMessages
|
|
487
|
+
<MapMessages
|
|
488
|
+
messages={messagesToShow?.messages?.length ? messagesToShow : messages}
|
|
489
|
+
messagesToShow={messagesToShow}
|
|
490
|
+
order={order}
|
|
491
|
+
filterSpecialStatus={filterSpecialStatus}
|
|
492
|
+
handleModalImage={handleModalImage}
|
|
493
|
+
getLevel={getLevel}
|
|
494
|
+
business={business}
|
|
495
|
+
driver={driver}
|
|
496
|
+
getLogisticTagStatus={getLogisticTagStatus}
|
|
497
|
+
getStatus={getStatus}
|
|
498
|
+
/>
|
|
661
499
|
</MessageContentWrapper>
|
|
662
500
|
)
|
|
663
501
|
}
|
|
@@ -55,7 +55,7 @@ const MomentControlUI = (props) => {
|
|
|
55
55
|
} = props
|
|
56
56
|
|
|
57
57
|
const [{ configs }] = useConfig()
|
|
58
|
-
const is12hours = configs?.
|
|
58
|
+
const is12hours = configs?.general_hour_format?.value?.includes('hh:mm')
|
|
59
59
|
const [{ parseTime }] = useUtils()
|
|
60
60
|
const { pathname } = useLocation()
|
|
61
61
|
const [, t] = useLanguage()
|
|
@@ -422,7 +422,7 @@ const OrderDetailsUI = (props) => {
|
|
|
422
422
|
{!hideDeliveryDate && (
|
|
423
423
|
<p className='date'>
|
|
424
424
|
{activeStatus.includes(order?.status) ? (
|
|
425
|
-
<OrderEta order={order} />
|
|
425
|
+
<OrderEta order={order} outputFormat={`YYYY-MM-DD ${configs?.general_hour_format?.value}`} />
|
|
426
426
|
) : (
|
|
427
427
|
parseDate(order?.reporting_data?.at[`status:${order.status}`], { outputFormat: `YYYY-MM-DD ${configs?.general_hour_format?.value}` })
|
|
428
428
|
)}
|