@pushwoosh/smart-components-kit 1.0.62 → 1.0.64
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.
|
@@ -12,6 +12,7 @@ export const useExportService = () => {
|
|
|
12
12
|
rpcGateway
|
|
13
13
|
} = useSPAContext();
|
|
14
14
|
const clearExport = useCallback(() => {
|
|
15
|
+
retriesRef.current = 0;
|
|
15
16
|
setError('');
|
|
16
17
|
setIsTaskInProgress(false);
|
|
17
18
|
setTaskResult(undefined);
|
|
@@ -54,9 +55,7 @@ export const useExportService = () => {
|
|
|
54
55
|
const result = await rpcGateway.exportStatistics.Status(params);
|
|
55
56
|
switch (result.status) {
|
|
56
57
|
case 'STATUS_PENDING':
|
|
57
|
-
|
|
58
|
-
setProgress(Math.round(result.progress));
|
|
59
|
-
}
|
|
58
|
+
setProgress(prev => result.progress > prev ? Math.round(result.progress) : prev);
|
|
60
59
|
clearStatusTimeout();
|
|
61
60
|
if (retriesRef.current < MAX_RETRIES) {
|
|
62
61
|
retriesRef.current += 1;
|
|
@@ -89,7 +88,7 @@ export const useExportService = () => {
|
|
|
89
88
|
retriesRef.current = 0;
|
|
90
89
|
return err;
|
|
91
90
|
}
|
|
92
|
-
}, [clearStatusTimeout, getResult,
|
|
91
|
+
}, [clearStatusTimeout, getResult, rpcGateway]);
|
|
93
92
|
const getLastTasks = useCallback(async params => {
|
|
94
93
|
try {
|
|
95
94
|
const {
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { useParams } from 'react-router-dom';
|
|
3
3
|
import { Link, Spinner } from '@pushwoosh/dumb-components';
|
|
4
4
|
import { Color, PlatformsIcons, PlatformsLabels, Tag } from '@pushwoosh/kit-constants';
|
|
5
|
-
import { Horizontal,
|
|
6
|
-
import { PlatformLogoIcon } from '@pushwoosh/kit-icons';
|
|
5
|
+
import { Horizontal, Vertical, useAsync } from '@pushwoosh/kit-helpers';
|
|
6
|
+
import { OpenIcon, PlatformLogoIcon } from '@pushwoosh/kit-icons';
|
|
7
7
|
import { Text } from '@pushwoosh/kit-typography';
|
|
8
8
|
import { LinkRow, ClickActionSection } from './styles';
|
|
9
9
|
import { useSPAContext } from '../../../context';
|
|
@@ -35,7 +35,14 @@ export const OpenActionsSummary = ({
|
|
|
35
35
|
rel: "noopener noreferrer",
|
|
36
36
|
target: "_blank",
|
|
37
37
|
href: url
|
|
38
|
-
},
|
|
38
|
+
}, React.createElement(Horizontal, {
|
|
39
|
+
"$alignItems": "center",
|
|
40
|
+
"$justifyContent": "start",
|
|
41
|
+
"$gap": 4
|
|
42
|
+
}, urlText ?? url, React.createElement(OpenIcon, {
|
|
43
|
+
view: "lined",
|
|
44
|
+
size: "small"
|
|
45
|
+
})))));
|
|
39
46
|
const renderPlatformDeepLink = (platformKey, url, label = 'deep link') => {
|
|
40
47
|
const isEnumKey = typeof platformKey === 'number';
|
|
41
48
|
const icon = isEnumKey ? PlatformsIcons[platformKey] : null;
|
|
@@ -43,9 +50,9 @@ export const OpenActionsSummary = ({
|
|
|
43
50
|
return React.createElement(ClickActionSection, {
|
|
44
51
|
key: platformKey
|
|
45
52
|
}, React.createElement(Horizontal, {
|
|
46
|
-
"$
|
|
53
|
+
"$alignItems": "start",
|
|
47
54
|
"$justifyContent": "start",
|
|
48
|
-
"$
|
|
55
|
+
"$gap": 8
|
|
49
56
|
}, icon && React.createElement(PlatformLogoIcon, {
|
|
50
57
|
size: "small",
|
|
51
58
|
type: icon,
|
package/package.json
CHANGED