ordering-ui-admin-external 1.25.0 → 1.26.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/main.css +1829 -1829
- package/_bundles/{ordering-ui-admin.f2522b983a000252b407.js → ordering-ui-admin.efcc125026af46873802.js} +2 -2
- package/_modules/components/BusinessIntelligence/AnalyticsCalendar/index.js +8 -1
- package/_modules/components/Delivery/DriversCompanyAddForm/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupAddForm/AdvancedLogisticsForm/index.js +68 -0
- package/_modules/components/Delivery/DriversGroupAddForm/AdvancedLogisticsForm/styles.js +42 -0
- package/_modules/components/Delivery/DriversGroupAddForm/BusinessesForm/index.js +89 -0
- package/_modules/components/Delivery/DriversGroupAddForm/BusinessesForm/styles.js +47 -0
- package/_modules/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +106 -0
- package/_modules/components/Delivery/DriversGroupAddForm/GeneralForm/styles.js +16 -0
- package/_modules/components/Delivery/DriversGroupAddForm/PaymethodsForm/index.js +87 -0
- package/_modules/components/Delivery/DriversGroupAddForm/PaymethodsForm/styles.js +33 -0
- package/_modules/components/Delivery/DriversGroupAddForm/index.js +132 -0
- package/_modules/components/Delivery/DriversGroupAddForm/styles.js +18 -0
- package/_modules/components/Delivery/DriversGroupCompanies/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupDrivers/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupOrders/index.js +5 -5
- package/_modules/components/Delivery/DriversGroupsList/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupsListing/index.js +28 -7
- package/_modules/components/Delivery/DriversGroupsListing/styles.js +2 -2
- package/_modules/components/Delivery/UserAddForm/index.js +39 -6
- package/_modules/components/Delivery/UserAddForm/styles.js +28 -21
- package/_modules/components/Delivery/UserDetails/index.js +2 -2
- package/_modules/components/Home/HomePage/index.js +71 -3
- package/_modules/components/Home/HomePage/styles.js +27 -5
- package/_modules/components/Login/LoginForm/index.js +0 -5
- package/_modules/components/MyProducts/AdvancedLayouts/LayoutStyleGroup.js +46 -0
- package/_modules/components/MyProducts/AdvancedLayouts/index.js +213 -0
- package/_modules/components/MyProducts/AdvancedLayouts/styles.js +146 -0
- package/_modules/components/MyProducts/AdvancedSettings/index.js +12 -0
- package/_modules/components/MyProducts/CustomDomain/index.js +6 -4
- package/_modules/components/MyProducts/CustomDomain/styles.js +27 -9
- package/_modules/components/MyProducts/OrderingWebsite/index.js +47 -6
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +20 -11
- package/_modules/components/Orders/AllInOne/DriversManager/index.js +128 -0
- package/_modules/components/Orders/AllInOne/DriversManager/styles.js +27 -0
- package/_modules/components/Orders/AllInOne/index.js +337 -0
- package/_modules/components/Orders/AllInOne/styles.js +67 -0
- package/_modules/components/Orders/CompanySelector/index.js +259 -0
- package/_modules/components/Orders/CompanySelector/styles.js +86 -0
- package/_modules/components/Orders/DriversBusyStatusFilter/styles.js +6 -3
- package/_modules/components/Orders/DriversList/index.js +3 -2
- package/_modules/components/Orders/DriversList/styles.js +2 -2
- package/_modules/components/Orders/DriversManager/index.js +2 -1
- package/_modules/components/Orders/DriversOnlineOfflineFilter/styles.js +5 -2
- package/_modules/components/Orders/OrderBill/RefundToWallet.js +1 -1
- package/_modules/components/Orders/OrderBill/index.js +17 -18
- package/_modules/components/Orders/OrderContactInformation/index.js +14 -3
- package/_modules/components/Orders/OrderDetails/index.js +1 -1
- package/_modules/components/Orders/OrderStatusSubFilter/styles.js +1 -1
- package/_modules/components/Orders/OrderToPrint/index.js +2 -1
- package/_modules/components/Orders/OrderToPrintTicket/index.js +4 -2
- package/_modules/components/Orders/OrdersContentHeader/index.js +2 -1
- package/_modules/components/Orders/OrdersListing/index.js +3 -1
- package/_modules/components/Orders/OrdersManager/index.js +5 -1
- package/_modules/components/Orders/OrdersTable/index.js +11 -10
- package/_modules/components/Orders/ProductItemAccordion/index.js +5 -9
- package/_modules/components/Orders/WebsocketStatus/index.js +119 -0
- package/_modules/components/Orders/WebsocketStatus/styles.js +65 -0
- package/_modules/components/Orders/index.js +7 -0
- package/_modules/components/Settings/IntegrationListing/Analytics.js +130 -0
- package/_modules/components/Settings/IntegrationListing/PaymentGateway.js +130 -0
- package/_modules/components/Settings/IntegrationListing/index.js +174 -31
- package/_modules/components/Settings/IntegrationListing/styles.js +42 -11
- package/_modules/components/Settings/NotificationSetting/index.js +25 -4
- package/_modules/components/Settings/NotificationSetting/styles.js +5 -3
- package/_modules/components/Settings/SettingsSelectUI/index.js +3 -2
- package/_modules/components/Shared/RangeCalendar/index.js +9 -1
- package/_modules/components/Shared/SearchBar/index.js +11 -6
- package/_modules/components/Shared/SearchBar/styles.js +9 -15
- package/_modules/components/SidebarMenu/index.js +19 -10
- package/_modules/components/Stores/ImporterHelpContent/index.js +1 -1
- package/_modules/components/Stores/ImportersButton/index.js +2 -2
- package/_modules/components/Users/UserDetails/index.js +2 -2
- package/_modules/config/currency.js +1017 -0
- package/_modules/index.js +6 -0
- package/_modules/utils/index.js +26 -3
- package/index-template.js +10 -0
- package/package.json +3 -2
- package/src/components/BusinessIntelligence/AnalyticsCalendar/index.js +7 -1
- package/src/components/Delivery/DriversCompanyAddForm/styles.js +0 -1
- package/src/components/Delivery/DriversGroupAddForm/AdvancedLogisticsForm/index.js +113 -0
- package/src/components/Delivery/DriversGroupAddForm/AdvancedLogisticsForm/styles.js +72 -0
- package/src/components/Delivery/DriversGroupAddForm/BusinessesForm/index.js +87 -0
- package/src/components/Delivery/DriversGroupAddForm/BusinessesForm/styles.js +87 -0
- package/src/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +104 -0
- package/src/components/Delivery/DriversGroupAddForm/GeneralForm/styles.js +31 -0
- package/src/components/Delivery/DriversGroupAddForm/PaymethodsForm/index.js +82 -0
- package/src/components/Delivery/DriversGroupAddForm/PaymethodsForm/styles.js +46 -0
- package/src/components/Delivery/DriversGroupAddForm/index.js +130 -0
- package/src/components/Delivery/DriversGroupAddForm/styles.js +38 -0
- package/src/components/Delivery/DriversGroupCompanies/styles.js +1 -0
- package/src/components/Delivery/DriversGroupDrivers/styles.js +1 -0
- package/src/components/Delivery/DriversGroupOrders/index.js +2 -2
- package/src/components/Delivery/DriversGroupsList/styles.js +1 -1
- package/src/components/Delivery/DriversGroupsListing/index.js +35 -13
- package/src/components/Delivery/DriversGroupsListing/styles.js +1 -1
- package/src/components/Delivery/UserAddForm/index.js +34 -2
- package/src/components/Delivery/UserAddForm/styles.js +25 -0
- package/src/components/Delivery/UserDetails/index.js +1 -1
- package/src/components/Home/HomePage/index.js +215 -142
- package/src/components/Home/HomePage/styles.js +105 -1
- package/src/components/Login/LoginForm/index.js +0 -7
- package/src/components/MyProducts/AdvancedLayouts/LayoutStyleGroup.js +37 -0
- package/src/components/MyProducts/AdvancedLayouts/index.js +240 -0
- package/src/components/MyProducts/AdvancedLayouts/styles.js +388 -0
- package/src/components/MyProducts/AdvancedSettings/index.js +5 -2
- package/src/components/MyProducts/CustomDomain/index.js +35 -16
- package/src/components/MyProducts/CustomDomain/styles.js +73 -1
- package/src/components/MyProducts/OrderingWebsite/index.js +97 -37
- package/src/components/MyProducts/OrderingWebsite/styles.js +38 -0
- package/src/components/Orders/AllInOne/DriversManager/index.js +137 -0
- package/src/components/Orders/AllInOne/DriversManager/styles.js +51 -0
- package/src/components/Orders/AllInOne/index.js +339 -0
- package/src/components/Orders/AllInOne/styles.js +144 -0
- package/src/components/Orders/CompanySelector/index.js +250 -0
- package/src/components/Orders/CompanySelector/styles.js +142 -0
- package/src/components/Orders/DriversBusyStatusFilter/styles.js +7 -1
- package/src/components/Orders/DriversList/index.js +7 -4
- package/src/components/Orders/DriversList/styles.js +2 -1
- package/src/components/Orders/DriversManager/index.js +2 -0
- package/src/components/Orders/DriversOnlineOfflineFilter/styles.js +8 -1
- package/src/components/Orders/OrderBill/RefundToWallet.js +12 -10
- package/src/components/Orders/OrderBill/index.js +18 -18
- package/src/components/Orders/OrderContactInformation/index.js +20 -1
- package/src/components/Orders/OrderDetails/index.js +8 -8
- package/src/components/Orders/OrderStatusSubFilter/styles.js +1 -1
- package/src/components/Orders/OrderToPrint/index.js +2 -1
- package/src/components/Orders/OrderToPrintTicket/index.js +160 -173
- package/src/components/Orders/OrdersContentHeader/index.js +2 -0
- package/src/components/Orders/OrdersListing/index.js +2 -0
- package/src/components/Orders/OrdersManager/index.js +2 -2
- package/src/components/Orders/OrdersTable/index.js +39 -25
- package/src/components/Orders/ProductItemAccordion/index.js +3 -3
- package/src/components/Orders/WebsocketStatus/index.js +138 -0
- package/src/components/Orders/WebsocketStatus/styles.js +171 -0
- package/src/components/Orders/index.js +2 -0
- package/src/components/Settings/IntegrationListing/Analytics.js +127 -0
- package/src/components/Settings/IntegrationListing/PaymentGateway.js +126 -0
- package/src/components/Settings/IntegrationListing/index.js +189 -96
- package/src/components/Settings/IntegrationListing/styles.js +90 -1
- package/src/components/Settings/NotificationSetting/index.js +73 -10
- package/src/components/Settings/NotificationSetting/styles.js +19 -0
- package/src/components/Settings/SettingsSelectUI/index.js +12 -9
- package/src/components/Shared/RangeCalendar/index.js +7 -1
- package/src/components/Shared/SearchBar/index.js +14 -5
- package/src/components/Shared/SearchBar/styles.js +19 -32
- package/src/components/SidebarMenu/index.js +15 -8
- package/src/components/Stores/ImporterHelpContent/index.js +17 -17
- package/src/components/Stores/ImportersButton/index.js +2 -2
- package/src/components/Users/UserDetails/index.js +1 -1
- package/src/config/currency.js +1010 -0
- package/src/index.js +2 -0
- package/src/utils/index.js +21 -0
- package/template/app.js +4 -0
- package/template/assets/images/preview/franchise.png +0 -0
- package/template/assets/images/preview/marketplace.png +0 -0
- package/template/assets/images/preview/single-store.png +0 -0
- package/template/components/AutologinParams/index.js +1 -3
- package/template/components/ListenPageChanges/index.js +1 -0
- package/template/helmetdata.json +7 -0
- package/template/pages/AllInOne/index.js +23 -0
- /package/_bundles/{ordering-ui-admin.f2522b983a000252b407.js.LICENSE.txt → ordering-ui-admin.efcc125026af46873802.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useLanguage,
|
|
3
|
+
DriversList as CompanysController
|
|
4
|
+
} from 'ordering-components-admin-external'
|
|
5
|
+
import { useTheme } from 'styled-components'
|
|
6
|
+
import { Select } from '../../../styles/Select'
|
|
7
|
+
import { Select as FirstSelect } from '../../../styles/Select/FirstSelect'
|
|
8
|
+
import { MultiSelect } from '../../../styles/MultiSelect'
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
Option,
|
|
12
|
+
OptionContent,
|
|
13
|
+
CompanyNameContainer,
|
|
14
|
+
WrapperCompanyImage,
|
|
15
|
+
CompanyImage,
|
|
16
|
+
CompanyName,
|
|
17
|
+
CompanyText,
|
|
18
|
+
PlaceholderTitle
|
|
19
|
+
} from './styles'
|
|
20
|
+
|
|
21
|
+
const CompanySelectorUI = (props) => {
|
|
22
|
+
const {
|
|
23
|
+
isFirstSelect,
|
|
24
|
+
order,
|
|
25
|
+
companysList,
|
|
26
|
+
defaultValue,
|
|
27
|
+
isPhoneView,
|
|
28
|
+
isFilterView,
|
|
29
|
+
small,
|
|
30
|
+
padding,
|
|
31
|
+
orderView,
|
|
32
|
+
handleAssignDriverCompany,
|
|
33
|
+
handleChangeCompany,
|
|
34
|
+
filterValues,
|
|
35
|
+
isTourOpen,
|
|
36
|
+
setCurrentTourStep,
|
|
37
|
+
handleOpenMessages
|
|
38
|
+
} = props
|
|
39
|
+
|
|
40
|
+
const [, t] = useLanguage()
|
|
41
|
+
const theme = useTheme()
|
|
42
|
+
const [defaultOption, setDefaultOption] = useState(null)
|
|
43
|
+
const [companysOptionList, setCompanysOptionList] = useState([])
|
|
44
|
+
const [companyssMultiOptionList, setCompanysMultiOptionList] = useState([])
|
|
45
|
+
const [searchValue, setSearchValue] = useState(null)
|
|
46
|
+
const companysLoading = [{ value: 'default', content: <Option small={small}>{t('LOADING', 'loading')}...</Option> }]
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const _companysOptionList = [
|
|
50
|
+
{
|
|
51
|
+
value: 'default',
|
|
52
|
+
content: (
|
|
53
|
+
<Option
|
|
54
|
+
padding={orderView ? padding : '0px'}
|
|
55
|
+
>
|
|
56
|
+
{orderView ? (
|
|
57
|
+
<>
|
|
58
|
+
<WrapperCompanyImage small={small} className='driver-photo'>
|
|
59
|
+
<CompanyImage bgimage={company.logo || theme?.images?.icons?.noDriver} small={small} />
|
|
60
|
+
</WrapperCompanyImage>
|
|
61
|
+
<OptionContent>
|
|
62
|
+
<CompanyNameContainer className='driver-info'>
|
|
63
|
+
<CompanyName small={small}>{t('NO_COMPANY', 'No Company')}</CompanyName>
|
|
64
|
+
</CompanyNameContainer>
|
|
65
|
+
</OptionContent>
|
|
66
|
+
</>
|
|
67
|
+
) : (
|
|
68
|
+
t('SELECT_COMPANY', 'Select company')
|
|
69
|
+
)}
|
|
70
|
+
</Option>
|
|
71
|
+
),
|
|
72
|
+
color: 'primary',
|
|
73
|
+
disabled: !isFilterView,
|
|
74
|
+
showDisable: true
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
if (!isFilterView) {
|
|
78
|
+
_companysOptionList.push({
|
|
79
|
+
value: 'remove',
|
|
80
|
+
content: (
|
|
81
|
+
<Option isRemove>{t('REMOVE_COMPANY', 'Remove assigned company')}</Option>
|
|
82
|
+
),
|
|
83
|
+
disabled: defaultValue === 'default'
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
if (!companysList.loading) {
|
|
87
|
+
let _companysList
|
|
88
|
+
if (searchValue) {
|
|
89
|
+
_companysList = companysList.companys.filter(company => (company.name).toLocaleLowerCase().includes(searchValue.toLocaleLowerCase()))
|
|
90
|
+
} else {
|
|
91
|
+
_companysList = companysList.companys
|
|
92
|
+
}
|
|
93
|
+
const _companysOptionListTemp = _companysList.map((company, i) => {
|
|
94
|
+
return {
|
|
95
|
+
value: company.id,
|
|
96
|
+
showDisable: isFilterView ? true : !(isFilterView || !company?.busy),
|
|
97
|
+
content: (
|
|
98
|
+
<Option small={small} isPhoneView={isPhoneView} padding={padding} isFilterView={isFilterView}>
|
|
99
|
+
<WrapperCompanyImage small={small} className='driver-photo'>
|
|
100
|
+
<CompanyImage bgimage={company.logo || theme.images.icons?.noDriver} small={small} />
|
|
101
|
+
</WrapperCompanyImage>
|
|
102
|
+
<OptionContent>
|
|
103
|
+
<CompanyNameContainer className='driver-info'>
|
|
104
|
+
<CompanyName small={small}>{company.name}</CompanyName>
|
|
105
|
+
<CompanyText small={small}>{t('COMPANY', 'Company')}</CompanyText>
|
|
106
|
+
</CompanyNameContainer>
|
|
107
|
+
</OptionContent>
|
|
108
|
+
</Option>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
setCompanysMultiOptionList(_companysOptionListTemp)
|
|
114
|
+
|
|
115
|
+
for (const option of _companysOptionListTemp) {
|
|
116
|
+
_companysOptionList.push(option)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
setCompanysOptionList(_companysOptionList)
|
|
120
|
+
}, [companysList, defaultValue, searchValue])
|
|
121
|
+
|
|
122
|
+
const changeCompany = (companyId) => {
|
|
123
|
+
if (isFilterView) {
|
|
124
|
+
if (companyId === 'default') {
|
|
125
|
+
handleChangeCompany(null)
|
|
126
|
+
} else {
|
|
127
|
+
handleChangeCompany(companyId)
|
|
128
|
+
}
|
|
129
|
+
return
|
|
130
|
+
}
|
|
131
|
+
if (companyId === 'default') return
|
|
132
|
+
if (companyId === 'remove') {
|
|
133
|
+
companyId = null
|
|
134
|
+
}
|
|
135
|
+
handleAssignDriverCompany({ orderId: order.id, companyId: companyId })
|
|
136
|
+
if (isTourOpen && setCurrentTourStep) {
|
|
137
|
+
handleOpenMessages('chat')
|
|
138
|
+
setTimeout(() => {
|
|
139
|
+
isTourOpen && setCurrentTourStep && setCurrentTourStep(3)
|
|
140
|
+
}, 50)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
setDefaultOption(defaultValue)
|
|
146
|
+
}, [defaultValue])
|
|
147
|
+
|
|
148
|
+
const Placeholder = <PlaceholderTitle>{t('SELECT_COMPANY', 'Select company')}</PlaceholderTitle>
|
|
149
|
+
|
|
150
|
+
const handleSearch = (val) => {
|
|
151
|
+
setSearchValue(val)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (isFilterView) {
|
|
155
|
+
return (
|
|
156
|
+
<>
|
|
157
|
+
{!companysList.loading ? (
|
|
158
|
+
<MultiSelect
|
|
159
|
+
defaultValue={filterValues.companyIds}
|
|
160
|
+
placeholder={Placeholder}
|
|
161
|
+
options={companyssMultiOptionList}
|
|
162
|
+
optionInnerMargin='10px'
|
|
163
|
+
optionInnerMaxHeight='150px'
|
|
164
|
+
onChange={(company) => handleChangeCompany(company)}
|
|
165
|
+
isShowSearchBar
|
|
166
|
+
searchBarIsCustomLayout
|
|
167
|
+
searchBarIsNotLazyLoad
|
|
168
|
+
searchValue={searchValue}
|
|
169
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
170
|
+
/>
|
|
171
|
+
) : (
|
|
172
|
+
<MultiSelect
|
|
173
|
+
defaultValue='default'
|
|
174
|
+
options={companysLoading}
|
|
175
|
+
optionInnerMargin='10px'
|
|
176
|
+
optionInnerMaxHeight='150px'
|
|
177
|
+
className='driver-select'
|
|
178
|
+
isShowSearchBar
|
|
179
|
+
searchBarIsCustomLayout
|
|
180
|
+
searchBarIsNotLazyLoad
|
|
181
|
+
searchValue={searchValue}
|
|
182
|
+
handleChangeSearch={(val) => setSearchValue(val)}
|
|
183
|
+
/>
|
|
184
|
+
)}
|
|
185
|
+
</>
|
|
186
|
+
)
|
|
187
|
+
} else {
|
|
188
|
+
return (
|
|
189
|
+
<>
|
|
190
|
+
{!companysList.loading ? (
|
|
191
|
+
<>
|
|
192
|
+
{isFirstSelect ? (
|
|
193
|
+
<FirstSelect
|
|
194
|
+
defaultValue={defaultOption || 'default'}
|
|
195
|
+
options={companysOptionList}
|
|
196
|
+
optionInnerMaxHeight='200px'
|
|
197
|
+
onChange={(companyId) => changeCompany(companyId)}
|
|
198
|
+
isShowSearchBar
|
|
199
|
+
searchBarPlaceholder={t('SEARCH', 'Search')}
|
|
200
|
+
searchBarIsCustomLayout
|
|
201
|
+
searchBarIsNotLazyLoad
|
|
202
|
+
searchValue={searchValue}
|
|
203
|
+
handleChangeSearch={handleSearch}
|
|
204
|
+
className='driver-select'
|
|
205
|
+
/>
|
|
206
|
+
) : (
|
|
207
|
+
<Select
|
|
208
|
+
defaultValue={defaultOption || 'default'}
|
|
209
|
+
options={companysOptionList}
|
|
210
|
+
optionInnerMaxHeight='200px'
|
|
211
|
+
onChange={(companyId) => changeCompany(companyId)}
|
|
212
|
+
isShowSearchBar
|
|
213
|
+
searchBarIsNotLazyLoad
|
|
214
|
+
searchBarPlaceholder={t('SEARCH', 'Search')}
|
|
215
|
+
searchBarIsCustomLayout
|
|
216
|
+
searchValue={searchValue}
|
|
217
|
+
handleChangeSearch={handleSearch}
|
|
218
|
+
className='driver-select'
|
|
219
|
+
/>
|
|
220
|
+
)}
|
|
221
|
+
</>
|
|
222
|
+
) : (
|
|
223
|
+
<>
|
|
224
|
+
<Select
|
|
225
|
+
placeholder={t('SELECT_COMPANY', 'Select company')}
|
|
226
|
+
defaultValue='default'
|
|
227
|
+
options={companysLoading}
|
|
228
|
+
optionInnerMargin='10px'
|
|
229
|
+
optionInnerMaxHeight='200px'
|
|
230
|
+
className='driver-select'
|
|
231
|
+
/>
|
|
232
|
+
</>
|
|
233
|
+
)}
|
|
234
|
+
</>
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export const CompanySelector = (props) => {
|
|
240
|
+
const CompanysControlProps = {
|
|
241
|
+
...props,
|
|
242
|
+
UIComponent: CompanySelectorUI,
|
|
243
|
+
propsToFetch: ['id', 'name', 'lastname', 'cellphone', 'photo']
|
|
244
|
+
}
|
|
245
|
+
return (
|
|
246
|
+
<>
|
|
247
|
+
<CompanysController {...CompanysControlProps} />
|
|
248
|
+
</>
|
|
249
|
+
)
|
|
250
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styled, { css } from 'styled-components'
|
|
3
|
+
|
|
4
|
+
export const Option = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
color: ${props => props.theme.colors?.headingColor};
|
|
8
|
+
padding: ${({ padding }) => padding || '5px 10px'};
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
${({ isPhoneView }) => isPhoneView && css`
|
|
11
|
+
width: 100%;
|
|
12
|
+
`}
|
|
13
|
+
${({ isRemove }) => isRemove && css`
|
|
14
|
+
color: ${props => props.theme.colors.danger};
|
|
15
|
+
padding: 3px 10px;
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
`}
|
|
18
|
+
|
|
19
|
+
img {
|
|
20
|
+
width: 45px;
|
|
21
|
+
border-radius: 8px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
${({ small }) => small && css`
|
|
25
|
+
padding: ${({ padding }) => padding || '5px 0px'};
|
|
26
|
+
img {
|
|
27
|
+
width: 25px;
|
|
28
|
+
}
|
|
29
|
+
`}
|
|
30
|
+
|
|
31
|
+
@media (max-width: 576px) {
|
|
32
|
+
padding: ${({ padding }) => padding || '5px 0px'};
|
|
33
|
+
${({ isFilterView }) => isFilterView && css`
|
|
34
|
+
${props => props.theme?.rtl ? css`
|
|
35
|
+
margin-right: 10px;
|
|
36
|
+
` : css`
|
|
37
|
+
margin-left: 10px;
|
|
38
|
+
`}
|
|
39
|
+
`}
|
|
40
|
+
}
|
|
41
|
+
`
|
|
42
|
+
|
|
43
|
+
export const OptionContent = styled.div`
|
|
44
|
+
flex: 1;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: space-between;
|
|
48
|
+
`
|
|
49
|
+
|
|
50
|
+
export const CompanyNameContainer = styled.div`
|
|
51
|
+
line-height: 1.3;
|
|
52
|
+
color: #263238;
|
|
53
|
+
`
|
|
54
|
+
|
|
55
|
+
export const CompanyName = styled.p`
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
line-height: 1.3;
|
|
59
|
+
color: ${props => props.theme.colors.headingColor};
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
max-width: 150px;
|
|
64
|
+
margin: 0px;
|
|
65
|
+
|
|
66
|
+
${({ small }) => small && css`
|
|
67
|
+
font-weight: 400;
|
|
68
|
+
`}
|
|
69
|
+
|
|
70
|
+
@media (max-width: 576px) {
|
|
71
|
+
max-width: 90px;
|
|
72
|
+
}
|
|
73
|
+
`
|
|
74
|
+
export const CompanyText = styled.span`
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
color: ${props => props.theme.colors.lightGray};
|
|
77
|
+
${({ small }) => small && css`
|
|
78
|
+
display: none;
|
|
79
|
+
`}
|
|
80
|
+
`
|
|
81
|
+
|
|
82
|
+
export const WrapperCompanyImage = styled.div`
|
|
83
|
+
width: 45px;
|
|
84
|
+
height: 45px;
|
|
85
|
+
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
|
|
86
|
+
border-radius: 8px;
|
|
87
|
+
display: flex;
|
|
88
|
+
|
|
89
|
+
svg {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
padding: 7px;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
${({ small }) => small && css`
|
|
98
|
+
width: 24px;
|
|
99
|
+
height: 24px;
|
|
100
|
+
border-radius: 8px;
|
|
101
|
+
svg {
|
|
102
|
+
padding: 3px;
|
|
103
|
+
}
|
|
104
|
+
`}
|
|
105
|
+
|
|
106
|
+
${props => props.theme?.rtl ? css`
|
|
107
|
+
margin-left: 8px;
|
|
108
|
+
` : css`
|
|
109
|
+
margin-right: 8px;
|
|
110
|
+
`}
|
|
111
|
+
`
|
|
112
|
+
const CompanyImageStyled = styled.div`
|
|
113
|
+
display: flex;
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 100%;
|
|
116
|
+
box-sizing: border-box;
|
|
117
|
+
position: relative;
|
|
118
|
+
background-repeat: no-repeat, repeat;
|
|
119
|
+
background-size: cover;
|
|
120
|
+
object-fit: cover;
|
|
121
|
+
background-position: center;
|
|
122
|
+
border-radius: 8px;
|
|
123
|
+
`
|
|
124
|
+
export const CompanyImage = (props) => {
|
|
125
|
+
return (
|
|
126
|
+
<CompanyImageStyled
|
|
127
|
+
{...props}
|
|
128
|
+
style={{ backgroundImage: `url(${props.bgimage})` }}
|
|
129
|
+
>
|
|
130
|
+
{props.children}
|
|
131
|
+
</CompanyImageStyled>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export const PlaceholderTitle = styled(Option)`
|
|
136
|
+
padding: 10px;
|
|
137
|
+
|
|
138
|
+
${({ isSingle }) => isSingle && css`
|
|
139
|
+
padding: 0px;
|
|
140
|
+
font-size: 14px;
|
|
141
|
+
`}
|
|
142
|
+
`
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components'
|
|
2
2
|
|
|
3
3
|
export const Container = styled.div`
|
|
4
|
-
|
|
4
|
+
display: flex;
|
|
5
5
|
button {
|
|
6
6
|
margin: 10px;
|
|
7
7
|
white-space: nowrap;
|
|
8
8
|
font-size: 14px;
|
|
9
|
+
margin: 10px 0;
|
|
10
|
+
${props => props.theme?.rtl ? css`
|
|
11
|
+
margin-left: 10px;
|
|
12
|
+
` : css`
|
|
13
|
+
margin-right: 10px;
|
|
14
|
+
`}
|
|
9
15
|
|
|
10
16
|
svg {
|
|
11
17
|
font-size: 20px;
|
|
@@ -23,7 +23,8 @@ export const DriversList = (props) => {
|
|
|
23
23
|
offlineDrivers,
|
|
24
24
|
selectedDriver,
|
|
25
25
|
handleChangeDriver,
|
|
26
|
-
handleOpenDriverOrders
|
|
26
|
+
handleOpenDriverOrders,
|
|
27
|
+
hidePhoto
|
|
27
28
|
} = props
|
|
28
29
|
|
|
29
30
|
const theme = useTheme()
|
|
@@ -74,9 +75,11 @@ export const DriversList = (props) => {
|
|
|
74
75
|
onClick={(e) => handleClickDriver(e, driver)}
|
|
75
76
|
active={selectedDriver?.id === driver.id}
|
|
76
77
|
>
|
|
77
|
-
|
|
78
|
-
<
|
|
79
|
-
|
|
78
|
+
{!hidePhoto && (
|
|
79
|
+
<WrapperImage>
|
|
80
|
+
<Image bgimage={optimizeImage(driver?.photo || theme.images?.icons?.noDriver, 'h_50,c_limit')} />
|
|
81
|
+
</WrapperImage>
|
|
82
|
+
)}
|
|
80
83
|
<DriverInfo>
|
|
81
84
|
<div>
|
|
82
85
|
<p>{driver.name} {driver.lastname}</p>
|
|
@@ -2,10 +2,11 @@ import React from 'react'
|
|
|
2
2
|
import styled, { css } from 'styled-components'
|
|
3
3
|
|
|
4
4
|
export const DriversListContainer = styled.div`
|
|
5
|
-
padding: 15px
|
|
5
|
+
padding: 15px 0px;
|
|
6
6
|
`
|
|
7
7
|
|
|
8
8
|
export const DriverCard = styled.div`
|
|
9
|
+
min-height: 66px;
|
|
9
10
|
cursor: pointer;
|
|
10
11
|
display: flex;
|
|
11
12
|
align-items: center;
|
|
@@ -9,6 +9,7 @@ import { List as MenuIcon } from 'react-bootstrap-icons'
|
|
|
9
9
|
import { IconButton } from '../../../styles/Buttons'
|
|
10
10
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
11
11
|
import { GoogleMapsApiKeySettingButton } from '../GoogleMapsApiKeySettingButton'
|
|
12
|
+
import { WebsocketStatus } from '../WebsocketStatus'
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
15
|
DriversHeader,
|
|
@@ -86,6 +87,7 @@ const DriversManagerUI = (props) => {
|
|
|
86
87
|
)}
|
|
87
88
|
<h1>{t('DRIVERS_DASHBOARD', 'Drivers dashboard')}</h1>
|
|
88
89
|
</HeaderTitleContainer>
|
|
90
|
+
<WebsocketStatus />
|
|
89
91
|
{!googleMapsApiKey && (
|
|
90
92
|
<GoogleMapsApiKeySettingButton />
|
|
91
93
|
)}
|
|
@@ -7,10 +7,11 @@ export const Container = styled.div`
|
|
|
7
7
|
`
|
|
8
8
|
|
|
9
9
|
export const Tab = styled.div`
|
|
10
|
-
padding: 10px
|
|
10
|
+
padding: 10px 0px;
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
color: ${props => props.theme.colors?.headingColor};
|
|
13
13
|
white-space: nowrap;
|
|
14
|
+
font-size: 14px;
|
|
14
15
|
|
|
15
16
|
${({ active }) => active && css`
|
|
16
17
|
border-bottom: 3px solid;
|
|
@@ -20,4 +21,10 @@ export const Tab = styled.div`
|
|
|
20
21
|
${({ active }) => !active && css`
|
|
21
22
|
color: #909BA9;
|
|
22
23
|
`}
|
|
24
|
+
|
|
25
|
+
${props => props.theme?.rtl ? css`
|
|
26
|
+
margin-left: 30px;
|
|
27
|
+
` : css`
|
|
28
|
+
margin-right: 30px;
|
|
29
|
+
`}
|
|
23
30
|
`
|
|
@@ -126,16 +126,18 @@ export const RefundToWallet = (props) => {
|
|
|
126
126
|
|
|
127
127
|
return (
|
|
128
128
|
<>
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
{(isAllowCashWalletRefund || isAllowCreditPointRefund || isAllowStripeRefund || isAllowOtherRefund) && (
|
|
130
|
+
<RefundWalletButtonWrapper>
|
|
131
|
+
<Button
|
|
132
|
+
color='primary'
|
|
133
|
+
borderRadius='8px'
|
|
134
|
+
disabled={actionStatus?.loading || refundDisabled}
|
|
135
|
+
onClick={() => setOpenModal(true)}
|
|
136
|
+
>
|
|
137
|
+
{t('REFUND_TO_WALLET', 'Refund to Wallet')}
|
|
138
|
+
</Button>
|
|
139
|
+
</RefundWalletButtonWrapper>
|
|
140
|
+
)}
|
|
139
141
|
<Modal
|
|
140
142
|
width='700px'
|
|
141
143
|
open={openModal}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useLanguage, useUtils, useConfig } from 'ordering-components-admin-external'
|
|
3
3
|
import { RefundToWallet } from './RefundToWallet'
|
|
4
|
-
import { verifyDecimals } from '../../../utils'
|
|
4
|
+
import { verifyDecimals, getCurrenySymbol } from '../../../utils'
|
|
5
5
|
import { Alert, Confirm } from '../../Shared'
|
|
6
6
|
import { Button } from '../../../styles'
|
|
7
7
|
|
|
@@ -89,7 +89,7 @@ export const OrderBill = (props) => {
|
|
|
89
89
|
<tr>
|
|
90
90
|
<td>{t('SUBTOTAL', 'Subtotal')}</td>
|
|
91
91
|
<td>
|
|
92
|
-
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency })}
|
|
92
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: getCurrenySymbol(order?.currency) })}
|
|
93
93
|
</td>
|
|
94
94
|
</tr>
|
|
95
95
|
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
@@ -102,7 +102,7 @@ export const OrderBill = (props) => {
|
|
|
102
102
|
) : (
|
|
103
103
|
<td>{t('DISCOUNT', 'Discount')}</td>
|
|
104
104
|
)}
|
|
105
|
-
<td>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency })}</td>
|
|
105
|
+
<td>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
106
106
|
</tr>
|
|
107
107
|
)}
|
|
108
108
|
{
|
|
@@ -115,7 +115,7 @@ export const OrderBill = (props) => {
|
|
|
115
115
|
)}
|
|
116
116
|
</td>
|
|
117
117
|
<td>
|
|
118
|
-
- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}
|
|
118
|
+
- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}
|
|
119
119
|
</td>
|
|
120
120
|
</tr>
|
|
121
121
|
))
|
|
@@ -124,9 +124,9 @@ export const OrderBill = (props) => {
|
|
|
124
124
|
<tr>
|
|
125
125
|
<td>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</td>
|
|
126
126
|
{order?.tax_type === 1 ? (
|
|
127
|
-
<td>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency })}</td>
|
|
127
|
+
<td>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
128
128
|
) : (
|
|
129
|
-
<td>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency })}</td>
|
|
129
|
+
<td>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
130
130
|
)}
|
|
131
131
|
</tr>
|
|
132
132
|
)}
|
|
@@ -137,7 +137,7 @@ export const OrderBill = (props) => {
|
|
|
137
137
|
{t('TAX', 'Tax')}
|
|
138
138
|
<span>{`(${verifyDecimals(order?.tax, parseNumber)}%)`}</span>
|
|
139
139
|
</td>
|
|
140
|
-
<td>{parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency })}</td>
|
|
140
|
+
<td>{parsePrice(order?.summary?.tax ?? 0, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
141
141
|
</tr>
|
|
142
142
|
)
|
|
143
143
|
}
|
|
@@ -148,7 +148,7 @@ export const OrderBill = (props) => {
|
|
|
148
148
|
{t('SERVICE_FEE', 'Service fee')}
|
|
149
149
|
<span>{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}</span>
|
|
150
150
|
</td>
|
|
151
|
-
<td>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency })}</td>
|
|
151
|
+
<td>{parsePrice(order?.summary?.service_fee ?? 0, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
152
152
|
</tr>
|
|
153
153
|
)
|
|
154
154
|
}
|
|
@@ -159,7 +159,7 @@ export const OrderBill = (props) => {
|
|
|
159
159
|
{t(tax?.name?.toUpperCase()?.replaceAll(' ', '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
160
160
|
<span>{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}</span>
|
|
161
161
|
</td>
|
|
162
|
-
<td>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency })}</td>
|
|
162
|
+
<td>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
163
163
|
</tr>
|
|
164
164
|
))
|
|
165
165
|
}
|
|
@@ -170,7 +170,7 @@ export const OrderBill = (props) => {
|
|
|
170
170
|
{t(fee?.name?.toUpperCase()?.replaceAll(' ', '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
171
171
|
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%)
|
|
172
172
|
</td>
|
|
173
|
-
<td>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency })}</td>
|
|
173
|
+
<td>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
174
174
|
</tr>
|
|
175
175
|
))
|
|
176
176
|
}
|
|
@@ -184,7 +184,7 @@ export const OrderBill = (props) => {
|
|
|
184
184
|
)}
|
|
185
185
|
</td>
|
|
186
186
|
<td>
|
|
187
|
-
- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}
|
|
187
|
+
- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}
|
|
188
188
|
</td>
|
|
189
189
|
</tr>
|
|
190
190
|
))
|
|
@@ -192,7 +192,7 @@ export const OrderBill = (props) => {
|
|
|
192
192
|
{typeof order?.summary?.delivery_price === 'number' && (
|
|
193
193
|
<tr>
|
|
194
194
|
<td>{t('DELIVERY_FEE', 'Delivery Fee')}</td>
|
|
195
|
-
<td>{parsePrice(order?.summary?.delivery_price, { currency: order?.currency })}</td>
|
|
195
|
+
<td>{parsePrice(order?.summary?.delivery_price, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
196
196
|
</tr>
|
|
197
197
|
)}
|
|
198
198
|
{
|
|
@@ -205,7 +205,7 @@ export const OrderBill = (props) => {
|
|
|
205
205
|
)}
|
|
206
206
|
</td>
|
|
207
207
|
<td>
|
|
208
|
-
- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}
|
|
208
|
+
- {parsePrice(offer?.summary?.discount, { currency: getCurrenySymbol(order?.currency) })}
|
|
209
209
|
</td>
|
|
210
210
|
</tr>
|
|
211
211
|
))
|
|
@@ -221,7 +221,7 @@ export const OrderBill = (props) => {
|
|
|
221
221
|
<span>{`(${verifyDecimals(order?.driver_tip, parseNumber)}%)`}</span>
|
|
222
222
|
)}
|
|
223
223
|
</td>
|
|
224
|
-
<td>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</td>
|
|
224
|
+
<td>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
225
225
|
</tr>
|
|
226
226
|
)}
|
|
227
227
|
</tbody>
|
|
@@ -230,7 +230,7 @@ export const OrderBill = (props) => {
|
|
|
230
230
|
<tbody>
|
|
231
231
|
<tr>
|
|
232
232
|
<td>{t('TOTAL', 'Total')}</td>
|
|
233
|
-
<td>{parsePrice(order?.summary?.total || order?.total, {
|
|
233
|
+
<td>{parsePrice(order?.summary?.total || order?.total, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
234
234
|
</tr>
|
|
235
235
|
</tbody>
|
|
236
236
|
</table>
|
|
@@ -255,8 +255,8 @@ export const OrderBill = (props) => {
|
|
|
255
255
|
</td>
|
|
256
256
|
<td>
|
|
257
257
|
{event?.paymethod?.gateway === 'cash' && order?.cash
|
|
258
|
-
? parsePrice(order?.cash, { currency: order?.currency })
|
|
259
|
-
: `-${parsePrice(event?.amount, { currency: order?.currency })}`}
|
|
258
|
+
? parsePrice(order?.cash, { currency: getCurrenySymbol(order?.currency) })
|
|
259
|
+
: `-${parsePrice(event?.amount, { currency: getCurrenySymbol(order?.currency) })}`}
|
|
260
260
|
</td>
|
|
261
261
|
</tr>
|
|
262
262
|
))}
|
|
@@ -289,7 +289,7 @@ export const OrderBill = (props) => {
|
|
|
289
289
|
? t(event?.data?.gateway?.toUpperCase(), event?.data?.gateway?.replaceAll('_', ' '))
|
|
290
290
|
: walletName[event?.data?.wallet_currency]?.name}
|
|
291
291
|
</td>
|
|
292
|
-
<td>{parsePrice(event?.amount, { currency: order?.currency })}</td>
|
|
292
|
+
<td>{parsePrice(event?.amount, { currency: getCurrenySymbol(order?.currency) })}</td>
|
|
293
293
|
</tr>
|
|
294
294
|
))}
|
|
295
295
|
</tbody>
|