@tap-payments/auth-jsconnect 2.3.94-test → 2.3.95-test

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.
@@ -3,7 +3,6 @@ export declare type UpdateBoardBody = {
3
3
  infoId?: string;
4
4
  step_name: string;
5
5
  lang: string;
6
- object_id?: string;
7
6
  encryption_contract?: string;
8
7
  };
9
8
  export declare type RetrieveBoardInfoBody = {
@@ -49,11 +49,9 @@ export declare const ICONS_NAMES: {
49
49
  WHITE_ARROW: string;
50
50
  BLACK_ARROW: string;
51
51
  BLUE_ARROW: string;
52
- GREEN_ARROW: string;
53
52
  REQUEST_EMAIL: string;
54
53
  REQUEST_EMAIL_GREEN: string;
55
54
  ADD_DETAIL: string;
56
- ADD_DETAIL_GREEN: string;
57
55
  SUCCESS: string;
58
56
  UNFINISHED: string;
59
57
  ABSHER_LOGO: string;
@@ -49,11 +49,9 @@ export var ICONS_NAMES = {
49
49
  WHITE_ARROW: 'https://tap-connecet.b-cdn.net/imgs/whiteArrow.svg',
50
50
  BLACK_ARROW: 'https://dash.b-cdn.net/icons/menu/arrow_right_icon.svg',
51
51
  BLUE_ARROW: 'https://dash.b-cdn.net/icons/menu/blue_arrow_next.svg',
52
- GREEN_ARROW: 'https://dash.b-cdn.net/icons/menu/green_arrow_next.svg',
53
52
  REQUEST_EMAIL: 'https://dash.b-cdn.net/icons/menu/request_email.svg',
54
53
  REQUEST_EMAIL_GREEN: 'https://dash.b-cdn.net/icons/menu/request_email_green.svg',
55
54
  ADD_DETAIL: 'https://dash.b-cdn.net/icons/menu/add_detail.svg',
56
- ADD_DETAIL_GREEN: 'https://dash.b-cdn.net/icons/menu/add_detail_green.svg',
57
55
  SUCCESS: 'https://dash.b-cdn.net/icons/menu/image.png',
58
56
  UNFINISHED: 'https://dash.b-cdn.net/icons/menu/not-finished.png',
59
57
  ABSHER_LOGO: 'https://dash.b-cdn.net/icons/menu/Absher.svg',
@@ -763,34 +763,31 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
763
763
  });
764
764
  });
765
765
  export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
