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
package/_modules/index.js
CHANGED
|
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "Alert", {
|
|
|
39
39
|
return _Shared.Alert;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "AllInOne", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _Orders.AllInOne;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
42
48
|
Object.defineProperty(exports, "AnalyticsAvailableTimes", {
|
|
43
49
|
enumerable: true,
|
|
44
50
|
get: function get() {
|
package/_modules/utils/index.js
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.widgetURL = exports.verifyDecimals = exports.stringToSlug = exports.sortInputFields = exports.shape = exports.setStorageItem = exports.scrollTo = exports.ribbonValues = exports.reviewCommentList = exports.removeStorageItem = exports.orderRejectCommentList = exports.optimizeImage = exports.getUniqueId = exports.getStorageItem = exports.getStarWidth = exports.getSeconds = exports.getOrderStatus = exports.getOrderStatuPickUp = exports.getMinutes = exports.getIconCard = exports.getHours = exports.getCurrentDiffDays = exports.getAgoMinutes = exports.formatUrlVideo = exports.formatSeconds = exports.firstLetterCapital = exports.findExitingCode = exports.fieldsToSort = exports.convertHoursToMinutes = exports.convertHMS = exports.checkValidUrlFormat = exports.checkSiteUrl = exports.checkPreSiteUrl = exports.capitalize = exports.bytesConverter = exports.DriverTipsOptions = void 0;
|
|
6
|
+
exports.widgetURL = exports.verifyDecimals = exports.stringToSlug = exports.sortInputFields = exports.shape = exports.setStorageItem = exports.scrollTo = exports.ribbonValues = exports.reviewCommentList = exports.removeStorageItem = exports.orderRejectCommentList = exports.optimizeImage = exports.getUniqueId = exports.getStorageItem = exports.getStarWidth = exports.getSeconds = exports.getOrderStatus = exports.getOrderStatuPickUp = exports.getMinutes = exports.getLocale = exports.getIconCard = exports.getHours = exports.getCurrenySymbol = exports.getCurrentDiffDays = exports.getAgoMinutes = exports.formatUrlVideo = exports.formatSeconds = exports.firstLetterCapital = exports.findExitingCode = exports.fieldsToSort = exports.convertHoursToMinutes = exports.convertHMS = exports.checkValidUrlFormat = exports.checkSiteUrl = exports.checkPreSiteUrl = exports.capitalize = exports.bytesConverter = exports.DriverTipsOptions = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _FaCcMastercard = _interopRequireDefault(require("@meronex/icons/fa/FaCcMastercard"));
|
|
9
9
|
var _FaCcVisa = _interopRequireDefault(require("@meronex/icons/fa/FaCcVisa"));
|
|
10
10
|
var _FaCreditCard = _interopRequireDefault(require("@meronex/icons/fa/FaCreditCard"));
|
|
11
11
|
var _moment = _interopRequireDefault(require("moment"));
|
|
12
12
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
13
|
+
var _currency = require("../config/currency.js");
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
15
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
15
16
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
@@ -170,9 +171,26 @@ var bytesConverter = function bytesConverter(bytes) {
|
|
|
170
171
|
};
|
|
171
172
|
|
|
172
173
|
/**
|
|
173
|
-
*
|
|
174
|
+
* Function to get language settins by language code
|
|
175
|
+
* @param {string} code // language code
|
|
176
|
+
* @param {any} locales // language settings
|
|
174
177
|
*/
|
|
175
178
|
exports.bytesConverter = bytesConverter;
|
|
179
|
+
var getLocale = function getLocale(code, locales) {
|
|
180
|
+
var locale = locales === null || locales === void 0 ? void 0 : locales[code];
|
|
181
|
+
if (code === 'es-419-1' || code === 'es-419-2') locale = locales === null || locales === void 0 ? void 0 : locales.es;
|
|
182
|
+
if (code === 'zh-CN') locale = locales === null || locales === void 0 ? void 0 : locales.zhCN;
|
|
183
|
+
if (code === 'ar') locale = locales === null || locales === void 0 ? void 0 : locales.arSA;
|
|
184
|
+
if (code === 'kn') locale = locales === null || locales === void 0 ? void 0 : locales.ta;
|
|
185
|
+
if (code === 'km') locale = locales === null || locales === void 0 ? void 0 : locales.th;
|
|
186
|
+
if (!locale) return locales === null || locales === void 0 ? void 0 : locales.enUS;
|
|
187
|
+
return locale;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* List of fields with correct order
|
|
192
|
+
*/
|
|
193
|
+
exports.getLocale = getLocale;
|
|
176
194
|
var fieldsToSort = ['name', 'middle_name', 'lastname', 'second_lastname', 'email'];
|
|
177
195
|
|
|
178
196
|
/**
|
|
@@ -816,4 +834,9 @@ var stringToSlug = function stringToSlug(str) {
|
|
|
816
834
|
|
|
817
835
|
return str;
|
|
818
836
|
};
|
|
819
|
-
exports.stringToSlug = stringToSlug;
|
|
837
|
+
exports.stringToSlug = stringToSlug;
|
|
838
|
+
var getCurrenySymbol = function getCurrenySymbol(code) {
|
|
839
|
+
var _CURRENCY$code$symbol, _CURRENCY$code;
|
|
840
|
+
return (_CURRENCY$code$symbol = _currency.CURRENCY === null || _currency.CURRENCY === void 0 ? void 0 : (_CURRENCY$code = _currency.CURRENCY[code]) === null || _CURRENCY$code === void 0 ? void 0 : _CURRENCY$code.symbol) !== null && _CURRENCY$code$symbol !== void 0 ? _CURRENCY$code$symbol : code;
|
|
841
|
+
};
|
|
842
|
+
exports.getCurrenySymbol = getCurrenySymbol;
|
package/index-template.js
CHANGED
|
@@ -283,6 +283,11 @@ import dinerWare from './template/assets/images/pos/diner-ware.png'
|
|
|
283
283
|
import digitalDining from './template/assets/images/pos/digital-dining.png'
|
|
284
284
|
import foodTec from './template/assets/images/pos/food-tec.png'
|
|
285
285
|
|
|
286
|
+
// preview
|
|
287
|
+
import marketplace from './template/assets/images/preview/marketplace.png'
|
|
288
|
+
import franchise from './template/assets/images/preview/franchise.png'
|
|
289
|
+
import singleStore from './template/assets/images/preview/single-store.png'
|
|
290
|
+
|
|
286
291
|
import { AutologinParams } from './template/components/AutologinParams'
|
|
287
292
|
|
|
288
293
|
if (!(window?.location?.hostname === 'localhost')) {
|
|
@@ -613,6 +618,11 @@ theme.images = {
|
|
|
613
618
|
tutorials: {
|
|
614
619
|
businessTutorial1: businessTutorial1,
|
|
615
620
|
businessTutorial2: businessTutorial2
|
|
621
|
+
},
|
|
622
|
+
preview: {
|
|
623
|
+
marketplace,
|
|
624
|
+
franchise,
|
|
625
|
+
singleStore
|
|
616
626
|
}
|
|
617
627
|
}
|
|
618
628
|
theme.sounds = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
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.26.0",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"react-datepicker": "^3.7.0",
|
|
96
96
|
"react-helmet": "^6.1.0",
|
|
97
97
|
"react-hook-form": "^6.11.3",
|
|
98
|
+
"react-hubspot-form": "^1.3.7",
|
|
98
99
|
"react-loading-skeleton": "^2.1.1",
|
|
99
100
|
"react-numeric-input": "^2.2.3",
|
|
100
101
|
"react-otp-input": "^2.4.0",
|
|
@@ -7,6 +7,8 @@ import 'react-date-range/dist/theme/default.css'
|
|
|
7
7
|
import { Calendar4 } from 'react-bootstrap-icons'
|
|
8
8
|
import { Button } from '../../../styles'
|
|
9
9
|
import { AnalyticsCalendarContainer } from './styles'
|
|
10
|
+
import * as locales from 'react-date-range/dist/locale'
|
|
11
|
+
import { getLocale } from '../../../utils'
|
|
10
12
|
|
|
11
13
|
export const AnalyticsCalendar = (props) => {
|
|
12
14
|
const {
|
|
@@ -15,7 +17,8 @@ export const AnalyticsCalendar = (props) => {
|
|
|
15
17
|
leftAlign
|
|
16
18
|
} = props
|
|
17
19
|
|
|
18
|
-
const [, t] = useLanguage()
|
|
20
|
+
const [state, t] = useLanguage()
|
|
21
|
+
|
|
19
22
|
const [dateRange, setDateRange] = useState([
|
|
20
23
|
{
|
|
21
24
|
startDate: null,
|
|
@@ -85,9 +88,12 @@ export const AnalyticsCalendar = (props) => {
|
|
|
85
88
|
<AnalyticsCalendarContainer className='ordering-calendar' ref={calendarRef} leftAlign={leftAlign}>
|
|
86
89
|
<DateRange
|
|
87
90
|
editableDateInputs
|
|
91
|
+
locale={getLocale(state?.language?.code, locales)}
|
|
88
92
|
onChange={item => handleChangeDates(item)}
|
|
89
93
|
moveRangeOnFirstSelection={false}
|
|
90
94
|
ranges={dateRange}
|
|
95
|
+
startDatePlaceholder={t('EARLY', 'Early')}
|
|
96
|
+
endDatePlaceholder={t('CONTINUOUS', 'Continuous')}
|
|
91
97
|
/>
|
|
92
98
|
</AnalyticsCalendarContainer>
|
|
93
99
|
)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
|
+
import { Circle, RecordCircleFill } from 'react-bootstrap-icons'
|
|
4
|
+
import { DriversGroupOrders } from '../../DriversGroupOrders'
|
|
5
|
+
import { DriversGroupAutoassign } from '../../DriversGroupAutoassign'
|
|
6
|
+
import { DriversMarkAsBusy } from '../../DriversMarkAsBusy'
|
|
7
|
+
import { Checkbox } from '../../../../styles'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
LogisticsContainer,
|
|
11
|
+
OrderStatusWrapper,
|
|
12
|
+
RadioButton,
|
|
13
|
+
SubSectionContainer,
|
|
14
|
+
CheckboxContainer,
|
|
15
|
+
HeaderWrapper
|
|
16
|
+
} from './styles'
|
|
17
|
+
|
|
18
|
+
export const AdvancedLogisticsForm = (props) => {
|
|
19
|
+
const {
|
|
20
|
+
driversGroupState,
|
|
21
|
+
changesState,
|
|
22
|
+
handleChangesState
|
|
23
|
+
} = props
|
|
24
|
+
|
|
25
|
+
const [, t] = useLanguage()
|
|
26
|
+
const [useAdvanced, setUseAdvanced] = useState(false)
|
|
27
|
+
|
|
28
|
+
const handleLogistic = (checked) => {
|
|
29
|
+
setUseAdvanced(checked)
|
|
30
|
+
if (checked) return
|
|
31
|
+
const changes = {
|
|
32
|
+
autoassign_amount_drivers: 0,
|
|
33
|
+
orders_group_max_orders: 0
|
|
34
|
+
}
|
|
35
|
+
handleChangesState(changes)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<LogisticsContainer>
|
|
40
|
+
<HeaderWrapper>
|
|
41
|
+
<h2>{t('ADVANCED_LOGISTICS', 'Advanced logistics')}</h2>
|
|
42
|
+
<CheckboxContainer>
|
|
43
|
+
<Checkbox
|
|
44
|
+
checked={useAdvanced}
|
|
45
|
+
onChange={e => handleLogistic(e.target.checked)}
|
|
46
|
+
/>
|
|
47
|
+
<p>{t('USE_ADVANCED_LOGISTIC', 'Use advanced logistic')}</p>
|
|
48
|
+
</CheckboxContainer>
|
|
49
|
+
</HeaderWrapper>
|
|
50
|
+
{useAdvanced && (
|
|
51
|
+
<>
|
|
52
|
+
<OrderStatusWrapper
|
|
53
|
+
onClick={() => handleChangesState({ orders_group_start_in_status: 7 })}
|
|
54
|
+
>
|
|
55
|
+
<RadioButton
|
|
56
|
+
active={
|
|
57
|
+
(changesState?.orders_group_start_in_status && changesState?.orders_group_start_in_status === 7) ||
|
|
58
|
+
(typeof changesState?.orders_group_start_in_status === 'undefined' && driversGroupState.driversGroup?.orders_group_start_in_status === 7)
|
|
59
|
+
}
|
|
60
|
+
>
|
|
61
|
+
{
|
|
62
|
+
((changesState?.orders_group_start_in_status && changesState?.orders_group_start_in_status === 7) ||
|
|
63
|
+
(typeof changesState?.orders_group_start_in_status === 'undefined' && driversGroupState.driversGroup?.orders_group_start_in_status === 7)
|
|
64
|
+
)
|
|
65
|
+
? (
|
|
66
|
+
<RecordCircleFill />
|
|
67
|
+
) : (
|
|
68
|
+
<Circle />
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
</RadioButton>
|
|
72
|
+
<span>{t('ACCEPT_BY_BUSINESS', 'Accepted by Business.')}</span>
|
|
73
|
+
</OrderStatusWrapper>
|
|
74
|
+
<OrderStatusWrapper
|
|
75
|
+
onClick={() => handleChangesState({ orders_group_start_in_status: 4 })}
|
|
76
|
+
>
|
|
77
|
+
<RadioButton
|
|
78
|
+
active={
|
|
79
|
+
(changesState?.orders_group_start_in_status && changesState?.orders_group_start_in_status === 4) ||
|
|
80
|
+
(typeof changesState?.orders_group_start_in_status === 'undefined' && driversGroupState.driversGroup?.orders_group_start_in_status === 4)
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
{
|
|
84
|
+
((changesState?.orders_group_start_in_status && changesState?.orders_group_start_in_status === 4) ||
|
|
85
|
+
(typeof changesState?.orders_group_start_in_status === 'undefined' && driversGroupState.driversGroup?.orders_group_start_in_status === 4)
|
|
86
|
+
)
|
|
87
|
+
? (
|
|
88
|
+
<RecordCircleFill />
|
|
89
|
+
) : (
|
|
90
|
+
<Circle />
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
</RadioButton>
|
|
94
|
+
<span>{t('PREPARATION_COMPLETED', 'Preparation Completed')}</span>
|
|
95
|
+
</OrderStatusWrapper>
|
|
96
|
+
{(changesState?.type === 0) && (
|
|
97
|
+
<SubSectionContainer>
|
|
98
|
+
<DriversGroupOrders {...props} />
|
|
99
|
+
</SubSectionContainer>
|
|
100
|
+
)}
|
|
101
|
+
<SubSectionContainer>
|
|
102
|
+
<DriversGroupAutoassign {...props} />
|
|
103
|
+
</SubSectionContainer>
|
|
104
|
+
{changesState?.type === 0 && (
|
|
105
|
+
<SubSectionContainer>
|
|
106
|
+
<DriversMarkAsBusy {...props} />
|
|
107
|
+
</SubSectionContainer>
|
|
108
|
+
)}
|
|
109
|
+
</>
|
|
110
|
+
)}
|
|
111
|
+
</LogisticsContainer>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const LogisticsContainer = styled.div``
|
|
4
|
+
|
|
5
|
+
export const OrderStatusWrapper = styled.div`
|
|
6
|
+
padding: 15px 0;
|
|
7
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
|
|
12
|
+
> span {
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
${props => props.theme?.rtl ? css`
|
|
15
|
+
margin-right: 15px;
|
|
16
|
+
` : css`
|
|
17
|
+
margin-left: 15px;
|
|
18
|
+
`}
|
|
19
|
+
}
|
|
20
|
+
`
|
|
21
|
+
|
|
22
|
+
export const RadioButton = styled.div`
|
|
23
|
+
svg {
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
color: ${props => props.theme.colors.secundaryLight};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
${({ active }) => active && css`
|
|
29
|
+
svg {
|
|
30
|
+
color: ${props => props.theme.colors.primary};
|
|
31
|
+
}
|
|
32
|
+
`}
|
|
33
|
+
`
|
|
34
|
+
export const SubSectionContainer = styled.div`
|
|
35
|
+
margin: 45px 0;
|
|
36
|
+
> div {
|
|
37
|
+
padding: 0;
|
|
38
|
+
h1 {
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
line-height: 21px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`
|
|
45
|
+
export const CheckboxContainer = styled.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
margin: 0 0 29px 0;
|
|
49
|
+
|
|
50
|
+
p {
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
margin: 0px;
|
|
53
|
+
${props => props.theme?.rtl ? css`
|
|
54
|
+
padding-right: 10px;
|
|
55
|
+
` : css`
|
|
56
|
+
padding-left: 10px;
|
|
57
|
+
`}
|
|
58
|
+
}
|
|
59
|
+
`
|
|
60
|
+
export const HeaderWrapper = styled.div`
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
flex-wrap: wrap;
|
|
64
|
+
|
|
65
|
+
h2 {
|
|
66
|
+
${props => props.theme?.rtl ? css`
|
|
67
|
+
padding-left: 16px;
|
|
68
|
+
` : css`
|
|
69
|
+
padding-right: 16px;
|
|
70
|
+
`}
|
|
71
|
+
}
|
|
72
|
+
`
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
|
+
|
|
4
|
+
import { Checkbox, Button } from '../../../../styles'
|
|
5
|
+
import { SearchBar } from '../../../Shared'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Container,
|
|
9
|
+
SearchBarWrapper,
|
|
10
|
+
ButtonGroup,
|
|
11
|
+
BusinessesContainer,
|
|
12
|
+
BusinessWrapper,
|
|
13
|
+
WrapperImage,
|
|
14
|
+
Image
|
|
15
|
+
} from './styles'
|
|
16
|
+
|
|
17
|
+
export const BusinessesForm = (props) => {
|
|
18
|
+
const {
|
|
19
|
+
businesses,
|
|
20
|
+
handleSelectBusiness,
|
|
21
|
+
actionState,
|
|
22
|
+
handleSelectAllBusiness,
|
|
23
|
+
selectedBusinessIds
|
|
24
|
+
} = props
|
|
25
|
+
|
|
26
|
+
const [, t] = useLanguage()
|
|
27
|
+
const [searchValue, setSearchValue] = useState(null)
|
|
28
|
+
const [filteredBusinesses, setFilteredBusinesses] = useState([])
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
let _filteredBusinesses = []
|
|
32
|
+
if (searchValue) {
|
|
33
|
+
_filteredBusinesses = businesses.filter(business => business?.name?.toLowerCase().includes(searchValue?.toLowerCase()))
|
|
34
|
+
} else {
|
|
35
|
+
_filteredBusinesses = [...businesses]
|
|
36
|
+
}
|
|
37
|
+
setFilteredBusinesses(_filteredBusinesses)
|
|
38
|
+
}, [searchValue])
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Container>
|
|
42
|
+
<h2>{t('BUSINESSES', 'Businesses')}</h2>
|
|
43
|
+
<SearchBarWrapper>
|
|
44
|
+
<SearchBar
|
|
45
|
+
placeholder={t('SEARCH', 'Search')}
|
|
46
|
+
isCustomLayout
|
|
47
|
+
lazyLoad
|
|
48
|
+
search={searchValue}
|
|
49
|
+
onSearch={val => setSearchValue(val)}
|
|
50
|
+
/>
|
|
51
|
+
</SearchBarWrapper>
|
|
52
|
+
<ButtonGroup>
|
|
53
|
+
<Button
|
|
54
|
+
type='button'
|
|
55
|
+
color='secundaryDark'
|
|
56
|
+
onClick={() => handleSelectAllBusiness(true)}
|
|
57
|
+
>
|
|
58
|
+
{t('SELECT_ALL', 'Select all')}
|
|
59
|
+
</Button>
|
|
60
|
+
<Button
|
|
61
|
+
type='button'
|
|
62
|
+
color='secundaryDark'
|
|
63
|
+
onClick={() => handleSelectAllBusiness(false)}
|
|
64
|
+
>
|
|
65
|
+
{t('SELECT_NONE', 'Select none')}
|
|
66
|
+
</Button>
|
|
67
|
+
</ButtonGroup>
|
|
68
|
+
<BusinessesContainer>
|
|
69
|
+
{filteredBusinesses.map(business => (
|
|
70
|
+
<BusinessWrapper
|
|
71
|
+
key={business.id}
|
|
72
|
+
isDisabed={actionState.loading}
|
|
73
|
+
>
|
|
74
|
+
<Checkbox
|
|
75
|
+
checked={selectedBusinessIds.includes(business.id)}
|
|
76
|
+
onChange={e => handleSelectBusiness(business.id, e.target.checked)}
|
|
77
|
+
/>
|
|
78
|
+
<WrapperImage>
|
|
79
|
+
<Image bgimage={business?.logo} alt='logo' />
|
|
80
|
+
</WrapperImage>
|
|
81
|
+
<p>{business?.name}</p>
|
|
82
|
+
</BusinessWrapper>
|
|
83
|
+
))}
|
|
84
|
+
</BusinessesContainer>
|
|
85
|
+
</Container>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styled, { css } from 'styled-components'
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div``
|
|
5
|
+
|
|
6
|
+
export const SearchBarWrapper = styled.div`
|
|
7
|
+
margin-bottom: 10px;
|
|
8
|
+
`
|
|
9
|
+
|
|
10
|
+
export const ButtonGroup = styled.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
margin-bottom: 20px;
|
|
14
|
+
button:first-child {
|
|
15
|
+
${props => props.theme?.rtl ? css`
|
|
16
|
+
margin-left: 7px;
|
|
17
|
+
` : css`
|
|
18
|
+
margin-right: 7px;
|
|
19
|
+
`}
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
|
|
23
|
+
export const BusinessesContainer = styled.div`
|
|
24
|
+
max-height: 610px;
|
|
25
|
+
overflow: auto;
|
|
26
|
+
`
|
|
27
|
+
|
|
28
|
+
export const BusinessWrapper = styled.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
padding: 10px 0;
|
|
32
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
33
|
+
|
|
34
|
+
p {
|
|
35
|
+
margin: 0px;
|
|
36
|
+
font-size: 12px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
${({ isDisabed }) => isDisabed && css`
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
`}
|
|
42
|
+
`
|
|
43
|
+
|
|
44
|
+
export const WrapperImage = styled.div`
|
|
45
|
+
max-width: 40px;
|
|
46
|
+
max-height: 40px;
|
|
47
|
+
height: 40px;
|
|
48
|
+
width: 40px;
|
|
49
|
+
${({ isSkeleton }) => !isSkeleton && css`
|
|
50
|
+
border: 1px solid #E3E3E3;
|
|
51
|
+
`}
|
|
52
|
+
border-radius: 8px;
|
|
53
|
+
|
|
54
|
+
svg {
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
padding: 7px;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
border-radius: 50%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
margin: 0 10px;
|
|
63
|
+
`
|
|
64
|
+
|
|
65
|
+
const ImageStyled = styled.div`
|
|
66
|
+
display: flex;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
position: relative;
|
|
71
|
+
background-repeat: no-repeat, repeat;
|
|
72
|
+
background-size: cover;
|
|
73
|
+
object-fit: cover;
|
|
74
|
+
background-position: center;
|
|
75
|
+
border-radius: 8px;
|
|
76
|
+
`
|
|
77
|
+
|
|
78
|
+
export const Image = (props) => {
|
|
79
|
+
return (
|
|
80
|
+
<ImageStyled
|
|
81
|
+
{...props}
|
|
82
|
+
style={{ backgroundImage: `url(${props.bgimage})` }}
|
|
83
|
+
>
|
|
84
|
+
{props.children}
|
|
85
|
+
</ImageStyled>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useLanguage, useSession } from 'ordering-components-admin-external'
|
|
3
|
+
import { useFormContext } from 'react-hook-form'
|
|
4
|
+
import { Input, SecondSelect as DefaultSelect } from '../../../../styles'
|
|
5
|
+
import { DriversGroupDrivers } from '../../DriversGroupDrivers'
|
|
6
|
+
import { DriversGroupCompanies } from '../../DriversGroupCompanies'
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Container,
|
|
10
|
+
InputWrapper
|
|
11
|
+
} from './styles'
|
|
12
|
+
|
|
13
|
+
export const GeneralForm = (props) => {
|
|
14
|
+
const {
|
|
15
|
+
driversManagers,
|
|
16
|
+
changesState,
|
|
17
|
+
handleChangesState
|
|
18
|
+
} = props
|
|
19
|
+
|
|
20
|
+
const [, t] = useLanguage()
|
|
21
|
+
const { register } = useFormContext()
|
|
22
|
+
const [{ user }] = useSession()
|
|
23
|
+
|
|
24
|
+
const typeOptions = [
|
|
25
|
+
{ value: 0, content: t('IN_HOUSE_DRIVERS', 'In house drivers') },
|
|
26
|
+
{ value: 1, content: t('DRIVER_COMPANIES', 'Driver companies') }
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
const driversManagersOptions = driversManagers.map(manager => {
|
|
30
|
+
return {
|
|
31
|
+
value: manager.id,
|
|
32
|
+
content: <div>{manager?.name} {manager?.lastname}</div>
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const priorityOptions = [
|
|
37
|
+
{ value: -1, content: t('LOW', 'Low') },
|
|
38
|
+
{ value: 0, content: t('NORMAL', 'Normal') },
|
|
39
|
+
{ value: 1, content: t('HIGH', 'High') },
|
|
40
|
+
{ value: 2, content: t('URGENT', 'Urgent') }
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Container>
|
|
45
|
+
<h2>{t('GENERAL', 'General')}</h2>
|
|
46
|
+
<InputWrapper>
|
|
47
|
+
<label>{t('NAME', 'Name')}</label>
|
|
48
|
+
<Input
|
|
49
|
+
name='name'
|
|
50
|
+
defaultValue={changesState?.name ?? ''}
|
|
51
|
+
onChange={e => handleChangesState({ name: e.target.value })}
|
|
52
|
+
placeholder={t('NAME', 'Name')}
|
|
53
|
+
ref={register({
|
|
54
|
+
required: t(
|
|
55
|
+
'VALIDATION_ERROR_REQUIRED',
|
|
56
|
+
'Project is required'
|
|
57
|
+
).replace('_attribute_', t('NAME', 'Name'))
|
|
58
|
+
})}
|
|
59
|
+
autoComplete='off'
|
|
60
|
+
/>
|
|
61
|
+
</InputWrapper>
|
|
62
|
+
{user?.level !== 5 && (
|
|
63
|
+
<InputWrapper>
|
|
64
|
+
<label>{t('DRIVER_MANAGER', 'Driver manager')}</label>
|
|
65
|
+
<DefaultSelect
|
|
66
|
+
isSecondIcon
|
|
67
|
+
placeholder={t('SELECT_MANAGER', 'Select driver manager')}
|
|
68
|
+
options={driversManagersOptions}
|
|
69
|
+
defaultValue={changesState?.administrator_id}
|
|
70
|
+
optionInnerMaxHeight='60vh'
|
|
71
|
+
onChange={val => handleChangesState({ administrator_id: val })}
|
|
72
|
+
/>
|
|
73
|
+
</InputWrapper>
|
|
74
|
+
)}
|
|
75
|
+
<InputWrapper>
|
|
76
|
+
<label>{t('TYPE', 'Type')}</label>
|
|
77
|
+
<DefaultSelect
|
|
78
|
+
isSecondIcon
|
|
79
|
+
placeholder={t('SELECT_TYPE', 'Select type')}
|
|
80
|
+
options={typeOptions}
|
|
81
|
+
defaultValue={changesState?.type}
|
|
82
|
+
onChange={val => handleChangesState({ type: val })}
|
|
83
|
+
/>
|
|
84
|
+
</InputWrapper>
|
|
85
|
+
|
|
86
|
+
{
|
|
87
|
+
(changesState?.type === 0)
|
|
88
|
+
? <DriversGroupDrivers {...props} />
|
|
89
|
+
: <DriversGroupCompanies {...props} />
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
<InputWrapper>
|
|
93
|
+
<label>{t('PRIORITY', 'Priority')}</label>
|
|
94
|
+
<DefaultSelect
|
|
95
|
+
isSecondIcon
|
|
96
|
+
placeholder={t('SELECT_PRIORITY', 'Select priority')}
|
|
97
|
+
options={priorityOptions}
|
|
98
|
+
defaultValue={changesState?.priority}
|
|
99
|
+
onChange={val => handleChangesState({ priority: val })}
|
|
100
|
+
/>
|
|
101
|
+
</InputWrapper>
|
|
102
|
+
</Container>
|
|
103
|
+
)
|
|
104
|
+
}
|