@pushwoosh/smart-components-kit 1.0.89 → 1.1.0
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/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.d.ts +1 -2
- package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +105 -56
- package/CampaignsConfigurationDrawer/components/Card/Card.d.ts +1 -2
- package/CampaignsConfigurationDrawer/components/Card/Card.js +19 -13
- package/CampaignsConfigurationDrawer/polyglot/index.d.ts +2 -0
- package/CampaignsConfigurationDrawer/polyglot/index.js +10 -0
- package/CampaignsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
- package/CampaignsConfigurationDrawer/polyglot/messages_en.js +18 -0
- package/CampaignsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
- package/CampaignsConfigurationDrawer/polyglot/messages_ru.js +18 -0
- package/CampaignsConfigurationDrawer/polyglot/types.d.ts +19 -0
- package/CampaignsConfigurationDrawer/polyglot/types.js +1 -0
- package/DocsButton/DocsButton.d.ts +1 -2
- package/DocsButton/DocsButton.js +21 -18
- package/DynamicContentPicker/DynamicContentPicker.js +76 -63
- package/DynamicContentPicker/Line.js +24 -22
- package/DynamicContentPickerForm/DynamicContentCustomPickerForm.js +20 -15
- package/DynamicContentPickerForm/DynamicContentEventPickerForm.js +62 -51
- package/DynamicContentPickerForm/DynamicContentTagPickerForm.js +62 -51
- package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +74 -59
- package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +104 -78
- package/DynamicContentPickerForm/polyglot/index.d.ts +2 -0
- package/DynamicContentPickerForm/polyglot/index.js +10 -0
- package/DynamicContentPickerForm/polyglot/messages_en.d.ts +3 -0
- package/DynamicContentPickerForm/polyglot/messages_en.js +16 -0
- package/DynamicContentPickerForm/polyglot/messages_ru.d.ts +3 -0
- package/DynamicContentPickerForm/polyglot/messages_ru.js +16 -0
- package/DynamicContentPickerForm/polyglot/types.d.ts +17 -0
- package/DynamicContentPickerForm/polyglot/types.js +1 -0
- package/EmailTemplatePreview/EmailTemplatePreview.js +10 -4
- package/EmailTemplatePreview/polyglot/index.d.ts +5 -0
- package/EmailTemplatePreview/polyglot/index.js +10 -0
- package/EmailTemplatePreview/polyglot/messages_en.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_en.js +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.d.ts +3 -0
- package/EmailTemplatePreview/polyglot/messages_ru.js +3 -0
- package/EmailTemplatePreview/polyglot/types.d.ts +4 -0
- package/EmailTemplatePreview/polyglot/types.js +1 -0
- package/ExportCSV/ExportCsvBanner/ExportCsvBanner.d.ts +1 -2
- package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +63 -42
- package/ExportCSV/polyglot/index.d.ts +2 -0
- package/ExportCSV/polyglot/index.js +10 -0
- package/ExportCSV/polyglot/messages_en.d.ts +3 -0
- package/ExportCSV/polyglot/messages_en.js +9 -0
- package/ExportCSV/polyglot/messages_ru.d.ts +3 -0
- package/ExportCSV/polyglot/messages_ru.js +9 -0
- package/ExportCSV/polyglot/types.d.ts +10 -0
- package/ExportCSV/polyglot/types.js +1 -0
- package/ExportCSV/useExportService/useExportService.js +1 -0
- package/LanguagesSelector/LanguagesModal.js +38 -24
- package/LanguagesSelector/LanguagesSelectForm.js +73 -62
- package/LanguagesSelector/LanguagesSelectFormLoader.js +8 -7
- package/LanguagesSelector/LanguagesSelector.js +92 -78
- package/MediaStore/CreateVariantDrawer.js +134 -85
- package/MediaStore/MediaStore.js +137 -112
- package/ModalCloningJourney/ModalCloningJourney.d.ts +1 -2
- package/ModalCloningJourney/ModalCloningJourney.js +113 -91
- package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.d.ts +1 -2
- package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.js +101 -37
- package/OpenActions/components/OpenActionsSummaryByPreset.d.ts +1 -2
- package/OpenActions/components/OpenActionsSummaryByPreset.js +2 -2
- package/OpenActions/polyglot/index.d.ts +2 -0
- package/OpenActions/polyglot/index.js +10 -0
- package/OpenActions/polyglot/messages_en.d.ts +3 -0
- package/OpenActions/polyglot/messages_en.js +14 -0
- package/OpenActions/polyglot/messages_ru.d.ts +3 -0
- package/OpenActions/polyglot/messages_ru.js +14 -0
- package/OpenActions/polyglot/types.d.ts +18 -0
- package/OpenActions/polyglot/types.js +1 -0
- package/PlatformsConfigurationDrawer/PlatformsConfigurationDrawer.js +21 -17
- package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +114 -57
- package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +157 -75
- package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +140 -69
- package/PlatformsConfigurationDrawer/polyglot/index.d.ts +2 -0
- package/PlatformsConfigurationDrawer/polyglot/index.js +10 -0
- package/PlatformsConfigurationDrawer/polyglot/messages_en.d.ts +3 -0
- package/PlatformsConfigurationDrawer/polyglot/messages_en.js +24 -0
- package/PlatformsConfigurationDrawer/polyglot/messages_ru.d.ts +3 -0
- package/PlatformsConfigurationDrawer/polyglot/messages_ru.js +24 -0
- package/PlatformsConfigurationDrawer/polyglot/types.d.ts +25 -0
- package/PlatformsConfigurationDrawer/polyglot/types.js +1 -0
- package/ResendModal/ResendModal.d.ts +1 -2
- package/ResendModal/ResendModal.js +95 -59
- package/ResendModal/polyglot/index.d.ts +2 -0
- package/ResendModal/polyglot/index.js +10 -0
- package/ResendModal/polyglot/messages_en.d.ts +3 -0
- package/ResendModal/polyglot/messages_en.js +9 -0
- package/ResendModal/polyglot/messages_ru.d.ts +3 -0
- package/ResendModal/polyglot/messages_ru.js +9 -0
- package/ResendModal/polyglot/types.d.ts +10 -0
- package/ResendModal/polyglot/types.js +1 -0
- package/RichMessageEditorSmart/NewDynamicContentForm.js +16 -12
- package/RichMessageEditorSmart/RichMessageEditorSmart.js +4 -4
- package/SystemParcel/SystemParcel.d.ts +3 -3
- package/SystemParcel/SystemParcel.js +3 -2
- package/Table/components/DataTable/DataTable.js +80 -61
- package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +1 -2
- package/Table/components/DataTableGetContext/DataTableGetContext.js +5 -2
- package/Table/components/DataTableList/DataTableList.d.ts +1 -2
- package/Table/components/DataTableList/DataTableList.js +86 -68
- package/Table/components/DataTablePagination/DataTablePagination.js +6 -4
- package/Table/components/DataTableSearchInput/DataTableSearchInput.js +3 -2
- package/Table/components/DataTableSortableCell/DataTableSortableCell.js +6 -4
- package/Table/components/Loading/Loading.d.ts +1 -2
- package/Table/components/Loading/Loading.js +16 -14
- package/Table/components/TablePagination/TablePagination.js +31 -25
- package/_devel/index.js +36 -24
- package/_devel/lib/dynamic-content-picker.d.ts +1 -2
- package/_devel/lib/dynamic-content-picker.js +16 -10
- package/_devel/lib/index.d.ts +2 -2
- package/_devel/lib/index.js +38 -19
- package/_devel/test-place.d.ts +1 -2
- package/_devel/test-place.js +4 -2
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.CUSTOM.PLACEHOLDER': 'Введите произвольный текст',
|
|
3
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.EVENT.PLACEHOLDER': 'Выберите событие',
|
|
4
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER': 'Выберите тег',
|
|
5
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TAG': 'Тег',
|
|
6
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.ATTRIBUTE': 'Атрибут',
|
|
7
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.MODIFIER': 'Модификатор',
|
|
8
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT': 'Запасной текст',
|
|
9
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.DEFAULT_TAG_VALUE': 'Значение тега по умолчанию',
|
|
10
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VARIABLE_TYPE': 'Тип переменной',
|
|
11
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.TAG': 'Тег',
|
|
12
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Событие',
|
|
13
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Произвольный текст',
|
|
14
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Отмена',
|
|
15
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Применить'
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NoParams } from '@pushwoosh/dumb-components/polyglot';
|
|
2
|
+
export type DynamicContentPickerFormMessages = {
|
|
3
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.CUSTOM.PLACEHOLDER': NoParams;
|
|
4
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.EVENT.PLACEHOLDER': NoParams;
|
|
5
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER': NoParams;
|
|
6
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TAG': NoParams;
|
|
7
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.ATTRIBUTE': NoParams;
|
|
8
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.MODIFIER': NoParams;
|
|
9
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FALLBACK_TEXT': NoParams;
|
|
10
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.DEFAULT_TAG_VALUE': NoParams;
|
|
11
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VARIABLE_TYPE': NoParams;
|
|
12
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.TAG': NoParams;
|
|
13
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': NoParams;
|
|
14
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': NoParams;
|
|
15
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': NoParams;
|
|
16
|
+
'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': NoParams;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { EmailTemplatePreview as DumbPreview, RectangularSkeleton } from '@pushwoosh/dumb-components';
|
|
3
3
|
import { useAsync } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { useSPAContext } from '@pushwoosh/spa-context';
|
|
5
|
+
import { useLang } from './polyglot';
|
|
5
6
|
export const EmailTemplatePreview = ({
|
|
6
7
|
code,
|
|
7
8
|
width,
|
|
8
9
|
height,
|
|
9
10
|
scale
|
|
10
11
|
}) => {
|
|
12
|
+
const lang = useLang();
|
|
11
13
|
const {
|
|
12
14
|
rpcGateway
|
|
13
15
|
} = useSPAContext();
|
|
@@ -31,15 +33,19 @@ export const EmailTemplatePreview = ({
|
|
|
31
33
|
};
|
|
32
34
|
}, [code]);
|
|
33
35
|
if (res.loading) {
|
|
34
|
-
return
|
|
36
|
+
return _jsx(RectangularSkeleton, {
|
|
35
37
|
width: width || '100%',
|
|
36
38
|
height: height || '100%'
|
|
37
39
|
});
|
|
38
40
|
}
|
|
39
41
|
if (res.error) {
|
|
40
|
-
return
|
|
42
|
+
return _jsx("div", {
|
|
43
|
+
children: lang({
|
|
44
|
+
message: 'SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW'
|
|
45
|
+
})
|
|
46
|
+
});
|
|
41
47
|
}
|
|
42
|
-
return
|
|
48
|
+
return _jsx(DumbPreview, {
|
|
43
49
|
template: res.value.template,
|
|
44
50
|
localization: res.value.localization,
|
|
45
51
|
values: res.value.values,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const Lang: import("react").FC<{
|
|
2
|
+
message: "SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW";
|
|
3
|
+
} & import("@pushwoosh/dumb-components/polyglot").NoParams>, useLang: () => (props: {
|
|
4
|
+
message: "SMART.EMAIL_TEMPLATE_PREVIEW.NO_PREVIEW";
|
|
5
|
+
} & import("@pushwoosh/dumb-components/polyglot").NoParams) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type TaskInfo_args, type GetLastTasksRequest, type Status } from '@pushwoosh/rpc-v2-http-api-data/pushwoosh_export_messages_v2';
|
|
3
2
|
export type ExportTask = {
|
|
4
3
|
id: number;
|
|
@@ -16,5 +15,5 @@ type ExportCsvBannerProps = {
|
|
|
16
15
|
isKeepPageOpenWarning?: boolean;
|
|
17
16
|
onClose?: () => void;
|
|
18
17
|
};
|
|
19
|
-
export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, isKeepPageOpenWarning, onClose, }: ExportCsvBannerProps) =>
|
|
18
|
+
export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, isKeepPageOpenWarning, onClose, }: ExportCsvBannerProps) => import("react").JSX.Element | null;
|
|
20
19
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect } from 'react';
|
|
2
3
|
import { ExportResult, ProgressBar, Button } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
4
5
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
5
6
|
import { DangerTriangleIcon, DownloadIcon } from '@pushwoosh/kit-icons';
|
|
6
7
|
import { Text } from '@pushwoosh/kit-typography';
|
|
8
|
+
import { useLang } from '../polyglot';
|
|
7
9
|
import { useExportService } from '../useExportService';
|
|
8
10
|
import { useExportVisibility } from './hooks/useExportVisibility';
|
|
9
11
|
export const ExportCsvBanner = ({
|
|
@@ -14,6 +16,7 @@ export const ExportCsvBanner = ({
|
|
|
14
16
|
isKeepPageOpenWarning,
|
|
15
17
|
onClose
|
|
16
18
|
}) => {
|
|
19
|
+
const lang = useLang();
|
|
17
20
|
const {
|
|
18
21
|
getLastTasks,
|
|
19
22
|
getStatus,
|
|
@@ -72,13 +75,17 @@ export const ExportCsvBanner = ({
|
|
|
72
75
|
status,
|
|
73
76
|
filename: data.file,
|
|
74
77
|
args,
|
|
75
|
-
progressTitle:
|
|
76
|
-
|
|
78
|
+
progressTitle: lang({
|
|
79
|
+
message: 'SMART.EXPORT_CSV.PROGRESS_TITLE'
|
|
80
|
+
}),
|
|
81
|
+
resultSubTitle: lang({
|
|
82
|
+
message: 'SMART.EXPORT_CSV.RESULT_SUBTITLE'
|
|
83
|
+
})
|
|
77
84
|
});
|
|
78
85
|
}
|
|
79
86
|
});
|
|
80
87
|
}
|
|
81
|
-
}, [getLastTasks, isHidden, lastTasksParams, updateExportTask]);
|
|
88
|
+
}, [getLastTasks, isHidden, lastTasksParams, updateExportTask, lang]);
|
|
82
89
|
const handleClose = useCallback(() => {
|
|
83
90
|
hide();
|
|
84
91
|
onClose === null || onClose === void 0 || onClose();
|
|
@@ -91,47 +98,61 @@ export const ExportCsvBanner = ({
|
|
|
91
98
|
resultSubTitle,
|
|
92
99
|
progressTitle
|
|
93
100
|
} = exportTask;
|
|
94
|
-
return
|
|
101
|
+
return _jsxs(Horizontal, {
|
|
95
102
|
"$padding": 8,
|
|
96
103
|
"$alignItems": "center",
|
|
97
104
|
"$border": `1px solid ${Color.DIVIDER}`,
|
|
98
105
|
"$borderRadius": ShapeRadius.SECTION,
|
|
99
|
-
"$bgColor": Color.CLEAR
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
"$bgColor": Color.CLEAR,
|
|
107
|
+
children: [status === 'STATUS_SUCCESS' && _jsx(ExportResult, {
|
|
108
|
+
type: "success",
|
|
109
|
+
title: lang({
|
|
110
|
+
message: 'SMART.EXPORT_CSV.SUCCESS_TITLE'
|
|
111
|
+
}),
|
|
112
|
+
subtitle: `${resultSubTitle} ${filename}`,
|
|
113
|
+
handleClose: handleClose,
|
|
114
|
+
rightSlot: _jsx("a", {
|
|
115
|
+
href: `/api/v2/statistics/exportMessagesStatistics/download/${filename}`,
|
|
116
|
+
download: filename,
|
|
117
|
+
children: _jsx(Button, {
|
|
118
|
+
color: "secondary",
|
|
119
|
+
size: "compact",
|
|
120
|
+
icon: _jsx(DownloadIcon, {
|
|
121
|
+
size: "small",
|
|
122
|
+
view: "filled"
|
|
123
|
+
}),
|
|
124
|
+
children: lang({
|
|
125
|
+
message: 'SMART.EXPORT_CSV.DOWNLOAD'
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
}), status === 'STATUS_PENDING' && (isKeepPageOpenWarning ? _jsx(ProgressBar, {
|
|
130
|
+
title: progressTitle,
|
|
131
|
+
percentValue: progress,
|
|
132
|
+
rightSlot: _jsx(Text, {
|
|
133
|
+
"$color": Color.WARNING,
|
|
134
|
+
"$variant": "h5",
|
|
135
|
+
"$uppercase": true,
|
|
136
|
+
children: lang({
|
|
137
|
+
message: 'SMART.EXPORT_CSV.KEEP_PAGE_OPEN'
|
|
138
|
+
})
|
|
114
139
|
})
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
view: "filled"
|
|
134
|
-
}),
|
|
135
|
-
handleClose: handleClose
|
|
136
|
-
}));
|
|
140
|
+
}) : _jsx(ProgressBar, {
|
|
141
|
+
title: progressTitle,
|
|
142
|
+
percentValue: progress
|
|
143
|
+
})), status === 'STATUS_FAILED' && _jsx(ExportResult, {
|
|
144
|
+
type: "error",
|
|
145
|
+
title: lang({
|
|
146
|
+
message: 'SMART.EXPORT_CSV.FAILED_TITLE'
|
|
147
|
+
}),
|
|
148
|
+
subtitle: lang({
|
|
149
|
+
message: 'SMART.EXPORT_CSV.FAILED_SUBTITLE'
|
|
150
|
+
}),
|
|
151
|
+
leftSlotIcon: _jsx(DangerTriangleIcon, {
|
|
152
|
+
size: "medium",
|
|
153
|
+
view: "filled"
|
|
154
|
+
}),
|
|
155
|
+
handleClose: handleClose
|
|
156
|
+
})]
|
|
157
|
+
});
|
|
137
158
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { type ExportCsvMessages } from './types';
|
|
2
|
+
export declare const Lang: import("react").FC<import("@pushwoosh/dumb-components/polyglot").LangProps<ExportCsvMessages>>, useLang: () => (props: import("@pushwoosh/dumb-components/polyglot").LangProps<ExportCsvMessages>) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'SMART.EXPORT_CSV.PROGRESS_TITLE': 'Exporting list:',
|
|
3
|
+
'SMART.EXPORT_CSV.RESULT_SUBTITLE': 'Result:',
|
|
4
|
+
'SMART.EXPORT_CSV.SUCCESS_TITLE': 'Exporting complete',
|
|
5
|
+
'SMART.EXPORT_CSV.DOWNLOAD': 'Download CSV',
|
|
6
|
+
'SMART.EXPORT_CSV.KEEP_PAGE_OPEN': 'Keep page open during export',
|
|
7
|
+
'SMART.EXPORT_CSV.FAILED_TITLE': 'Export failed',
|
|
8
|
+
'SMART.EXPORT_CSV.FAILED_SUBTITLE': 'Please try again'
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const messages = {
|
|
2
|
+
'SMART.EXPORT_CSV.PROGRESS_TITLE': 'Экспорт списка:',
|
|
3
|
+
'SMART.EXPORT_CSV.RESULT_SUBTITLE': 'Результат:',
|
|
4
|
+
'SMART.EXPORT_CSV.SUCCESS_TITLE': 'Экспорт завершён',
|
|
5
|
+
'SMART.EXPORT_CSV.DOWNLOAD': 'Скачать CSV',
|
|
6
|
+
'SMART.EXPORT_CSV.KEEP_PAGE_OPEN': 'Не закрывайте страницу во время экспорта',
|
|
7
|
+
'SMART.EXPORT_CSV.FAILED_TITLE': 'Ошибка экспорта',
|
|
8
|
+
'SMART.EXPORT_CSV.FAILED_SUBTITLE': 'Попробуйте ещё раз'
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NoParams } from '@pushwoosh/dumb-components/polyglot';
|
|
2
|
+
export type ExportCsvMessages = {
|
|
3
|
+
'SMART.EXPORT_CSV.PROGRESS_TITLE': NoParams;
|
|
4
|
+
'SMART.EXPORT_CSV.RESULT_SUBTITLE': NoParams;
|
|
5
|
+
'SMART.EXPORT_CSV.SUCCESS_TITLE': NoParams;
|
|
6
|
+
'SMART.EXPORT_CSV.DOWNLOAD': NoParams;
|
|
7
|
+
'SMART.EXPORT_CSV.KEEP_PAGE_OPEN': NoParams;
|
|
8
|
+
'SMART.EXPORT_CSV.FAILED_TITLE': NoParams;
|
|
9
|
+
'SMART.EXPORT_CSV.FAILED_SUBTITLE': NoParams;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -60,6 +60,7 @@ export const useExportService = () => {
|
|
|
60
60
|
if (retriesRef.current < MAX_RETRIES) {
|
|
61
61
|
retriesRef.current += 1;
|
|
62
62
|
timeoutStatusRef.current = setTimeout(() => {
|
|
63
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
63
64
|
getStatus(params);
|
|
64
65
|
clearStatusTimeout();
|
|
65
66
|
}, API_CHECK_INTERVAL);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { Button, ModalHeader, ModalBody, ModalFooter, ModalTitle } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { LanguagesSelectFormLoader } from './LanguagesSelectFormLoader';
|
|
@@ -12,27 +13,40 @@ export const LanguagesModal = ({
|
|
|
12
13
|
}) => {
|
|
13
14
|
const lang = useLang();
|
|
14
15
|
const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages);
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
return _jsxs(_Fragment, {
|
|
17
|
+
children: [_jsx(ModalHeader, {
|
|
18
|
+
children: _jsx(ModalTitle, {
|
|
19
|
+
children: lang({
|
|
20
|
+
message: 'SMART.LANGUAGES_SELECTOR.MODAL.TITLE'
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
}), _jsx(ModalBody, {
|
|
24
|
+
children: _jsx(LanguagesSelectFormLoader, {
|
|
25
|
+
application: applicationCode,
|
|
26
|
+
onChange: setSelectedLanguages,
|
|
27
|
+
value: selectedLanguages
|
|
28
|
+
})
|
|
29
|
+
}), _jsx(ModalFooter, {
|
|
30
|
+
children: _jsxs(Horizontal, {
|
|
31
|
+
"$justifyContent": "end",
|
|
32
|
+
"$gap": 8,
|
|
33
|
+
children: [_jsx(Button, {
|
|
34
|
+
color: "secondary",
|
|
35
|
+
onClick: onClose,
|
|
36
|
+
children: lang({
|
|
37
|
+
message: 'SMART.LANGUAGES_SELECTOR.BUTTON.CANCEL'
|
|
38
|
+
})
|
|
39
|
+
}), _jsx(Button, {
|
|
40
|
+
color: "primary",
|
|
41
|
+
onClick: () => {
|
|
42
|
+
saveLastSelection(selectedLanguages);
|
|
43
|
+
onSubmit(selectedLanguages);
|
|
44
|
+
},
|
|
45
|
+
children: lang({
|
|
46
|
+
message: 'SMART.LANGUAGES_SELECTOR.BUTTON.APPLY'
|
|
47
|
+
})
|
|
48
|
+
})]
|
|
49
|
+
})
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
38
52
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
2
3
|
import { Checkbox, SearchInput } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { Columns, Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { useLang } from './polyglot';
|
|
@@ -24,65 +25,75 @@ export const LanguagesSelectForm = ({
|
|
|
24
25
|
return item.name.toLowerCase().includes(search.toLowerCase());
|
|
25
26
|
});
|
|
26
27
|
}, [allLanguageItems, search, showAllLanguages, langs]);
|
|
27
|
-
return
|
|
28
|
-
"$gap": 8
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
28
|
+
return _jsxs(Vertical, {
|
|
29
|
+
"$gap": 8,
|
|
30
|
+
children: [_jsx(SearchInput, {
|
|
31
|
+
value: search,
|
|
32
|
+
onChange: e => setSearch(e.target.value),
|
|
33
|
+
"$onClear": () => setSearch(''),
|
|
34
|
+
placeholder: lang({
|
|
35
|
+
message: 'SMART.LANGUAGES_SELECTOR.SEARCH_PLACEHOLDER'
|
|
36
|
+
})
|
|
37
|
+
}), _jsxs(Horizontal, {
|
|
38
|
+
"$justifyContent": "space-between",
|
|
39
|
+
children: [_jsxs(Horizontal, {
|
|
40
|
+
"$gap": 16,
|
|
41
|
+
"$justifyContent": "start",
|
|
42
|
+
children: [_jsx(ActionButton, {
|
|
43
|
+
onClick: () => {
|
|
44
|
+
onChange(filteredLanguages.map(item => item.code));
|
|
45
|
+
},
|
|
46
|
+
children: lang({
|
|
47
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.SELECT_ALL'
|
|
48
|
+
})
|
|
49
|
+
}), _jsx(ActionButton, {
|
|
50
|
+
onClick: () => {
|
|
51
|
+
onChange([]);
|
|
52
|
+
},
|
|
53
|
+
children: lang({
|
|
54
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.DESELECT_ALL'
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
}), lastSelection.length > 0 && _jsx(ActionButton, {
|
|
58
|
+
onClick: () => {
|
|
59
|
+
onChange(lastSelection);
|
|
60
|
+
},
|
|
61
|
+
children: lang({
|
|
62
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.REUSE_LAST'
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
}), _jsxs(Vertical, {
|
|
66
|
+
"$gap": 24,
|
|
67
|
+
children: [_jsx(Columns, {
|
|
68
|
+
"$sizes": 3,
|
|
69
|
+
"$gap": 8,
|
|
70
|
+
children: filteredLanguages.map(item => _jsx(Checkbox, {
|
|
71
|
+
name: "languages",
|
|
72
|
+
value: item.code,
|
|
73
|
+
isChecked: langs.includes(item.code),
|
|
74
|
+
onChange: isChecked => {
|
|
75
|
+
if (isChecked) {
|
|
76
|
+
onChange([...langs, item.code]);
|
|
77
|
+
} else {
|
|
78
|
+
onChange(langs.filter(code => code !== item.code));
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
label: lang({
|
|
82
|
+
message: 'SMART.LANGUAGES_SELECTOR.CHECKBOX_LABEL',
|
|
83
|
+
name: getLangName(item.code),
|
|
84
|
+
subscribers: item.subscribers
|
|
85
|
+
})
|
|
86
|
+
}, item.code))
|
|
87
|
+
}), _jsx("div", {
|
|
88
|
+
children: _jsx(ActionButton, {
|
|
89
|
+
onClick: () => setShowAllLanguages(x => !x),
|
|
90
|
+
children: showAllLanguages ? lang({
|
|
91
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.SHOW_WITH_SUBSCRIBERS'
|
|
92
|
+
}) : lang({
|
|
93
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.SHOW_ALL'
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
})]
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
88
99
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Spinner } from '@pushwoosh/dumb-components';
|
|
3
3
|
import { Horizontal, useAsync } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { useSPAContext } from '@pushwoosh/spa-context';
|
|
@@ -38,14 +38,15 @@ export const LanguagesSelectFormLoader = ({
|
|
|
38
38
|
});
|
|
39
39
|
}, [application, getLangName, systemLanguage]);
|
|
40
40
|
if (langAsync.loading) {
|
|
41
|
-
return
|
|
41
|
+
return _jsx(Horizontal, {
|
|
42
42
|
"$placeItems": "center",
|
|
43
|
-
"$padding": 36
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
"$padding": 36,
|
|
44
|
+
children: _jsx(Spinner, {
|
|
45
|
+
size: "medium"
|
|
46
|
+
})
|
|
47
|
+
});
|
|
47
48
|
}
|
|
48
|
-
return
|
|
49
|
+
return _jsx(LanguagesSelectForm, {
|
|
49
50
|
allLanguageItems: langAsync.value,
|
|
50
51
|
langs: value,
|
|
51
52
|
onChange: onChange,
|