ordering-ui-admin-external 1.35.6 → 1.36.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/{ordering-ui-admin.96b9c2dbf6ae132b2099.js → ordering-ui-admin.6fdb2672f967b8414891.js} +2 -2
- package/_modules/components/BusinessIntelligence/AnalyticsAvailableTimes/index.js +3 -2
- package/_modules/components/BusinessIntelligence/AnalyticsBusyTimes/index.js +3 -2
- package/_modules/components/BusinessIntelligence/AnalyticsCustomerSatisfaction/index.js +2 -1
- package/_modules/components/BusinessIntelligence/AnalyticsDriverOrders/index.js +3 -2
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersAcceptSpend/index.js +2 -1
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersOrSales/index.js +3 -2
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersStatus/index.js +3 -2
- package/_modules/components/BusinessIntelligence/AnalyticsProductCategories/index.js +2 -1
- package/_modules/components/BusinessIntelligence/AnalyticsRegisterUsers/index.js +3 -2
- package/_modules/components/BusinessIntelligence/AnalyticsSpendList/index.js +2 -1
- package/_modules/components/BusinessIntelligence/AnalyticsSpendTimes/index.js +3 -2
- package/_modules/components/BusinessIntelligence/AnalyticsTopOrders/index.js +2 -1
- package/_modules/components/BusinessIntelligence/DriverAnalytics/index.js +1 -1
- package/_modules/components/BusinessIntelligence/GraphLoadingMessage/index.js +24 -0
- package/_modules/components/BusinessIntelligence/GraphLoadingMessage/styles.js +14 -0
- package/_modules/components/Home/HomePage/index.js +10 -1
- package/_modules/components/Home/HomePage/styles.js +7 -3
- package/_modules/components/Marketing/CampaignDetail/index.js +16 -10
- package/_modules/components/Marketing/CampaignDetail/styles.js +5 -3
- package/_modules/components/Marketing/CampaignDetailGeneral/index.js +64 -6
- package/_modules/components/Marketing/CampaignDetailGeneral/styles.js +38 -26
- package/_modules/components/Marketing/CampaignEmail/index.js +13 -19
- package/_modules/components/Marketing/CampaignEmail/styles.js +6 -4
- package/_modules/components/Marketing/CampaignList/index.js +56 -5
- package/_modules/components/Marketing/CampaignListing/index.js +1 -1
- package/_modules/components/Marketing/CampaignNotification/index.js +7 -1
- package/_modules/components/Marketing/CampaignNotification/styles.js +5 -3
- package/_modules/components/Marketing/CampaignSMS/index.js +7 -1
- package/_modules/components/Marketing/CampaignSMS/styles.js +5 -3
- package/_modules/components/Marketing/CampaignUsersList/index.js +7 -4
- package/_modules/components/Marketing/index.js +0 -7
- package/_modules/components/Orders/AllInOne/DriversManager/index.js +10 -7
- package/_modules/components/Orders/AllInOne/index.js +45 -32
- package/_modules/components/Orders/CreateCustomOrder/index.js +4 -1
- package/_modules/components/Orders/DriverMapMarkerAndInfo/index.js +2 -4
- package/_modules/components/Orders/DriversLocation/index.js +47 -34
- package/_modules/components/Orders/OrderContactInformation/index.js +2 -1
- package/_modules/components/Orders/OrderDetails/styles.js +16 -8
- package/_modules/components/Orders/OrderDetailsHeader/index.js +1 -1
- package/_modules/components/Orders/OrderStatusTypeSelector/index.js +36 -0
- package/_modules/components/Stores/BusinessPaymentMethods/index.js +5 -1
- package/_modules/components/Stores/ChildMapplingList/index.js +3 -10
- package/_modules/components/Stores/ImporterForm/index.js +2 -1
- package/_modules/components/Stores/PaymentOption/index.js +31 -6
- package/_modules/components/Stores/PaymentOption/styles.js +5 -3
- package/_modules/components/Stores/PaymentOptionSquare/index.js +26 -4
- package/_modules/components/Stores/PaymentOptionSquare/styles.js +5 -3
- package/_modules/components/Stores/ProductDetailsAdvanced/index.js +1 -1
- package/_modules/index.js +0 -6
- package/index-template.js +1 -1
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/AnalyticsAvailableTimes/index.js +5 -1
- package/src/components/BusinessIntelligence/AnalyticsBusyTimes/index.js +5 -1
- package/src/components/BusinessIntelligence/AnalyticsCustomerSatisfaction/index.js +2 -0
- package/src/components/BusinessIntelligence/AnalyticsDriverOrders/index.js +5 -1
- package/src/components/BusinessIntelligence/AnalyticsOrdersAcceptSpend/index.js +2 -0
- package/src/components/BusinessIntelligence/AnalyticsOrdersOrSales/index.js +5 -1
- package/src/components/BusinessIntelligence/AnalyticsOrdersStatus/index.js +5 -1
- package/src/components/BusinessIntelligence/AnalyticsProductCategories/index.js +2 -0
- package/src/components/BusinessIntelligence/AnalyticsRegisterUsers/index.js +5 -1
- package/src/components/BusinessIntelligence/AnalyticsSpendList/index.js +2 -0
- package/src/components/BusinessIntelligence/AnalyticsSpendTimes/index.js +5 -1
- package/src/components/BusinessIntelligence/AnalyticsTopOrders/index.js +2 -0
- package/src/components/BusinessIntelligence/DriverAnalytics/index.js +1 -1
- package/src/components/BusinessIntelligence/GraphLoadingMessage/index.js +15 -0
- package/src/components/BusinessIntelligence/GraphLoadingMessage/styles.js +20 -0
- package/src/components/Home/HomePage/index.js +12 -1
- package/src/components/Home/HomePage/styles.js +29 -0
- package/src/components/Marketing/CampaignDetail/index.js +20 -5
- package/src/components/Marketing/CampaignDetail/styles.js +16 -0
- package/src/components/Marketing/CampaignDetailGeneral/index.js +47 -2
- package/src/components/Marketing/CampaignDetailGeneral/styles.js +55 -0
- package/src/components/Marketing/CampaignEmail/index.js +82 -92
- package/src/components/Marketing/CampaignEmail/styles.js +17 -0
- package/src/components/Marketing/CampaignList/index.js +49 -2
- package/src/components/Marketing/CampaignListing/index.js +1 -1
- package/src/components/Marketing/CampaignNotification/index.js +6 -1
- package/src/components/Marketing/CampaignNotification/styles.js +16 -0
- package/src/components/Marketing/CampaignSMS/index.js +6 -1
- package/src/components/Marketing/CampaignSMS/styles.js +16 -0
- package/src/components/Marketing/CampaignUsersList/index.js +16 -7
- package/src/components/Marketing/index.js +0 -2
- package/src/components/Orders/AllInOne/DriversManager/index.js +9 -2
- package/src/components/Orders/AllInOne/index.js +8 -1
- package/src/components/Orders/CreateCustomOrder/index.js +11 -8
- package/src/components/Orders/DriverMapMarkerAndInfo/index.js +3 -3
- package/src/components/Orders/DriversLocation/index.js +57 -30
- package/src/components/Orders/OrderContactInformation/index.js +2 -2
- package/src/components/Orders/OrderDetails/styles.js +6 -2
- package/src/components/Orders/OrderDetailsHeader/index.js +10 -0
- package/src/components/Orders/OrderStatusTypeSelector/index.js +30 -0
- package/src/components/Stores/BusinessPaymentMethods/index.js +4 -0
- package/src/components/Stores/ChildMapplingList/index.js +1 -7
- package/src/components/Stores/ImporterForm/index.js +2 -1
- package/src/components/Stores/PaymentOption/index.js +41 -4
- package/src/components/Stores/PaymentOption/styles.js +4 -0
- package/src/components/Stores/PaymentOptionSquare/index.js +31 -1
- package/src/components/Stores/PaymentOptionSquare/styles.js +4 -0
- package/src/components/Stores/ProductDetailsAdvanced/index.js +1 -1
- package/src/index.js +0 -2
- package/_modules/components/Marketing/CampaignDetailContent/index.js +0 -128
- package/_modules/components/Marketing/CampaignDetailContent/styles.js +0 -24
- package/src/components/Marketing/CampaignDetailContent/index.js +0 -105
- package/src/components/Marketing/CampaignDetailContent/styles.js +0 -58
- /package/_bundles/{ordering-ui-admin.96b9c2dbf6ae132b2099.js.LICENSE.txt → ordering-ui-admin.6fdb2672f967b8414891.js.LICENSE.txt} +0 -0
|
@@ -230,7 +230,7 @@ const ProductDetailsAdvancedUI = (props) => {
|
|
|
230
230
|
})
|
|
231
231
|
}
|
|
232
232
|
if (formState?.changes?.minimum_per_order && formState?.changes?.maximum_per_order && !(formState?.changes?.maximum_per_order === null || formState?.changes?.maximum_per_order === '0')) {
|
|
233
|
-
if ((Number(formState?.changes?.minimum_per_order)
|
|
233
|
+
if ((Number(formState?.changes?.minimum_per_order) > Number(formState?.changes?.maximum_per_order))) {
|
|
234
234
|
valid = false
|
|
235
235
|
setAlertState({
|
|
236
236
|
open: true,
|
package/src/index.js
CHANGED
|
@@ -163,7 +163,6 @@ import {
|
|
|
163
163
|
CampaignHeader,
|
|
164
164
|
CampaignList,
|
|
165
165
|
CampaignDetailGeneral,
|
|
166
|
-
CampaignDetailContent,
|
|
167
166
|
CampaignAmountOption,
|
|
168
167
|
CampaignSignUpOption,
|
|
169
168
|
CampaignEmail,
|
|
@@ -581,7 +580,6 @@ export {
|
|
|
581
580
|
CampaignHeader,
|
|
582
581
|
CampaignList,
|
|
583
582
|
CampaignDetailGeneral,
|
|
584
|
-
CampaignDetailContent,
|
|
585
583
|
CampaignAmountOption,
|
|
586
584
|
CampaignSignUpOption,
|
|
587
585
|
CampaignEmail,
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.CampaignDetailContent = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
|
-
var _FirstSelect = require("../../../styles/Select/FirstSelect");
|
|
11
|
-
var _CampaignEmail = require("../CampaignEmail");
|
|
12
|
-
var _CampaignSMS = require("../CampaignSMS");
|
|
13
|
-
var _CampaignWhatsapp = require("../CampaignWhatsapp");
|
|
14
|
-
var _CampaignNotification = require("../CampaignNotification");
|
|
15
|
-
var _CampaignPopup = require("../CampaignPopup");
|
|
16
|
-
var _CampaignWebHook = require("../CampaignWebHook");
|
|
17
|
-
var _Shared = require("../../Shared");
|
|
18
|
-
var _styles = require("./styles");
|
|
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); }
|
|
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; }
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
25
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
26
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
30
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
31
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
32
|
-
var CampaignDetailContentUI = function CampaignDetailContentUI(props) {
|
|
33
|
-
var _contactState$changes, _contactState$changes2, _contactState$changes3, _contactState$changes4, _contactState$changes5, _contactState$changes6, _contactState$changes7;
|
|
34
|
-
var handleChangeType = props.handleChangeType,
|
|
35
|
-
contactState = props.contactState,
|
|
36
|
-
isAddMode = props.isAddMode;
|
|
37
|
-
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
38
|
-
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
39
|
-
t = _useLanguage2[1];
|
|
40
|
-
var _useState = (0, _react.useState)(null),
|
|
41
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
-
typeOptions = _useState2[0],
|
|
43
|
-
setTypeOptions = _useState2[1];
|
|
44
|
-
var _useState3 = (0, _react.useState)(''),
|
|
45
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
46
|
-
contactTypeSearchVal = _useState4[0],
|
|
47
|
-
setContactTypeSearchVal = _useState4[1];
|
|
48
|
-
var _useState5 = (0, _react.useState)({
|
|
49
|
-
open: false,
|
|
50
|
-
content: []
|
|
51
|
-
}),
|
|
52
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
53
|
-
alertState = _useState6[0],
|
|
54
|
-
setAlertState = _useState6[1];
|
|
55
|
-
var typeList = [{
|
|
56
|
-
value: 'email',
|
|
57
|
-
content: /*#__PURE__*/_react.default.createElement(_styles.Option, null, t('EMAIL', 'Email'))
|
|
58
|
-
}, {
|
|
59
|
-
value: 'sms',
|
|
60
|
-
content: /*#__PURE__*/_react.default.createElement(_styles.Option, null, t('SMS', 'SMS'))
|
|
61
|
-
}, {
|
|
62
|
-
value: 'notification',
|
|
63
|
-
content: /*#__PURE__*/_react.default.createElement(_styles.Option, null, t('PUSH_NOTIFICATIONS', 'Push notifications'))
|
|
64
|
-
}, {
|
|
65
|
-
value: 'webhook',
|
|
66
|
-
content: /*#__PURE__*/_react.default.createElement(_styles.Option, null, t('WEBHOOK', 'Webhook'))
|
|
67
|
-
}
|
|
68
|
-
// { value: 'popup', content: <Option>{t('POPUP', 'Popup')}</Option> },
|
|
69
|
-
// { value: 'whatsapp', content: <Option>{t('WHATSAPP', 'Whatsapp')}</Option> }
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
var closeAlert = function closeAlert() {
|
|
73
|
-
setAlertState({
|
|
74
|
-
open: false,
|
|
75
|
-
content: []
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
(0, _react.useEffect)(function () {
|
|
79
|
-
var options = typeList.filter(function (option) {
|
|
80
|
-
return option === null || option === void 0 ? void 0 : option.value.toLocaleLowerCase().includes(contactTypeSearchVal.toLocaleLowerCase());
|
|
81
|
-
});
|
|
82
|
-
setTypeOptions(options);
|
|
83
|
-
}, [contactTypeSearchVal]);
|
|
84
|
-
(0, _react.useEffect)(function () {
|
|
85
|
-
if (!(contactState !== null && contactState !== void 0 && contactState.error) || contactState.loading) return;
|
|
86
|
-
setAlertState({
|
|
87
|
-
open: true,
|
|
88
|
-
content: contactState === null || contactState === void 0 ? void 0 : contactState.error
|
|
89
|
-
});
|
|
90
|
-
}, [contactState === null || contactState === void 0 ? void 0 : contactState.error]);
|
|
91
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement(_styles.SelectWrapper, null, /*#__PURE__*/_react.default.createElement("label", null, t('CONTACT_TYPE', 'Contact type')), /*#__PURE__*/_react.default.createElement(_FirstSelect.Select, {
|
|
92
|
-
options: typeOptions,
|
|
93
|
-
className: "select",
|
|
94
|
-
defaultValue: (contactState === null || contactState === void 0 || (_contactState$changes = contactState.changes) === null || _contactState$changes === void 0 ? void 0 : _contactState$changes.contact_type) || '',
|
|
95
|
-
placeholder: t('SELECT_OPTION', 'Select an option'),
|
|
96
|
-
onChange: function onChange(value) {
|
|
97
|
-
return handleChangeType('contact_type', value);
|
|
98
|
-
}
|
|
99
|
-
// isShowSearchBar
|
|
100
|
-
,
|
|
101
|
-
searchBarIsCustomLayout: true,
|
|
102
|
-
searchBarIsNotLazyLoad: true,
|
|
103
|
-
isDisabled: !isAddMode,
|
|
104
|
-
searchValue: contactTypeSearchVal,
|
|
105
|
-
handleChangeSearch: function handleChangeSearch(val) {
|
|
106
|
-
return setContactTypeSearchVal(val);
|
|
107
|
-
}
|
|
108
|
-
})), (contactState === null || contactState === void 0 || (_contactState$changes2 = contactState.changes) === null || _contactState$changes2 === void 0 ? void 0 : _contactState$changes2.contact_type) === 'email' && /*#__PURE__*/_react.default.createElement(_CampaignEmail.CampaignEmail, props), (contactState === null || contactState === void 0 || (_contactState$changes3 = contactState.changes) === null || _contactState$changes3 === void 0 ? void 0 : _contactState$changes3.contact_type) === 'sms' && /*#__PURE__*/_react.default.createElement(_CampaignSMS.CampaignSMS, props), (contactState === null || contactState === void 0 || (_contactState$changes4 = contactState.changes) === null || _contactState$changes4 === void 0 ? void 0 : _contactState$changes4.contact_type) === 'whatsapp' && /*#__PURE__*/_react.default.createElement(_CampaignWhatsapp.CampaignWhatsapp, props), (contactState === null || contactState === void 0 || (_contactState$changes5 = contactState.changes) === null || _contactState$changes5 === void 0 ? void 0 : _contactState$changes5.contact_type) === 'notification' && /*#__PURE__*/_react.default.createElement(_CampaignNotification.CampaignNotification, props), (contactState === null || contactState === void 0 || (_contactState$changes6 = contactState.changes) === null || _contactState$changes6 === void 0 ? void 0 : _contactState$changes6.contact_type) === 'popup' && /*#__PURE__*/_react.default.createElement(_CampaignPopup.CampaignPopup, props), (contactState === null || contactState === void 0 || (_contactState$changes7 = contactState.changes) === null || _contactState$changes7 === void 0 ? void 0 : _contactState$changes7.contact_type) === 'webhook' && /*#__PURE__*/_react.default.createElement(_CampaignWebHook.CampaignWebHook, props)), /*#__PURE__*/_react.default.createElement(_Shared.Alert, {
|
|
109
|
-
title: t('CAMPAIGN', 'Campaign'),
|
|
110
|
-
content: alertState.content,
|
|
111
|
-
acceptText: t('ACCEPT', 'Accept'),
|
|
112
|
-
open: alertState.open,
|
|
113
|
-
onClose: function onClose() {
|
|
114
|
-
return closeAlert();
|
|
115
|
-
},
|
|
116
|
-
onAccept: function onAccept() {
|
|
117
|
-
return closeAlert();
|
|
118
|
-
},
|
|
119
|
-
closeOnBackdrop: false
|
|
120
|
-
}));
|
|
121
|
-
};
|
|
122
|
-
var CampaignDetailContent = function CampaignDetailContent(props) {
|
|
123
|
-
var campaignDetailContentProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
124
|
-
UIComponent: CampaignDetailContentUI
|
|
125
|
-
});
|
|
126
|
-
return /*#__PURE__*/_react.default.createElement(_orderingComponentsAdminExternal.CampaignDetailContent, campaignDetailContentProps);
|
|
127
|
-
};
|
|
128
|
-
exports.CampaignDetailContent = CampaignDetailContent;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SelectWrapper = exports.Option = exports.Container = void 0;
|
|
7
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
|
|
12
|
-
exports.Container = Container;
|
|
13
|
-
var SelectWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-bottom: 25px;\n\n label {\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n margin-bottom: 10px;\n }\n\n > div {\n width: 100%;\n border: none;\n\n > div:first-child {\n background-color: ", ";\n height: 43px;\n border: none;\n border-radius: 7.6px;\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ", ";\n }\n .list {\n background-color: ", ";\n border: none;\n \n .search-bar-container {\n padding: 10px;\n input {\n background-color: transparent;\n height: 44px;\n }\n }\n\n .list-wrapper {\n > div {\n padding: 6px 10px;\n &:hover {\n background-color: #f2f5f7;\n }\n }\n }\n }\n }\n"])), function (props) {
|
|
14
|
-
return props.theme.colors.secundary;
|
|
15
|
-
}, function (props) {
|
|
16
|
-
return props.theme.colors.secundaryContrast;
|
|
17
|
-
}, function (props) {
|
|
18
|
-
return props.theme.colors.secundary;
|
|
19
|
-
});
|
|
20
|
-
exports.SelectWrapper = SelectWrapper;
|
|
21
|
-
var Option = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ", ";\n"])), function (props) {
|
|
22
|
-
return props.theme.colors.secundaryContrast;
|
|
23
|
-
});
|
|
24
|
-
exports.Option = Option;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { useLanguage, CampaignDetailContent as CampaignDetailContentController } from 'ordering-components-admin-external'
|
|
3
|
-
import { Select } from '../../../styles/Select/FirstSelect'
|
|
4
|
-
import { CampaignEmail } from '../CampaignEmail'
|
|
5
|
-
import { CampaignSMS } from '../CampaignSMS'
|
|
6
|
-
import { CampaignWhatsapp } from '../CampaignWhatsapp'
|
|
7
|
-
import { CampaignNotification } from '../CampaignNotification'
|
|
8
|
-
import { CampaignPopup } from '../CampaignPopup'
|
|
9
|
-
import { CampaignWebHook } from '../CampaignWebHook'
|
|
10
|
-
import { Alert } from '../../Shared'
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
Container,
|
|
14
|
-
SelectWrapper,
|
|
15
|
-
Option
|
|
16
|
-
} from './styles'
|
|
17
|
-
|
|
18
|
-
const CampaignDetailContentUI = (props) => {
|
|
19
|
-
const {
|
|
20
|
-
handleChangeType,
|
|
21
|
-
contactState,
|
|
22
|
-
isAddMode
|
|
23
|
-
} = props
|
|
24
|
-
|
|
25
|
-
const [, t] = useLanguage()
|
|
26
|
-
const [typeOptions, setTypeOptions] = useState(null)
|
|
27
|
-
const [contactTypeSearchVal, setContactTypeSearchVal] = useState('')
|
|
28
|
-
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
29
|
-
|
|
30
|
-
const typeList = [
|
|
31
|
-
{ value: 'email', content: <Option>{t('EMAIL', 'Email')}</Option> },
|
|
32
|
-
{ value: 'sms', content: <Option>{t('SMS', 'SMS')}</Option> },
|
|
33
|
-
{ value: 'notification', content: <Option>{t('PUSH_NOTIFICATIONS', 'Push notifications')}</Option> },
|
|
34
|
-
{ value: 'webhook', content: <Option>{t('WEBHOOK', 'Webhook')}</Option> }
|
|
35
|
-
// { value: 'popup', content: <Option>{t('POPUP', 'Popup')}</Option> },
|
|
36
|
-
// { value: 'whatsapp', content: <Option>{t('WHATSAPP', 'Whatsapp')}</Option> }
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
const closeAlert = () => {
|
|
40
|
-
setAlertState({
|
|
41
|
-
open: false,
|
|
42
|
-
content: []
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
const options = typeList.filter(option => option?.value.toLocaleLowerCase().includes(contactTypeSearchVal.toLocaleLowerCase()))
|
|
48
|
-
setTypeOptions(options)
|
|
49
|
-
}, [contactTypeSearchVal])
|
|
50
|
-
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (!contactState?.error || contactState.loading) return
|
|
53
|
-
setAlertState({
|
|
54
|
-
open: true,
|
|
55
|
-
content: contactState?.error
|
|
56
|
-
})
|
|
57
|
-
}, [contactState?.error])
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<>
|
|
61
|
-
<Container>
|
|
62
|
-
<SelectWrapper>
|
|
63
|
-
<label>{t('CONTACT_TYPE', 'Contact type')}</label>
|
|
64
|
-
<Select
|
|
65
|
-
options={typeOptions}
|
|
66
|
-
className='select'
|
|
67
|
-
defaultValue={contactState?.changes?.contact_type || ''}
|
|
68
|
-
placeholder={t('SELECT_OPTION', 'Select an option')}
|
|
69
|
-
onChange={(value) => handleChangeType('contact_type', value)}
|
|
70
|
-
// isShowSearchBar
|
|
71
|
-
searchBarIsCustomLayout
|
|
72
|
-
searchBarIsNotLazyLoad
|
|
73
|
-
isDisabled={!isAddMode}
|
|
74
|
-
searchValue={contactTypeSearchVal}
|
|
75
|
-
handleChangeSearch={(val) => setContactTypeSearchVal(val)}
|
|
76
|
-
/>
|
|
77
|
-
</SelectWrapper>
|
|
78
|
-
|
|
79
|
-
{contactState?.changes?.contact_type === 'email' && <CampaignEmail {...props} />}
|
|
80
|
-
{contactState?.changes?.contact_type === 'sms' && <CampaignSMS {...props} />}
|
|
81
|
-
{contactState?.changes?.contact_type === 'whatsapp' && <CampaignWhatsapp {...props} />}
|
|
82
|
-
{contactState?.changes?.contact_type === 'notification' && <CampaignNotification {...props} />}
|
|
83
|
-
{contactState?.changes?.contact_type === 'popup' && <CampaignPopup {...props} />}
|
|
84
|
-
{contactState?.changes?.contact_type === 'webhook' && <CampaignWebHook {...props} />}
|
|
85
|
-
</Container>
|
|
86
|
-
<Alert
|
|
87
|
-
title={t('CAMPAIGN', 'Campaign')}
|
|
88
|
-
content={alertState.content}
|
|
89
|
-
acceptText={t('ACCEPT', 'Accept')}
|
|
90
|
-
open={alertState.open}
|
|
91
|
-
onClose={() => closeAlert()}
|
|
92
|
-
onAccept={() => closeAlert()}
|
|
93
|
-
closeOnBackdrop={false}
|
|
94
|
-
/>
|
|
95
|
-
</>
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export const CampaignDetailContent = (props) => {
|
|
100
|
-
const campaignDetailContentProps = {
|
|
101
|
-
...props,
|
|
102
|
-
UIComponent: CampaignDetailContentUI
|
|
103
|
-
}
|
|
104
|
-
return <CampaignDetailContentController {...campaignDetailContentProps} />
|
|
105
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components'
|
|
2
|
-
|
|
3
|
-
export const Container = styled.div``
|
|
4
|
-
|
|
5
|
-
export const SelectWrapper = styled.div`
|
|
6
|
-
margin-bottom: 25px;
|
|
7
|
-
|
|
8
|
-
label {
|
|
9
|
-
font-weight: 400;
|
|
10
|
-
font-size: 14px;
|
|
11
|
-
line-height: 24px;
|
|
12
|
-
margin-bottom: 10px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
> div {
|
|
16
|
-
width: 100%;
|
|
17
|
-
border: none;
|
|
18
|
-
|
|
19
|
-
> div:first-child {
|
|
20
|
-
background-color: ${props => props.theme.colors.secundary};
|
|
21
|
-
height: 43px;
|
|
22
|
-
border: none;
|
|
23
|
-
border-radius: 7.6px;
|
|
24
|
-
font-weight: 400;
|
|
25
|
-
font-size: 14px;
|
|
26
|
-
line-height: 24px;
|
|
27
|
-
color: ${props => props.theme.colors.secundaryContrast};
|
|
28
|
-
}
|
|
29
|
-
.list {
|
|
30
|
-
background-color: ${props => props.theme.colors.secundary};
|
|
31
|
-
border: none;
|
|
32
|
-
|
|
33
|
-
.search-bar-container {
|
|
34
|
-
padding: 10px;
|
|
35
|
-
input {
|
|
36
|
-
background-color: transparent;
|
|
37
|
-
height: 44px;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.list-wrapper {
|
|
42
|
-
> div {
|
|
43
|
-
padding: 6px 10px;
|
|
44
|
-
&:hover {
|
|
45
|
-
background-color: #f2f5f7;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
`
|
|
52
|
-
|
|
53
|
-
export const Option = styled.div`
|
|
54
|
-
font-weight: 400;
|
|
55
|
-
font-size: 14px;
|
|
56
|
-
line-height: 24px;
|
|
57
|
-
color: ${props => props.theme.colors.secundaryContrast};
|
|
58
|
-
`
|