@tap-payments/auth-jsconnect 2.11.1-beta → 2.11.1-development
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/build/@types/app.d.ts +3 -1
- package/build/@types/app.js +1 -0
- package/build/@types/form.d.ts +2 -0
- package/build/@types/index.d.ts +1 -0
- package/build/@types/index.js +1 -0
- package/build/@types/terminal.d.ts +116 -0
- package/build/@types/terminal.js +1 -0
- package/build/api/auth.d.ts +9 -1
- package/build/api/entity.d.ts +3 -0
- package/build/api/index.d.ts +7 -1
- package/build/api/index.js +3 -1
- package/build/api/lead.d.ts +1 -0
- package/build/api/terminal.d.ts +28 -0
- package/build/api/terminal.js +45 -0
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/settings.js +1 -2
- package/build/app/store.d.ts +2 -0
- package/build/assets/locales/ar.json +48 -16
- package/build/assets/locales/en.json +51 -45
- package/build/components/DeviceCard/DeviceCard.d.ts +18 -0
- package/build/components/DeviceCard/DeviceCard.js +103 -0
- package/build/components/DeviceCard/index.d.ts +3 -0
- package/build/components/DeviceCard/index.js +2 -0
- package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
- package/build/components/OTPTimer/OTPTimer.js +4 -4
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +0 -2
- package/build/constants/app.d.ts +21 -3
- package/build/constants/app.js +122 -5
- package/build/constants/flows.d.ts +15 -0
- package/build/constants/flows.js +15 -0
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/business/businessStore.js +15 -10
- package/build/features/app/connectExpress/connectExpressStore.js +19 -4
- package/build/features/app/individual/individualStore.js +0 -1
- package/build/features/app/tax/taxStore.js +1 -1
- package/build/features/app/terminal/terminalStore.d.ts +110 -0
- package/build/features/app/terminal/terminalStore.js +676 -0
- package/build/features/auth/screens/AuthenticationList/EntityList.js +2 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +13 -2
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
- package/build/features/business/screens/BusinessType/LicenseList.js +15 -7
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
- package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +31 -10
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +23 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
- package/build/features/entity/screens/EntityName/EntityName.js +2 -1
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +14 -3
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +67 -0
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
- package/build/features/shared/Button/FlowsButtons.js +2 -2
- package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
- package/build/features/shared/PushNotification/PushNotification.js +34 -0
- package/build/features/shared/PushNotification/index.d.ts +2 -0
- package/build/features/shared/PushNotification/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +5 -4
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/features/terminal/Terminal.d.ts +14 -0
- package/build/features/terminal/Terminal.js +95 -0
- package/build/features/terminal/index.d.ts +1 -0
- package/build/features/terminal/index.js +1 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +69 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +51 -0
- package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +55 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
- package/build/features/terminal/screens/Loading/Loading.js +10 -0
- package/build/features/terminal/screens/Loading/index.d.ts +2 -0
- package/build/features/terminal/screens/Loading/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +58 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
- package/build/features/terminal/screens/OperatorError/index.js +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +32 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +153 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +47 -0
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +53 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +98 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
- package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
- package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
- package/build/features/terminal/screens/Verify/Verify.js +85 -0
- package/build/features/terminal/screens/Verify/index.d.ts +2 -0
- package/build/features/terminal/screens/Verify/index.js +2 -0
- package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
- package/build/features/terminal/screens/Verify/validation.js +4 -0
- package/build/features/terminal/screens/shared/Header.d.ts +10 -0
- package/build/features/terminal/screens/shared/Header.js +30 -0
- package/build/features/terminal/screens/shared/TerminalList.d.ts +11 -0
- package/build/features/terminal/screens/shared/TerminalList.js +25 -0
- package/build/features/terminal/screens/shared/index.d.ts +5 -0
- package/build/features/terminal/screens/shared/index.js +5 -0
- package/build/features/terminal/screens/shared/styles.d.ts +196 -0
- package/build/features/terminal/screens/shared/styles.js +155 -0
- package/build/features/terminal/screens/shared/utils.d.ts +7 -0
- package/build/features/terminal/screens/shared/utils.js +24 -0
- package/build/hooks/useAppConfig.js +1 -1
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/theme/palette.js +12 -0
- package/build/theme/typography.js +4 -0
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +5 -6
- package/build/utils/string.d.ts +3 -2
- package/build/utils/string.js +14 -3
- package/build/utils/validation.js +1 -1
- package/package.json +2 -2
|
@@ -45,7 +45,7 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
|
|
|
45
45
|
});
|
|
46
46
|
var SuccessFlowButtons = function (_a) {
|
|
47
47
|
var _b, _c, _d;
|
|
48
|
-
var brand = _a.brand, entity = _a.entity, business = _a.business, merchant = _a.merchant, bank = _a.bank, user = _a.user, flows = _a.flows, boardInfoId = _a.boardInfoId, boardId = _a.boardId, flowName = _a.flowName, individuals = _a.individuals, recipient = _a.recipient, onClose = _a.onClose, loading = _a.loading, status = _a.status;
|
|
48
|
+
var brand = _a.brand, entity = _a.entity, business = _a.business, merchant = _a.merchant, bank = _a.bank, user = _a.user, flows = _a.flows, boardInfoId = _a.boardInfoId, boardId = _a.boardId, flowName = _a.flowName, individuals = _a.individuals, recipient = _a.recipient, onClose = _a.onClose, loading = _a.loading, status = _a.status, terminalStepName = _a.terminalStepName;
|
|
49
49
|
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
50
50
|
var t = useTranslation().t;
|
|
51
51
|
var isAr = useLanguage().isAr;
|
|
@@ -72,7 +72,8 @@ var SuccessFlowButtons = function (_a) {
|
|
|
72
72
|
{ name: 'entity', status: entity === null || entity === void 0 ? void 0 : entity.data_state },
|
|
73
73
|
{ name: 'bank', status: bank === null || bank === void 0 ? void 0 : bank.data_state },
|
|
74
74
|
{ name: 'tax', status: entity === null || entity === void 0 ? void 0 : entity.tax_data_state },
|
|
75
|
-
{ name: 'individual', status: individuals === null || individuals === void 0 ? void 0 : individuals.data_state }
|
|
75
|
+
{ name: 'individual', status: individuals === null || individuals === void 0 ? void 0 : individuals.data_state },
|
|
76
|
+
{ name: 'terminal', status: '' }
|
|
76
77
|
];
|
|
77
78
|
var reMapFlowData = function (flows) {
|
|
78
79
|
if (flows === void 0) { flows = []; }
|
|
@@ -117,7 +118,6 @@ var SuccessFlowButtons = function (_a) {
|
|
|
117
118
|
}, [flows, isAr]);
|
|
118
119
|
useEffect(function () {
|
|
119
120
|
var _a, _b;
|
|
120
|
-
console.log('status', status);
|
|
121
121
|
if ((status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) === 'complete') {
|
|
122
122
|
(_b = (_a = settings.data.appConfig).onBoardCompleted) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
123
123
|
}
|
|
@@ -127,7 +127,8 @@ var SuccessFlowButtons = function (_a) {
|
|
|
127
127
|
email: email || '',
|
|
128
128
|
emailUrl: url,
|
|
129
129
|
brandName: shortenBrand(brandName),
|
|
130
|
-
isAuthorizedUser: is_authorized
|
|
130
|
+
isAuthorizedUser: is_authorized,
|
|
131
|
+
terminalStepName: terminalStepName
|
|
131
132
|
} }) })] }));
|
|
132
133
|
};
|
|
133
134
|
export default memo(SuccessFlowButtons);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
export interface ThankYouProps {
|
|
3
4
|
title?: string;
|
|
@@ -9,6 +10,7 @@ export interface ThankYouProps {
|
|
|
9
10
|
description?: string | React.ReactElement;
|
|
10
11
|
enableBack?: boolean;
|
|
11
12
|
onBack?: () => void;
|
|
13
|
+
sx?: SxProps<Theme>;
|
|
12
14
|
}
|
|
13
|
-
declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error, enableBack, onBack }: ThankYouProps) => JSX.Element>;
|
|
15
|
+
declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error, enableBack, onBack, sx }: ThankYouProps) => JSX.Element>;
|
|
14
16
|
export default _default;
|
|
@@ -55,9 +55,9 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
55
55
|
_b);
|
|
56
56
|
});
|
|
57
57
|
var ThankYou = function (_a) {
|
|
58
|
-
var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error, enableBack = _a.enableBack, onBack = _a.onBack;
|
|
58
|
+
var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error, enableBack = _a.enableBack, onBack = _a.onBack, sx = _a.sx;
|
|
59
59
|
var t = useTranslation().t;
|
|
60
60
|
var isAr = useLanguage().isAr;
|
|
61
|
-
return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), description && _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) })), enableBack && (_jsx(Button, __assign({ sx: { mb: 1.5, mt: 0 }, onClick: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, variant: 'text' }, { children: t('back') })))] }));
|
|
61
|
+
return (_jsxs(ContainerStyled, __assign({ sx: sx }, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), description && _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) })), enableBack && (_jsx(Button, __assign({ sx: { mb: 1.5, mt: 0 }, onClick: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, variant: 'text' }, { children: t('back') })))] })));
|
|
62
62
|
};
|
|
63
63
|
export default React.memo(ThankYou);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LibConfig } from '../../@types';
|
|
3
|
+
export interface TerminalLibProps extends LibConfig {
|
|
4
|
+
verifyToken?: string;
|
|
5
|
+
configToken?: string;
|
|
6
|
+
loaderColor?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TerminalLibFullProps extends TerminalLibProps {
|
|
9
|
+
unmount?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function TerminalElement(props: TerminalLibFullProps): JSX.Element;
|
|
12
|
+
export declare function renderTerminalLib(config: TerminalLibProps, elementId: string): {
|
|
13
|
+
unmount: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import React, { memo } from 'react';
|
|
25
|
+
import { createRoot } from 'react-dom/client';
|
|
26
|
+
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useVerifyToken, useAppDispatch } from '../../hooks';
|
|
27
|
+
import { handleCurrentActiveScreen, settingsSelector } from '../../app/settings';
|
|
28
|
+
import { store } from '../../app/store';
|
|
29
|
+
import AnimationFlow from '../../components/AnimationFlow';
|
|
30
|
+
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
31
|
+
import Collapse from '../../components/Collapse';
|
|
32
|
+
import { findOrCreateElementAndInject, initializeGTM, sendPageView } from '../../utils';
|
|
33
|
+
import { CONNECT_FLOWS, TERMINAL_SCREENS_NAVIGATION } from '../../constants';
|
|
34
|
+
import { FeatureContainer } from '../shared/Containers';
|
|
35
|
+
import { terminalSelector, verifyToken as verifyTokenAPI } from '../app/terminal/terminalStore';
|
|
36
|
+
import { terminalFeatureScreens } from '../featuresScreens';
|
|
37
|
+
import Background from '../shared/Background';
|
|
38
|
+
var Terminal = memo(function (_a) {
|
|
39
|
+
var _b, _c;
|
|
40
|
+
var configToken = _a.configToken, verifyToken = _a.verifyToken, loaderColor = _a.loaderColor, props = __rest(_a, ["configToken", "verifyToken", "loaderColor"]);
|
|
41
|
+
var theme = useAppTheme().theme;
|
|
42
|
+
var dispatch = useAppDispatch();
|
|
43
|
+
var _d = useAppSelector(settingsSelector), data = _d.data, error = _d.error, settingLoading = _d.loading;
|
|
44
|
+
var _e = useAppSelector(terminalSelector), customLoading = _e.customLoading, terminalError = _e.error, loading = _e.loading, terminalListLoading = _e.terminalListLoading;
|
|
45
|
+
useAppConfig(__assign(__assign({ navigation: TERMINAL_SCREENS_NAVIGATION }, props), { disableSettingFetching: props.mode === 'content' ? false : !!verifyToken || !!configToken }));
|
|
46
|
+
useErrorListener(terminalError || error);
|
|
47
|
+
useStepStartedListener();
|
|
48
|
+
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, featureScreensNavigation = data.featureScreensNavigation, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress, appConfig = data.appConfig;
|
|
49
|
+
var animationDirection = open ? (_b = appConfig.features) === null || _b === void 0 ? void 0 : _b.dialogStartTransition : (_c = appConfig.features) === null || _c === void 0 ? void 0 : _c.dialogEndTransition;
|
|
50
|
+
var verifyTokenAndMoveToNextScreen = function (_a) {
|
|
51
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
52
|
+
return function () {
|
|
53
|
+
dispatch(verifyTokenAPI({ token: token, isInternally: isInternally }))
|
|
54
|
+
.unwrap()
|
|
55
|
+
.then(function (_a) {
|
|
56
|
+
var nextScreen = _a.nextScreen;
|
|
57
|
+
dispatch(handleCurrentActiveScreen(nextScreen));
|
|
58
|
+
})
|
|
59
|
+
.catch(function () { });
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
useVerifyToken({
|
|
63
|
+
verify: verifyTokenAndMoveToNextScreen,
|
|
64
|
+
loadingScreenName: CONNECT_FLOWS.terminal.loadingData,
|
|
65
|
+
navigation: featureScreensNavigation,
|
|
66
|
+
open: open,
|
|
67
|
+
mode: props.mode,
|
|
68
|
+
internalToken: verifyToken,
|
|
69
|
+
settingLoading: settingLoading,
|
|
70
|
+
operatorErrorScreenName: CONNECT_FLOWS.terminal.operatorError,
|
|
71
|
+
isValidOperator: data.isValidOperator
|
|
72
|
+
});
|
|
73
|
+
React.useEffect(function () {
|
|
74
|
+
initializeGTM();
|
|
75
|
+
sendPageView({
|
|
76
|
+
title: 'Terminal'
|
|
77
|
+
});
|
|
78
|
+
}, []);
|
|
79
|
+
var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
|
|
80
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading || terminalListLoading ? 'none' : 'auto', isTapOrigin: isTapOrigin, animationDirection: animationDirection, open: open, error: error, loading: initialLoading, loaderColor: loaderColor, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: terminalFeatureScreens.map(function (_a, index) {
|
|
81
|
+
var Element = _a.element, name = _a.name;
|
|
82
|
+
var isActive = activeScreen.name === name;
|
|
83
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
84
|
+
}) })) })) })) })));
|
|
85
|
+
});
|
|
86
|
+
export function TerminalElement(props) {
|
|
87
|
+
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Terminal, __assign({}, props)) })));
|
|
88
|
+
}
|
|
89
|
+
export function renderTerminalLib(config, elementId) {
|
|
90
|
+
var element = findOrCreateElementAndInject(elementId);
|
|
91
|
+
var root = createRoot(element);
|
|
92
|
+
var unmount = function () { return root.unmount(); };
|
|
93
|
+
root.render(_jsx(TerminalElement, __assign({}, config, { unmount: unmount })));
|
|
94
|
+
return { unmount: unmount };
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Terminal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Terminal';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import Box from '@mui/material/Box';
|
|
16
|
+
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
17
|
+
import Button from '../../../../components/Button';
|
|
18
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
|
+
import { formatCode } from '../../../../utils';
|
|
20
|
+
import { CONNECT_FLOWS, TERMINAL_PUSH_NOTIFICATION_DURATION } from '../../../../constants';
|
|
21
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
22
|
+
import PushNotification from '../../../shared/PushNotification';
|
|
23
|
+
import { pushNotificationLinkNewTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
24
|
+
import { CodeDescription, QRCodeImage } from './styles';
|
|
25
|
+
import { LinkNewTerminalContainer, LinkTerminalText, QRCodeDescription } from '../shared';
|
|
26
|
+
var LinkNewTerminal = function () {
|
|
27
|
+
var _a, _b, _c, _d;
|
|
28
|
+
var t = useTranslation().t;
|
|
29
|
+
var dispatch = useAppDispatch();
|
|
30
|
+
var data = useAppSelector(terminalSelector).data;
|
|
31
|
+
var _e = React.useState(false), isReady = _e[0], setIsReady = _e[1];
|
|
32
|
+
var _f = React.useState(false), success = _f[0], setSuccess = _f[1];
|
|
33
|
+
var _g = React.useState(false), failed = _g[0], setFailed = _g[1];
|
|
34
|
+
var terminalInfo = data.terminalInfo, responseData = data.responseData;
|
|
35
|
+
var _h = responseData || {}, terminalData = _h.terminalData, linkNewTerminalData = _h.linkNewTerminalData;
|
|
36
|
+
var terminal_devices = (terminalData || {}).terminal_devices;
|
|
37
|
+
var qrCode = "data:image/png;base64,".concat((_a = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _a === void 0 ? void 0 : _a.qr);
|
|
38
|
+
var code = (_b = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _b === void 0 ? void 0 : _b.code;
|
|
39
|
+
var expiry = TERMINAL_PUSH_NOTIFICATION_DURATION;
|
|
40
|
+
var deviceName = ((_d = (_c = terminalInfo.selectedTerminalDevice.model) === null || _c === void 0 ? void 0 : _c.name[0]) === null || _d === void 0 ? void 0 : _d.text) || '';
|
|
41
|
+
var newTerminal = true;
|
|
42
|
+
React.useEffect(function () {
|
|
43
|
+
if (linkNewTerminalData && !isReady) {
|
|
44
|
+
setIsReady(true);
|
|
45
|
+
}
|
|
46
|
+
}, [linkNewTerminalData]);
|
|
47
|
+
React.useEffect(function () {
|
|
48
|
+
if (!isReady)
|
|
49
|
+
return;
|
|
50
|
+
var promise = dispatch(pushNotificationLinkNewTerminal({ newTerminal: newTerminal, onSuccess: function () { return setSuccess(true); }, onFailure: function () { return setFailed(true); } }));
|
|
51
|
+
promise
|
|
52
|
+
.unwrap()
|
|
53
|
+
.then(function (_a) {
|
|
54
|
+
var nextScreen = _a.nextScreen;
|
|
55
|
+
if (nextScreen)
|
|
56
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
57
|
+
})
|
|
58
|
+
.catch(function () { });
|
|
59
|
+
return function () {
|
|
60
|
+
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
61
|
+
};
|
|
62
|
+
}, [isReady]);
|
|
63
|
+
var handleOnBack = function () {
|
|
64
|
+
var previousScreen = (terminal_devices === null || terminal_devices === void 0 ? void 0 : terminal_devices.length) ? CONNECT_FLOWS.terminal.terminalList : CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
65
|
+
dispatch(handlePrevScreenStep(previousScreen));
|
|
66
|
+
};
|
|
67
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 200, justifyContent: 'space-between' }, { children: [_jsx(PushNotification, __assign({ error: t('terminal_request_denied', { device: deviceName }), failed: failed, success: success, expiryInSeconds: expiry }, { children: _jsxs(LinkNewTerminalContainer, { children: [_jsx(LinkTerminalText, { children: t('terminal_link_terminal') }), _jsx(QRCodeDescription, { children: t('terminal_qr_code_description') }), _jsx(QRCodeImage, { src: qrCode }), code && (_jsxs(_Fragment, { children: [_jsx(LinkTerminalText, { children: t('terminal_or_use_code') }), _jsx(CodeDescription, { children: formatCode(code) })] }))] }) })), _jsx(Box, __assign({ sx: { ml: 2.5, mr: 2.5 } }, { children: _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: handleOnBack, variant: 'text' }, { children: t('back') })) }))] })));
|
|
68
|
+
};
|
|
69
|
+
export default React.memo(LinkNewTerminal);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const QRCodeImage: import("@emotion/styled").StyledComponent<import("../../../../components/Icon").IconProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
3
|
+
export declare const CodeDescription: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
4
|
+
children?: import("react").ReactNode;
|
|
5
|
+
component?: import("react").ElementType<any> | undefined;
|
|
6
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
7
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
8
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
9
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
10
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import Box from '@mui/material/Box';
|
|
13
|
+
import { styled } from '@mui/material/styles';
|
|
14
|
+
import Icon from '../../../../components/Icon';
|
|
15
|
+
export var QRCodeImage = styled(Icon)(function (_a) {
|
|
16
|
+
var spacing = _a.theme.spacing;
|
|
17
|
+
return ({
|
|
18
|
+
margin: '0px auto',
|
|
19
|
+
width: spacing(31.25),
|
|
20
|
+
height: spacing(31.25),
|
|
21
|
+
marginTop: spacing(2.5),
|
|
22
|
+
marginBottom: spacing(2.5)
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
export var CodeDescription = styled(Box)(function (_a) {
|
|
26
|
+
var _b = _a.theme, palette = _b.palette, spacing = _b.spacing, typography = _b.typography;
|
|
27
|
+
return (__assign(__assign({ backgroundColor: palette.common.white, padding: spacing(1.375, 2), color: palette.components.deviceCard.title }, typography.h4_small), { fontWeight: typography.fontWeightBold, display: 'flex', justifyContent: 'center' }));
|
|
28
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import Box from '@mui/material/Box';
|
|
16
|
+
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
17
|
+
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
18
|
+
import { retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalDeviceList, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
19
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
20
|
+
import Button from '../../../shared/Button';
|
|
21
|
+
import { getTerminalName, SuccessContainerStyled } from '../shared';
|
|
22
|
+
import { CONNECT_FLOWS } from '../../../../constants';
|
|
23
|
+
var LinkedSuccess = function () {
|
|
24
|
+
var t = useTranslation().t;
|
|
25
|
+
var isAr = useLanguage().isAr;
|
|
26
|
+
var dispatch = useAppDispatch();
|
|
27
|
+
var _a = useAppSelector(terminalSelector), error = _a.error, loading = _a.loading, _b = _a.data, selectedTerminal = _b.terminalInfo.selectedTerminal, responseData = _b.responseData;
|
|
28
|
+
var _c = responseData || {}, boardData = _c.boardData, authData = _c.authData;
|
|
29
|
+
var deviceName = getTerminalName(selectedTerminal);
|
|
30
|
+
var handleGoToBoard = function () {
|
|
31
|
+
var board_id = (boardData || {}).id;
|
|
32
|
+
var _a = (authData === null || authData === void 0 ? void 0 : authData.recipient) || {}, id = _a.id, type = _a.type;
|
|
33
|
+
dispatch(retrieveTerminalDeviceList());
|
|
34
|
+
dispatch(retrieveBoardStatus({ boardId: board_id }))
|
|
35
|
+
.unwrap()
|
|
36
|
+
.then(function () {
|
|
37
|
+
dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type }))
|
|
38
|
+
.unwrap()
|
|
39
|
+
.then(function () {
|
|
40
|
+
dispatch(handleNextScreenStep(CONNECT_FLOWS.terminal.board));
|
|
41
|
+
})
|
|
42
|
+
.catch(function () { });
|
|
43
|
+
})
|
|
44
|
+
.catch(function () { });
|
|
45
|
+
};
|
|
46
|
+
var handleOnBack = function () {
|
|
47
|
+
dispatch(handlePrevScreenStep());
|
|
48
|
+
};
|
|
49
|
+
return (_jsxs(SuccessContainerStyled, { children: [_jsx(SuccessScreen, { sx: { minHeight: 'unset', ml: 2.5, mr: 2.5 }, title: t('terminal_linked_success', { device: deviceName }), successTitle: t('terminal_go_to_board'), loading: loading, error: error || '' }), _jsx(Box, __assign({ sx: { width: '100%' } }, { children: _jsx(Button, __assign({ loading: loading, disableBack: true, onBackClicked: handleOnBack, onClick: handleGoToBoard, isAr: isAr }, { children: t('terminal_go_to_board') })) }))] }));
|
|
50
|
+
};
|
|
51
|
+
export default React.memo(LinkedSuccess);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
16
|
+
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
17
|
+
import { useTheme } from '@mui/material';
|
|
18
|
+
import { CONNECT_FLOWS, ICONS_NAMES } from '../../../../constants';
|
|
19
|
+
import DeviceCard from '../../../../components/DeviceCard';
|
|
20
|
+
import Warning from '../../../../components/Warning';
|
|
21
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
22
|
+
import Button from '../../../shared/Button';
|
|
23
|
+
import { clearError, terminalSelector, unlinkTerminalDevice } from '../../../app/terminal/terminalStore';
|
|
24
|
+
import { Container, getId, getIdLabel, getPairedWith, LinkWithText } from '../shared';
|
|
25
|
+
var LinkedTerminalInfo = function () {
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
27
|
+
var t = useTranslation().t;
|
|
28
|
+
var _h = useTheme(), spacing = _h.spacing, palette = _h.palette;
|
|
29
|
+
var dispatch = useAppDispatch();
|
|
30
|
+
var isAr = useLanguage().isAr;
|
|
31
|
+
var _j = useAppSelector(terminalSelector), error = _j.error, selectedTerminalDevice = _j.data.terminalInfo.selectedTerminalDevice, loading = _j.loading;
|
|
32
|
+
var model = selectedTerminalDevice.model, linked = selectedTerminalDevice.linked, display_name = selectedTerminalDevice.display_name, terminal = selectedTerminalDevice.terminal, platform = selectedTerminalDevice.platform;
|
|
33
|
+
var _k = (model || {}).image_url, image_url = _k === void 0 ? ICONS_NAMES.device_image : _k;
|
|
34
|
+
var deviceName = (_b = (_a = terminal === null || terminal === void 0 ? void 0 : terminal.device) === null || _a === void 0 ? void 0 : _a.display_name) !== null && _b !== void 0 ? _b : (_c = terminal === null || terminal === void 0 ? void 0 : terminal.name) === null || _c === void 0 ? void 0 : _c.en;
|
|
35
|
+
var deviceImage = (_e = (_d = platform === null || platform === void 0 ? void 0 : platform.brand) === null || _d === void 0 ? void 0 : _d.logo) !== null && _e !== void 0 ? _e : ICONS_NAMES.platform_image;
|
|
36
|
+
var deviceId = (_g = (_f = terminal === null || terminal === void 0 ? void 0 : terminal.device) === null || _f === void 0 ? void 0 : _f.id) !== null && _g !== void 0 ? _g : terminal === null || terminal === void 0 ? void 0 : terminal.legacy_id;
|
|
37
|
+
React.useEffect(function () {
|
|
38
|
+
if (error)
|
|
39
|
+
dispatch(clearError());
|
|
40
|
+
}, []);
|
|
41
|
+
var handleOnNext = function () {
|
|
42
|
+
dispatch(unlinkTerminalDevice())
|
|
43
|
+
.unwrap()
|
|
44
|
+
.then(function (_a) {
|
|
45
|
+
var nextScreen = _a.nextScreen;
|
|
46
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
47
|
+
})
|
|
48
|
+
.catch(function () { });
|
|
49
|
+
};
|
|
50
|
+
var handleOnBack = function () {
|
|
51
|
+
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.terminalDeviceList));
|
|
52
|
+
};
|
|
53
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 224, justifyContent: 'space-between' }, { children: [_jsxs(Container, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: [_jsx(DeviceCard, { badge: true, image: image_url, name: display_name, deviceId: getId(selectedTerminalDevice), deviceIdLabel: getIdLabel(selectedTerminalDevice), pairedWith: getPairedWith(selectedTerminalDevice), isLinked: linked }), _jsx(LinkWithText, { children: t('terminal_linked_with') }), _jsx(DeviceCard, { sx: { minHeight: spacing(10), borderRadius: spacing(1), background: palette.components.deviceCard.deviceInfoBackground }, image: deviceImage || '', name: deviceName || '', deviceId: deviceId !== null && deviceId !== void 0 ? deviceId : '', isLinked: linked })] })), error && _jsx(Warning, __assign({ sx: { mt: 2 } }, { children: t(error) })), _jsx(Button, __assign({ loading: loading, onBackClicked: handleOnBack, onClick: handleOnNext, isAr: isAr }, { children: t('terminal_unlink') }))] })));
|
|
54
|
+
};
|
|
55
|
+
export default React.memo(LinkedTerminalInfo);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { useAppSelector } from '../../../../hooks';
|
|
4
|
+
import DataLoading from '../../../shared/DataLoading';
|
|
5
|
+
import { terminalSelector } from '../../../app/terminal/terminalStore';
|
|
6
|
+
export var Loading = function () {
|
|
7
|
+
var error = useAppSelector(terminalSelector).error;
|
|
8
|
+
return _jsx(DataLoading, { error: error });
|
|
9
|
+
};
|
|
10
|
+
export default memo(Loading);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
16
|
+
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
17
|
+
import Button from '../../../../components/Button';
|
|
18
|
+
import Loader from '../../../../components/Loader';
|
|
19
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
20
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import { linkNewTerminal, retrieveBoardDetails, retrieveBoardStatus, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
22
|
+
import { DescriptionTypography, DeviceImage, NoTerminalDeviceLinkedContainer, TitleTypography } from './styles';
|
|
23
|
+
var NoTerminalDeviceLinked = function () {
|
|
24
|
+
var t = useTranslation().t;
|
|
25
|
+
var isAr = useLanguage().isAr;
|
|
26
|
+
var dispatch = useAppDispatch();
|
|
27
|
+
var _a = useAppSelector(terminalSelector), loading = _a.loading, data = _a.data;
|
|
28
|
+
var _b = data.responseData || {}, boardFlows = _b.boardFlows, authData = _b.authData, boardData = _b.boardData;
|
|
29
|
+
var handleOnClickNewTerminalLink = function () {
|
|
30
|
+
dispatch(linkNewTerminal())
|
|
31
|
+
.unwrap()
|
|
32
|
+
.then(function (_a) {
|
|
33
|
+
var nextScreen = _a.nextScreen;
|
|
34
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
35
|
+
})
|
|
36
|
+
.catch(function () { });
|
|
37
|
+
};
|
|
38
|
+
var handleOnBack = function () {
|
|
39
|
+
if ((boardFlows === null || boardFlows === void 0 ? void 0 : boardFlows.length) > 0) {
|
|
40
|
+
dispatch(handlePrevScreenStep());
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
var _a = (authData === null || authData === void 0 ? void 0 : authData.recipient) || {}, id = _a.id, type = _a.type;
|
|
44
|
+
var board_id = (boardData || {}).id;
|
|
45
|
+
dispatch(retrieveBoardStatus({ boardId: board_id }))
|
|
46
|
+
.unwrap()
|
|
47
|
+
.then(function () {
|
|
48
|
+
dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type }))
|
|
49
|
+
.unwrap()
|
|
50
|
+
.then(function () {
|
|
51
|
+
dispatch(handlePrevScreenStep());
|
|
52
|
+
});
|
|
53
|
+
})
|
|
54
|
+
.catch(function () { });
|
|
55
|
+
};
|
|
56
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { ml: 2.5, mr: 2.5 }, minHeight: 280, justifyContent: 'space-between' }, { children: [_jsxs(NoTerminalDeviceLinkedContainer, { children: [_jsx(DeviceImage, { src: ICONS_NAMES.terminal_device }), _jsx(TitleTypography, { children: t('terminal_no_terminal_linked') }), _jsx(DescriptionTypography, { children: t('terminal_no_terminal_linked_description') })] }), _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: loading ? _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 15, toggleAnimation: !!loading }) : t('back') }))] })));
|
|
57
|
+
};
|
|
58
|
+
export default React.memo(NoTerminalDeviceLinked);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const NoTerminalDeviceLinkedContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
component?: import("react").ElementType<any> | undefined;
|
|
5
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
6
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
7
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
8
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
9
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
10
|
+
export declare const DeviceImage: import("@emotion/styled").StyledComponent<import("../../../../components/Icon").IconProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
11
|
+
export declare const TitleTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
12
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
13
|
+
children?: import("react").ReactNode;
|
|
14
|
+
classes?: Partial<import("@mui/material/Typography").TypographyClasses> | undefined;
|
|
15
|
+
gutterBottom?: boolean | undefined;
|
|
16
|
+
noWrap?: boolean | undefined;
|
|
17
|
+
paragraph?: boolean | undefined;
|
|
18
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
19
|
+
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
|
|
20
|
+
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", string>> | undefined;
|
|
21
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
|
|
22
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
23
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
24
|
+
export declare const DescriptionTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
25
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
26
|
+
children?: import("react").ReactNode;
|
|
27
|
+
classes?: Partial<import("@mui/material/Typography").TypographyClasses> | undefined;
|
|
28
|
+
gutterBottom?: boolean | undefined;
|
|
29
|
+
noWrap?: boolean | undefined;
|
|
30
|
+
paragraph?: boolean | undefined;
|
|
31
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
32
|
+
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
|
|
33
|
+
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", string>> | undefined;
|
|
34
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
|
|
35
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
36
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|