@tap-payments/auth-jsconnect 2.11.6-sandbox → 2.11.7-sandbox

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.
Files changed (47) hide show
  1. package/build/@types/terminal.d.ts +32 -44
  2. package/build/api/auth.d.ts +7 -1
  3. package/build/api/index.d.ts +2 -2
  4. package/build/api/terminal.d.ts +3 -6
  5. package/build/api/terminal.js +22 -12
  6. package/build/components/DeviceCard/DeviceCard.js +8 -9
  7. package/build/components/TruncatedTooltipText/TruncatedTooltipText.d.ts +7 -0
  8. package/build/components/TruncatedTooltipText/TruncatedTooltipText.js +33 -0
  9. package/build/components/TruncatedTooltipText/index.d.ts +2 -0
  10. package/build/components/TruncatedTooltipText/index.js +2 -0
  11. package/build/constants/app.d.ts +2 -2
  12. package/build/constants/app.js +32 -21
  13. package/build/constants/flows.d.ts +1 -1
  14. package/build/constants/flows.js +1 -1
  15. package/build/features/app/terminal/terminalStore.d.ts +7 -7
  16. package/build/features/app/terminal/terminalStore.js +51 -51
  17. package/build/features/entity/screens/EntityName/EntityName.js +14 -14
  18. package/build/features/entity/screens/EntityName/validation.d.ts +44 -42
  19. package/build/features/entity/screens/EntityName/validation.js +98 -79
  20. package/build/features/featuresScreens.js +3 -3
  21. package/build/features/terminal/Terminal.js +2 -2
  22. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +8 -9
  23. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +5 -6
  24. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +9 -9
  25. package/build/features/terminal/screens/{TerminalListPage/TerminalListPage.js → POSDeviceListPage/POSDeviceListPage.js} +9 -9
  26. package/build/features/terminal/screens/POSDeviceListPage/index.d.ts +2 -0
  27. package/build/features/terminal/screens/POSDeviceListPage/index.js +2 -0
  28. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  29. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +3 -3
  30. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +1 -1
  31. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +15 -15
  32. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +5 -7
  33. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +12 -11
  34. package/build/features/terminal/screens/shared/POSDeviceList.d.ts +11 -0
  35. package/build/features/terminal/screens/shared/POSDeviceList.js +28 -0
  36. package/build/features/terminal/screens/shared/index.d.ts +2 -2
  37. package/build/features/terminal/screens/shared/index.js +2 -2
  38. package/build/features/terminal/screens/shared/styles.d.ts +1 -1
  39. package/build/features/terminal/screens/shared/styles.js +1 -1
  40. package/build/features/terminal/screens/shared/utils.d.ts +4 -4
  41. package/build/features/terminal/screens/shared/utils.js +8 -9
  42. package/package.json +1 -1
  43. package/build/features/terminal/screens/TerminalListPage/index.d.ts +0 -2
  44. package/build/features/terminal/screens/TerminalListPage/index.js +0 -2
  45. package/build/features/terminal/screens/shared/TerminalList.d.ts +0 -11
  46. package/build/features/terminal/screens/shared/TerminalList.js +0 -25
  47. /package/build/features/terminal/screens/{TerminalListPage/TerminalListPage.d.ts → POSDeviceListPage/POSDeviceListPage.d.ts} +0 -0
@@ -1,63 +1,56 @@
1
1
  import * as yup from 'yup';
2
2
  import { BusinessType } from '../../../../@types';
3
3
  import { KW_MIN_LICENSE_LENGTH, UNIFIED_NUMBER_MIN_LENGTH } from '../../../../constants';
