@tap-payments/auth-jsconnect 2.4.11-test → 2.4.12-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.
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +22 -6
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +12 -7
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +2 -1
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +13 -5
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +1 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +5 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +1 -1
- package/package.json +1 -1
|
@@ -35,11 +35,11 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
35
35
|
flexDirection: 'column'
|
|
36
36
|
}); });
|
|
37
37
|
var BrandActivities = function (_a) {
|
|
38
|
-
var _b;
|
|
39
|
-
var
|
|
38
|
+
var _b, _c, _d, _e, _f;
|
|
39
|
+
var _g = React.useState(), listActive = _g[0], setListActive = _g[1];
|
|
40
40
|
var dispatch = useAppDispatch();
|
|
41
|
-
var
|
|
42
|
-
var
|
|
41
|
+
var _h = useAppSelector(brandSelector), data = _h.data, loading = _h.loading, error = _h.error;
|
|
42
|
+
var _j = data.brandActivities, activities = _j.activities, customerLocations = _j.customerLocations, expectedCustomer = _j.expectedCustomer, expectedSale = _j.expectedSale, termAndConditionChecked = _j.termAndConditionChecked, refundPolicy = _j.refundPolicy, transactionPolicy = _j.transactionPolicy;
|
|
43
43
|
var ListType;
|
|
44
44
|
(function (ListType) {
|
|
45
45
|
ListType["ActivitiesList"] = "ActivitiesList";
|
|
@@ -61,7 +61,7 @@ var BrandActivities = function (_a) {
|
|
|
61
61
|
mode: 'onChange'
|
|
62
62
|
});
|
|
63
63
|
useSetFromDefaultValues(methods, data.brandActivities, true);
|
|
64
|
-
var
|
|
64
|
+
var _k = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) || {}, data_status = _k.data_status, data_verification = _k.data_verification, operations = _k.operations;
|
|
65
65
|
var originalReadOnly = useFormReadOnly(methods);
|
|
66
66
|
var noneEditable = useDataNoneEditable(data_status, [
|
|
67
67
|
'activities',
|
|
@@ -77,6 +77,22 @@ var BrandActivities = function (_a) {
|
|
|
77
77
|
'operations.sales_range'
|
|
78
78
|
]);
|
|
79
79
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
80
|
+
var locations = methods.watch('customerLocations');
|
|
81
|
+
var isCustomerLocationsHasVerifiedValue = React.useMemo(function () {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
var locationIds = locations === null || locations === void 0 ? void 0 : locations.map(function (_a) {
|
|
84
|
+
var id = _a.id;
|
|
85
|
+
return id;
|
|
86
|
+
});
|
|
87
|
+
var Ids = (_b = (_a = operations === null || operations === void 0 ? void 0 : operations.customer_base) === null || _a === void 0 ? void 0 : _a.locations) === null || _b === void 0 ? void 0 : _b.map(function (_a) {
|
|
88
|
+
var id = _a.id;
|
|
89
|
+
return id;
|
|
90
|
+
});
|
|
91
|
+
return (locationIds === null || locationIds === void 0 ? void 0 : locationIds.length) === (Ids === null || Ids === void 0 ? void 0 : Ids.length) && locationIds.every(function (locationId) { return Ids.includes(locationId); });
|
|
92
|
+
}, [locations, operations]);
|
|
93
|
+
var isCustomerLocationsVerified = dataVerified['operations.customer_base_location'] && isCustomerLocationsHasVerifiedValue;
|
|
94
|
+
var isExpectedSalesRangeVerified = dataVerified['operations.sales_range'] && ((_c = operations === null || operations === void 0 ? void 0 : operations.sales) === null || _c === void 0 ? void 0 : _c.id) === ((_d = methods.watch('expectedSale')) === null || _d === void 0 ? void 0 : _d.id);
|
|
95
|
+
var isExpectedCustomersVerified = dataVerified['operations.customer_base'] && ((_e = operations === null || operations === void 0 ? void 0 : operations.customer_base) === null || _e === void 0 ? void 0 : _e.id) === ((_f = methods.watch('expectedCustomer')) === null || _f === void 0 ? void 0 : _f.id);
|
|
80
96
|
var onSubmit = function (data) {
|
|
81
97
|
dispatch(updateBrandActivities(getFelids(data)));
|
|
82
98
|
};
|
|
@@ -93,6 +109,6 @@ var BrandActivities = function (_a) {
|
|
|
93
109
|
var isCustomerBaseListActive = listActive === ListType.CustomerBaseList;
|
|
94
110
|
var isExpectedCustomerListActive = listActive === ListType.ExpectedCustomerList;
|
|
95
111
|
var isExpectedSalesListActive = listActive === ListType.ExpectedSalesList;
|
|
96
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivitiesList, { readOnly: readOnly['activities'] || noneEditable['activities'], show: !isCustomerBaseListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ActivitiesList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(CustomerBase, { readOnly: readOnly['customerLocations'] || noneEditable['operations.customer_base_location'], show: !isActivitiesListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.CustomerBaseList); }, onListClose: function () { return handleMenuClick(); }, isVerified:
|
|
112
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivitiesList, { readOnly: readOnly['activities'] || noneEditable['activities'], show: !isCustomerBaseListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ActivitiesList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(CustomerBase, { readOnly: readOnly['customerLocations'] || noneEditable['operations.customer_base_location'], show: !isActivitiesListActive && !isExpectedCustomerListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.CustomerBaseList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isCustomerLocationsVerified }), _jsx(ExpectedCustomers, { readOnly: readOnly['expectedCustomer'] || noneEditable['operations.customer_base'], show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedSalesListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedCustomerList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isExpectedCustomersVerified }), _jsx(ExpectedSalesRange, { readOnly: readOnly['expectedSale'] || noneEditable['operations.sales_range'], show: !isActivitiesListActive && !isCustomerBaseListActive && !isExpectedCustomerListActive, onListOpen: function () { return handleMenuClick(ListType.ExpectedSalesList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isExpectedSalesRangeVerified }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(TAC, { readOnly: readOnly['termAndConditionChecked'] || noneEditable['terms'] }), _jsx(RefundPolicy, { readOnly: readOnly['refundPolicy'] || noneEditable['terms'] }), _jsx(TransactionPolicy, { readOnly: readOnly['transactionPolicy'] || noneEditable['terms'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') }))] }))] })) })) }));
|
|
97
113
|
};
|
|
98
114
|
export default BrandActivities;
|
|
@@ -39,15 +39,16 @@ var ListType;
|
|
|
39
39
|
ListType["TeamSizeList"] = "TeamSizeList";
|
|
40
40
|
})(ListType || (ListType = {}));
|
|
41
41
|
var BrandInfo = function (_a) {
|
|
42
|
-
var _b
|
|
43
|
-
var
|
|
42
|
+
var _b, _c, _d, _e;
|
|
43
|
+
var _f = React.useState(), listActive = _f[0], setListActive = _f[1];
|
|
44
|
+
var _g = React.useState(false), brandNameChecking = _g[0], setBrandNameChecking = _g[1];
|
|
44
45
|
var dispatch = useAppDispatch();
|
|
45
46
|
var t = useTranslation().t;
|
|
46
47
|
var isAr = useLanguage().isAr;
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
48
|
+
var _h = useAppSelector(brandSelector), data = _h.data, loading = _h.loading, error = _h.error, uploadingBrandLogo = _h.uploadingBrandLogo;
|
|
49
|
+
var _j = data.brandData, brandName = _j.brandName, segment = _j.segment, teamSize = _j.teamSize, salesChannels = _j.salesChannels, brandLogoId = _j.brandLogoId, responseBody = _j.responseBody;
|
|
50
|
+
var _k = data.verify.responseBody || {}, brand = _k.brand, flows = _k.flows;
|
|
51
|
+
var _l = brand || {}, logo_details = _l.logo_details, data_status = _l.data_status, data_verification = _l.data_verification, name = _l.name, resSegment = _l.segment;
|
|
51
52
|
var methods = useForm({
|
|
52
53
|
resolver: yupResolver(BrandValidationSchema()),
|
|
53
54
|
defaultValues: {
|
|
@@ -59,6 +60,7 @@ var BrandInfo = function (_a) {
|
|
|
59
60
|
},
|
|
60
61
|
mode: 'onChange'
|
|
61
62
|
});
|
|
63
|
+
var watch = methods.watch;
|
|
62
64
|
useSetFromDefaultValues(methods, data.brandData, true);
|
|
63
65
|
var defaultBrandLogoFile = React.useMemo(function () { return logo_details && __assign(__assign({}, logo_details), { docId: '' }); }, [logo_details]);
|
|
64
66
|
var originalReadOnly = useFormReadOnly(methods, { brandLogoId: defaultBrandLogoFile });
|
|
@@ -66,6 +68,9 @@ var BrandInfo = function (_a) {
|
|
|
66
68
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
67
69
|
var dataVerified = useDataVerified(data_verification, ['logo', 'name.en', 'name.ar', 'segment.teams', 'segment.type']);
|
|
68
70
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
71
|
+
var isBrandNameVerified = dataVerified['name.en'] && dataVerified['name.ar'] && ((name === null || name === void 0 ? void 0 : name.en) === watch('brandName') || (name === null || name === void 0 ? void 0 : name.ar) === watch('brandName'));
|
|
72
|
+
var isSegmentVerified = dataVerified['segment.type'] && ((_b = resSegment === null || resSegment === void 0 ? void 0 : resSegment.type) === null || _b === void 0 ? void 0 : _b.id) === ((_c = watch('segment')) === null || _c === void 0 ? void 0 : _c.id);
|
|
73
|
+
var isTeamSizeVerified = dataVerified['segment.teams'] && ((_d = resSegment === null || resSegment === void 0 ? void 0 : resSegment.team) === null || _d === void 0 ? void 0 : _d.id) === ((_e = watch('teamSize')) === null || _e === void 0 ? void 0 : _e.id);
|
|
69
74
|
var onSubmit = function (data) {
|
|
70
75
|
dispatch(updateBrand(getFelids(data)));
|
|
71
76
|
};
|
|
@@ -95,6 +100,6 @@ var BrandInfo = function (_a) {
|
|
|
95
100
|
};
|
|
96
101
|
var isSegmentsListActive = listActive === ListType.SegmentsList;
|
|
97
102
|
var isTeamSizeListActive = listActive === ListType.TeamSizeList;
|
|
98
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'] || (noneEditable['name.en'] && noneEditable['name.ar']), show: !listActive, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking, isVerified:
|
|
103
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'] || (noneEditable['name.en'] && noneEditable['name.ar']), show: !listActive, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking, isVerified: isBrandNameVerified }), _jsx(BrandLogo, { defaultFile: defaultBrandLogoFile, readOnly: readOnly['brandLogoId'], show: !listActive, isVerified: dataVerified['logo'] }), _jsx(Segments, { readOnly: readOnly['segment'] || noneEditable['segment.type'], show: !isTeamSizeListActive, onListOpen: function () { return handleMenuClick(ListType.SegmentsList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isSegmentVerified }), _jsx(TeamSize, { readOnly: readOnly['teamSize'] || noneEditable['segment.teams'], show: !isSegmentsListActive, onListOpen: function () { return handleMenuClick(ListType.TeamSizeList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isTeamSizeVerified }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(SalesChannels, { readOnly: readOnly['salesChannels'] || noneEditable['channel_services'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: t('next') }))] }))] })) })) }));
|
|
99
104
|
};
|
|
100
105
|
export default BrandInfo;
|
|
@@ -35,6 +35,7 @@ var BrandLogo = function (_a) {
|
|
|
35
35
|
var dispatch = useAppDispatch();
|
|
36
36
|
var _c = useAppSelector(brandSelector), data = _c.data, error = _c.error, loading = _c.loading;
|
|
37
37
|
var logo_details = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) || {}).logo_details;
|
|
38
|
+
var id = brandLogoIdControl.field.value;
|
|
38
39
|
var handleBrandLogoChange = function (id) {
|
|
39
40
|
if (error)
|
|
40
41
|
dispatch(clearError());
|
|
@@ -47,6 +48,6 @@ var BrandLogo = function (_a) {
|
|
|
47
48
|
dispatch(clearBrandLogo());
|
|
48
49
|
brandLogoIdControl.field.onChange(undefined);
|
|
49
50
|
};
|
|
50
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadWrapper, { id: 'brandLogoId', readOnly: readOnly, fileRemoveType: FileRemoveType.BRAND_LOGO_FILE_ID, control: control, label: t('title_brand_logo'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('description_brand_logo'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleBrandLogoChange, isSubmitting: loading, onDeleteFile: handleReset, defaultFile: defaultFile, purpose: DocumentPurpose.BRAND_LOGO, validFileFormats: VALID_FILE_FORMATS_FOR_IMAGE, fileUploadingStatus: function (uploading) { return dispatch(uploadingBrandLogoStatus(uploading)); }, isVerified: isVerified }) }) })));
|
|
51
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadWrapper, { id: 'brandLogoId', readOnly: readOnly, fileRemoveType: FileRemoveType.BRAND_LOGO_FILE_ID, control: control, label: t('title_brand_logo'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('description_brand_logo'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleBrandLogoChange, isSubmitting: loading, onDeleteFile: handleReset, defaultFile: defaultFile, purpose: DocumentPurpose.BRAND_LOGO, validFileFormats: VALID_FILE_FORMATS_FOR_IMAGE, fileUploadingStatus: function (uploading) { return dispatch(uploadingBrandLogoStatus(uploading)); }, isVerified: isVerified && !id }) }) })));
|
|
51
52
|
};
|
|
52
53
|
export default BrandLogo;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useController, useFormContext } from 'react-hook-form';
|
|
4
4
|
import { useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
5
|
-
import { hasVerifiedValue, mapSalesChannel } from '../../../../utils';
|
|
5
|
+
import { hasVerifiedValue, isTwitter, isWebsite, mapSalesChannel } from '../../../../utils';
|
|
6
6
|
import { brandSelector, clearError } from '../../../app/brand/brandStore';
|
|
7
7
|
import SalesChannel from '../../../shared/SalesChannels';
|
|
8
8
|
var SalesChannels = function (_a) {
|
|
@@ -13,16 +13,24 @@ var SalesChannels = function (_a) {
|
|
|
13
13
|
var _c = useController({ control: control, name: 'salesChannels' }), fieldState = _c.fieldState, field = _c.field;
|
|
14
14
|
var _d = useAppSelector(brandSelector), data = _d.data, error = _d.error;
|
|
15
15
|
var brand = (data.verify.responseBody || {}).brand;
|
|
16
|
-
var isChannelVerified = function (id) {
|
|
17
|
-
return hasVerifiedValue(brand === null || brand === void 0 ? void 0 : brand.data_verification, "channel_services.".concat(id));
|
|
18
|
-
};
|
|
19
16
|
var channelList = (data.verify.responseBody || {}).channel_list;
|
|
17
|
+
var isChannelVerified = function (id, selected) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
var initial = (_b = (_a = brand === null || brand === void 0 ? void 0 : brand.channel_services) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, function (sale) { return (sale === null || sale === void 0 ? void 0 : sale.id) === id; });
|
|
20
|
+
var _c = initial || {}, address = _c.address, code = _c.code;
|
|
21
|
+
var initialAddress = isTwitter(code || '')
|
|
22
|
+
? address === null || address === void 0 ? void 0 : address.replaceAll('@', '')
|
|
23
|
+
: isWebsite(code || '')
|
|
24
|
+
? address === null || address === void 0 ? void 0 : address.replaceAll('https://www.', '')
|
|
25
|
+
: address;
|
|
26
|
+
return hasVerifiedValue(brand === null || brand === void 0 ? void 0 : brand.data_verification, "channel_services.".concat(id)) && initialAddress === (selected === null || selected === void 0 ? void 0 : selected.address);
|
|
27
|
+
};
|
|
20
28
|
var selectedSalesChannels = React.useMemo(function () { return mapSalesChannel(field.value); }, [(field.value || []).length]);
|
|
21
29
|
var onChange = function (channels) {
|
|
22
30
|
if (error)
|
|
23
31
|
dispatch(clearError());
|
|
24
32
|
field.onChange(channels);
|
|
25
33
|
};
|
|
26
|
-
return (_jsx(SalesChannel, { readOnly: readOnly, isChannelVerified: function (id) { return isChannelVerified(id); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, list: channelList, onChange: onChange, defaultValue: selectedSalesChannels }));
|
|
34
|
+
return (_jsx(SalesChannel, { readOnly: readOnly, isChannelVerified: function (id, selected) { return isChannelVerified(id, selected); }, error: (_b = fieldState.error) === null || _b === void 0 ? void 0 : _b.message, list: channelList, onChange: onChange, defaultValue: selectedSalesChannels }));
|
|
27
35
|
};
|
|
28
36
|
export default SalesChannels;
|
|
@@ -8,7 +8,7 @@ interface SalesChannelProps {
|
|
|
8
8
|
selectFirstIconListener?: string | number | boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
readOnly?: boolean;
|
|
11
|
-
isChannelVerified?: (id: string) => boolean;
|
|
11
|
+
isChannelVerified?: (id: string, selected?: SaleChannel) => boolean;
|
|
12
12
|
}
|
|
13
13
|
declare const _default: React.MemoExoticComponent<({ list, onChange, error, disabled, readOnly, defaultValue, selectFirstIconListener, isChannelVerified }: SalesChannelProps) => JSX.Element>;
|
|
14
14
|
export default _default;
|
|
@@ -142,9 +142,13 @@ var SalesChannel = function (_a) {
|
|
|
142
142
|
selectFirstIcon(defaultValue);
|
|
143
143
|
}
|
|
144
144
|
}, [selectFirstIconListener]);
|
|
145
|
+
var selectedChannel = React.useMemo(function () { return selectedSalas.find(function (_a) {
|
|
146
|
+
var id = _a.id;
|
|
147
|
+
return id === activeSaleIconId;
|
|
148
|
+
}); }, [selectedSalas, activeSaleIconId]);
|
|
145
149
|
return (_jsxs(_Fragment, { children: [_jsxs(Box, __assign({ sx: { mb: 3 } }, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), list.map(function (channel, index) {
|
|
146
150
|
var _a, _b;
|
|
147
151
|
return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disabled: disabled || readOnly, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
|
|
148
|
-
}), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { readOnly: readOnly, error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas, isVerified: isChannelVerified === null || isChannelVerified === void 0 ? void 0 : isChannelVerified(activeSaleIconId) }, 'saleChannelIconsInput')] }));
|
|
152
|
+
}), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { readOnly: readOnly, error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas, isVerified: isChannelVerified === null || isChannelVerified === void 0 ? void 0 : isChannelVerified(activeSaleIconId, selectedChannel) }, 'saleChannelIconsInput')] }));
|
|
149
153
|
};
|
|
150
154
|
export default React.memo(SalesChannel);
|
|
@@ -170,7 +170,7 @@ var UploadMultipleFile = function (_a) {
|
|
|
170
170
|
};
|
|
171
171
|
var fileExists = fileInfoArray.length > 0;
|
|
172
172
|
return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: _jsxs(_Fragment, { children: [label, required && _jsx(Mandatory, {})] }) }), _jsx(Collapse, __assign({ in: !!uploadedFileCount, timeout: 100, unmountOnExit: true }, { children: _jsx(UploadCountBox, { children: "".concat(uploadedFileCount, " ").concat(t('uploaded_file')) }) }))] }), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: (fileArray || []).map(function (file, index) {
|
|
173
|
-
return (_jsx(UploadFile, { readOnly: readOnly, required: required, purpose: purpose, fileType: fileType, title: fileTitle, isVerified: isVerified, isSubmitting: isSubmitting, uploadedFiles: fileInfoArray, index: index, file: file, sx: {
|
|
173
|
+
return (_jsx(UploadFile, { readOnly: readOnly, required: required, purpose: purpose, fileType: fileType, title: fileTitle, isVerified: isVerified && (defaultFiles === null || defaultFiles === void 0 ? void 0 : defaultFiles.length) === uploadedFileCount, isSubmitting: isSubmitting, uploadedFiles: fileInfoArray, index: index, file: file, sx: {
|
|
174
174
|
borderBottom: index === fileArray.length - 1 ? "1px solid ".concat(alpha(theme.palette.divider, 0.8)) : ''
|
|
175
175
|
}, onSuccess: handleSuccess, onDelete: handleDelete, onUpdate: handleUpdate }, index));
|
|
176
176
|
}) })), _jsx(Collapse, __assign({ in: !readOnly }, { children: _jsx(InputContainerStyled, __assign({ sx: { mt: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, onSuccess: handleFileChange, multiple: true, error: error }) })) }))] }));
|