ordering-ui-admin-external 1.26.1 → 1.27.1
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/{ordering-ui-admin.45097ebbca4f4a7d30b7.js → ordering-ui-admin.a9792b22d968cdf424d1.js} +2 -2
- package/_modules/components/Delivery/UserFormDetails/index.js +38 -3
- package/_modules/components/Delivery/UserFormDetails/styles.js +10 -3
- package/_modules/components/MyProducts/OrderingWebsite/index.js +3 -0
- package/_modules/components/Orders/DeliveriesLocation/index.js +4 -4
- package/_modules/components/Orders/OrderDetailsHeader/index.js +1 -1
- package/_modules/components/Orders/OrderDetailsHeader/styles.js +1 -1
- package/_modules/components/Orders/OrderNotification/index.js +2 -0
- package/_modules/components/Settings/BacCredomatic/index.js +200 -0
- package/_modules/components/Settings/BacCredomatic/styles.js +111 -0
- package/_modules/components/Settings/IntegrationListing/Analytics.js +5 -2
- package/_modules/components/Settings/IntegrationListing/PaymentGateway.js +22 -4
- package/_modules/components/Settings/IntegrationListing/index.js +10 -2
- package/_modules/components/Settings/index.js +7 -0
- package/_modules/components/Shared/ImageCrop/index.js +7 -1
- package/_modules/components/Stores/BusinessQRCodeOption/index.js +9 -4
- package/_modules/components/Stores/BusinessQRCodeOption/styles.js +8 -4
- package/index-template.js +1 -1
- package/package.json +2 -2
- package/src/components/Delivery/UserFormDetails/index.js +34 -2
- package/src/components/Delivery/UserFormDetails/styles.js +27 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +3 -0
- package/src/components/Orders/DeliveriesLocation/index.js +5 -6
- package/src/components/Orders/OrderDetailsHeader/index.js +7 -0
- package/src/components/Orders/OrderDetailsHeader/styles.js +6 -0
- package/src/components/Orders/OrderNotification/index.js +1 -0
- package/src/components/Settings/BacCredomatic/index.js +213 -0
- package/src/components/Settings/BacCredomatic/styles.js +344 -0
- package/src/components/Settings/IntegrationListing/Analytics.js +5 -2
- package/src/components/Settings/IntegrationListing/PaymentGateway.js +20 -2
- package/src/components/Settings/IntegrationListing/index.js +10 -2
- package/src/components/Settings/index.js +2 -0
- package/src/components/Shared/ImageCrop/index.js +9 -3
- package/src/components/Stores/BusinessQRCodeOption/index.js +28 -11
- package/src/components/Stores/BusinessQRCodeOption/styles.js +9 -1
- /package/_bundles/{ordering-ui-admin.45097ebbca4f4a7d30b7.js.LICENSE.txt → ordering-ui-admin.a9792b22d968cdf424d1.js.LICENSE.txt} +0 -0
|
@@ -256,11 +256,19 @@ var IntegrationListing = function IntegrationListing(props) {
|
|
|
256
256
|
style: {
|
|
257
257
|
order: selectedTab === 5 ? 1 : selectedTab
|
|
258
258
|
}
|
|
259
|
-
}, /*#__PURE__*/_react.default.createElement(_PaymentGateway.PaymentGateway,
|
|
259
|
+
}, /*#__PURE__*/_react.default.createElement(_PaymentGateway.PaymentGateway, {
|
|
260
|
+
showOption: showOption,
|
|
261
|
+
setShowOption: setShowOption,
|
|
262
|
+
handleCloseSettings: handleCloseSettings,
|
|
263
|
+
handleOpenBasicSetting: handleOpenSetting
|
|
264
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
260
265
|
style: {
|
|
261
266
|
order: selectedTab === 6 ? 1 : selectedTab
|
|
262
267
|
}
|
|
263
|
-
}, /*#__PURE__*/_react.default.createElement(_Analytics.Analytics,
|
|
268
|
+
}, /*#__PURE__*/_react.default.createElement(_Analytics.Analytics, {
|
|
269
|
+
showOption: showOption,
|
|
270
|
+
setShowOption: setShowOption
|
|
271
|
+
})))), showOption === 'plugins' && /*#__PURE__*/_react.default.createElement(_Shared.SideBar, {
|
|
264
272
|
sidebarId: "plugins-integrations",
|
|
265
273
|
defaultSideBarWidth: 600,
|
|
266
274
|
open: showOption === 'plugins',
|
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "ApiKeysList", {
|
|
|
15
15
|
return _ApiKeysList.ApiKeysList;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "BacCredomatic", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _BacCredomatic.BacCredomatic;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "CardFieldsSetting", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
@@ -218,6 +224,7 @@ var _NotificationSetting = require("./NotificationSetting");
|
|
|
218
224
|
var _SettingsSelectUI = require("./SettingsSelectUI");
|
|
219
225
|
var _SettingsCountryFilter = require("./SettingsCountryFilter");
|
|
220
226
|
var _ApiKeysList = require("./ApiKeysList");
|
|
227
|
+
var _BacCredomatic = require("./BacCredomatic");
|
|
221
228
|
var _WebhookList = require("./WebhookList");
|
|
222
229
|
var _PluginList = require("./PluginList");
|
|
223
230
|
var _WebhookDelaySelector = require("./WebhookDelaySelector");
|
|
@@ -13,6 +13,8 @@ var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
|
13
13
|
var _styledComponents = require("styled-components");
|
|
14
14
|
require("cropperjs/dist/cropper.css");
|
|
15
15
|
var _styles2 = require("./styles");
|
|
16
|
+
var _Checkbox = require("../../../styles/Checkbox");
|
|
17
|
+
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
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); }
|
|
18
20
|
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; }
|
|
@@ -157,7 +159,11 @@ var ImageCrop = function ImageCrop(props) {
|
|
|
157
159
|
}
|
|
158
160
|
setCropper(_cropper);
|
|
159
161
|
}, [photo, aspectRatio]);
|
|
160
|
-
return /*#__PURE__*/_react.default.createElement(_styles2.Container, null, /*#__PURE__*/_react.default.createElement(
|
|
162
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.Container, null, loading ? /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
163
|
+
style: {
|
|
164
|
+
height: 400
|
|
165
|
+
}
|
|
166
|
+
}) : /*#__PURE__*/_react.default.createElement(_styles2.ImageCropWrapper, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
161
167
|
ref: cropperRef,
|
|
162
168
|
src: photo
|
|
163
169
|
})), /*#__PURE__*/_react.default.createElement(_styles2.ImageCropActionWrapper, null, /*#__PURE__*/_react.default.createElement(_styles2.RangeWrapper, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -74,7 +74,7 @@ var BusinessQRCodeOption = function BusinessQRCodeOption(props) {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
var storeUrl = siteState !== null && siteState !== void 0 && (_siteState$site = siteState.site) !== null && _siteState$site !== void 0 && _siteState$site.domain && (siteState === null || siteState === void 0 ? void 0 : (_siteState$site2 = siteState.site) === null || _siteState$site2 === void 0 ? void 0 : _siteState$site2.ssl_process_status) === 'ended' ? "https://".concat(siteState === null || siteState === void 0 ? void 0 : (_siteState$site3 = siteState.site) === null || _siteState$site3 === void 0 ? void 0 : _siteState$site3.domain, "/store/").concat(business === null || business === void 0 ? void 0 : business.slug) : "https://".concat(ordering.project, ".tryordering.com/store/").concat(business === null || business === void 0 ? void 0 : business.slug);
|
|
77
|
-
var tsNumber = (item === null || item === void 0 ? void 0 : item.key) !== 'pick_up' ? (item === null || item === void 0 ? void 0 : item.key) === 'eat_in' ? "&
|
|
77
|
+
var tsNumber = (item === null || item === void 0 ? void 0 : item.key) !== 'pick_up' ? (item === null || item === void 0 ? void 0 : item.key) === 'eat_in' ? "&table_number=".concat(numberRef === null || numberRef === void 0 ? void 0 : (_numberRef$current2 = numberRef.current) === null || _numberRef$current2 === void 0 ? void 0 : _numberRef$current2.value) : "&spot_number=".concat(numberRef === null || numberRef === void 0 ? void 0 : (_numberRef$current3 = numberRef.current) === null || _numberRef$current3 === void 0 ? void 0 : _numberRef$current3.value) : '';
|
|
78
78
|
var compltedUrl = "".concat(storeUrl, "?order_type=").concat(item.value).concat(tsNumber);
|
|
79
79
|
setCode(compltedUrl);
|
|
80
80
|
};
|
|
@@ -121,10 +121,15 @@ var BusinessQRCodeOption = function BusinessQRCodeOption(props) {
|
|
|
121
121
|
},
|
|
122
122
|
value: code,
|
|
123
123
|
viewBox: "0 0 256 256"
|
|
124
|
-
})), (item === null || item === void 0 ? void 0 : item.key) === 'pick_up' ? /*#__PURE__*/_react.default.createElement("
|
|
124
|
+
})), (item === null || item === void 0 ? void 0 : item.key) === 'pick_up' ? /*#__PURE__*/_react.default.createElement("h4", null, t('GENERATE_QR_CODE', 'Generate QR Code')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (item === null || item === void 0 ? void 0 : item.key) === 'eat_in' && code && /*#__PURE__*/_react.default.createElement(_styles2.TableNumberHintText, null, t('TO_GENERATE_NEW_QR_CODE_UPDATE_TABLE_NUMBER', 'To generate new QR codes, update the table number and regenerate the code.')), /*#__PURE__*/_react.default.createElement(_styles2.FormControl, null, /*#__PURE__*/_react.default.createElement("label", null, (item === null || item === void 0 ? void 0 : item.key) === 'eat_in' ? t('TABLE_NUMBER', 'Table number') : t('SPOT_NUMBER', 'Spot number')), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
125
125
|
placeholder: "0",
|
|
126
|
-
ref: numberRef
|
|
127
|
-
|
|
126
|
+
ref: numberRef,
|
|
127
|
+
onKeyPress: function onKeyPress(e) {
|
|
128
|
+
if (!/^[0-9.]$/.test(e.key)) {
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}))), /*#__PURE__*/_react.default.createElement(_styles2.ButtonGroup, null, /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
128
133
|
color: "primary",
|
|
129
134
|
outline: true,
|
|
130
135
|
onClick: generateQRCode
|
|
@@ -4,13 +4,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.QRCodeLayout = exports.Header = exports.FormControl = exports.Container = exports.CloseButton = exports.ButtonGroup = void 0;
|
|
7
|
+
exports.TableNumberHintText = exports.QRCodeLayout = exports.Header = exports.FormControl = exports.Container = exports.CloseButton = exports.ButtonGroup = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
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 Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 20px;\n overflow: auto;\n transition: 0.3s;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n > button {\n margin-top: 20px;\n position: sticky;\n top: 100%;\n width: fit-content;\n height: 42px;\n margin-bottom: 20px;\n }\n\n @media (min-width: 1000px) {\n width: 0;\n ", "\n }\n >
|
|
13
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 20px;\n overflow: auto;\n transition: 0.3s;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n > button {\n margin-top: 20px;\n position: sticky;\n top: 100%;\n width: fit-content;\n height: 42px;\n margin-bottom: 20px;\n }\n\n @media (min-width: 1000px) {\n width: 0;\n ", "\n }\n > h4 {\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n margin: 0;\n }\n"])), function (props) {
|
|
14
14
|
var _props$theme;
|
|
15
15
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.rtl ? (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-right: 1px solid #E9ECEF;\n "]))) : (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-left: 1px solid #E9ECEF;\n "])));
|
|
16
16
|
});
|
|
@@ -36,4 +36,8 @@ var FormControl = _styledComponents.default.div(_templateObject10 || (_templateO
|
|
|
36
36
|
});
|
|
37
37
|
exports.FormControl = FormControl;
|
|
38
38
|
var QRCodeLayout = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n margin-bottom: 20px;\n"])));
|
|
39
|
-
exports.QRCodeLayout = QRCodeLayout;
|
|
39
|
+
exports.QRCodeLayout = QRCodeLayout;
|
|
40
|
+
var TableNumberHintText = _styledComponents.default.span(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n font-weight: 400;\n font-size: 14px;\n line-height: 18px;\n margin-bottom: 15px;\n color: ", ";\n"])), function (props) {
|
|
41
|
+
return props.theme.colors.lightGray;
|
|
42
|
+
});
|
|
43
|
+
exports.TableNumberHintText = TableNumberHintText;
|
package/index-template.js
CHANGED
|
@@ -297,7 +297,7 @@ if (!(window?.location?.hostname === 'localhost')) {
|
|
|
297
297
|
integrations: [
|
|
298
298
|
new Integrations.BrowserTracing()
|
|
299
299
|
],
|
|
300
|
-
release: process.env.npm_package_version ? 'ordering-ui-admin-release@' + process.env.npm_package_version : 'ordering-ui-admin-release@' + '1.0.
|
|
300
|
+
release: process.env.npm_package_version ? 'ordering-ui-admin-release@' + process.env.npm_package_version : 'ordering-ui-admin-release@' + '1.0.2',
|
|
301
301
|
// Release health
|
|
302
302
|
autoSessionTracking: true,
|
|
303
303
|
ignoreErrors: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.1",
|
|
4
4
|
"description": "Ordering UI Admin Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash": "^4.17.20",
|
|
84
84
|
"moment": "^2.29.1",
|
|
85
85
|
"moment-range": "^4.0.2",
|
|
86
|
-
"ordering-components-admin-external": "1.
|
|
86
|
+
"ordering-components-admin-external": "1.27.0",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -3,10 +3,11 @@ import Skeleton from 'react-loading-skeleton'
|
|
|
3
3
|
import { useLanguage, useCustomer } from 'ordering-components-admin-external'
|
|
4
4
|
import { useForm } from 'react-hook-form'
|
|
5
5
|
import parsePhoneNumber from 'libphonenumber-js'
|
|
6
|
-
import { Input, Button, Switch } from '../../../styles'
|
|
6
|
+
import { Input, Button, Switch, DefaultSelect } from '../../../styles'
|
|
7
7
|
import { Alert, InputPhoneNumber } from '../../Shared'
|
|
8
8
|
import { sortInputFields } from '../../../utils'
|
|
9
9
|
import { Eye, EyeSlash } from 'react-bootstrap-icons'
|
|
10
|
+
import { timezones } from '../../../config/constants'
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
13
|
FormInput,
|
|
@@ -14,7 +15,8 @@ import {
|
|
|
14
15
|
SkeletonForm,
|
|
15
16
|
DriverZoneRestrictionWrapper,
|
|
16
17
|
WrapperPassword,
|
|
17
|
-
TogglePassword
|
|
18
|
+
TogglePassword,
|
|
19
|
+
InputWrapper
|
|
18
20
|
} from './styles'
|
|
19
21
|
|
|
20
22
|
export const UserFormDetailsUI = (props) => {
|
|
@@ -43,6 +45,8 @@ export const UserFormDetailsUI = (props) => {
|
|
|
43
45
|
|
|
44
46
|
const [user, setUser] = useState(userData)
|
|
45
47
|
const [passwordSee, setPasswordSee] = useState(false)
|
|
48
|
+
const [timezonesOptions, setTimezonesOptions] = useState([])
|
|
49
|
+
const [timezoneSearchValue, setTimezoneSearchValue] = useState('')
|
|
46
50
|
|
|
47
51
|
useEffect(() => {
|
|
48
52
|
setUser(userData)
|
|
@@ -214,6 +218,18 @@ export const UserFormDetailsUI = (props) => {
|
|
|
214
218
|
}
|
|
215
219
|
}, [user?.id])
|
|
216
220
|
|
|
221
|
+
useEffect(() => {
|
|
222
|
+
const _timezonesOptions = timezones
|
|
223
|
+
.filter(timezone => timezone.toLocaleLowerCase().includes(timezoneSearchValue.toLocaleLowerCase()))
|
|
224
|
+
.map(timezone => {
|
|
225
|
+
return {
|
|
226
|
+
value: timezone,
|
|
227
|
+
content: timezone
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
setTimezonesOptions(_timezonesOptions)
|
|
231
|
+
}, [timezoneSearchValue])
|
|
232
|
+
|
|
217
233
|
return (
|
|
218
234
|
<>
|
|
219
235
|
<FormInput onSubmit={formMethods.handleSubmit(onSubmit)}>
|
|
@@ -257,6 +273,22 @@ export const UserFormDetailsUI = (props) => {
|
|
|
257
273
|
</React.Fragment>
|
|
258
274
|
)
|
|
259
275
|
)}
|
|
276
|
+
{isDriversPage && (
|
|
277
|
+
<InputWrapper isTimezone>
|
|
278
|
+
<DefaultSelect
|
|
279
|
+
placeholder={t('SELECT_TIMEZONE', 'Select a timezone')}
|
|
280
|
+
defaultValue={formState?.changes?.timezone ?? user?.timezone ?? ''}
|
|
281
|
+
options={timezonesOptions}
|
|
282
|
+
onChange={val => handleChangeSwtich('timezone', val)}
|
|
283
|
+
optionInnerMaxHeight='300px'
|
|
284
|
+
isShowSearchBar
|
|
285
|
+
searchBarIsCustomLayout
|
|
286
|
+
searchBarIsNotLazyLoad
|
|
287
|
+
searchValue={timezoneSearchValue}
|
|
288
|
+
handleChangeSearch={setTimezoneSearchValue}
|
|
289
|
+
/>
|
|
290
|
+
</InputWrapper>
|
|
291
|
+
)}
|
|
260
292
|
{!!showInputPhoneNumber && (
|
|
261
293
|
<InputPhoneNumber
|
|
262
294
|
user={user}
|
|
@@ -141,3 +141,30 @@ export const TogglePassword = styled.span`
|
|
|
141
141
|
right: 10px;
|
|
142
142
|
`}
|
|
143
143
|
`
|
|
144
|
+
|
|
145
|
+
export const InputWrapper = styled.div`
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
width: 100%;
|
|
149
|
+
margin-bottom: 20px;
|
|
150
|
+
|
|
151
|
+
.select {
|
|
152
|
+
padding-top: 4px;
|
|
153
|
+
padding-bottom: 4px;
|
|
154
|
+
border: none;
|
|
155
|
+
background-color: ${props => props.theme.colors.secundary};
|
|
156
|
+
font-size: 14px;
|
|
157
|
+
|
|
158
|
+
${({ isTimezone }) => isTimezone && css`
|
|
159
|
+
> div:first-child {
|
|
160
|
+
> div {
|
|
161
|
+
overflow: hidden;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
.list-wrapper {
|
|
165
|
+
font-size: 12px;
|
|
166
|
+
max-height: 220px;
|
|
167
|
+
}
|
|
168
|
+
`}
|
|
169
|
+
}
|
|
170
|
+
`
|
|
@@ -154,6 +154,9 @@ const OrderingWebsiteUI = (props) => {
|
|
|
154
154
|
setCropState({ name: name, data: reader.result, open: true })
|
|
155
155
|
}
|
|
156
156
|
reader.onerror = error => console.log(error)
|
|
157
|
+
logoRef.current.value = null
|
|
158
|
+
backgroundRef.current.value = null
|
|
159
|
+
mobileBackgroundRef.current.value = null
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
162
|
|
|
@@ -46,11 +46,6 @@ export const DeliveriesLocation = (props) => {
|
|
|
46
46
|
const mapRef = useRef(null)
|
|
47
47
|
|
|
48
48
|
const mapFit = () => {
|
|
49
|
-
const _onlineDrivers = driversList.drivers.filter(
|
|
50
|
-
(driver) => driver.enabled && driver.available && !driver.busy
|
|
51
|
-
)
|
|
52
|
-
setActiveDrivers(_onlineDrivers)
|
|
53
|
-
|
|
54
49
|
const bounds = new window.google.maps.LatLngBounds()
|
|
55
50
|
|
|
56
51
|
if (interActionMapOrder === null) {
|
|
@@ -129,6 +124,10 @@ export const DeliveriesLocation = (props) => {
|
|
|
129
124
|
// Fit bounds on mount, and when the markers change
|
|
130
125
|
useEffect(() => {
|
|
131
126
|
if (driversList.loading || driversList.drivers.length === 0 || mapLoaded) return
|
|
127
|
+
const _onlineDrivers = driversList.drivers.filter(
|
|
128
|
+
(driver) => driver.enabled && driver.available && !driver.busy
|
|
129
|
+
)
|
|
130
|
+
setActiveDrivers(_onlineDrivers)
|
|
132
131
|
if (interActionMapOrder !== null) {
|
|
133
132
|
for (const driver of driversList.drivers) {
|
|
134
133
|
if (driver.id === interActionMapOrder?.driver?.id) {
|
|
@@ -146,7 +145,7 @@ export const DeliveriesLocation = (props) => {
|
|
|
146
145
|
}, [interActionMapOrder])
|
|
147
146
|
|
|
148
147
|
const handleMapChange = (data) => {
|
|
149
|
-
if(!data?.zoom) return
|
|
148
|
+
if (!data?.zoom) return
|
|
150
149
|
setMapZoom(data?.zoom)
|
|
151
150
|
}
|
|
152
151
|
|
|
@@ -182,6 +182,13 @@ export const OrderDetailsHeader = (props) => {
|
|
|
182
182
|
</ButtonLink>
|
|
183
183
|
</ButtonGroup>
|
|
184
184
|
</div>
|
|
185
|
+
{order?.external_id && (
|
|
186
|
+
<div>
|
|
187
|
+
<h2>
|
|
188
|
+
{t('EXTERNAL_ID', 'External ID :')} {order?.external_id}
|
|
189
|
+
</h2>
|
|
190
|
+
</div>
|
|
191
|
+
)}
|
|
185
192
|
<p>
|
|
186
193
|
{order?.payment_events?.length > 0 ? (
|
|
187
194
|
order?.payment_events?.filter(item => item.event === 'payment').map((event, i) => (
|
|
@@ -33,6 +33,7 @@ const OrderNotificationUI = (props) => {
|
|
|
33
33
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
34
34
|
|
|
35
35
|
const handleNotification = (order) => {
|
|
36
|
+
if (order?.products?.[0]?.type === 'gift_card') return
|
|
36
37
|
if (customerId && order?.customer_id !== customerId) return
|
|
37
38
|
if (isOnlyDelivery && order?.delivery_type !== 1) return
|
|
38
39
|
const _registerOrderIds = [...registerOrderIds]
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
3
|
+
import { useLanguage, ApiKeysList as ApiKeysListController } from 'ordering-components-admin-external'
|
|
4
|
+
import { Button, IconButton } from '../../../styles'
|
|
5
|
+
import { Alert, Confirm, Modal } from '../../Shared'
|
|
6
|
+
import BsArrowRight from '@meronex/icons/bs/BsArrowRight'
|
|
7
|
+
import { ArrowsAngleContract, ArrowsAngleExpand, XLg } from 'react-bootstrap-icons'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
Header,
|
|
11
|
+
Description,
|
|
12
|
+
CategoryExtraContent,
|
|
13
|
+
Container,
|
|
14
|
+
DescriptionHeader,
|
|
15
|
+
HeaderIcons,
|
|
16
|
+
DoordashConnectContainer,
|
|
17
|
+
Paragraph
|
|
18
|
+
} from './styles'
|
|
19
|
+
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
20
|
+
|
|
21
|
+
const BacCredomaticUI = (props) => {
|
|
22
|
+
const {
|
|
23
|
+
actionState,
|
|
24
|
+
onClose
|
|
25
|
+
} = props
|
|
26
|
+
|
|
27
|
+
const history = useHistory()
|
|
28
|
+
const query = new URLSearchParams(useLocation().search)
|
|
29
|
+
const [, t] = useLanguage()
|
|
30
|
+
const { width } = useWindowSize()
|
|
31
|
+
|
|
32
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
33
|
+
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
34
|
+
const [settingsOpen, setSettingsOpen] = useState(false)
|
|
35
|
+
const [isExpand, setIsExpand] = useState(false)
|
|
36
|
+
|
|
37
|
+
const toggleMainContent = () => {
|
|
38
|
+
if (width <= 500) {
|
|
39
|
+
document.getElementById('catDescription').style.width = '100vw'
|
|
40
|
+
} else {
|
|
41
|
+
if ((settingsOpen) && width >= 1000) {
|
|
42
|
+
document.getElementById('catDescription').style.width = '1000px'
|
|
43
|
+
} else {
|
|
44
|
+
document.getElementById('catDescription').style.width = '500px'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const handleGoToLink = (link) => {
|
|
50
|
+
window.open(link, '_blank')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const expandSidebar = () => {
|
|
54
|
+
const element = document.getElementById('catDescription')
|
|
55
|
+
if (isExpand) element.style.width = '500px'
|
|
56
|
+
else element.style.width = '100vw'
|
|
57
|
+
setIsExpand(prev => !prev)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!actionState?.error) return
|
|
62
|
+
setAlertState({
|
|
63
|
+
open: true,
|
|
64
|
+
content: actionState?.error
|
|
65
|
+
})
|
|
66
|
+
}, [actionState?.error])
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (width < 1000) return
|
|
70
|
+
if (settingsOpen) {
|
|
71
|
+
document.getElementById('catDescription').style.width = '1000px'
|
|
72
|
+
} else {
|
|
73
|
+
toggleMainContent()
|
|
74
|
+
}
|
|
75
|
+
}, [settingsOpen])
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
toggleMainContent()
|
|
79
|
+
}, [width])
|
|
80
|
+
|
|
81
|
+
const handleOpenMore = (isInitialRender) => {
|
|
82
|
+
setSettingsOpen(true)
|
|
83
|
+
if (!isInitialRender) {
|
|
84
|
+
const id = query.get('id')
|
|
85
|
+
history.replace(`${location.pathname}?id=${id}&more=settings`)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const handleCloseDescription = () => {
|
|
90
|
+
setSettingsOpen(false)
|
|
91
|
+
const id = query.get('id')
|
|
92
|
+
history.replace(`${location.pathname}?id=${id}`)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
const more = query.get('more')
|
|
97
|
+
if (more === 'settings') {
|
|
98
|
+
handleOpenMore(true)
|
|
99
|
+
}
|
|
100
|
+
}, [])
|
|
101
|
+
|
|
102
|
+
const DoordashConnectDescription = () => {
|
|
103
|
+
return (
|
|
104
|
+
<CategoryExtraContent>
|
|
105
|
+
<IconButton
|
|
106
|
+
color='black'
|
|
107
|
+
onClick={() => handleCloseDescription()}
|
|
108
|
+
>
|
|
109
|
+
<XLg />
|
|
110
|
+
</IconButton>
|
|
111
|
+
<div>
|
|
112
|
+
<Header>
|
|
113
|
+
<h1>{t('MORE_INFO', 'More Info')}</h1>
|
|
114
|
+
</Header>
|
|
115
|
+
<Paragraph>
|
|
116
|
+
<h3>{t('SUPPORT', 'Support')}</h3>
|
|
117
|
+
<p>
|
|
118
|
+
{t('BAC_CREDOMATIC_CONNECT_SUPPORT', 'Are you having trouble connecting this')}
|
|
119
|
+
</p>
|
|
120
|
+
<p>
|
|
121
|
+
<a onClick={() => handleGoToLink(t('BAC_CREDOMATIC_CONNECT_SUPPORT_LINK', 'https://www.ordering.co/contact-ordering'))}>{t('CONTACT_US', 'Contact us')}</a>; <span>{t('WE_ARE_HAPPY_TO_HELP', 'we are happy to help.')}</span>
|
|
122
|
+
</p>
|
|
123
|
+
</Paragraph>
|
|
124
|
+
</div>
|
|
125
|
+
</CategoryExtraContent>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<Container
|
|
131
|
+
id='catDescription'
|
|
132
|
+
>
|
|
133
|
+
<DoordashConnectContainer>
|
|
134
|
+
<DescriptionHeader>
|
|
135
|
+
<HeaderIcons>
|
|
136
|
+
{width > 576 && !settingsOpen && (
|
|
137
|
+
<IconButton
|
|
138
|
+
color='black'
|
|
139
|
+
onClick={expandSidebar}
|
|
140
|
+
>
|
|
141
|
+
{isExpand ? <ArrowsAngleContract /> : <ArrowsAngleExpand />}
|
|
142
|
+
</IconButton>
|
|
143
|
+
)}
|
|
144
|
+
<IconButton
|
|
145
|
+
color='black'
|
|
146
|
+
onClick={onClose}
|
|
147
|
+
>
|
|
148
|
+
<XLg />
|
|
149
|
+
</IconButton>
|
|
150
|
+
</HeaderIcons>
|
|
151
|
+
</DescriptionHeader>
|
|
152
|
+
<Header>
|
|
153
|
+
<h1>{t('BAC_CREDOMATIC', 'BAC Credomatic')}</h1>
|
|
154
|
+
</Header>
|
|
155
|
+
<Description>
|
|
156
|
+
{t('CONNECT_WITH_BAC_CREDOMATIC_DESCRIPTION', 'BAC Credomatic is a financial group in Central America, with operations in Guatemala, El Salvador, Honduras, Nicaragua, Costa Rica , Panama, Grand Cayman, The Bahamas, and the United States.')}
|
|
157
|
+
</Description>
|
|
158
|
+
<Button color='primary' borderRadius='8px' className='all-setting' onClick={() => handleOpenMore()}>
|
|
159
|
+
<span>{t('SETTINGS', 'All settings')}</span>
|
|
160
|
+
<BsArrowRight />
|
|
161
|
+
</Button>
|
|
162
|
+
</DoordashConnectContainer>
|
|
163
|
+
{settingsOpen && (
|
|
164
|
+
<>
|
|
165
|
+
{width >= 1000 ? (
|
|
166
|
+
<DoordashConnectDescription />
|
|
167
|
+
) : (
|
|
168
|
+
<>
|
|
169
|
+
<Modal
|
|
170
|
+
width='70%'
|
|
171
|
+
height='90vh'
|
|
172
|
+
open
|
|
173
|
+
padding='0px'
|
|
174
|
+
onClose={() => setSettingsOpen(false)}
|
|
175
|
+
hideCloseDefault
|
|
176
|
+
>
|
|
177
|
+
<DoordashConnectDescription />
|
|
178
|
+
</Modal>
|
|
179
|
+
</>
|
|
180
|
+
)}
|
|
181
|
+
</>
|
|
182
|
+
)}
|
|
183
|
+
<Alert
|
|
184
|
+
title={t('WEB_APPNAME', 'Ordering')}
|
|
185
|
+
content={alertState.content}
|
|
186
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
187
|
+
open={alertState.open}
|
|
188
|
+
onClose={() => setAlertState({ open: false, content: [] })}
|
|
189
|
+
onAccept={() => setAlertState({ open: false, content: [] })}
|
|
190
|
+
closeOnBackdrop={false}
|
|
191
|
+
/>
|
|
192
|
+
<Confirm
|
|
193
|
+
title={t('WEB_APPNAME', 'Ordering')}
|
|
194
|
+
content={confirm.content}
|
|
195
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
196
|
+
open={confirm.open}
|
|
197
|
+
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
198
|
+
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
199
|
+
onAccept={confirm.handleOnAccept}
|
|
200
|
+
closeOnBackdrop={false}
|
|
201
|
+
/>
|
|
202
|
+
</Container>
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export const BacCredomatic = (props) => {
|
|
207
|
+
const bacCredomaticProps = {
|
|
208
|
+
...props,
|
|
209
|
+
UIComponent: BacCredomaticUI
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return <ApiKeysListController {...bacCredomaticProps} />
|
|
213
|
+
}
|