4
- export var EntityNameValidationSchema = function () {
4
+ export var EntityNameValidationSchema = function (noneEditable) {
5
5
  return yup.object().shape({
6
- legalName: yup
7
- .string()
8
- .required('')
9
- .test({
10
- test: function (value) {
11
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
12
- if (length === 0)
13
- return true;
14
- return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
15
- }
16
- }),
6
+ legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
7
+ ? yup.string().optional()
8
+ : yup
9
+ .string()
10
+ .required('')
11
+ .test({
12
+ test: function (value) {
13
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
14
+ if (length === 0)
15
+ return true;
16
+ return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
17
+ }
18
+ }),
17
19
  licenseType: yup.string().optional(),
18
- entityType: yup.string().required('entity_type_required'),
20
+ entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
19
21
  licenseNumber: yup.string().optional(),
20
- unifiedNumber: yup.string().test({
21
- name: 'unifiedNumber',
22
- message: '',
23
- test: function (value) {
24
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
25
- if (length >= UNIFIED_NUMBER_MIN_LENGTH)
26
- return true;
27
- if (length === 0)
28
- return this.createError({ message: '' });
29
- return this.createError({ message: 'unified_number_required' });
30
- }
31
- }),
32
- issuingDate: yup.string().required('choose_any_issuing_date'),
22
+ unifiedNumber: noneEditable['license.additional_info']
23
+ ? yup.string().optional()
24
+ : yup.string().when('licenseType', function (licenseType) {
25
+ var isCR = licenseType === BusinessType.CR;
26
+ if (!isCR) {
27
+ return yup.string().optional();
28
+ }
29
+ return yup
30
+ .string()
31
+ .required('')
32
+ .test({
33
+ test: function (value) {
34
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
35
+ if (length >= UNIFIED_NUMBER_MIN_LENGTH)
36
+ return true;
37
+ if (length === 0)
38
+ return this.createError({ message: '' });
39
+ return this.createError({ message: 'unified_number_required' });
40
+ }
41
+ });
42
+ }),
43
+ issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
33
44
  expiryDate: yup.string().optional(),
34
45
  certificateId: yup.array().optional(),
35
46
  articleId: yup.string().optional()
36
47
  });
37
48
  };
38
- export var EntityNameKWValidationSchema = function () {
49
+ export var EntityNameKWValidationSchema = function (noneEditable) {
39
50
  return yup.object().shape({
40
- legalName: yup
41
- .string()
42
- .required('')
43
- .test({
44
- test: function (value) {
45
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
46
- if (length === 0)
47
- return true;
48
- return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
49
- }
50
- }),
51
- licenseType: yup.string().optional(),
52
- entityType: yup.string().required('entity_type_required'),
53
- licenseNumber: yup
54
- .string()
55
- .when('licenseType', function (licenseType) {
56
- var isCR = licenseType === BusinessType.CR;
57
- if (!isCR) {
58
- return yup.string().optional();
59
- }
60
- return yup
51
+ legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
52
+ ? yup.string().optional()
53
+ : yup
61
54
  .string()
62
55
  .required('')
63
56
  .test({
@@ -65,37 +58,44 @@ export var EntityNameKWValidationSchema = function () {
65
58
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
66
59
  if (length === 0)
67
60
  return true;
68
- return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
61
+ return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
62
+ }
63
+ }),
64
+ licenseType: yup.string().optional(),
65
+ entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
66
+ licenseNumber: noneEditable['license.number']
67
+ ? yup.string().optional()
68
+ : yup
69
+ .string()
70
+ .when('licenseType', function (licenseType) {
71
+ var isCR = licenseType === BusinessType.CR;
72
+ if (!isCR) {
73
+ return yup.string().optional();
69
74
  }
70
- });
71
- })
72
- .required(''),
73
- issuingDate: yup.string().required('choose_any_issuing_date'),
74
- expiryDate: yup.string().required('choose_any_expiry_date'),
75
+ return yup
76
+ .string()
77
+ .required('')
78
+ .test({
79
+ test: function (value) {
80
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
81
+ if (length === 0)
82
+ return true;
83
+ return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_kw_max_length' });
84
+ }
85
+ });
86
+ })
87
+ .required(''),
88
+ issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
89
+ expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
75
90
  certificateId: yup.array().optional(),
76
91
  articleId: yup.string().optional()
77
92
  });
78
93
  };