766
- var _a, settings, individual, _b, id, infoId, _c, notification, user, userId, payload, data, boardInfoStatus;
767
- var _d, _e, _f, _g;
768
- return __generator(this, function (_h) {
769
- switch (_h.label) {
766
+ var _a, settings, individual, _b, id, infoId, payload, data, boardInfoStatus;
767
+ var _c, _d, _e, _f;
768
+ return __generator(this, function (_g) {
769
+ switch (_g.label) {
770
770
  case 0:
771
771
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
772
772
  _b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
773
- _c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user;
774
- userId = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
775
773
  if (!id)
776
774
  return [2];
777
775
  payload = {
778
776
  lang: settings.data.language,
779
- object_id: userId,
780
777
  step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS,
781
778
  id: id
782
779
  };
783
780
  return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
784
781
  case 1:
785
- data = _h.sent();
782
+ data = _g.sent();
786
783
  return [4, API.boardService.retrieveBoardInfoStatus(id)];
787
784
  case 2:
788
- boardInfoStatus = _h.sent();
785
+ boardInfoStatus = _g.sent();
789
786
  return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
790
787
  case 3:
791
- _h.sent();
792
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
793
- (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
788
+ _g.sent();
789
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
790
+ (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
794
791
  thunkApi.dispatch(handleNextScreenStep());
795
792
  return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params }];
796
793
  }
@@ -88,7 +88,7 @@ var UserList = function (_a) {
88
88
  var _l = data.individualCollectData, email = _l.email, mobile = _l.mobile, responseBody = _l.responseBody;
89
89
  var is_available = (responseBody || {}).is_available;
90
90
  var verify = data.verify;
91
- var _m = verify.responseBody || {}, userList = _m.userList, notification = _m.notification, flows = _m.flows;
91
+ var _m = verify.responseBody || {}, userList = _m.userList, notification = _m.notification;
92
92
  var methods = useForm({
93
93
  resolver: yupResolver(IndividualCollectInfoValidationSchema(activeUser)),
94
94
  defaultValues: {
@@ -160,15 +160,6 @@ var UserList = function (_a) {
160
160
  var _a;
161
161
  return (user === null || user === void 0 ? void 0 : user.id) === ((_a = notification === null || notification === void 0 ? void 0 : notification.recipient) === null || _a === void 0 ? void 0 : _a.id);
162
162
  };
163
- var isUserCompleted = function (user) {
164
- var _a;
165
- var status = (flows || []).find(function (_a) {
166
- var name = _a.name;
167
- return name === 'individual';
168
- });
169
- var isCompleted = ((_a = status === null || status === void 0 ? void 0 : status.object_status) === null || _a === void 0 ? void 0 : _a[user.id]) === 'completed';
170
- return isCompleted;
171
- };
172
163
  var isPhoneAndEmailAvailable = function (user) {
173
164
  var _a = (user === null || user === void 0 ? void 0 : user.contact) || { email: '' }, resEmail = _a.email, phone = _a.phone;
174
165
  return !!(isValidEmail(resEmail) && (phone === null || phone === void 0 ? void 0 : phone.country_code) && (phone === null || phone === void 0 ? void 0 : phone.number));
@@ -195,7 +186,6 @@ var UserList = function (_a) {
195
186
  return (_jsxs(Box, __assign({ sx: index !== usersMenuList.length - 1 ? { borderBottom: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) } : {} }, { children: [_jsxs(TextBoxStyled, __assign({ sx: {
196
187
  cursor: emailChecking ? 'default' : 'pointer'
197
188
  }, onClick: !!anchorEl && isActiveUser(user) ? function () { return onCloseUserAction(); } : function (e) { return onClickUser(user, e); } }, { children: [_jsxs(TextStyled, { children: [_jsx("span", { children: getName(user) || '' }), _jsx(RoleTextStyled, { children: getUserRole(user) || '' })] }), (user === null || user === void 0 ? void 0 : user.isRequestedEmail) ? _jsx(CheckIcon, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl && isActiveUser(user) })] })), _jsx(Collapse, __assign({ in: !!anchorEl && isActiveUser(user), timeout: 300 }, { children: _jsx(IndividualActionButtons, { isAr: isAr, addDetails: {
198
- isCompleted: isUserCompleted(user),
199
189
  title: t('add_details'),
200
190
  onClick: onAddDetails,
201
191
  loading: isActiveUser(user) && loading && type === IndividualRequestType.ADD
@@ -13,9 +13,7 @@ interface IndividualActionButtonsProps extends ButtonProps {
13
13
  show: boolean;
14
14
  children?: React.ReactNode;
15
15
  };
16
- addDetails: buttonProps & {
17
- isCompleted: boolean;
18
- };
16
+ addDetails: buttonProps;
19
17
  }
20
18
  export default function IndividualActionButtons({ isAr, requestEmail, addDetails }: IndividualActionButtonsProps): JSX.Element;
21
19
  export {};
@@ -81,29 +81,6 @@ var LoaderStyled = styled(Loader)(function (_a) {
81
81
  height: theme.spacing(3.75)
82
82
  });
83
83
  });
84
- var AddDetailsButtonStyled = styled(ButtonStyled, {
85
- shouldForwardProp: function (prop) { return prop !== 'isCompleted'; }
86
- })(function (_a) {
87
- var theme = _a.theme, isCompleted = _a.isCompleted;
88
- return (__assign({}, (isCompleted && {
89
- '&.MuiButton-outlined': {
90
- backgroundColor: theme.palette.common.white,
91
- border: "1px solid ".concat(theme.palette.success.main),
92
- color: theme.palette.success.main,
93
- '&:hover': {
94
- cursor: 'pointer',
95
- backgroundColor: theme.palette.success.main,
96
- color: theme.palette.common.white,
97
- img: {
98
- filter: 'brightness(0) invert(1)'
99
- },
100
- svg: {
101
- filter: 'brightness(0) invert(1)'
102
- }
103
- }
104
- }
105
- })));
106
- });
107
84
  var RequestEmailButtonStyled = styled(ButtonStyled, {
108
85
  shouldForwardProp: function (prop) { return prop !== 'isRequested' && prop !== 'disabled'; }
109
86
  })(function (_a) {
@@ -151,5 +128,5 @@ export default function IndividualActionButtons(_a) {
151
128
  var theme = useTheme();
152
129
  var isRequestedAndNotLoading = requestEmail.isRequested && !requestEmail.loading;
153
130
  var requestEmailLoaderColor = isRequestedAndNotLoading ? theme.palette.success.main : theme.palette.primary.main;
154
- return (_jsxs(ButtonBoxStyled, { children: [_jsxs(AddDetailsButtonStyled, __assign({ isCompleted: addDetails.isCompleted, isLoading: addDetails.loading, type: 'button', variant: 'outlined', onClick: addDetails.onClick, startIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(Image, { src: addDetails.isCompleted ? ICONS_NAMES.ADD_DETAIL_GREEN : ICONS_NAMES.ADD_DETAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(ArrowIconStyled, { isAr: isAr, src: addDetails.isCompleted ? ICONS_NAMES.GREEN_ARROW : ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: addDetails.loading }, { children: _jsx(LoaderStyled, { innerColor: addDetails.isCompleted ? theme.palette.success.main : theme.palette.primary.main, outerColor: addDetails.isCompleted ? theme.palette.success.main : theme.palette.primary.main, size: 15, toggleAnimation: addDetails.loading }) })), _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(TextStyled, { children: t(addDetails.title) }) }))] })), requestEmail.show && (_jsxs(_Fragment, { children: [requestEmail.children, _jsxs(RequestEmailButtonStyled, __assign({ isRequested: requestEmail.isRequested, isLoading: requestEmail.loading, variant: 'outlined', disabled: requestEmail.disabled, type: 'button', onClick: requestEmail.onClick, startIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(Image, { src: isRequestedAndNotLoading ? ICONS_NAMES.REQUEST_EMAIL_GREEN : ICONS_NAMES.REQUEST_EMAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: isRequestedAndNotLoading ? _jsx(CheckIconStyled, {}) : _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: requestEmail.loading }, { children: _jsx(LoaderStyled, { innerColor: requestEmailLoaderColor, outerColor: requestEmailLoaderColor, size: 15, toggleAnimation: requestEmail.loading }) })), _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(TextStyled, { children: t(requestEmail.title) }) }))] }))] }))] }));
131
+ return (_jsxs(ButtonBoxStyled, { children: [_jsxs(ButtonStyled, __assign({ isLoading: addDetails.loading, type: 'button', variant: 'outlined', onClick: addDetails.onClick, startIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(Image, { src: ICONS_NAMES.ADD_DETAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: addDetails.loading }, { children: _jsx(LoaderStyled, { innerColor: theme.palette.primary.main, outerColor: theme.palette.primary.main, size: 15, toggleAnimation: addDetails.loading }) })), _jsx(Collapse, __assign({ in: !addDetails.loading }, { children: _jsx(TextStyled, { children: t(addDetails.title) }) }))] })), requestEmail.show && (_jsxs(_Fragment, { children: [requestEmail.children, _jsxs(RequestEmailButtonStyled, __assign({ isRequested: requestEmail.isRequested, isLoading: requestEmail.loading, variant: 'outlined', disabled: requestEmail.disabled, type: 'button', onClick: requestEmail.onClick, startIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(Image, { src: isRequestedAndNotLoading ? ICONS_NAMES.REQUEST_EMAIL_GREEN : ICONS_NAMES.REQUEST_EMAIL }) })), endIcon: _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: isRequestedAndNotLoading ? _jsx(CheckIconStyled, {}) : _jsx(ArrowIconStyled, { isAr: isAr, src: ICONS_NAMES.BLUE_ARROW }) })) }, { children: [_jsx(Collapse, __assign({ in: requestEmail.loading }, { children: _jsx(LoaderStyled, { innerColor: requestEmailLoaderColor, outerColor: requestEmailLoaderColor, size: 15, toggleAnimation: requestEmail.loading }) })), _jsx(Collapse, __assign({ in: !requestEmail.loading }, { children: _jsx(TextStyled, { children: t(requestEmail.title) }) }))] }))] }))] }));
155
132
  }
@@ -71,7 +71,6 @@ var SuccessFlowButtons = function (_a) {
71
71
  var mappedFlows = flows
72
72
  .filter(function (item) { return item === null || item === void 0 ? void 0 : item.name; })
73
73
  .map(function (_a) {
74
- var _b;
75
74
  var name = _a.name, url = _a.url, status = _a.status, token = _a.token;
76
75
  var type = status === 'completed' ? 'completed' : 'pending';
77
76
  var title = t("".concat(name, "_flow_").concat(type), {
@@ -83,14 +82,8 @@ var SuccessFlowButtons = function (_a) {
83
82
  iban: iban ? t('masking_symbols') + iban : '',
84
83
  tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
85
84
  });
86
- var individualStatus = ((_b = (flows || []).find(function (_a) {
87
- var name = _a.name;
88
- return name === 'individual';
89
- })) === null || _b === void 0 ? void 0 : _b.object_status) || {};
90
- var isIndividualAllCompleted = Object.keys(individualStatus).length === count;
91
- var isIndividualCompleted = is_authorized && count > 1 ? isIndividualAllCompleted : status === 'completed';
85
+ var isCompleted = status === 'completed' && name !== 'password';
92
86
  var isIndividual = name === 'individual';
93
- var isCompleted = isIndividual ? isIndividualCompleted : status === 'completed' && name !== 'password';
94
87
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
95
88
  var hoverSrc = "".concat(name, "_white_icon");
96
89
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.3.94-test",
3
+ "version": "2.3.95-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",