ordering-ui-admin-external 1.3.7 → 1.4.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.c4c95a935a61dabfd053.js → ordering-ui-admin.cfc8aeb7e1a4b36cfd23.js} +2 -2
- package/_bundles/{ordering-ui-admin.c4c95a935a61dabfd053.js.LICENSE.txt → ordering-ui-admin.cfc8aeb7e1a4b36cfd23.js.LICENSE.txt} +0 -0
- package/_modules/components/Marketing/EnterprisePromotionDetails/index.js +28 -1
- package/_modules/components/Settings/IntegrationListing/index.js +65 -6
- package/_modules/components/Settings/LanguageSetting/index.js +3 -2
- package/_modules/components/Settings/LanguageSetting/styles.js +12 -3
- package/_modules/components/Settings/Settings/index.js +29 -9
- package/_modules/components/Settings/Settings/styles.js +46 -3
- package/_modules/components/Settings/SettingsDetail/styles.js +1 -1
- package/_modules/components/Settings/SettingsList/index.js +7 -4
- package/_modules/components/Shared/SelectLoyaltyLevels/index.js +153 -0
- package/_modules/components/Shared/SelectLoyaltyLevels/styles.js +46 -0
- package/_modules/components/Shared/SelectSites/index.js +4 -3
- package/_modules/components/Shared/SelectUsers/index.js +130 -0
- package/_modules/components/Shared/SelectUsers/styles.js +40 -0
- package/_modules/components/Shared/index.js +16 -0
- package/_modules/components/SidebarMenu/index.js +10 -5
- package/_modules/components/Stores/BusinessOrderingChannels/index.js +41 -33
- package/_modules/components/Stores/BusinessOrderingChannels/styles.js +38 -17
- package/_modules/components/Stores/BusinessProductsListing/index.js +2 -1
- package/_modules/components/Stores/BusinessWidgets/index.js +108 -0
- package/_modules/components/Stores/BusinessWidgets/styles.js +40 -0
- package/_modules/components/Stores/EditTaxManager/index.js +77 -14
- package/_modules/components/Stores/ProductDetails/index.js +4 -2
- package/_modules/components/Stores/ProductDetailsAdvanced/index.js +1 -2
- package/_modules/components/Stores/ProductMainDetails/index.js +4 -2
- package/_modules/components/Stores/SeoOptions/index.js +34 -2
- package/_modules/components/Stores/SeoOptions/styles.js +9 -3
- package/_modules/components/Stores/index.js +8 -0
- package/_modules/index.js +6 -0
- package/_modules/utils/index.js +4 -2
- package/package.json +2 -2
- package/src/components/Marketing/EnterprisePromotionDetails/index.js +32 -2
- package/src/components/Marketing/EnterprisePromotionListing/index.js +1 -1
- package/src/components/Settings/IntegrationListing/index.js +50 -8
- package/src/components/Settings/LanguageSetting/index.js +5 -3
- package/src/components/Settings/LanguageSetting/styles.js +10 -0
- package/src/components/Settings/Settings/index.js +41 -6
- package/src/components/Settings/Settings/styles.js +112 -0
- package/src/components/Settings/SettingsDetail/styles.js +1 -1
- package/src/components/Settings/SettingsList/index.js +5 -4
- package/src/components/Shared/SelectLoyaltyLevels/index.js +106 -0
- package/src/components/Shared/SelectLoyaltyLevels/styles.js +41 -0
- package/src/components/Shared/SelectSites/index.js +3 -2
- package/src/components/Shared/SelectUsers/index.js +106 -0
- package/src/components/Shared/SelectUsers/styles.js +33 -0
- package/src/components/Shared/index.js +4 -0
- package/src/components/SidebarMenu/index.js +12 -6
- package/src/components/Stores/BusinessOrderingChannels/index.js +44 -46
- package/src/components/Stores/BusinessOrderingChannels/styles.js +30 -15
- package/src/components/Stores/BusinessProductsListing/index.js +1 -0
- package/src/components/Stores/BusinessWidgets/index.js +117 -0
- package/src/components/Stores/BusinessWidgets/styles.js +53 -0
- package/src/components/Stores/EditTaxManager/index.js +60 -13
- package/src/components/Stores/ProductDetails/index.js +3 -1
- package/src/components/Stores/ProductDetailsAdvanced/index.js +0 -1
- package/src/components/Stores/ProductMainDetails/index.js +3 -1
- package/src/components/Stores/SeoOptions/index.js +37 -4
- package/src/components/Stores/SeoOptions/styles.js +22 -0
- package/src/components/Stores/index.js +2 -0
- package/src/index.js +2 -0
- package/src/utils/index.js +2 -0
- package/template/app.js +4 -0
- package/template/components/ListenPageChanges/index.js +3 -2
- package/template/helmetdata.json +9 -2
- package/template/pages/BasicSettings/index.js +1 -1
- package/template/pages/OperationSettings/index.js +1 -1
- package/template/pages/PluginSettings/index.js +16 -0
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.BusinessWidgets = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
13
|
+
|
|
14
|
+
var _Select = require("../../../styles/Select");
|
|
15
|
+
|
|
16
|
+
var _styledComponents = require("styled-components");
|
|
17
|
+
|
|
18
|
+
var _utils = require("../../../utils");
|
|
19
|
+
|
|
20
|
+
var _styles = require("./styles");
|
|
21
|
+
|
|
22
|
+
var _styles2 = require("../../../styles");
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
29
|
+
|
|
30
|
+
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."); }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
37
|
+
|
|
38
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
|
+
|
|
40
|
+
var BusinessWidgets = function BusinessWidgets(props) {
|
|
41
|
+
var business = props.business;
|
|
42
|
+
|
|
43
|
+
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
44
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
45
|
+
t = _useLanguage2[1];
|
|
46
|
+
|
|
47
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
48
|
+
|
|
49
|
+
var _useState = (0, _react.useState)('modal'),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
selectedType = _useState2[0],
|
|
52
|
+
setSelectedType = _useState2[1];
|
|
53
|
+
|
|
54
|
+
var modalTypes = [{
|
|
55
|
+
value: 'modal',
|
|
56
|
+
content: t('TYPE_MODAL_POPUP', 'Button with modal style')
|
|
57
|
+
}, {
|
|
58
|
+
value: 'chat',
|
|
59
|
+
content: t('TYPE_MODAL_CHAT', 'Chat style integration')
|
|
60
|
+
}];
|
|
61
|
+
var url = "".concat(_utils.widgetURL).concat(business === null || business === void 0 ? void 0 : business.slug);
|
|
62
|
+
var color = theme.colors.primary;
|
|
63
|
+
var widgetPopup = '<script type="text/javascript">window.onload=function(){function e(e,t){return!0===e||!1===e?e:t}function t(){return!!(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))}"undefined"==typeof orderingSettings&&(orderingSettings={});var i=orderingSettings,o=e(i.openOnMobile,!1),n=e(i.openOnDesktop,!1),s=!1,l=document.createElement("div");l.id="ordering_bot",l.style.height=0,l.style.width=0,l.style.position="fixed",l.style.right="20%",l.style.left="20%",l.style.top="7%",l.style.bottom="7%",l.style.borderRadius="5px",l.style.overflow="hidden",l.style.zIndex=99999,l.style.maxheight=window.innerHeight+"px",l.style["-webkit-transition"]="height 0.5s, width 0.5s",l.style["-moz-transition"]="height 0.5s, width 0.5s",l.style["-ms-transition"]="height 0.5s, width 0.5s",l.style["-o-transition"]="height 0.5s, width 0.5s",l.style.transition="height 0.5s, width 0.5s",l.style["-webkit-overflow-scrolling"]="touch",l.style["overflow-y"]="scroll",l.style.boxShadow="0 0 20px 0 #999";var r={insideIframe:!1};document.addEventListener("scroll",function(e){r.insideIframe&&(e.preventDefault(),window.scrollTo(0,0))});var d=document.createElement("div");d.style.height="40px",d.style.background="#ccc",d.style.width="100%",d.style.position="absolute";var a=document.createElement("div");a.style.height="40px",a.style.width="40px",a.style.float="right",a.style.fontSize="28px",a.style.lineHeight="25px",a.style.padding="5px",a.style.textAlign="center",a.style.boxSizing="border-box",a.style.color="#666",a.style.borderLeft="1px solid #bbb",a.style.cursor="pointer",a.innerHTML="×",d.appendChild(a);var h=document.createElement("iframe");function y(){s?(l.style.height="auto",l.style.width="auto",window.innerWidth<=480?(l.style.right=0,l.style.left=0,l.style.top=0,l.style.bottom=0,l.style.borderRadius=0):(window.innerWidth>480&&window.innerWidth<600?(l.style.left="10%",l.style.right="10%"):(l.style.left="20%",l.style.right="20%"),l.style.top="7%",l.style.bottom="7%",l.style.borderRadius="5px")):(l.style.height="0px",l.style.width="0px")}h.id="ordering_iframe",h.src="' + url + '",h.style.border=0,h.style.height="100%",h.style.width="100%",h.style.maxWidth="none",h.style.paddingTop="40px",h.style.boxSizing="border-box",h.style["-webkit-overflow-scrolling"]="touch",l.appendChild(d),l.appendChild(h),document.getElementsByTagName("body")[0].appendChild(l),window.toggleOrderingWidget=function(){(s=!s)?(t()&&(r.insideIframe=!0,document.body.style.overflow="hidden",document.body.style.height=window.innerHeight-150+"px"),r.insideIframe=!0,r.scrollX=window.scrollX,r.scrollY=window.scrollY,t()||(document.body.style.overflow="hidden")):(t()&&(r.insideIframe=!1,document.body.style.overflow="auto",document.body.style.height="auto"),r.insideIframe=!1,t()||(document.body.style.overflow="auto")),y()},y(),window.onresize=y,(t()&&o&&!(navigator.userAgent.match(/iPad/i)||(navigator.userAgent.match(/iPhone/i)||void 0))||!t()&&n)&&toggleOrderingWidget(),a.addEventListener("click",toggleOrderingWidget)};</script>';
|
|
64
|
+
var widgetBot = '<script type="text/javascript">window.onload=function(){function e(e,t){return e===!0||e===!1||void 0!=e||null!=e?e:t}function t(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)?!0:!1}function n(){return navigator.userAgent.match(/iPad/i)?"iPad":navigator.userAgent.match(/iPhone/i)?"iPhone":void 0}function i(){h=!h,h?(t()&&(w.insideIframe=!0,document.body.style.overflow="hidden",document.body.style.height=window.innerHeight-150+"px"),g.innerHTML=p.outerHTML):(t()&&(w.insideIframe=!1,document.body.style.overflow="auto",document.body.style.height="auto"),g.innerHTML=c.outerHTML),o(m)}function o(e){e.style.height=s(),e.style.width=r(),window.innerWidth<=480&&(e.style.top=0,e.style.left=0,e.style.right=0,e.style.bottom=0)}function s(){if(h){if(window.innerWidth<=480)return"100%";var e=window.innerHeight-70-10-20;return (e>570&&y.type=="chat")?"570px":e+"px"}return"0px"}function r(){return h?window.innerWidth<=480?"100%":"chat"==y.type?"370px":window.innerWidth-40+"px":"0px"}function l(){console.log("onresize"),window.innerWidth<=480?(m.style.position="fixed",m.style.bottom=0,m.style.right=0,m.style.borderRadius=0,f.style.display="block"):(m.style.position="fixed",m.style.bottom="80px",m.style.right="20px",m.style.borderRadius="10px",f.style.display="none"),m.style.height=s(),m.style.width=r()}var d="' + url + '";"undefined"==typeof orderingSettings&&(orderingSettings={});var a=orderingSettings,y={openOnMobile:e(a.openOnMobile,!1),openOnDesktop:e(a.openOnDesktop,!1),type:e(a.type,"chat")},h=!1,g=document.createElement("div"),c=document.createElement("img");c.src=d.split("/")[0]+"//"+d.split("/")[2]+"/templates/web/img/icon.png",c.style.width="30px",c.style.marginTop="9px",c.style.maxWidth="none";var p=document.createElement("div");p.innerHTML="×",p.style.display="block",p.style.color="#fff",p.style.font="Arial",p.style.fontSize="30px",p.style.margin="0 5px",p.style.borderRadius="50px",p.style.width="40px",p.style.height="40px",p.style.lineHeight="47px",p.style.fontWeight="400",g.style.position="fixed",g.style.bottom="20px",g.style.right="20px",g.style.width="50px",g.style.height="50px",g.style.background="' + color + '",g.style.borderRadius="50px",g.style.textAlign="center",g.style.cursor="pointer",g.style.outline="none",g.style.border=0,g.style.zIndex=99999,g.appendChild(c);var m=document.createElement("div");m.id="ordering_bot",m.style.height=0,m.style.width=0,m.style.position="fixed",m.style.bottom="80px",m.style.right="20px",m.style.borderRadius="10px",m.style.overflow="hidden",m.style.zIndex=99999,m.style.maxheight=window.innerHeight+"px",m.style["-webkit-transition"]="height 0.5s, width 0.5s",m.style["-moz-transition"]="height 0.5s, width 0.5s",m.style["-ms-transition"]="height 0.5s, width 0.5s",m.style["-o-transition"]="height 0.5s, width 0.5s",m.style.transition="height 0.5s, width 0.5s";var u=document.createElement("iframe");u.id="ordering_bot_iframe",u.src=d,u.setAttribute("allow", "geolocation"),u.style.border=0,u.style.height="125%",u.style.width="125%",u.style.maxWidth="none",u.style["-ms-zoom"]="0.8",u.style["-moz-transform"]="scale(0.8)",u.style["-moz-transform-origin"]="0 0",u.style["-o-transform"]="scale(0.8)",u.style["-o-transform-origin"]="0 0",u.style["-webkit-transform"]="scale(0.8)",u.style["-webkit-transform-origin"]="0 0";var w={insideIframe:!1};m.addEventListener("mouseenter",function(){w.insideIframe=!0,w.scrollX=window.scrollX,w.scrollY=window.scrollY,t()||(document.body.style.overflow="hidden")}),m.addEventListener("mouseleave",function(){w.insideIframe=!1,t()||(document.body.style.overflow="auto")}),document.addEventListener("scroll",function(e){w.insideIframe&&(e.preventDefault(),window.scrollTo(0,0))});var f=document.createElement("div");f.style.position="absolute",f.style.width="35px",f.style.height="35px",f.style.bottom="45px",f.style.left="50%",f.style.lineHeight="36px",f.style.background="transparent",f.style.borderColor="transparent";var x=document.createElement("div");x.innerHTML="×",x.style.position="relative",x.style.left="-50%",x.style.zIndex="999",x.style.width="40px",x.style.height="40px",x.style.background="rgba(0,0,0,0.2)",x.style.textAlign="center",x.style.border=0,x.style.borderRadius="35px",x.style.color="#fff",x.style.fontSize="30px",x.style.outline="none",x.style.cursor="pointer",f.appendChild(x),m.appendChild(f),m.appendChild(u),document.getElementsByTagName("body")[0].appendChild(g),document.getElementsByTagName("body")[0].appendChild(m),window.toggleOrderingWidget=i,g.onclick=i,f.onclick=i,l(),window.onresize=l,(t()&&y.openOnMobile&&!n()||!t()&&y.openOnDesktop)&&i(),setInterval(function(){n()&&window.innerHeight<m.clientHeight&&(u.style.height=.7*window.innerHeight+"px"),n()&&window.innerHeight==m.clientHeight&&(m.style.bottom=0,u.style.height="125%")},2e3)};</script>';
|
|
65
|
+
var widgetInline = '<script type="text/javascript">var orderingInlineSettings = {baseUrl: "/"};</script><script type="text/javascript">window.onload=function(){var i={baseUrl:orderingInlineSettings&&orderingInlineSettings.baseUrl?orderingInlineSettings.baseUrl:"/inline/"},l=location.href.split(i.baseUrl)[0],e=location.href.split(i.baseUrl)[1],a="' + url + '",r=document.createElement("iframe");r.id="ordering_iframe",r.src=(a+"/"+e).replace(/([^:]\\/)\\/+/g,"$1"),r.style.border=0,r.style.height="100%",r.style.width="100%",r.style.maxWidth="none",r.allow="geolocation";var d=document.getElementById("ordering_iframe_inline");d.appendChild(r),r.addEventListener("load",function(){t(),setInterval(function(){var e=JSON.stringify({event:"body",data:{}});r.contentWindow.postMessage(e,a)},100)});function t(){var e=document.documentElement,t=window.innerwidth||e.clientWidth,n=window.innerHeight||e.clientHeight,o=(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0),i=(window.pageYOffset||e.scrollTop)-(e.clientTop||0),l=JSON.stringify({event:"scroll",data:{top:i,left:o,width:t,height:n,offsetTop:s(r).top}});r.contentWindow.postMessage(l,a)}function s(e){for(var t=0,n=0;t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent;);return{top:t,left:n}}window.addEventListener("message",function(e){var t=e.data;if("body"==t.event)d.style.height=t.data.height+"px";else if("scroll"==t.event)t.data.enable?document.getElementsByTagName("body")[0].style.overflowY="auto":document.getElementsByTagName("body")[0].style.overflowY="hidden";else if("url"==t.event){var n=document.createElement("a");n.href=t.data;var o=((l?l+"/":"")+i.baseUrl+"/"+n.pathname).replace(/([^:]\\/)\\/+/g,"$1");window.history.pushState("","",o),"http://localhost/"!=t.data&&window.scrollTo(0,s(r).top)}},!1),window.onscroll=function(e){t()}};</script><div style="height: 1000px;" id="ordering_iframe_inline"></div>';
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement(_styles.PopupContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('INTEGRATION_WEBSITE', 'Integration on your website'), ": ", t('POPUP', 'Popup')), /*#__PURE__*/_react.default.createElement(_styles.FormGroup, null, /*#__PURE__*/_react.default.createElement("label", null, t('TYPE_MODAL', 'Modal style')), /*#__PURE__*/_react.default.createElement(_styles.SelectWrapper, null, /*#__PURE__*/_react.default.createElement(_Select.Select, {
|
|
67
|
+
isSecondIcon: true,
|
|
68
|
+
notAsync: true,
|
|
69
|
+
placeholder: t('SELECT_TYPE', 'Select Type'),
|
|
70
|
+
defaultValue: selectedType,
|
|
71
|
+
options: modalTypes,
|
|
72
|
+
onChange: function onChange(val) {
|
|
73
|
+
return setSelectedType(val);
|
|
74
|
+
}
|
|
75
|
+
}))), /*#__PURE__*/_react.default.createElement(_styles.FormGroup, null, /*#__PURE__*/_react.default.createElement("label", null, "1* ", t('INSERT_ON_DIV_DISPLAY', 'Insert in the div where you want to display it.')), /*#__PURE__*/_react.default.createElement(_styles2.Input, {
|
|
76
|
+
placeholder: t('CODE', 'Code'),
|
|
77
|
+
defaultValue: "<button onclick=\"toggleOrderingWidget()\">".concat(t('Online_Ordering', 'Online Ordering'), "</button>"),
|
|
78
|
+
disabled: true
|
|
79
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.FormGroup, null, /*#__PURE__*/_react.default.createElement("label", null, "2* ", t('INSERT_ON_END_BODY', 'Insert at the end of the body tag'), " (", t('IF_USED_PAYPALEXPRESS', 'Use only if Paypal Express is used'), ")"), /*#__PURE__*/_react.default.createElement(_styles2.Input, {
|
|
80
|
+
placeholder: t('CODE', 'Code'),
|
|
81
|
+
defaultValue: "<script src=\"https://www.paypalobjects.com/api/checkout.js\"></script>",
|
|
82
|
+
disabled: true
|
|
83
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.FormGroup, null, /*#__PURE__*/_react.default.createElement("label", null, "3* ", t('INSERT_ON_END_BODY', 'Insert at the end of the body tag')), /*#__PURE__*/_react.default.createElement(_styles2.TextArea, {
|
|
84
|
+
placeholder: t('CODE', 'Code'),
|
|
85
|
+
value: selectedType === 'modal' ? widgetPopup : widgetBot,
|
|
86
|
+
disabled: true
|
|
87
|
+
}))), /*#__PURE__*/_react.default.createElement(_styles.InlineContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('INTEGRATION_WEBSITE', 'Integration on your website'), ": ", t('INLINE', 'Inline')), /*#__PURE__*/_react.default.createElement(_styles.FormGroup, null, /*#__PURE__*/_react.default.createElement("label", null, "1* ", t('INSERT_ON_END_BODY', 'Insert at the end of the body tag'), " (", t('IF_USED_PAYPALEXPRESS', 'Use only if Paypal Express is used'), ")"), /*#__PURE__*/_react.default.createElement(_styles2.Input, {
|
|
88
|
+
placeholder: t('CODE', 'Code'),
|
|
89
|
+
defaultValue: "<script src=\"https://www.paypalobjects.com/api/checkout.js\"></script>",
|
|
90
|
+
disabled: true
|
|
91
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.FormGroup, null, /*#__PURE__*/_react.default.createElement("label", null, "2* ", t('INSERT_ON_DIV_DISPLAY', 'Insert in the div where you want to display it.')), /*#__PURE__*/_react.default.createElement(_styles2.TextArea, {
|
|
92
|
+
placeholder: t('CODE', 'Code'),
|
|
93
|
+
defaultValue: widgetInline,
|
|
94
|
+
disabled: true
|
|
95
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.FormGroup, null, /*#__PURE__*/_react.default.createElement("label", null, "3* .htaccess"), /*#__PURE__*/_react.default.createElement(_styles2.TextArea, {
|
|
96
|
+
placeholder: t('CODE', 'Code'),
|
|
97
|
+
defaultValue: "RewriteEngine On RewriteRule ^inline/(.+)$ /inline/ [NC,L] #where inline is the folder",
|
|
98
|
+
disabled: true
|
|
99
|
+
}))), /*#__PURE__*/_react.default.createElement(_styles.GuideLink, null, /*#__PURE__*/_react.default.createElement(_styles2.Button, {
|
|
100
|
+
outline: true,
|
|
101
|
+
color: "primary",
|
|
102
|
+
onClick: function onClick() {
|
|
103
|
+
return window.open('https://support.ordering.co/hc/en-us/articles/360043529971-Widget-Integration', '_blank');
|
|
104
|
+
}
|
|
105
|
+
}, t('LEARN_HOW_TO_DO_IT', 'Learn how to do it'))));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
exports.BusinessWidgets = BusinessWidgets;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectWrapper = exports.PopupContainer = exports.InlineContainer = exports.GuideLink = exports.FormGroup = exports.Container = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
|
|
16
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
|
|
17
|
+
|
|
18
|
+
exports.Container = Container;
|
|
19
|
+
|
|
20
|
+
var PopupContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n h2 {\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n margin-top: 0px;\n margin-bottom: 20px;\n }\n"])));
|
|
21
|
+
|
|
22
|
+
exports.PopupContainer = PopupContainer;
|
|
23
|
+
|
|
24
|
+
var FormGroup = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-bottom: 30px;\n label {\n display: block;\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n margin-bottom: 11px;\n }\n input, textarea {\n width: 100%;\n }\n"])));
|
|
25
|
+
|
|
26
|
+
exports.FormGroup = FormGroup;
|
|
27
|
+
|
|
28
|
+
var SelectWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-size: 14px;\n .select {\n border: none;\n background: ", ";\n padding: 11px 0;\n }\n"])), function (props) {
|
|
29
|
+
return props.theme.colors.secundary;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
exports.SelectWrapper = SelectWrapper;
|
|
33
|
+
|
|
34
|
+
var InlineContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n h2 {\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n margin-top: 0px;\n margin-bottom: 20px;\n }\n"])));
|
|
35
|
+
|
|
36
|
+
exports.InlineContainer = InlineContainer;
|
|
37
|
+
|
|
38
|
+
var GuideLink = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n button {\n border-radius: 8px;\n height: 44px;\n }\n"])));
|
|
39
|
+
|
|
40
|
+
exports.GuideLink = GuideLink;
|
|
@@ -13,6 +13,8 @@ var _orderingComponentsAdminExternal = require("ordering-components-admin-extern
|
|
|
13
13
|
|
|
14
14
|
var _reactHookForm = require("react-hook-form");
|
|
15
15
|
|
|
16
|
+
var _Shared = require("../../Shared");
|
|
17
|
+
|
|
16
18
|
var _styles = require("./styles");
|
|
17
19
|
|
|
18
20
|
var _FirstSelect = require("../../../styles/Select/FirstSelect");
|
|
@@ -45,14 +47,22 @@ var EditTaxManager = function EditTaxManager(props) {
|
|
|
45
47
|
data = props.data,
|
|
46
48
|
formChanges = props.formChanges,
|
|
47
49
|
_onChange = props.onChange,
|
|
48
|
-
onClose = props.onClose
|
|
49
|
-
setAlertState = props.setAlertState;
|
|
50
|
+
onClose = props.onClose;
|
|
50
51
|
|
|
51
52
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
52
53
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
53
54
|
t = _useLanguage2[1];
|
|
54
55
|
|
|
56
|
+
var _useState = (0, _react.useState)({
|
|
57
|
+
open: false,
|
|
58
|
+
content: []
|
|
59
|
+
}),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
alertState = _useState2[0],
|
|
62
|
+
setAlertState = _useState2[1];
|
|
63
|
+
|
|
55
64
|
var formMethods = (0, _reactHookForm.useForm)();
|
|
65
|
+
var positiveNumberFields = ['rate', 'fixed', 'percentage'];
|
|
56
66
|
var defaultInputs = [{
|
|
57
67
|
field: 'name',
|
|
58
68
|
placeholder: t('NAME', 'Name'),
|
|
@@ -62,30 +72,58 @@ var EditTaxManager = function EditTaxManager(props) {
|
|
|
62
72
|
placeholder: t('DESCRIPTION', 'Description'),
|
|
63
73
|
required: t('DESCRIPTION_REQUIRED', 'The Description is required')
|
|
64
74
|
}];
|
|
75
|
+
|
|
76
|
+
var rateValidationNumber = function rateValidationNumber(value) {
|
|
77
|
+
if (!isNaN(Number(value))) {
|
|
78
|
+
return true;
|
|
79
|
+
} else {
|
|
80
|
+
return t('VALIDATION_ERROR_NUMERIC', 'The _attribute_ must be a number.').replace('_attribute_', t('RATE', 'Rate'));
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
var feeValidationNumber = function feeValidationNumber(value) {
|
|
85
|
+
if (!isNaN(Number(value))) {
|
|
86
|
+
return true;
|
|
87
|
+
} else {
|
|
88
|
+
return t('VALIDATION_ERROR_NUMERIC', 'The _attribute_ must be a number.').replace('_attribute_', t('FIXED', 'Fixed'));
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var percentageValidationNumber = function percentageValidationNumber(value) {
|
|
93
|
+
if (Number(value) <= 100) {
|
|
94
|
+
return true;
|
|
95
|
+
} else {
|
|
96
|
+
return t('VALIDATION_MUST_SMALLER_HUNDRED', 'The precentage must be not bigger than 100').replace('_attribute_', t('PERCENTAGE', 'Percentage'));
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
65
100
|
var inputs = [].concat(defaultInputs, [type === 'taxes' ? [{
|
|
66
101
|
field: 'rate',
|
|
67
102
|
placeholder: t('RATE', 'Rate'),
|
|
68
103
|
required: t('TAX_RATE_REQUIRED', 'Tax rate is required'),
|
|
69
104
|
pattern: {
|
|
70
|
-
value:
|
|
71
|
-
message: t('
|
|
72
|
-
}
|
|
105
|
+
value: /^\d*\.?\d*$/,
|
|
106
|
+
message: t('VALIDATION_ERROR_NUMERIC', 'The _attribute_ must be a number.').replace('_attribute_', t('RATE', 'Rate'))
|
|
107
|
+
},
|
|
108
|
+
validate: rateValidationNumber
|
|
73
109
|
}] : [{
|
|
74
110
|
field: 'fixed',
|
|
75
111
|
placeholder: t('FIXED', 'Fixed'),
|
|
76
112
|
required: t('FEE_FIXED_REQUIRED', 'Fee fixed is required'),
|
|
77
113
|
pattern: {
|
|
78
|
-
value:
|
|
79
|
-
message: t('
|
|
80
|
-
}
|
|
114
|
+
value: /^\d*\.?\d*$/,
|
|
115
|
+
message: t('VALIDATION_ERROR_NUMERIC', 'The _attribute_ must be a number.').replace('_attribute_', t('FIXED', 'Fixed'))
|
|
116
|
+
},
|
|
117
|
+
validate: feeValidationNumber
|
|
81
118
|
}, {
|
|
82
119
|
field: 'percentage',
|
|
83
120
|
placeholder: t('PERCENTAGE', 'Percentage'),
|
|
84
121
|
required: t('FEE_PERCENTAGE_REQUIRED', 'Fee percentage is required'),
|
|
85
122
|
pattern: {
|
|
86
|
-
value:
|
|
87
|
-
message: t('
|
|
88
|
-
}
|
|
123
|
+
value: /^\d*\.?\d*$/,
|
|
124
|
+
message: t('VALIDATION_ERROR_NUMERIC', 'The _attribute_ must be a number.').replace('_attribute_', t('PERCENTAGE', 'Percentage'))
|
|
125
|
+
},
|
|
126
|
+
validate: percentageValidationNumber
|
|
89
127
|
}]]);
|
|
90
128
|
(0, _react.useEffect)(function () {
|
|
91
129
|
if (Object.keys(formMethods.errors).length > 0) {
|
|
@@ -119,8 +157,15 @@ var EditTaxManager = function EditTaxManager(props) {
|
|
|
119
157
|
},
|
|
120
158
|
ref: formMethods.register({
|
|
121
159
|
required: input.required,
|
|
122
|
-
pattern: input.pattern
|
|
123
|
-
|
|
160
|
+
pattern: input.pattern,
|
|
161
|
+
validate: input.validate
|
|
162
|
+
}),
|
|
163
|
+
onKeyPress: function onKeyPress(e) {
|
|
164
|
+
if (positiveNumberFields.includes(input.field) && !/^[0-9.]$/.test(e.key)) {
|
|
165
|
+
e.preventDefault();
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
autoComplete: "off"
|
|
124
169
|
}));
|
|
125
170
|
}), type === 'taxes' && /*#__PURE__*/_react.default.createElement(_styles.InputContainer, null, /*#__PURE__*/_react.default.createElement(_styles.LabelCustom, {
|
|
126
171
|
htmlFor: "type"
|
|
@@ -150,7 +195,25 @@ var EditTaxManager = function EditTaxManager(props) {
|
|
|
150
195
|
onClick: function onClick() {
|
|
151
196
|
return onClose();
|
|
152
197
|
}
|
|
153
|
-
}, t('CLOSE', 'Close')))
|
|
198
|
+
}, t('CLOSE', 'Close'))), /*#__PURE__*/_react.default.createElement(_Shared.Alert, {
|
|
199
|
+
title: t('ERROR'),
|
|
200
|
+
content: alertState.content,
|
|
201
|
+
acceptText: t('ACCEPT', 'Accept'),
|
|
202
|
+
open: alertState.open,
|
|
203
|
+
onClose: function onClose() {
|
|
204
|
+
return setAlertState({
|
|
205
|
+
open: false,
|
|
206
|
+
content: []
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
onAccept: function onAccept() {
|
|
210
|
+
return setAlertState({
|
|
211
|
+
open: false,
|
|
212
|
+
content: []
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
closeOnBackdrop: false
|
|
216
|
+
}));
|
|
154
217
|
};
|
|
155
218
|
|
|
156
219
|
exports.EditTaxManager = EditTaxManager;
|
|
@@ -79,7 +79,8 @@ var ProductDetailsUI = function ProductDetailsUI(props) {
|
|
|
79
79
|
handleUpdateClick = props.handleUpdateClick,
|
|
80
80
|
handleChangeFormState = props.handleChangeFormState,
|
|
81
81
|
handleSuccessUpdate = props.handleSuccessUpdate,
|
|
82
|
-
handleChangeRibbon = props.handleChangeRibbon
|
|
82
|
+
handleChangeRibbon = props.handleChangeRibbon,
|
|
83
|
+
cleanFormState = props.cleanFormState;
|
|
83
84
|
|
|
84
85
|
var _useWindowSize = (0, _useWindowSize2.useWindowSize)(),
|
|
85
86
|
width = _useWindowSize.width;
|
|
@@ -201,7 +202,8 @@ var ProductDetailsUI = function ProductDetailsUI(props) {
|
|
|
201
202
|
taxes: taxes,
|
|
202
203
|
setTaxes: setTaxes,
|
|
203
204
|
fees: fees,
|
|
204
|
-
setFees: setFees
|
|
205
|
+
setFees: setFees,
|
|
206
|
+
cleanFormState: cleanFormState
|
|
205
207
|
}), showOption === 'service_details' && /*#__PURE__*/_react.default.createElement(_ServiceDetail.ServiceDetail, {
|
|
206
208
|
product: productState === null || productState === void 0 ? void 0 : productState.product,
|
|
207
209
|
formState: formState,
|
|
@@ -636,8 +636,7 @@ var ProductDetailsAdvancedUI = function ProductDetailsAdvancedUI(props) {
|
|
|
636
636
|
payload: null
|
|
637
637
|
});
|
|
638
638
|
},
|
|
639
|
-
handleSave: handleSaveTax
|
|
640
|
-
setAlertState: setAlertState
|
|
639
|
+
handleSave: handleSaveTax
|
|
641
640
|
})), /*#__PURE__*/_react.default.createElement(_Shared.Alert, {
|
|
642
641
|
title: taxToDelete.action ? t("DELETE_".concat(getTaxOrFeeString(taxToDelete === null || taxToDelete === void 0 ? void 0 : taxToDelete.action).toUpperCase()), "Delete ".concat(getTaxOrFeeString(taxToDelete === null || taxToDelete === void 0 ? void 0 : taxToDelete.action))) : t('ERROR'),
|
|
643
642
|
content: alertState.content,
|
|
@@ -56,7 +56,8 @@ var ProductMainDetails = function ProductMainDetails(props) {
|
|
|
56
56
|
taxes = props.taxes,
|
|
57
57
|
setTaxes = props.setTaxes,
|
|
58
58
|
fees = props.fees,
|
|
59
|
-
setFees = props.setFees
|
|
59
|
+
setFees = props.setFees,
|
|
60
|
+
cleanFormState = props.cleanFormState;
|
|
60
61
|
|
|
61
62
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
62
63
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -127,7 +128,8 @@ var ProductMainDetails = function ProductMainDetails(props) {
|
|
|
127
128
|
handleUpdateClick: handleUpdateClick,
|
|
128
129
|
handlechangeImageProductCategory: handlechangeImage,
|
|
129
130
|
handleProductCategoryChangeInput: handleChangeInput,
|
|
130
|
-
isProductSeo: true
|
|
131
|
+
isProductSeo: true,
|
|
132
|
+
cleanFormState: cleanFormState
|
|
131
133
|
}));
|
|
132
134
|
};
|
|
133
135
|
|
|
@@ -58,7 +58,8 @@ var SeoOptions = function SeoOptions(props) {
|
|
|
58
58
|
handlechangeImageProductCategory = props.handlechangeImageProductCategory,
|
|
59
59
|
isBusinessSeo = props.isBusinessSeo,
|
|
60
60
|
isProductSeo = props.isProductSeo,
|
|
61
|
-
isCategorySeo = props.isCategorySeo
|
|
61
|
+
isCategorySeo = props.isCategorySeo,
|
|
62
|
+
cleanFormState = props.cleanFormState;
|
|
62
63
|
|
|
63
64
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
64
65
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -87,6 +88,14 @@ var SeoOptions = function SeoOptions(props) {
|
|
|
87
88
|
cropState = _useState4[0],
|
|
88
89
|
setCropState = _useState4[1];
|
|
89
90
|
|
|
91
|
+
var _useState5 = (0, _react.useState)(false),
|
|
92
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
93
|
+
isSameInfo = _useState6[0],
|
|
94
|
+
setIsSameInfo = _useState6[1];
|
|
95
|
+
|
|
96
|
+
var titleRef = (0, _react.useRef)(null);
|
|
97
|
+
var descriptionRef = (0, _react.useRef)(null);
|
|
98
|
+
|
|
90
99
|
var handleClickImage = function handleClickImage() {
|
|
91
100
|
productImageInputRef.current.click();
|
|
92
101
|
};
|
|
@@ -178,6 +187,22 @@ var SeoOptions = function SeoOptions(props) {
|
|
|
178
187
|
});
|
|
179
188
|
};
|
|
180
189
|
|
|
190
|
+
(0, _react.useEffect)(function () {
|
|
191
|
+
if (!isSameInfo || !isProductSeo) return;
|
|
192
|
+
setFormState({
|
|
193
|
+
seo_title: data === null || data === void 0 ? void 0 : data.name,
|
|
194
|
+
seo_description: data === null || data === void 0 ? void 0 : data.description
|
|
195
|
+
});
|
|
196
|
+
titleRef.current.value = data === null || data === void 0 ? void 0 : data.name;
|
|
197
|
+
descriptionRef.current.value = data === null || data === void 0 ? void 0 : data.description;
|
|
198
|
+
}, [isSameInfo, isProductSeo]);
|
|
199
|
+
(0, _react.useEffect)(function () {
|
|
200
|
+
return function () {
|
|
201
|
+
cleanFormState && cleanFormState({
|
|
202
|
+
changes: {}
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
}, []);
|
|
181
206
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.Container, null, /*#__PURE__*/_react.default.createElement(_styles2.WrapperImage, null, /*#__PURE__*/_react.default.createElement("label", null, t('SEO_IMAGE', 'SEO Image')), /*#__PURE__*/_react.default.createElement(_styles2.SEOImage, {
|
|
182
207
|
onClick: function onClick() {
|
|
183
208
|
return handleClickImage();
|
|
@@ -207,8 +232,14 @@ var SeoOptions = function SeoOptions(props) {
|
|
|
207
232
|
loading: "lazy"
|
|
208
233
|
}), /*#__PURE__*/_react.default.createElement(_styles2.UploadImageIconContainer, {
|
|
209
234
|
isImage: (formState === null || formState === void 0 ? void 0 : (_formState$changes4 = formState.changes) === null || _formState$changes4 === void 0 ? void 0 : _formState$changes4.seo_image) || data.seo_image
|
|
210
|
-
}, /*#__PURE__*/_react.default.createElement(_styles2.CameraWrapper, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Camera, null)), /*#__PURE__*/_react.default.createElement(_styles2.UploadImageIcon, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Image, null), /*#__PURE__*/_react.default.createElement("span", null, t('DRAG_DROP', 'Drag and Drop')))))))), /*#__PURE__*/_react.default.createElement(_styles2.
|
|
235
|
+
}, /*#__PURE__*/_react.default.createElement(_styles2.CameraWrapper, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Camera, null)), /*#__PURE__*/_react.default.createElement(_styles2.UploadImageIcon, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Image, null), /*#__PURE__*/_react.default.createElement("span", null, t('DRAG_DROP', 'Drag and Drop')))))))), isProductSeo && /*#__PURE__*/_react.default.createElement(_styles2.UseSameInfoWrapper, null, /*#__PURE__*/_react.default.createElement("label", null, t('USE_SAME_PRODUCT_INFORMATION', 'Use the same as main product information')), /*#__PURE__*/_react.default.createElement(_styles.Switch, {
|
|
236
|
+
defaultChecked: isSameInfo || false,
|
|
237
|
+
onChange: function onChange(val) {
|
|
238
|
+
return setIsSameInfo(val);
|
|
239
|
+
}
|
|
240
|
+
})), /*#__PURE__*/_react.default.createElement(_styles2.WrapperShortDescription, null, /*#__PURE__*/_react.default.createElement("label", null, t('SEO_TITLE', 'SEO Title')), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
211
241
|
name: "seo_title",
|
|
242
|
+
ref: titleRef,
|
|
212
243
|
defaultValue: formState !== null && formState !== void 0 && (_formState$result2 = formState.result) !== null && _formState$result2 !== void 0 && _formState$result2.result ? formState === null || formState === void 0 ? void 0 : (_formState$result3 = formState.result) === null || _formState$result3 === void 0 ? void 0 : (_formState$result3$re = _formState$result3.result) === null || _formState$result3$re === void 0 ? void 0 : _formState$result3$re.seo_title : (_ref = (_formState$changes$se = formState === null || formState === void 0 ? void 0 : (_formState$changes5 = formState.changes) === null || _formState$changes5 === void 0 ? void 0 : _formState$changes5.seo_title) !== null && _formState$changes$se !== void 0 ? _formState$changes$se : data === null || data === void 0 ? void 0 : data.seo_title) !== null && _ref !== void 0 ? _ref : '',
|
|
213
244
|
onChange: function onChange(e) {
|
|
214
245
|
if (isBusinessSeo) handleChangeInput(e);
|
|
@@ -217,6 +248,7 @@ var SeoOptions = function SeoOptions(props) {
|
|
|
217
248
|
placeholder: t('SEO_TITLE', 'SEO Title')
|
|
218
249
|
})), /*#__PURE__*/_react.default.createElement(_styles2.WrapperDescription, null, /*#__PURE__*/_react.default.createElement("label", null, t('SEO_DESCRIPTION', 'SEO Description')), /*#__PURE__*/_react.default.createElement(_styles.TextArea, {
|
|
219
250
|
name: "seo_description",
|
|
251
|
+
ref: descriptionRef,
|
|
220
252
|
rows: 4,
|
|
221
253
|
defaultValue: formState !== null && formState !== void 0 && (_formState$result4 = formState.result) !== null && _formState$result4 !== void 0 && _formState$result4.result ? formState === null || formState === void 0 ? void 0 : (_formState$result5 = formState.result) === null || _formState$result5 === void 0 ? void 0 : (_formState$result5$re = _formState$result5.result) === null || _formState$result5$re === void 0 ? void 0 : _formState$result5$re.seo_description : (_ref2 = (_formState$changes$se2 = formState === null || formState === void 0 ? void 0 : (_formState$changes6 = formState.changes) === null || _formState$changes6 === void 0 ? void 0 : _formState$changes6.seo_description) !== null && _formState$changes$se2 !== void 0 ? _formState$changes$se2 : data === null || data === void 0 ? void 0 : data.seo_description) !== null && _ref2 !== void 0 ? _ref2 : '',
|
|
222
254
|
onChange: function onChange(e) {
|
|
@@ -5,11 +5,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.WrapperShortDescription = exports.WrapperImage = exports.WrapperDescription = exports.UploadImageIconContainer = exports.UploadImageIcon = exports.SkipButton = exports.SkeletonWrapper = exports.SEOImage = exports.Container = exports.CameraWrapper = exports.ActionButtons = void 0;
|
|
8
|
+
exports.WrapperShortDescription = exports.WrapperImage = exports.WrapperDescription = exports.UseSameInfoWrapper = exports.UploadImageIconContainer = exports.UploadImageIcon = exports.SkipButton = exports.SkeletonWrapper = exports.SEOImage = exports.Container = exports.CameraWrapper = exports.ActionButtons = void 0;
|
|
9
9
|
|
|
10
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
11
|
|
|
12
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
|
|
12
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23;
|
|
13
13
|
|
|
14
14
|
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); }
|
|
15
15
|
|
|
@@ -89,4 +89,10 @@ exports.SkipButton = SkipButton;
|
|
|
89
89
|
|
|
90
90
|
var ActionButtons = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n position: sticky;\n top: 100%;\n display: flex;\n align-items: center;\n\n > button {\n height: 42px;\n }\n"])));
|
|
91
91
|
|
|
92
|
-
exports.ActionButtons = ActionButtons;
|
|
92
|
+
exports.ActionButtons = ActionButtons;
|
|
93
|
+
|
|
94
|
+
var UseSameInfoWrapper = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-bottom: 20px;\n\n label {\n &:first-child {\n font-weight: 400;\n font-size: 14px;\n margin: 0px;\n margin-right: 10px;\n ", "\n }\n &:last-child {\n min-width: 25px;\n }\n }\n"])), function (props) {
|
|
95
|
+
return props.theme.rtl && (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n margin-right: 0px;\n margin-left: 10px;\n "])));
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
exports.UseSameInfoWrapper = UseSameInfoWrapper;
|
|
@@ -345,6 +345,12 @@ Object.defineProperty(exports, "BusinessWebhooks", {
|
|
|
345
345
|
return _BusinessWebhooks.BusinessWebhooks;
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
|
+
Object.defineProperty(exports, "BusinessWidgets", {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
get: function get() {
|
|
351
|
+
return _BusinessWidgets.BusinessWidgets;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
348
354
|
Object.defineProperty(exports, "BusinessesList", {
|
|
349
355
|
enumerable: true,
|
|
350
356
|
get: function get() {
|
|
@@ -648,6 +654,8 @@ var _BusinessVideos = require("./BusinessVideos");
|
|
|
648
654
|
|
|
649
655
|
var _BusinessWebhooks = require("./BusinessWebhooks");
|
|
650
656
|
|
|
657
|
+
var _BusinessWidgets = require("./BusinessWidgets");
|
|
658
|
+
|
|
651
659
|
var _SeoOptions = require("./SeoOptions");
|
|
652
660
|
|
|
653
661
|
var _AddBusinessForm = require("./AddBusinessForm");
|
package/_modules/index.js
CHANGED
|
@@ -513,6 +513,12 @@ Object.defineProperty(exports, "BusinessWebhooks", {
|
|
|
513
513
|
return _Stores.BusinessWebhooks;
|
|
514
514
|
}
|
|
515
515
|
});
|
|
516
|
+
Object.defineProperty(exports, "BusinessWidgets", {
|
|
517
|
+
enumerable: true,
|
|
518
|
+
get: function get() {
|
|
519
|
+
return _Stores.BusinessWidgets;
|
|
520
|
+
}
|
|
521
|
+
});
|
|
516
522
|
Object.defineProperty(exports, "BusinessesList", {
|
|
517
523
|
enumerable: true,
|
|
518
524
|
get: function get() {
|
package/_modules/utils/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.verifyDecimals = exports.sortInputFields = exports.shape = exports.setStorageItem = exports.scrollTo = exports.ribbonValues = exports.reviewCommentList = exports.removeStorageItem = exports.orderRejectCommentList = exports.optimizeImage = exports.getStorageItem = exports.getStarWidth = exports.getSeconds = exports.getMinutes = exports.getIconCard = exports.getHours = exports.getAgoMinutes = exports.formatUrlVideo = exports.fieldsToSort = exports.convertHoursToMinutes = exports.convertHMS = exports.capitalize = exports.bytesConverter = exports.DriverTipsOptions = void 0;
|
|
6
|
+
exports.widgetURL = exports.verifyDecimals = exports.sortInputFields = exports.shape = exports.setStorageItem = exports.scrollTo = exports.ribbonValues = exports.reviewCommentList = exports.removeStorageItem = exports.orderRejectCommentList = exports.optimizeImage = exports.getStorageItem = exports.getStarWidth = exports.getSeconds = exports.getMinutes = exports.getIconCard = exports.getHours = exports.getAgoMinutes = exports.formatUrlVideo = exports.fieldsToSort = exports.convertHoursToMinutes = exports.convertHMS = exports.capitalize = exports.bytesConverter = exports.DriverTipsOptions = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -592,4 +592,6 @@ var orderRejectCommentList = function orderRejectCommentList(status) {
|
|
|
592
592
|
return list;
|
|
593
593
|
};
|
|
594
594
|
|
|
595
|
-
exports.orderRejectCommentList = orderRejectCommentList;
|
|
595
|
+
exports.orderRejectCommentList = orderRejectCommentList;
|
|
596
|
+
var widgetURL = 'https://orderingweb.ordering.co/';
|
|
597
|
+
exports.widgetURL = widgetURL;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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.4.0",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -7,7 +7,7 @@ import { Dropdown, DropdownButton } from 'react-bootstrap'
|
|
|
7
7
|
import { ThreeDots } from 'react-bootstrap-icons'
|
|
8
8
|
import { useTheme } from 'styled-components'
|
|
9
9
|
import { Switch } from '../../../styles'
|
|
10
|
-
import { DragScroll, Alert, Confirm, SelectBusinesses, SelectSites } from '../../Shared'
|
|
10
|
+
import { DragScroll, Alert, Confirm, SelectBusinesses, SelectSites, SelectUsers, SelectLoyaltyLevels } from '../../Shared'
|
|
11
11
|
import { EnterprisePromotionGeneralDetails } from '../EnterprisePromotionGeneralDetails'
|
|
12
12
|
import { EnterprisePromotionRules } from '../EnterprisePromotionRules'
|
|
13
13
|
|
|
@@ -37,7 +37,13 @@ const EnterprisePromotionDetailsUI = (props) => {
|
|
|
37
37
|
businessesList,
|
|
38
38
|
handleSelectBusiness,
|
|
39
39
|
handleSelectAllBusiness,
|
|
40
|
-
handleDeletePromotion
|
|
40
|
+
handleDeletePromotion,
|
|
41
|
+
selectedUserIds,
|
|
42
|
+
handleSelectUser,
|
|
43
|
+
|
|
44
|
+
selectedLoyaltyLevelIds,
|
|
45
|
+
handleSelectLoyaltyLevel,
|
|
46
|
+
handleSelectAllLoyaltyLevels
|
|
41
47
|
} = props
|
|
42
48
|
|
|
43
49
|
const theme = useTheme()
|
|
@@ -50,6 +56,8 @@ const EnterprisePromotionDetailsUI = (props) => {
|
|
|
50
56
|
{ key: 'general', content: t('GENERAL', 'General') },
|
|
51
57
|
{ key: 'sites', content: t('SITES', 'Sites') },
|
|
52
58
|
{ key: 'businesses', content: t('CONTROL_PANEL_BUSINESS', 'Business') },
|
|
59
|
+
{ key: 'users', content: t('USERS', '') },
|
|
60
|
+
{ key: 'loyalty_levels', content: t('LOYALTY_LEVELS', 'Loyalty Levels') },
|
|
53
61
|
{ key: 'rules', content: t('RULES', 'Rules') }
|
|
54
62
|
]
|
|
55
63
|
|
|
@@ -165,6 +173,7 @@ const EnterprisePromotionDetailsUI = (props) => {
|
|
|
165
173
|
)}
|
|
166
174
|
{selectedOption === 'sites' && (
|
|
167
175
|
<SelectSites
|
|
176
|
+
isAllChecked={selectedSitesIds.length === 0}
|
|
168
177
|
isAddMode={isAddMode}
|
|
169
178
|
allSites={sitesState.sites}
|
|
170
179
|
selectedSitesIds={selectedSitesIds}
|
|
@@ -189,6 +198,27 @@ const EnterprisePromotionDetailsUI = (props) => {
|
|
|
189
198
|
handleAddClick={handleAddPromotion}
|
|
190
199
|
/>
|
|
191
200
|
)}
|
|
201
|
+
{selectedOption === 'users' && (
|
|
202
|
+
<SelectUsers
|
|
203
|
+
isAddMode={isAddMode}
|
|
204
|
+
isDisabled={Object.keys(formState.changes).length === 0 || actionState.loading}
|
|
205
|
+
selectedUserIds={selectedUserIds}
|
|
206
|
+
handleSelectUser={handleSelectUser}
|
|
207
|
+
handleUpdateClick={handleUpdateClick}
|
|
208
|
+
handleAddPromotion={handleAddPromotion}
|
|
209
|
+
/>
|
|
210
|
+
)}
|
|
211
|
+
{selectedOption === 'loyalty_levels' && (
|
|
212
|
+
<SelectLoyaltyLevels
|
|
213
|
+
isAddMode={isAddMode}
|
|
214
|
+
isDisabled={Object.keys(formState.changes).length === 0 || actionState.loading}
|
|
215
|
+
selectedLoyaltyLevelIds={selectedLoyaltyLevelIds}
|
|
216
|
+
handleSelectLoyaltyLevel={handleSelectLoyaltyLevel}
|
|
217
|
+
handleSelectAllLoyaltyLevels={handleSelectAllLoyaltyLevels}
|
|
218
|
+
handleUpdateClick={handleUpdateClick}
|
|
219
|
+
handleAddPromotion={handleAddPromotion}
|
|
220
|
+
/>
|
|
221
|
+
)}
|
|
192
222
|
{selectedOption === 'rules' && (
|
|
193
223
|
<EnterprisePromotionRules
|
|
194
224
|
{...props}
|
|
@@ -42,7 +42,7 @@ const EnterprisePromotionListingUI = (props) => {
|
|
|
42
42
|
const [moveDistance, setMoveDistance] = useState(0)
|
|
43
43
|
|
|
44
44
|
const handleOpenDetails = (promotion) => {
|
|
45
|
-
setMoveDistance(0)
|
|
45
|
+
setMoveDistance(0)
|
|
46
46
|
setSelectedPromotion(promotion)
|
|
47
47
|
setOpenDetails(true)
|
|
48
48
|
}
|