79
- export var EntityNameOtherCountryValidationSchema = function () {
94
+ export var EntityNameOtherCountryValidationSchema = function (noneEditable) {
80
95
  return yup.object().shape({
81
- legalName: yup
82
- .string()
83
- .required('')
84
- .test({
85
- test: function (value) {
86
- var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
87
- if (length === 0)
88
- return true;
89
- return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
90
- }
91
- }),
92
- licenseType: yup.string().optional(),
93
- entityType: yup.string().required('entity_type_required'),
94
- licenseNumber: yup
95
- .string()
96
- .when('licenseType', function (licenseType) {
97
- var isCR = licenseType === BusinessType.CR;
98
- return yup
96
+ legalName: noneEditable['legal_name.en'] && noneEditable['legal_name.ar']
97
+ ? yup.string().optional()
98
+ : yup
99
99
  .string()
100
100
  .required('')
101
101
  .test({
@@ -103,13 +103,32 @@ export var EntityNameOtherCountryValidationSchema = function () {
103
103
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
104
104
  if (length === 0)
105
105
  return true;
106
- return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: isCR ? 'cr_kw_max_length' : 'fl_max_length' });
106
+ return length >= 3 ? true : this.createError({ message: 'enter_legal_name_min_three_chars' });
107
107
  }
108
- });
109
- })
110
- .required(''),
111
- issuingDate: yup.string().required('choose_any_issuing_date'),
112
- expiryDate: yup.string().required('choose_any_expiry_date'),
108
+ }),
109
+ licenseType: yup.string().optional(),
110
+ entityType: noneEditable['type'] ? yup.string().optional() : yup.string().required('entity_type_required'),
111
+ licenseNumber: noneEditable['license.number']
112
+ ? yup.string().optional()
113
+ : yup
114
+ .string()
115
+ .when('licenseType', function (licenseType) {
116
+ var isCR = licenseType === BusinessType.CR;
117
+ return yup
118
+ .string()
119
+ .required('')
120
+ .test({
121
+ test: function (value) {
122
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
123
+ if (length === 0)
124
+ return true;
125
+ return length >= KW_MIN_LICENSE_LENGTH ? true : this.createError({ message: isCR ? 'cr_kw_max_length' : 'fl_max_length' });
126
+ }
127
+ });
128
+ })
129
+ .required(''),
130
+ issuingDate: noneEditable['license.issuing_date'] ? yup.string().optional() : yup.string().required('choose_any_issuing_date'),
131
+ expiryDate: noneEditable['license.expiry_date'] ? yup.string().optional() : yup.string().required('choose_any_expiry_date'),
113
132
  certificateId: yup.array().optional(),
114
133
  articleId: yup.string().optional()
115
134
  });
@@ -146,7 +146,7 @@ import TerminalOperatorErrorPage from './terminal/screens/OperatorError';
146
146
  import TerminalVerifyPage from './terminal/screens/Verify';
147
147
  import NoTerminalDeviceLinkedPage from './terminal/screens/NoTerminalDeviceLinked';
148
148
  import TerminalDeviceListPage from './terminal/screens/TerminalDeviceList';
149
- import TerminalListPage from './terminal/screens/TerminalListPage';
149
+ import POSDeviceListPage from '../features/terminal/screens/POSDeviceListPage';
150
150
  import LinkNewTerminalPage from './terminal/screens/LinkNewTerminal';
151
151
  import LinkedTerminalInfoPage from './terminal/screens/LinkedTerminalInfo';
152
152
  import UnlinkedTerminalInfoPage from './terminal/screens/UnlinkedTerminalInfo';
@@ -744,8 +744,8 @@ export var terminalFeatureScreens = [
744
744
  element: LinkNewTerminalPage
745
745
  },
746
746
  {
747
- name: CONNECT_FLOWS.terminal.terminalList,
748
- element: TerminalListPage
747
+ name: CONNECT_FLOWS.terminal.posDeviceList,
748
+ element: POSDeviceListPage
749
749
  },
