@tap-payments/auth-jsconnect 2.10.14-beta → 2.10.14-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/README.md +2 -2
- package/build/@types/app.d.ts +4 -2
- package/build/@types/app.js +2 -0
- package/build/@types/form.d.ts +6 -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/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/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/index.d.ts +2 -2
- package/build/assets/currencies/index.js +2 -2
- package/build/assets/currencies/utils.js +3 -1
- package/build/assets/locales/ar.json +47 -11
- package/build/assets/locales/en.json +50 -14
- 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.js +1 -1
- 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 +13 -3
- package/build/constants/app.js +127 -6
- package/build/constants/assets.d.ts +11 -6
- package/build/constants/assets.js +118 -107
- package/build/constants/dummy.js +27 -20
- 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/auth/authStore.d.ts +24 -5
- package/build/features/app/auth/authStore.js +143 -77
- package/build/features/app/business/businessStore.js +5 -4
- package/build/features/app/connectExpress/connectExpressStore.js +14 -10
- 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/AuthenticationList.js +14 -8
- package/build/features/auth/screens/AuthenticationList/UnifiedNumber.d.ts +35 -0
- package/build/features/auth/screens/AuthenticationList/UnifiedNumber.js +80 -0
- package/build/features/auth/screens/AuthenticationList/validation.d.ts +22 -0
- package/build/features/auth/screens/AuthenticationList/validation.js +77 -1
- 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/business/screens/BusinessType/BusinessType.js +12 -2
- package/build/features/business/screens/BusinessType/LicenseList.js +4 -1
- 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 -7
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +14 -9
- package/build/features/connectExpress/screens/AuthenticationList/UnifiedNumber.d.ts +35 -0
- package/build/features/connectExpress/screens/AuthenticationList/UnifiedNumber.js +80 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +22 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +77 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +13 -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 +21 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +44 -13
- 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 +72 -0
- package/build/features/shared/Button/Button.js +2 -3
- package/build/features/shared/Button/FlowsButtons.js +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 +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 +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 +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/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 -1
- package/build/utils/string.js +10 -1
- package/package.json +2 -2
|
@@ -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);
|
|
@@ -0,0 +1,153 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
+
import * as React from 'react';
|
|
50
|
+
import { useTranslation } from 'react-i18next';
|
|
51
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
52
|
+
import { CONNECT_FLOWS } from '../../../../constants';
|
|
53
|
+
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
54
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
55
|
+
import Button from '../../../../components/Button';
|
|
56
|
+
import Loader from '../../../../components/Loader';
|
|
57
|
+
import Warning from '../../../../components/Warning';
|
|
58
|
+
import Box from '@mui/material/Box';
|
|
59
|
+
import { clearError, resetTerminalLinkResponse, retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalList, storeSelectedTerminalDevice, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
60
|
+
import { Header, Container, TextTypography } from '../shared';
|
|
61
|
+
import DeviceList from './DeviceList';
|
|
62
|
+
var TerminalDeviceList = function () {
|
|
63
|
+
var t = useTranslation().t;
|
|
64
|
+
var dispatch = useAppDispatch();
|
|
65
|
+
var _a = useAppSelector(terminalSelector), data = _a.data, loading = _a.loading, terminalListLoading = _a.terminalListLoading, error = _a.error;
|
|
66
|
+
var _b = React.useState(false), newLinkClicked = _b[0], setNewLinkClicked = _b[1];
|
|
67
|
+
var _c = data.responseData || {}, boardFlows = _c.boardFlows, authData = _c.authData, boardData = _c.boardData, terminalData = _c.terminalData, terminalList = _c.terminalList;
|
|
68
|
+
var terminal_devices = (terminalData || {}).terminal_devices;
|
|
69
|
+
var _d = React.useMemo(function () {
|
|
70
|
+
var linked = terminal_devices === null || terminal_devices === void 0 ? void 0 : terminal_devices.filter(function (d) { return d.linked; });
|
|
71
|
+
var unLinked = terminal_devices === null || terminal_devices === void 0 ? void 0 : terminal_devices.filter(function (d) { return !d.linked; });
|
|
72
|
+
return { linkedDevices: linked, unLinkedDevices: unLinked };
|
|
73
|
+
}, [terminal_devices]), linkedDevices = _d.linkedDevices, unLinkedDevices = _d.unLinkedDevices;
|
|
74
|
+
var handleOnClickNewTerminalLink = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
75
|
+
return __generator(this, function (_a) {
|
|
76
|
+
switch (_a.label) {
|
|
77
|
+
case 0:
|
|
78
|
+
setNewLinkClicked(true);
|
|
79
|
+
return [4, retrieveTerminalListAsync(CONNECT_FLOWS.terminal.terminalList)];
|
|
80
|
+
case 1:
|
|
81
|
+
_a.sent();
|
|
82
|
+
return [2];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}); };
|
|
86
|
+
React.useEffect(function () {
|
|
87
|
+
if (error)
|
|
88
|
+
dispatch(clearError());
|
|
89
|
+
dispatch(resetTerminalLinkResponse());
|
|
90
|
+
}, []);
|
|
91
|
+
var retrieveTerminalListAsync = function (nextScreen) { return __awaiter(void 0, void 0, void 0, function () {
|
|
92
|
+
var err_1;
|
|
93
|
+
return __generator(this, function (_a) {
|
|
94
|
+
switch (_a.label) {
|
|
95
|
+
case 0:
|
|
96
|
+
if (terminalList === null || terminalList === void 0 ? void 0 : terminalList.length) {
|
|
97
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
98
|
+
return [2];
|
|
99
|
+
}
|
|
100
|
+
_a.label = 1;
|
|
101
|
+
case 1:
|
|
102
|
+
_a.trys.push([1, 3, , 4]);
|
|
103
|
+
return [4, dispatch(retrieveTerminalList()).unwrap()];
|
|
104
|
+
case 2:
|
|
105
|
+
_a.sent();
|
|
106
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
107
|
+
return [3, 4];
|
|
108
|
+
case 3:
|
|
109
|
+
err_1 = _a.sent();
|
|
110
|
+
console.log('Error while retrieving terminal list error', err_1);
|
|
111
|
+
return [3, 4];
|
|
112
|
+
case 4: return [2];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}); };
|
|
116
|
+
var handleOnClickLinkedTerminal = function (terminal) {
|
|
117
|
+
dispatch(storeSelectedTerminalDevice(terminal));
|
|
118
|
+
dispatch(handleNextScreenStep(CONNECT_FLOWS.terminal.linkedTerminalInfo));
|
|
119
|
+
};
|
|
120
|
+
var handleOnClickUnlinkedTerminal = function (terminal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
switch (_a.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
setNewLinkClicked(false);
|
|
125
|
+
dispatch(storeSelectedTerminalDevice(terminal));
|
|
126
|
+
return [4, retrieveTerminalListAsync(CONNECT_FLOWS.terminal.unlinkedTerminalInfo)];
|
|
127
|
+
case 1:
|
|
128
|
+
_a.sent();
|
|
129
|
+
return [2];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}); };
|
|
133
|
+
var handleOnBack = function () {
|
|
134
|
+
if ((boardFlows === null || boardFlows === void 0 ? void 0 : boardFlows.length) > 0) {
|
|
135
|
+
dispatch(handlePrevScreenStep());
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
var _a = (authData === null || authData === void 0 ? void 0 : authData.recipient) || {}, id = _a.id, type = _a.type;
|
|
139
|
+
var board_id = (boardData || {}).id;
|
|
140
|
+
dispatch(retrieveBoardStatus({ boardId: board_id }))
|
|
141
|
+
.unwrap()
|
|
142
|
+
.then(function () {
|
|
143
|
+
dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type }))
|
|
144
|
+
.unwrap()
|
|
145
|
+
.then(function () {
|
|
146
|
+
dispatch(handlePrevScreenStep());
|
|
147
|
+
});
|
|
148
|
+
})
|
|
149
|
+
.catch(function () { });
|
|
150
|
+
};
|
|
151
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 200, justifyContent: 'space-between' }, { children: [_jsxs(Container, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: [_jsx(Header, { onLinkClick: handleOnClickNewTerminalLink, loading: terminalListLoading && newLinkClicked }), _jsx(DeviceList, { devices: linkedDevices, onClick: handleOnClickLinkedTerminal }), !!(unLinkedDevices === null || unLinkedDevices === void 0 ? void 0 : unLinkedDevices.length) && !!(linkedDevices === null || linkedDevices === void 0 ? void 0 : linkedDevices.length) && _jsx(TextTypography, __assign({ sx: { pt: 1, pb: 1 } }, { children: t('terminal_unlinked') })), _jsx(DeviceList, { loading: terminalListLoading && !newLinkClicked, devices: unLinkedDevices, onClick: handleOnClickUnlinkedTerminal })] })), error && _jsx(Warning, __assign({ sx: { mt: 2 } }, { children: t(error) })), _jsx(Box, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: _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') })) }))] })));
|
|
152
|
+
};
|
|
153
|
+
export default React.memo(TerminalDeviceList);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DeviceListContainer: 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>, {}, {}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Box from '@mui/material/Box';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
export var DeviceListContainer = styled(Box)(function (_a) {
|
|
4
|
+
var spacing = _a.theme.spacing;
|
|
5
|
+
return ({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
justifyContent: 'space-between',
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
width: '100%',
|
|
11
|
+
gap: spacing(0.75)
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { ScreenContainer } from '../../../shared/Containers';
|
|
17
|
+
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
18
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
|
+
import Button from '../../../../components/Button';
|
|
20
|
+
import Warning from '../../../../components/Warning';
|
|
21
|
+
import { clearError, linkNewTerminal, storeSelectedTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
22
|
+
import { Header, Container, TerminalList } from '../shared';
|
|
23
|
+
var TerminalListPage = function () {
|
|
24
|
+
var t = useTranslation().t;
|
|
25
|
+
var dispatch = useAppDispatch();
|
|
26
|
+
var _a = useAppSelector(terminalSelector), _b = _a.data, selectedTerminal = _b.terminalInfo.selectedTerminal, responseData = _b.responseData, loading = _a.loading, error = _a.error;
|
|
27
|
+
var terminalList = (responseData || {}).terminalList;
|
|
28
|
+
React.useEffect(function () {
|
|
29
|
+
if (error)
|
|
30
|
+
dispatch(clearError());
|
|
31
|
+
}, []);
|
|
32
|
+
var handleOnSelectTerminal = function (terminal) {
|
|
33
|
+
dispatch(storeSelectedTerminal(terminal));
|
|
34
|
+
dispatch(linkNewTerminal())
|
|
35
|
+
.unwrap()
|
|
36
|
+
.then(function (_a) {
|
|
37
|
+
var nextScreen = _a.nextScreen;
|
|
38
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
39
|
+
})
|
|
40
|
+
.catch(function () { });
|
|
41
|
+
};
|
|
42
|
+
var handleOnBack = function () {
|
|
43
|
+
dispatch(handlePrevScreenStep());
|
|
44
|
+
};
|
|
45
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 200, justifyContent: 'space-between' }, { children: [_jsxs(Container, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: [_jsx(Header, { title: 'terminal_select_device', sx: { pb: 0 } }), _jsx(TerminalList, { select: false, loading: loading, selectedTerminal: selectedTerminal, list: terminalList, onClick: handleOnSelectTerminal })] })), error && _jsx(Warning, __assign({ sx: { mt: 2 } }, { children: t(error) })), _jsx(Box, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: t('back') })) }))] })));
|
|
46
|
+
};
|
|
47
|
+
export default React.memo(TerminalListPage);
|