@tap-payments/auth-jsconnect 2.10.9-beta → 2.10.9-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 +9 -2
- package/build/@types/app.js +8 -0
- package/build/@types/form.d.ts +3 -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 +10 -1
- package/build/api/index.d.ts +7 -1
- package/build/api/index.js +3 -1
- 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.d.ts +1 -0
- package/build/app/settings.js +7 -3
- package/build/app/store.d.ts +2 -0
- package/build/assets/currencies/AEDSymbol.d.ts +7 -0
- package/build/assets/currencies/AEDSymbol.js +28 -0
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +6 -0
- package/build/assets/locales/ar.json +43 -6
- package/build/assets/locales/en.json +46 -9
- 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/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- 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 +15 -3
- package/build/constants/app.js +157 -24
- package/build/constants/assets.d.ts +11 -0
- package/build/constants/assets.js +17 -3
- package/build/constants/flows.d.ts +15 -0
- package/build/constants/flows.js +15 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.d.ts +24 -5
- package/build/features/app/auth/authStore.js +136 -71
- package/build/features/app/connectExpress/connectExpressStore.d.ts +14 -3
- package/build/features/app/connectExpress/connectExpressStore.js +178 -30
- 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 +109 -0
- package/build/features/app/terminal/terminalStore.js +673 -0
- package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
- package/build/features/auth/screens/OTP/OTP.js +15 -3
- package/build/features/auth/screens/OTP/index.d.ts +1 -2
- package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
- package/build/features/auth/screens/Passcode/Passcode.js +82 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
- package/build/features/auth/screens/Passcode/index.d.ts +2 -0
- package/build/features/auth/screens/Passcode/index.js +2 -0
- package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
- package/build/features/auth/screens/Passcode/validation.js +4 -0
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.js +49 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.js +88 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +9 -3
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +77 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/shared/Background/LogoBackground.js +5 -17
- package/build/features/shared/Button/Button.js +2 -3
- package/build/features/shared/Button/FlowsButtons.js +1 -1
- package/build/features/shared/Input/Input.d.ts +1 -1
- 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.js +2 -2
- 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 +68 -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 +50 -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 +56 -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 +31 -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 +144 -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 +42 -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/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.js +4 -4
- package/build/utils/string.d.ts +2 -2
- package/build/utils/string.js +4 -1
- package/package.json +2 -2
|
@@ -0,0 +1,68 @@
|
|
|
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 { CONNECT_FLOWS, TERMINAL_PUSH_NOTIFICATION_DURATION } from '../../../../constants';
|
|
20
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import PushNotification from '../../../shared/PushNotification';
|
|
22
|
+
import { pushNotificationLinkNewTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
23
|
+
import { CodeDescription, QRCodeImage } from './styles';
|
|
24
|
+
import { LinkNewTerminalContainer, LinkTerminalText, QRCodeDescription } from '../shared';
|
|
25
|
+
var LinkNewTerminal = function () {
|
|
26
|
+
var _a, _b, _c, _d;
|
|
27
|
+
var t = useTranslation().t;
|
|
28
|
+
var dispatch = useAppDispatch();
|
|
29
|
+
var data = useAppSelector(terminalSelector).data;
|
|
30
|
+
var _e = React.useState(false), isReady = _e[0], setIsReady = _e[1];
|
|
31
|
+
var _f = React.useState(false), success = _f[0], setSuccess = _f[1];
|
|
32
|
+
var _g = React.useState(false), failed = _g[0], setFailed = _g[1];
|
|
33
|
+
var terminalInfo = data.terminalInfo, responseData = data.responseData;
|
|
34
|
+
var _h = responseData || {}, terminalData = _h.terminalData, linkNewTerminalData = _h.linkNewTerminalData;
|
|
35
|
+
var terminal_devices = (terminalData || {}).terminal_devices;
|
|
36
|
+
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);
|
|
37
|
+
var code = (_b = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _b === void 0 ? void 0 : _b.code;
|
|
38
|
+
var expiry = TERMINAL_PUSH_NOTIFICATION_DURATION;
|
|
39
|
+
var deviceName = ((_d = (_c = terminalInfo.selectedTerminalDevice.model) === null || _c === void 0 ? void 0 : _c.name[0]) === null || _d === void 0 ? void 0 : _d.text) || '';
|
|
40
|
+
var newTerminal = true;
|
|
41
|
+
React.useEffect(function () {
|
|
42
|
+
if (linkNewTerminalData && !isReady) {
|
|
43
|
+
setIsReady(true);
|
|
44
|
+
}
|
|
45
|
+
}, [linkNewTerminalData]);
|
|
46
|
+
React.useEffect(function () {
|
|
47
|
+
if (!isReady)
|
|
48
|
+
return;
|
|
49
|
+
var promise = dispatch(pushNotificationLinkNewTerminal({ newTerminal: newTerminal, onSuccess: function () { return setSuccess(true); }, onFailure: function () { return setFailed(true); } }));
|
|
50
|
+
promise
|
|
51
|
+
.unwrap()
|
|
52
|
+
.then(function (_a) {
|
|
53
|
+
var nextScreen = _a.nextScreen;
|
|
54
|
+
if (nextScreen)
|
|
55
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
56
|
+
})
|
|
57
|
+
.catch(function () { });
|
|
58
|
+
return function () {
|
|
59
|
+
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
60
|
+
};
|
|
61
|
+
}, [isReady]);
|
|
62
|
+
var handleOnBack = function () {
|
|
63
|
+
var previousScreen = (terminal_devices === null || terminal_devices === void 0 ? void 0 : terminal_devices.length) ? CONNECT_FLOWS.terminal.terminalList : CONNECT_FLOWS.terminal.noTerminalLinked;
|
|
64
|
+
dispatch(handlePrevScreenStep(previousScreen));
|
|
65
|
+
};
|
|
66
|
+
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: 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') })) }))] })));
|
|
67
|
+
};
|
|
68
|
+
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(21.875),
|
|
20
|
+
height: spacing(21.875),
|
|
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,50 @@
|
|
|
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 { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import Button from '../../../shared/Button';
|
|
22
|
+
import { terminalSelector, unlinkTerminalDevice } from '../../../app/terminal/terminalStore';
|
|
23
|
+
import { Container, getId, getIdLabel, getPairedWith, LinkWithText } from '../shared';
|
|
24
|
+
var LinkedTerminalInfo = function () {
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
26
|
+
var t = useTranslation().t;
|
|
27
|
+
var _h = useTheme(), spacing = _h.spacing, palette = _h.palette;
|
|
28
|
+
var dispatch = useAppDispatch();
|
|
29
|
+
var isAr = useLanguage().isAr;
|
|
30
|
+
var _j = useAppSelector(terminalSelector), selectedTerminalDevice = _j.data.terminalInfo.selectedTerminalDevice, loading = _j.loading;
|
|
31
|
+
var model = selectedTerminalDevice.model, linked = selectedTerminalDevice.linked, display_name = selectedTerminalDevice.display_name, terminal = selectedTerminalDevice.terminal, platform = selectedTerminalDevice.platform;
|
|
32
|
+
var _k = (model || {}).image_url, image_url = _k === void 0 ? ICONS_NAMES.device_image : _k;
|
|
33
|
+
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;
|
|
34
|
+
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;
|
|
35
|
+
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;
|
|
36
|
+
var handleOnNext = function () {
|
|
37
|
+
dispatch(unlinkTerminalDevice())
|
|
38
|
+
.unwrap()
|
|
39
|
+
.then(function (_a) {
|
|
40
|
+
var nextScreen = _a.nextScreen;
|
|
41
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
42
|
+
})
|
|
43
|
+
.catch(function () { });
|
|
44
|
+
};
|
|
45
|
+
var handleOnBack = function () {
|
|
46
|
+
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.terminalDeviceList));
|
|
47
|
+
};
|
|
48
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 224, sx: { pl: 2.5, pr: 2.5 }, justifyContent: 'space-between' }, { children: [_jsxs(Container, { 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 })] }), _jsx(Button, __assign({ sx: { ml: 0, mr: 0 }, loading: loading, onBackClicked: handleOnBack, onClick: handleOnNext, isAr: isAr }, { children: t('terminal_unlink') }))] })));
|
|
49
|
+
};
|
|
50
|
+
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,56 @@
|
|
|
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 { ICONS_NAMES } from '../../../../constants';
|
|
18
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
19
|
+
import { linkNewTerminal, retrieveBoardDetails, retrieveBoardStatus, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
20
|
+
import { DescriptionTypography, DeviceImage, NoTerminalDeviceLinkedContainer, TitleTypography } from './styles';
|
|
21
|
+
var NoTerminalDeviceLinked = function () {
|
|
22
|
+
var t = useTranslation().t;
|
|
23
|
+
var isAr = useLanguage().isAr;
|
|
24
|
+
var dispatch = useAppDispatch();
|
|
25
|
+
var _a = useAppSelector(terminalSelector), loading = _a.loading, data = _a.data;
|
|
26
|
+
var _b = data.responseData || {}, boardFlows = _b.boardFlows, authData = _b.authData, boardData = _b.boardData;
|
|
27
|
+
var handleOnClickNewTerminalLink = function () {
|
|
28
|
+
dispatch(linkNewTerminal())
|
|
29
|
+
.unwrap()
|
|
30
|
+
.then(function (_a) {
|
|
31
|
+
var nextScreen = _a.nextScreen;
|
|
32
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
33
|
+
})
|
|
34
|
+
.catch(function () { });
|
|
35
|
+
};
|
|
36
|
+
var handleOnBack = function () {
|
|
37
|
+
if ((boardFlows === null || boardFlows === void 0 ? void 0 : boardFlows.length) > 0) {
|
|
38
|
+
dispatch(handlePrevScreenStep());
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
var _a = (authData === null || authData === void 0 ? void 0 : authData.recipient) || {}, id = _a.id, type = _a.type;
|
|
42
|
+
var board_id = (boardData || {}).id;
|
|
43
|
+
dispatch(retrieveBoardStatus({ boardId: board_id }))
|
|
44
|
+
.unwrap()
|
|
45
|
+
.then(function () {
|
|
46
|
+
dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type }))
|
|
47
|
+
.unwrap()
|
|
48
|
+
.then(function () {
|
|
49
|
+
dispatch(handlePrevScreenStep());
|
|
50
|
+
});
|
|
51
|
+
})
|
|
52
|
+
.catch(function () { });
|
|
53
|
+
};
|
|
54
|
+
return (_jsx(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') })] }) })));
|
|
55
|
+
};
|
|
56
|
+
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>, {}, {}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { alpha, styled } from '@mui/material/styles';
|
|
13
|
+
import Typography from '@mui/material/Typography';
|
|
14
|
+
import Icon from '../../../../components/Icon';
|
|
15
|
+
import { Container } from '../shared';
|
|
16
|
+
export var NoTerminalDeviceLinkedContainer = styled(Container)(function () { return ({
|
|
17
|
+
alignItems: 'center'
|
|
18
|
+
}); });
|
|
19
|
+
export var DeviceImage = styled(Icon)(function (_a) {
|
|
20
|
+
var spacing = _a.theme.spacing;
|
|
21
|
+
return ({
|
|
22
|
+
margin: '0px auto',
|
|
23
|
+
width: spacing(8.25),
|
|
24
|
+
height: spacing(8.25)
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
export var TitleTypography = styled(Typography)(function (_a) {
|
|
28
|
+
var _b = _a.theme, palette = _b.palette, typography = _b.typography, spacing = _b.spacing;
|
|
29
|
+
return (__assign(__assign({}, typography.body1), { fontWeight: typography.fontWeightBold, color: palette.info.dark, marginTop: spacing(3.25) }));
|
|
30
|
+
});
|
|
31
|
+
export var DescriptionTypography = styled(Typography)(function (_a) {
|
|
32
|
+
var _b = _a.theme, palette = _b.palette, typography = _b.typography, spacing = _b.spacing;
|
|
33
|
+
return (__assign(__assign({}, typography.caption), { fontWeight: typography.fontWeightMedium, color: alpha(palette.components.deviceCard.title, 0.5), marginTop: spacing(1) }));
|
|
34
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import GenericError from '../../../shared/GenericError';
|
|
5
|
+
var OperatorError = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
+
};
|
|
9
|
+
export default React.memo(OperatorError);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
4
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
5
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
6
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
7
|
+
import { maskEmail } from '../../../../utils';
|
|
8
|
+
import { terminalSelector } from '../../../app/terminal/terminalStore';
|
|
9
|
+
var ResetPasswordSuccess = function () {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
var t = useTranslation().t;
|
|
12
|
+
var dispatch = useAppDispatch();
|
|
13
|
+
var data = useAppSelector(terminalSelector).data;
|
|
14
|
+
var email = (((_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.business) === null || _b === void 0 ? void 0 : _b.primary_contact) || {}).email;
|
|
15
|
+
var maskedEmail = maskEmail(email);
|
|
16
|
+
var onBack = function () {
|
|
17
|
+
dispatch(handlePrevScreenStep());
|
|
18
|
+
};
|
|
19
|
+
return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: _jsx(Trans, { i18nKey: 'reset_password_success_description_dev', values: { email: maskedEmail } }), showEmailProviders: true, enableBack: true, onBack: function () { return onBack(); } }));
|
|
20
|
+
};
|
|
21
|
+
export default React.memo(ResetPasswordSuccess);
|
|
@@ -0,0 +1,31 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import { memo } from 'react';
|
|
14
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
15
|
+
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
16
|
+
import { SCOPE_AUTH } from '../../../../constants';
|
|
17
|
+
import SuccessFlowButtons from '../../../shared/SuccessFlowButtons';
|
|
18
|
+
import { onCloseCompleteTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
19
|
+
var SuccessWithFlowButtons = function () {
|
|
20
|
+
var dispatch = useAppDispatch();
|
|
21
|
+
var _a = useAppSelector(terminalSelector), data = _a.data, loading = _a.loading;
|
|
22
|
+
var settingsData = useAppSelector(settingsSelector).data;
|
|
23
|
+
var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
|
|
24
|
+
var _b = data.responseData || {}, boardFlows = _b.boardFlows, boardData = _b.boardData;
|
|
25
|
+
var _c = boardData || {}, entity = _c.entity, brand = _c.brand, bank = _c.bank_account, merchant = _c.merchant, user = _c.user, business = _c.business, board_id = _c.board_id, board_info_id = _c.board_info_id, name = _c.name, individuals = _c.individuals, recipient = _c.recipient, board_status = _c.board_status;
|
|
26
|
+
var onClose = function () {
|
|
27
|
+
dispatch(onCloseCompleteTerminal());
|
|
28
|
+
};
|
|
29
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: boardFlows || [], onClose: isScopeAuthentication ? onClose : undefined, recipient: recipient, status: board_status }));
|
|
30
|
+
};
|
|
31
|
+
export default memo(SuccessWithFlowButtons);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TerminalDeviceInfo } from '../../../../@types';
|
|
3
|
+
interface DeviceListProps {
|
|
4
|
+
devices: TerminalDeviceInfo[];
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
onClick: (device: TerminalDeviceInfo) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ devices, onClick, loading }: DeviceListProps) => JSX.Element>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useState } from 'react';
|
|
3
|
+
import DeviceCard from '../../../../components/DeviceCard';
|
|
4
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
5
|
+
import { DeviceListContainer } from './styles';
|
|
6
|
+
import { getId, getIdLabel, getPairedWith } from '../shared';
|
|
7
|
+
var DeviceList = function (_a) {
|
|
8
|
+
var devices = _a.devices, onClick = _a.onClick, loading = _a.loading;
|
|
9
|
+
var defaultImage = ICONS_NAMES.device_image;
|
|
10
|
+
var _b = useState(), selected = _b[0], setSelected = _b[1];
|
|
11
|
+
var handleOnClick = function (device) {
|
|
12
|
+
setSelected(device);
|
|
13
|
+
onClick(device);
|
|
14
|
+
};
|
|
15
|
+
return (_jsx(DeviceListContainer, { children: devices.map(function (device, index) {
|
|
16
|
+
var _a;
|
|
17
|
+
return (_jsx(DeviceCard, { onClick: function () { return handleOnClick(device); }, loading: device.id === (selected === null || selected === void 0 ? void 0 : selected.id) && loading, image: (_a = device.model.image_url) !== null && _a !== void 0 ? _a : defaultImage, name: device.display_name, deviceId: getId(device), pairedWith: getPairedWith(device), deviceIdLabel: getIdLabel(device), isLinked: device.linked, arrow: true, badge: true }, index));
|
|
18
|
+
}) }));
|
|
19
|
+
};
|
|
20
|
+
export default memo(DeviceList);
|