750
750
  {
751
751
  name: CONNECT_FLOWS.terminal.linkedTerminalInfo,
@@ -41,7 +41,7 @@ var Terminal = memo(function (_a) {
41
41
  var theme = useAppTheme().theme;
42
42
  var dispatch = useAppDispatch();
43
43
  var _d = useAppSelector(settingsSelector), data = _d.data, error = _d.error, settingLoading = _d.loading;
44
- var _e = useAppSelector(terminalSelector), customLoading = _e.customLoading, terminalError = _e.error, loading = _e.loading, terminalListLoading = _e.terminalListLoading;
44
+ var _e = useAppSelector(terminalSelector), customLoading = _e.customLoading, terminalError = _e.error, loading = _e.loading, posDevicesLoading = _e.posDevicesLoading;
45
45
  useAppConfig(__assign(__assign({ navigation: TERMINAL_SCREENS_NAVIGATION }, props), { disableSettingFetching: props.mode === 'content' ? false : !!verifyToken || !!configToken }));
46
46
  useErrorListener(terminalError || error);
47
47
  useStepStartedListener();
@@ -77,7 +77,7 @@ var Terminal = memo(function (_a) {
77
77
  });
78
78
  }, []);
79
79
  var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
80
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading || terminalListLoading ? 'none' : 'auto', isTapOrigin: isTapOrigin, animationDirection: animationDirection, open: open, error: error, loading: initialLoading, loaderColor: loaderColor, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: terminalFeatureScreens.map(function (_a, index) {
80
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading || posDevicesLoading ? 'none' : 'auto', isTapOrigin: isTapOrigin, animationDirection: animationDirection, open: open, error: error, loading: initialLoading, loaderColor: loaderColor, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: terminalFeatureScreens.map(function (_a, index) {
81
81
  var Element = _a.element, name = _a.name;
82
82
  var isActive = activeScreen.name === name;
83
83
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -27,17 +27,15 @@ var LinkNewTerminal = function () {
27
27
  var _a, _b, _c, _d;
28
28
  var t = useTranslation().t;
29
29
  var dispatch = useAppDispatch();
30
- var data = useAppSelector(terminalSelector).data;
31
- var _e = React.useState(false), isReady = _e[0], setIsReady = _e[1];
32
- var _f = React.useState(false), success = _f[0], setSuccess = _f[1];
33
- var _g = React.useState(false), failed = _g[0], setFailed = _g[1];
34
- var terminalInfo = data.terminalInfo, responseData = data.responseData;
35
- var _h = responseData || {}, terminalData = _h.terminalData, linkNewTerminalData = _h.linkNewTerminalData;
36
- var terminal_devices = (terminalData || {}).terminal_devices;
30
+ var _e = useAppSelector(terminalSelector).data, terminal_device = _e.terminalInfo.selectedTerminal.terminal_device, responseData = _e.responseData;
31
+ var _f = React.useState(false), isReady = _f[0], setIsReady = _f[1];
32
+ var _g = React.useState(false), success = _g[0], setSuccess = _g[1];
33
+ var _h = React.useState(false), failed = _h[0], setFailed = _h[1];
34
+ var _j = responseData || {}, terminalData = _j.terminalData, linkNewTerminalData = _j.linkNewTerminalData;
37
35
  var qrCode = "data:image/png;base64,".concat((_a = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _a === void 0 ? void 0 : _a.qr);
38
36
  var code = (_b = linkNewTerminalData === null || linkNewTerminalData === void 0 ? void 0 : linkNewTerminalData.linking) === null || _b === void 0 ? void 0 : _b.code;
39
37
  var expiry = TERMINAL_PUSH_NOTIFICATION_DURATION;
40
- var deviceName = ((_d = (_c = terminalInfo.selectedTerminalDevice.model) === null || _c === void 0 ? void 0 : _c.name[0]) === null || _d === void 0 ? void 0 : _d.text) || '';
38
+ var deviceName = ((_d = (_c = terminal_device === null || terminal_device === void 0 ? void 0 : terminal_device.model) === null || _c === void 0 ? void 0 : _c.name[0]) === null || _d === void 0 ? void 0 : _d.text) || '';
41
39
  var newTerminal = true;
42
40
  React.useEffect(function () {
43
41
  if (linkNewTerminalData && !isReady) {
@@ -61,7 +59,8 @@ var LinkNewTerminal = function () {
61
59
  };
62
60
  }, [isReady]);
63
61
  var handleOnBack = function () {
64
- var previousScreen = (terminal_devices === null || terminal_devices === void 0 ? void 0 : terminal_devices.length) ? CONNECT_FLOWS.terminal.terminalList : CONNECT_FLOWS.terminal.noTerminalLinked;
62
+ var _a;
63
+ var previousScreen = ((_a = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _a === void 0 ? void 0 : _a.length) ? CONNECT_FLOWS.terminal.posDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked;
65
64
  dispatch(handlePrevScreenStep(previousScreen));
66
65
  };
67
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: formatCode(code) })] }))] }) })), _jsx(Box, __assign({ sx: { ml: 2.5, mr: 2.5 } }, { children: _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: handleOnBack, variant: 'text' }, { children: t('back') })) }))] })));
@@ -15,22 +15,21 @@ import { useTranslation } from 'react-i18next';
15
15
  import Box from '@mui/material/Box';
16
16
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
17
17
  import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
18
- import { retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalDeviceList, terminalSelector } from '../../../app/terminal/terminalStore';
18
+ import { retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalList, terminalSelector } from '../../../app/terminal/terminalStore';
19
19
  import SuccessScreen from '../../../shared/SuccessScreen';
20
20
  import Button from '../../../shared/Button';
21
- import { getTerminalName, SuccessContainerStyled } from '../shared';
21
+ import { SuccessContainerStyled } from '../shared';
22
22
  import { CONNECT_FLOWS } from '../../../../constants';
23
23
  var LinkedSuccess = function () {
24
24
  var t = useTranslation().t;
25
25
  var isAr = useLanguage().isAr;
26
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;
27
+ var _a = useAppSelector(terminalSelector), error = _a.error, loading = _a.loading, _b = _a.data, selectedPOS = _b.terminalInfo.selectedPOS, responseData = _b.responseData;
28
28
  var _c = responseData || {}, boardData = _c.boardData, authData = _c.authData;
29
- var deviceName = getTerminalName(selectedTerminal);
30
29
  var handleGoToBoard = function () {
31
30
  var board_id = (boardData || {}).id;
32
31
  var _a = (authData === null || authData === void 0 ? void 0 : authData.recipient) || {}, id = _a.id, type = _a.type;
33
- dispatch(retrieveTerminalDeviceList());
32
+ dispatch(retrieveTerminalList());
34
33
  dispatch(retrieveBoardStatus({ boardId: board_id }))
35
34
  .unwrap()
36
35
  .then(function () {
@@ -46,6 +45,6 @@ var LinkedSuccess = function () {
46
45
  var handleOnBack = function () {
47
46
  dispatch(handlePrevScreenStep());
48
47
  };
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') })) }))] }));
48
+ return (_jsxs(SuccessContainerStyled, { children: [_jsx(SuccessScreen, { sx: { minHeight: 'unset', ml: 2.5, mr: 2.5 }, title: t('terminal_linked_success', { device: selectedPOS === null || selectedPOS === void 0 ? void 0 : selectedPOS.display_name }), 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
49
  };
51
50
  export default React.memo(LinkedSuccess);
@@ -23,17 +23,17 @@ import Button from '../../../shared/Button';
23
23
  import { clearError, terminalSelector, unlinkTerminalDevice } from '../../../app/terminal/terminalStore';
24
24
  import { Container, getId, getIdLabel, getPairedWith, LinkWithText } from '../shared';
25
25
  var LinkedTerminalInfo = function () {
26
- var _a, _b, _c, _d, _e, _f, _g;
26
+ var _a;
27
27
  var t = useTranslation().t;
28
- var _h = useTheme(), spacing = _h.spacing, palette = _h.palette;
28
+ var _b = useTheme(), spacing = _b.spacing, palette = _b.palette;
29
29
  var dispatch = useAppDispatch();
30
30
  var isAr = useLanguage().isAr;
31
- var _j = useAppSelector(terminalSelector), error = _j.error, selectedTerminalDevice = _j.data.terminalInfo.selectedTerminalDevice, loading = _j.loading;
32
- var model = selectedTerminalDevice.model, linked = selectedTerminalDevice.linked, display_name = selectedTerminalDevice.display_name, terminal = selectedTerminalDevice.terminal, platform = selectedTerminalDevice.platform;
33
- var _k = (model || {}).image_url, image_url = _k === void 0 ? ICONS_NAMES.device_image : _k;
34
- var deviceName = (_b = (_a = terminal === null || terminal === void 0 ? void 0 : terminal.device) === null || _a === void 0 ? void 0 : _a.display_name) !== null && _b !== void 0 ? _b : (_c = terminal === null || terminal === void 0 ? void 0 : terminal.name) === null || _c === void 0 ? void 0 : _c.en;
35
- var deviceImage = (_e = (_d = platform === null || platform === void 0 ? void 0 : platform.brand) === null || _d === void 0 ? void 0 : _d.logo) !== null && _e !== void 0 ? _e : ICONS_NAMES.platform_image;
36
- var deviceId = (_g = (_f = terminal === null || terminal === void 0 ? void 0 : terminal.device) === null || _f === void 0 ? void 0 : _f.id) !== null && _g !== void 0 ? _g : terminal === null || terminal === void 0 ? void 0 : terminal.legacy_id;
31
+ var _c = useAppSelector(terminalSelector), error = _c.error, selectedTerminal = _c.data.terminalInfo.selectedTerminal, loading = _c.loading;
32
+ var terminal_device = selectedTerminal.terminal_device, linked = selectedTerminal.linked, device = selectedTerminal.device;
33
+ var _d = (terminal_device.model || {}).image_url, image_url = _d === void 0 ? ICONS_NAMES.device_image : _d;
34
+ var deviceName = (device === null || device === void 0 ? void 0 : device.display_name) || '';
35
+ var deviceImage = (device === null || device === void 0 ? void 0 : device.logo) || ICONS_NAMES.platform_image;
36
+ var deviceId = (device === null || device === void 0 ? void 0 : device.reference) || (device === null || device === void 0 ? void 0 : device.id) || '';
37
37
  React.useEffect(function () {
38
38
  if (error)
39
39
  dispatch(clearError());
@@ -50,6 +50,6 @@ var LinkedTerminalInfo = function () {
50
50
  var handleOnBack = function () {
51
51
  dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.terminalDeviceList));
52
52
  };
53
- return (_jsxs(ScreenContainer, __assign({ minHeight: 224, justifyContent: 'space-between' }, { children: [_jsxs(Container, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: [_jsx(DeviceCard, { badge: true, image: image_url, name: display_name, deviceId: getId(selectedTerminalDevice), deviceIdLabel: getIdLabel(selectedTerminalDevice), pairedWith: getPairedWith(selectedTerminalDevice), isLinked: linked }), _jsx(LinkWithText, { children: t('terminal_linked_with') }), _jsx(DeviceCard, { sx: { minHeight: spacing(10), borderRadius: spacing(1), background: palette.components.deviceCard.deviceInfoBackground }, image: deviceImage || '', name: deviceName || '', deviceId: deviceId !== null && deviceId !== void 0 ? deviceId : '', isLinked: linked })] })), error && _jsx(Warning, __assign({ sx: { mt: 2 } }, { children: t(error) })), _jsx(Button, __assign({ loading: loading, onBackClicked: handleOnBack, onClick: handleOnNext, isAr: isAr }, { children: t('terminal_unlink') }))] })));
53
+ return (_jsxs(ScreenContainer, __assign({ minHeight: 224, justifyContent: 'space-between' }, { children: [_jsxs(Container, __assign({ sx: { pl: 2.5, pr: 2.5 } }, { children: [_jsx(DeviceCard, { badge: true, image: image_url, name: ((_a = selectedTerminal.terminal_device) === null || _a === void 0 ? void 0 : _a.display_name) || '', deviceId: getId(selectedTerminal), deviceIdLabel: getIdLabel(selectedTerminal), pairedWith: getPairedWith(selectedTerminal), 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, isLinked: linked })] })), error && _jsx(Warning, __assign({ sx: { mt: 2 } }, { children: t(error) })), _jsx(Button, __assign({ loading: loading, onBackClicked: handleOnBack, onClick: handleOnNext, isAr: isAr }, { children: t('terminal_unlink') }))] })));
54
54
  };
55
55
  export default React.memo(LinkedTerminalInfo);
@@ -18,19 +18,19 @@ import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/sett
18
18
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
19
  import Button from '../../../../components/Button';
20
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 () {
21
+ import { clearError, linkNewTerminal, storeSelectedPOS, terminalSelector } from '../../../app/terminal/terminalStore';
22
+ import { Header, Container, POSDeviceList } from '../shared';
23
+ var POSDeviceListPage = function () {
24
24
  var t = useTranslation().t;
25
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;
26
+ var _a = useAppSelector(terminalSelector), _b = _a.data, selectedPOS = _b.terminalInfo.selectedPOS, responseData = _b.responseData, loading = _a.loading, error = _a.error;
27
+ var posDevices = (responseData || {}).posDevices;
28
28
  React.useEffect(function () {
29
29
  if (error)
30
30
  dispatch(clearError());
31
31
  }, []);
32
- var handleOnSelectTerminal = function (terminal) {
33
- dispatch(storeSelectedTerminal(terminal));
32
+ var handleOnSelectPOS = function (pos) {
33
+ dispatch(storeSelectedPOS(pos));
34
34
  dispatch(linkNewTerminal())
35
35
  .unwrap()
36
36
  .then(function (_a) {
@@ -42,6 +42,6 @@ var TerminalListPage = function () {
42
42
  var handleOnBack = function () {
43
43
  dispatch(handlePrevScreenStep());
44
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') })) }))] })));
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(POSDeviceList, { select: false, loading: loading, selectedPOS: selectedPOS, posDevices: posDevices, onClick: handleOnSelectPOS })] })), 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
46
  };
47
- export default React.memo(TerminalListPage);
47
+ export default React.memo(POSDeviceListPage);
@@ -0,0 +1,2 @@
1
+ import TerminalListPage from './POSDeviceListPage';
2
+ export default TerminalListPage;
@@ -0,0 +1,2 @@
1
+ import TerminalListPage from './POSDeviceListPage';
2
+ export default TerminalListPage;
@@ -27,6 +27,6 @@ var SuccessWithFlowButtons = function () {
27
27
  var onClose = function () {
28
28
  dispatch(onCloseCompleteTerminal());
29
29
  };
30
- 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, terminalStepName: ((_a = terminalData === null || terminalData === void 0 ? void 0 : terminalData.terminal_devices) === null || _a === void 0 ? void 0 : _a.length) ? CONNECT_FLOWS.terminal.terminalDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked }));
30
+ 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, terminalStepName: ((_a = terminalData === null || terminalData === void 0 ? void 0 : terminalData.list) === null || _a === void 0 ? void 0 : _a.length) ? CONNECT_FLOWS.terminal.terminalDeviceList : CONNECT_FLOWS.terminal.noTerminalLinked }));
31
31
  };
32
32
  export default memo(SuccessWithFlowButtons);
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { TerminalDeviceInfo } from '../../../../@types';
2
+ import { TerminalInfo } from '../../../../@types';
3
3
  interface DeviceListProps {
4
- devices: TerminalDeviceInfo[];
4
+ devices: TerminalInfo[];
5
5
  loading?: boolean;
6
- onClick: (device: TerminalDeviceInfo) => void;
6
+ onClick: (device: TerminalInfo) => void;
7
7
  }
8
8
  declare const _default: React.MemoExoticComponent<({ devices, onClick, loading }: DeviceListProps) => JSX.Element>;
9
9
  export default _default;
@@ -14,7 +14,7 @@ var DeviceList = function (_a) {
14
14
  };
15
15
  return (_jsx(DeviceListContainer, { children: devices.map(function (device, index) {
16
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));
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.terminal_device.model.image_url) !== null && _a !== void 0 ? _a : defaultImage, name: device.terminal_device.display_name, deviceId: getId(device), pairedWith: getPairedWith(device), deviceIdLabel: getIdLabel(device), isLinked: device.linked, arrow: true, badge: true }, index));
18
18
  }) }));
19
19
  };
20
20
  export default memo(DeviceList);
@@ -56,27 +56,27 @@ import Button from '../../../../components/Button';
56
56
  import Loader from '../../../../components/Loader';
57
57
  import Warning from '../../../../components/Warning';
58
58
  import Box from '@mui/material/Box';
59
- import { clearError, resetTerminalLinkResponse, retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalList, storeSelectedTerminalDevice, terminalSelector } from '../../../app/terminal/terminalStore';
59
+ import { clearError, resetTerminalLinkResponse, retrieveBoardDetails, retrieveBoardStatus, retrievePOSDevices, storeSelectedTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
60
60
  import { Header, Container, TextTypography } from '../shared';
61
61
  import DeviceList from './DeviceList';
62
62
  var TerminalDeviceList = function () {
63
63
  var t = useTranslation().t;
64
64
  var dispatch = useAppDispatch();
65
- var _a = useAppSelector(terminalSelector), data = _a.data, loading = _a.loading, terminalListLoading = _a.terminalListLoading, error = _a.error;
65
+ var _a = useAppSelector(terminalSelector), data = _a.data, loading = _a.loading, posDevicesLoading = _a.posDevicesLoading, error = _a.error;
66
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;
67
+ var _c = data.responseData || {}, boardFlows = _c.boardFlows, authData = _c.authData, boardData = _c.boardData, terminalData = _c.terminalData, posDevices = _c.posDevices;
68
+ var list = (terminalData || {}).list;
69
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; });
70
+ var linked = list === null || list === void 0 ? void 0 : list.filter(function (d) { return d.linked; });
71
+ var unLinked = list === null || list === void 0 ? void 0 : list.filter(function (d) { return !d.linked; });
72
72
  return { linkedDevices: linked, unLinkedDevices: unLinked };
73
- }, [terminal_devices]), linkedDevices = _d.linkedDevices, unLinkedDevices = _d.unLinkedDevices;
73
+ }, [list]), linkedDevices = _d.linkedDevices, unLinkedDevices = _d.unLinkedDevices;
74
74
  var handleOnClickNewTerminalLink = function () { return __awaiter(void 0, void 0, void 0, function () {
75
75
  return __generator(this, function (_a) {
76
76
  switch (_a.label) {
77
77
  case 0:
78
78
  setNewLinkClicked(true);
79
- return [4, retrieveTerminalListAsync(CONNECT_FLOWS.terminal.terminalList)];
79
+ return [4, retrievePOSDevicesAsync(CONNECT_FLOWS.terminal.posDeviceList)];
80
80
  case 1:
81
81
  _a.sent();
82
82
  return [2];
@@ -88,19 +88,19 @@ var TerminalDeviceList = function () {
88
88
  dispatch(clearError());
89
89
  dispatch(resetTerminalLinkResponse());
90
90
  }, []);
91
- var retrieveTerminalListAsync = function (nextScreen) { return __awaiter(void 0, void 0, void 0, function () {
91
+ var retrievePOSDevicesAsync = function (nextScreen) { return __awaiter(void 0, void 0, void 0, function () {
92
92
  var err_1;
93
93
  return __generator(this, function (_a) {
94
94
  switch (_a.label) {
95
95
  case 0:
96
- if (terminalList === null || terminalList === void 0 ? void 0 : terminalList.length) {
96
+ if (posDevices === null || posDevices === void 0 ? void 0 : posDevices.length) {
97
97
  dispatch(handleNextScreenStep(nextScreen));
98
98
  return [2];
99
99
  }
100
100
  _a.label = 1;
101
101
  case 1:
102
102
  _a.trys.push([1, 3, , 4]);
103
- return [4, dispatch(retrieveTerminalList()).unwrap()];
103
+ return [4, dispatch(retrievePOSDevices()).unwrap()];
104
104
  case 2:
105
105
  _a.sent();
106
106
  dispatch(handleNextScreenStep(nextScreen));
@@ -114,7 +114,7 @@ var TerminalDeviceList = function () {
114
114
  });
115
115
  }); };
116
116
  var handleOnClickLinkedTerminal = function (terminal) {
117
- dispatch(storeSelectedTerminalDevice(terminal));
117
+ dispatch(storeSelectedTerminal(terminal));
118
118
  dispatch(handleNextScreenStep(CONNECT_FLOWS.terminal.linkedTerminalInfo));
119
119
  };
120
120
  var handleOnClickUnlinkedTerminal = function (terminal) { return __awaiter(void 0, void 0, void 0, function () {
@@ -122,8 +122,8 @@ var TerminalDeviceList = function () {
122
122
  switch (_a.label) {
123
123
  case 0:
124
124
  setNewLinkClicked(false);
125
- dispatch(storeSelectedTerminalDevice(terminal));
126
- return [4, retrieveTerminalListAsync(CONNECT_FLOWS.terminal.unlinkedTerminalInfo)];
125
+ dispatch(storeSelectedTerminal(terminal));
126
+ return [4, retrievePOSDevicesAsync(CONNECT_FLOWS.terminal.unlinkedTerminalInfo)];
127
127
  case 1:
128
128
  _a.sent();
129
129
  return [2];
@@ -148,6 +148,6 @@ var TerminalDeviceList = function () {
148
148
  })
149
149
  .catch(function () { });
150
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') })) }))] })));
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: posDevicesLoading && 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: posDevicesLoading && !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
152
  };
153
153
  export default React.memo(TerminalDeviceList);
@@ -16,23 +16,21 @@ import Box from '@mui/material/Box';
16
16
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
17
17
  import { CONNECT_FLOWS } from '../../../../constants';
18
18
  import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
19
- import { retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalDeviceList, terminalSelector } from '../../../app/terminal/terminalStore';
19
+ import { retrieveBoardDetails, retrieveBoardStatus, retrieveTerminalList, terminalSelector } from '../../../app/terminal/terminalStore';
20
20
  import SuccessScreen from '../../../shared/SuccessScreen';
21
21
  import Button from '../../../shared/Button';
22
22
  import { SuccessContainerStyled } from '../shared';
23
23
  var UnlinkedSuccess = function () {
24
- var _a, _b, _c;
25
24
  var t = useTranslation().t;
26
25
  var isAr = useLanguage().isAr;
27
26
  var dispatch = useAppDispatch();
28
- var _d = useAppSelector(terminalSelector), error = _d.error, loading = _d.loading, _e = _d.data, selectedTerminalDevice = _e.terminalInfo.selectedTerminalDevice, responseData = _e.responseData;
29
- var _f = responseData || {}, boardData = _f.boardData, authData = _f.authData;
30
- var terminal = (selectedTerminalDevice || {}).terminal;
31
- 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;
27
+ var _a = useAppSelector(terminalSelector), error = _a.error, loading = _a.loading, _b = _a.data, device = _b.terminalInfo.selectedTerminal.device, responseData = _b.responseData;
28
+ var _c = responseData || {}, boardData = _c.boardData, authData = _c.authData;
29
+ var deviceName = device === null || device === void 0 ? void 0 : device.display_name;
32
30
  var handleGoToBoard = function () {
33
31
  var board_id = (boardData || {}).id;
34
32
  var _a = (authData === null || authData === void 0 ? void 0 : authData.recipient) || {}, id = _a.id, type = _a.type;
35
- dispatch(retrieveTerminalDeviceList());
33
+ dispatch(retrieveTerminalList());
36
34
  dispatch(retrieveBoardStatus({ boardId: board_id }))
37
35
  .unwrap()
38
36
  .then(function () {