ydb-embedded-ui 6.12.0 → 6.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/AutoRefreshControl/i18n/index.d.ts +1 -1
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +3 -2
- package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +9 -5
- package/dist/components/CriticalActionDialog/CriticalActionDialog.d.ts +5 -3
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +8 -7
- package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +1 -1
- package/dist/components/CriticalActionDialog/i18n/en.json +1 -0
- package/dist/components/CriticalActionDialog/i18n/index.d.ts +1 -1
- package/dist/components/Errors/PageError/PageError.d.ts +11 -0
- package/dist/components/Errors/PageError/PageError.js +19 -0
- package/dist/components/Errors/i18n/en.json +2 -1
- package/dist/components/Errors/i18n/index.d.ts +1 -1
- package/dist/components/Errors/i18n/ru.json +2 -1
- package/dist/components/Fullscreen/Fullscreen.d.ts +1 -1
- package/dist/components/Fullscreen/Fullscreen.js +34 -27
- package/dist/components/Fullscreen/Fullscreen.scss +16 -8
- package/dist/components/Graph/Graph.d.ts +13 -0
- package/dist/components/Graph/Graph.js +41 -0
- package/dist/components/LabelWithPopover/LabelWithPopover.d.ts +4 -1
- package/dist/components/LabelWithPopover/LabelWithPopover.js +1 -1
- package/dist/components/Loader/Loader.d.ts +2 -1
- package/dist/components/Loader/Loader.js +6 -1
- package/dist/components/LoaderWrapper/LoaderWrapper.d.ts +10 -0
- package/dist/components/LoaderWrapper/LoaderWrapper.js +8 -0
- package/dist/components/MetricChart/reducer.d.ts +2 -2
- package/dist/components/PDiskInfo/PDiskInfo.d.ts +2 -2
- package/dist/components/PDiskInfo/PDiskInfo.js +9 -6
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/ProgressViewer/ProgressViewer.js +3 -0
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.js +13 -3
- package/dist/components/QueryExecutionStatus/QueryExecutionStatus.scss +4 -0
- package/dist/components/QuerySettingsDescription/QuerySettingsDescription.d.ts +7 -0
- package/dist/components/QuerySettingsDescription/QuerySettingsDescription.js +8 -0
- package/dist/components/QuerySettingsDescription/QuerySettingsDescription.scss +8 -0
- package/dist/components/QuerySettingsDescription/index.d.ts +1 -0
- package/dist/components/QuerySettingsDescription/index.js +1 -0
- package/dist/components/VDisk/VDisk.js +3 -4
- package/dist/components/VDiskInfo/VDiskInfo.d.ts +2 -2
- package/dist/components/VDiskInfo/VDiskInfo.js +4 -2
- package/dist/containers/App/Content.js +15 -19
- package/dist/containers/AsideNavigation/AsideNavigation.js +2 -1
- package/dist/containers/AsideNavigation/YdbInternalUser/YdbInternalUser.js +4 -4
- package/dist/containers/Authentication/Authentication.js +8 -10
- package/dist/containers/Authentication/utils.d.ts +8 -0
- package/dist/containers/Authentication/utils.js +15 -0
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js +6 -6
- package/dist/containers/Clusters/constants.d.ts +1 -1
- package/dist/containers/Heatmap/Heatmap.js +5 -4
- package/dist/containers/Node/Node.js +5 -7
- package/dist/containers/Node/Node.scss +4 -0
- package/dist/containers/Node/NodeStructure/NodeStructure.js +4 -4
- package/dist/containers/Node/NodeStructure/NodeStructure.scss +4 -0
- package/dist/containers/Node/NodeStructure/Pdisk.js +2 -2
- package/dist/containers/Nodes/Nodes.js +6 -8
- package/dist/containers/Nodes/getNodesColumns.js +6 -21
- package/dist/containers/PDiskPage/PDiskPage.js +19 -8
- package/dist/containers/PDiskPage/i18n/en.json +1 -0
- package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
- package/dist/containers/Storage/PDisk/PDisk.js +3 -4
- package/dist/containers/Storage/Storage.js +4 -6
- package/dist/containers/Tablet/Tablet.js +2 -2
- package/dist/containers/Tablet/TabletControls/TabletControls.js +2 -1
- package/dist/containers/Tablets/Tablets.js +3 -5
- package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +2 -5
- package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +10 -13
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +1 -0
- package/dist/containers/Tenant/Diagnostics/Network/Network.js +8 -11
- package/dist/containers/Tenant/Diagnostics/Network/Network.scss +1 -0
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.d.ts +1 -2
- package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +3 -5
- package/dist/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.js +3 -4
- package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +1 -4
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.js +3 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +4 -3
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +4 -3
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.d.ts +2 -2
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +56 -20
- package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.scss +10 -6
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/en.json +7 -0
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.js +4 -0
- package/dist/containers/Tenant/Query/ExecuteResult/utils.d.ts +18 -0
- package/dist/containers/Tenant/Query/ExecuteResult/utils.js +36 -0
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.d.ts +23 -1
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +56 -111
- package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.scss +1 -30
- package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.d.ts +7 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.js +18 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.scss +8 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.d.ts +8 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.js +14 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.scss +14 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/MetricsCell.d.ts +6 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/MetricsCell.js +11 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationCell.d.ts +13 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationCell.js +48 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationParams.d.ts +6 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationParams.js +66 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.d.ts +7 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.js +100 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.scss +128 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/types.d.ts +5 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/utils.d.ts +5 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/utils.js +59 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.d.ts +8 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.js +11 -0
- package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.scss +14 -0
- package/dist/containers/Tenant/Query/ExplainResult/i18n/en.json +8 -0
- package/dist/containers/Tenant/Query/ExplainResult/i18n/index.d.ts +2 -0
- package/dist/containers/Tenant/Query/ExplainResult/i18n/index.js +4 -0
- package/dist/containers/Tenant/Query/Preview/Preview.js +2 -3
- package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.js +1 -19
- package/dist/containers/Tenant/Query/QueryDuration/QueryDuration.js +1 -1
- package/dist/containers/Tenant/Query/QueryDuration/QueryDuration.scss +11 -0
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +1 -1
- package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +91 -95
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.d.ts +4 -6
- package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +18 -49
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.d.ts +2 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.js +5 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.test.d.ts +1 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.test.js +42 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.d.ts +5 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.js +19 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.test.d.ts +1 -0
- package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.test.js +56 -0
- package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.d.ts +2 -0
- package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.js +12 -0
- package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.scss +3 -0
- package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.js +20 -23
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.d.ts +123 -7
- package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js +32 -10
- package/dist/containers/Tenant/Query/i18n/en.json +3 -1
- package/dist/containers/Tenant/Query/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +6 -6
- package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +5 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/columns.d.ts +2 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/columns.js +13 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/i18n/en.json +1 -0
- package/dist/containers/Tenant/Schema/SchemaViewer/i18n/index.d.ts +1 -1
- package/dist/containers/Tenant/Schema/SchemaViewer/prepareData.js +3 -2
- package/dist/containers/Tenant/Schema/SchemaViewer/types.d.ts +1 -0
- package/dist/containers/Tenant/Tenant.js +4 -8
- package/dist/containers/Tenant/utils/schemaActions.d.ts +2 -2
- package/dist/containers/Tenant/utils/schemaActions.js +2 -2
- package/dist/containers/Tenants/Tenants.js +4 -7
- package/dist/containers/UserSettings/i18n/en.json +3 -5
- package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
- package/dist/containers/UserSettings/settings.d.ts +2 -3
- package/dist/containers/UserSettings/settings.js +17 -23
- package/dist/containers/VDiskPage/VDiskPage.js +27 -13
- package/dist/containers/VDiskPage/i18n/en.json +1 -0
- package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
- package/dist/services/api.d.ts +21 -8
- package/dist/services/api.js +29 -42
- package/dist/services/settings.d.ts +11 -4
- package/dist/services/settings.js +7 -6
- package/dist/store/configureStore.d.ts +7 -7
- package/dist/store/defaultStore.d.ts +3 -3
- package/dist/store/reducers/api.d.ts +1 -1
- package/dist/store/reducers/api.js +1 -1
- package/dist/store/reducers/authentication/authentication.d.ts +37 -24
- package/dist/store/reducers/authentication/authentication.js +77 -57
- package/dist/store/reducers/authentication/types.d.ts +0 -8
- package/dist/store/reducers/capabilities/capabilities.d.ts +106 -0
- package/dist/store/reducers/capabilities/capabilities.js +22 -0
- package/dist/store/reducers/capabilities/hooks.d.ts +2 -0
- package/dist/store/reducers/capabilities/hooks.js +13 -0
- package/dist/store/reducers/cluster/cluster.d.ts +2 -2
- package/dist/store/reducers/clusterNodes/clusterNodes.d.ts +2 -2
- package/dist/store/reducers/clusters/clusters.d.ts +2 -2
- package/dist/store/reducers/describe.d.ts +2 -2
- package/dist/store/reducers/executeQuery.d.ts +7 -14
- package/dist/store/reducers/executeQuery.js +19 -14
- package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +2 -2
- package/dist/store/reducers/explainQuery/explainQuery.d.ts +5 -4
- package/dist/store/reducers/explainQuery/explainQuery.js +14 -4
- package/dist/store/reducers/explainQuery/types.d.ts +13 -1
- package/dist/store/reducers/explainQuery/utils.js +7 -2
- package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +58 -58
- package/dist/store/reducers/heatmap.d.ts +2 -2
- package/dist/store/reducers/hotKeys/hotKeys.d.ts +2 -2
- package/dist/store/reducers/index.d.ts +6 -6
- package/dist/store/reducers/network/network.d.ts +2 -2
- package/dist/store/reducers/node/node.d.ts +3 -3
- package/dist/store/reducers/node/selectors.d.ts +1 -1
- package/dist/store/reducers/nodes/nodes.d.ts +3 -3
- package/dist/store/reducers/nodesList.d.ts +3 -3
- package/dist/store/reducers/overview/overview.d.ts +2 -2
- package/dist/store/reducers/partitions/partitions.d.ts +2 -2
- package/dist/store/reducers/pdisk/pdisk.d.ts +3 -3
- package/dist/store/reducers/preview.d.ts +2 -2
- package/dist/store/reducers/schema/schema.d.ts +3 -3
- package/dist/store/reducers/schema/schema.js +10 -3
- package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +2 -2
- package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +2 -2
- package/dist/store/reducers/storage/storage.d.ts +3 -3
- package/dist/store/reducers/tablet.d.ts +3 -3
- package/dist/store/reducers/tablets.d.ts +13 -13
- package/dist/store/reducers/tabletsFilters.d.ts +1 -1
- package/dist/store/reducers/tenant/tenant.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topNodes/topNodes.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +2 -2
- package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.d.ts +2 -2
- package/dist/store/reducers/tenants/selectors.d.ts +31 -30
- package/dist/store/reducers/tenants/selectors.js +8 -2
- package/dist/store/reducers/tenants/tenants.d.ts +2 -2
- package/dist/store/reducers/topic.d.ts +44 -44
- package/dist/store/reducers/vdisk/vdisk.d.ts +2 -2
- package/dist/store/reducers/viewSchema/viewSchema.d.ts +2 -2
- package/dist/styles/mixins.scss +2 -0
- package/dist/types/api/capabilities.d.ts +7 -0
- package/dist/types/api/capabilities.js +1 -0
- package/dist/types/api/modifyDisk.d.ts +8 -0
- package/dist/types/api/modifyDisk.js +1 -0
- package/dist/types/api/query.d.ts +39 -3
- package/dist/types/api/query.js +9 -1
- package/dist/types/api/schema/shared.d.ts +8 -0
- package/dist/types/store/query.d.ts +7 -0
- package/dist/utils/__test__/prepareQueryExplain.test.d.ts +1 -0
- package/dist/utils/__test__/prepareQueryExplain.test.js +115 -0
- package/dist/utils/constants.d.ts +13 -4
- package/dist/utils/constants.js +15 -4
- package/dist/utils/dataFormatters/dataFormatters.d.ts +0 -1
- package/dist/utils/dataFormatters/dataFormatters.js +1 -4
- package/dist/utils/hooks/index.d.ts +2 -1
- package/dist/utils/hooks/index.js +2 -1
- package/dist/utils/hooks/useChangedQuerySettings.d.ts +10 -0
- package/dist/utils/hooks/useChangedQuerySettings.js +46 -0
- package/dist/utils/hooks/useDelayed.d.ts +1 -0
- package/dist/utils/hooks/useDelayed.js +13 -0
- package/dist/utils/hooks/useEventHandler.d.ts +6 -0
- package/dist/utils/hooks/useEventHandler.js +17 -0
- package/dist/utils/hooks/useLastQueryExecutionSettings.d.ts +2 -0
- package/dist/utils/hooks/useLastQueryExecutionSettings.js +5 -0
- package/dist/utils/hooks/useQueryExecutionSettings.d.ts +8 -0
- package/dist/utils/hooks/useQueryExecutionSettings.js +15 -0
- package/dist/utils/prepareQueryExplain.d.ts +3 -1
- package/dist/utils/prepareQueryExplain.js +54 -2
- package/dist/utils/query.js +1 -0
- package/dist/utils/query.test.js +3 -0
- package/dist/utils/utils.d.ts +8 -7
- package/dist/utils/utils.js +23 -11
- package/package.json +4 -2
- package/dist/containers/Tenant/Query/ExplainResult/utils.d.ts +0 -2
- package/dist/containers/Tenant/Query/ExplainResult/utils.js +0 -4
- package/dist/store/utils.d.ts +0 -23
- package/dist/store/utils.js +0 -49
- package/dist/types/api/restartPDisk.d.ts +0 -4
- package/dist/utils/hooks/useQueryModes.d.ts +0 -2
- package/dist/utils/hooks/useQueryModes.js +0 -5
- /package/dist/{types/api/restartPDisk.js → containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/types.js} +0 -0
package/dist/utils/constants.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import DataTable from '@gravity-ui/react-data-table';
|
2
2
|
import { EType } from '../types/api/tablet';
|
3
|
+
import { ISOLATION_LEVELS, QUERY_MODES, STATISTICS_MODES, TRACING_LEVELS } from './query';
|
3
4
|
const SECOND = 1000;
|
4
5
|
export const AUTO_RELOAD_INTERVAL = 10 * SECOND;
|
5
6
|
export const DEFAULT_POLLING_INTERVAL = 30 * SECOND;
|
@@ -13,6 +14,7 @@ export const TERABYTE = 1000000000000;
|
|
13
14
|
export const MINUTE_IN_SECONDS = 60;
|
14
15
|
export const HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
|
15
16
|
export const DAY_IN_SECONDS = 24 * HOUR_IN_SECONDS;
|
17
|
+
export const WEEK_IN_SECONDS = 7 * DAY_IN_SECONDS;
|
16
18
|
export const MS_IN_NANOSECONDS = 1000000;
|
17
19
|
export const TABLET_COLORS = {
|
18
20
|
Created: 'grey',
|
@@ -94,7 +96,16 @@ export const TENANT_OVERVIEW_TABLES_SETTINGS = {
|
|
94
96
|
stickyHead: 'fixed',
|
95
97
|
dynamicRender: false,
|
96
98
|
};
|
97
|
-
export const
|
99
|
+
export const DEFAULT_QUERY_SETTINGS = {
|
100
|
+
queryMode: QUERY_MODES.script,
|
101
|
+
isolationLevel: ISOLATION_LEVELS.serializable,
|
102
|
+
timeout: '60',
|
103
|
+
statisticsMode: STATISTICS_MODES.none,
|
104
|
+
tracingLevel: TRACING_LEVELS.detailed,
|
105
|
+
};
|
106
|
+
export const QUERY_EXECUTION_SETTINGS_KEY = 'queryExecutionSettings';
|
107
|
+
export const LAST_QUERY_EXECUTION_SETTINGS_KEY = 'last_query_execution_settings';
|
108
|
+
export const QUERY_SETTINGS_BANNER_LAST_CLOSED_KEY = 'querySettingsBannerLastClosed';
|
98
109
|
export const LAST_USED_QUERY_ACTION_KEY = 'last_used_query_action';
|
99
110
|
export const PARTITIONS_HIDDEN_COLUMNS_KEY = 'partitionsHiddenColumns';
|
100
111
|
// Remain "tab" in key name for backward compatibility
|
@@ -102,12 +113,12 @@ export const TENANT_INITIAL_PAGE_KEY = 'saved_tenant_initial_tab';
|
|
102
113
|
// Setting to use paginated tables
|
103
114
|
// Old key value for backward compatibility
|
104
115
|
export const USE_PAGINATED_TABLES_KEY = 'useBackendParamsForTables';
|
116
|
+
// Setting to hide domain in database list
|
117
|
+
export const SHOW_DOMAIN_DATABASE_KEY = 'showDomainDatabase';
|
105
118
|
// Enable schema that supports multiple resultsets
|
106
119
|
export const QUERY_USE_MULTI_SCHEMA_KEY = 'queryUseMultiSchema';
|
107
120
|
export const USE_CLUSTER_BALANCER_AS_BACKEND_KEY = 'useClusterBalancerAsBacked';
|
108
121
|
export const ENABLE_AUTOCOMPLETE = 'enableAutocomplete';
|
109
122
|
export const AUTOCOMPLETE_ON_ENTER = 'autocompleteOnEnter';
|
110
123
|
export const IS_HOTKEYS_HELP_HIDDEN_KEY = 'isHotKeysHelpHidden';
|
111
|
-
export const
|
112
|
-
export const USE_DIRECTORY_OPERATIONS = 'useDirectoryOperations';
|
113
|
-
export const QUERY_SETTINGS = 'query_settings';
|
124
|
+
export const ENABLE_TRACING_LEVEL_KEY = 'enableTracingLevel';
|
@@ -2,7 +2,6 @@ import type { TVDiskID, TVSlotId } from '../../types/api/vdisk';
|
|
2
2
|
import type { BytesSizes } from '../bytesParsers/formatBytes';
|
3
3
|
export declare const formatBytes: (bytes?: string | number) => string;
|
4
4
|
export declare const formatBps: (bytes?: string | number) => string;
|
5
|
-
export declare const formatBytesToGigabyte: (bytes: number | string) => string;
|
6
5
|
export declare const stringifyVdiskId: (id?: TVDiskID | TVSlotId) => string;
|
7
6
|
export declare const formatUptime: (seconds: number) => string;
|
8
7
|
export declare const formatMsToUptime: (ms?: number) => string | 0 | undefined;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { dateTimeParse } from '@gravity-ui/date-utils';
|
2
2
|
import { formatBytes as formatBytesCustom, getSizeWithSignificantDigits, } from '../bytesParsers/formatBytes';
|
3
|
-
import { DAY_IN_SECONDS,
|
3
|
+
import { DAY_IN_SECONDS, HOUR_IN_SECONDS } from '../constants';
|
4
4
|
import { configuredNumeral } from '../numeral';
|
5
5
|
import { isNumeric } from '../utils';
|
6
6
|
import i18n from './i18n';
|
@@ -20,9 +20,6 @@ export const formatBps = (bytes) => {
|
|
20
20
|
}
|
21
21
|
return formattedBytes + '/s';
|
22
22
|
};
|
23
|
-
export const formatBytesToGigabyte = (bytes) => {
|
24
|
-
return `${Math.floor(Number(bytes) / GIGABYTE)} GB`;
|
25
|
-
};
|
26
23
|
export const stringifyVdiskId = (id) => {
|
27
24
|
return id ? Object.values(id).join('-') : '';
|
28
25
|
};
|
@@ -1,7 +1,8 @@
|
|
1
1
|
export * from './useTypedSelector';
|
2
2
|
export * from './useTypedDispatch';
|
3
3
|
export * from './useSetting';
|
4
|
-
export * from './
|
4
|
+
export * from './useQueryExecutionSettings';
|
5
5
|
export * from './useTableSort';
|
6
6
|
export * from './useSearchQuery';
|
7
7
|
export * from './useAutoRefreshInterval';
|
8
|
+
export * from './useEventHandler';
|
@@ -1,7 +1,8 @@
|
|
1
1
|
export * from './useTypedSelector';
|
2
2
|
export * from './useTypedDispatch';
|
3
3
|
export * from './useSetting';
|
4
|
-
export * from './
|
4
|
+
export * from './useQueryExecutionSettings';
|
5
5
|
export * from './useTableSort';
|
6
6
|
export * from './useSearchQuery';
|
7
7
|
export * from './useAutoRefreshInterval';
|
8
|
+
export * from './useEventHandler';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare const useChangedQuerySettings: () => {
|
2
|
+
isBannerShown: boolean;
|
3
|
+
isIndicatorShown: boolean | 0 | undefined;
|
4
|
+
closeBanner: () => void;
|
5
|
+
resetBanner: () => void;
|
6
|
+
changedCurrentSettings: (keyof import("../../types/store/query").QuerySettings)[];
|
7
|
+
changedCurrentSettingsDescriptions: Record<string, string>;
|
8
|
+
changedLastExucutionSettings: (keyof import("../../types/store/query").QuerySettings)[];
|
9
|
+
changedLastExecutionSettingsDescriptions: Record<string, string>;
|
10
|
+
};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import getChangedQueryExecutionSettings from '../../containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings';
|
2
|
+
import getChangedQueryExecutionSettingsDescription from '../../containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription';
|
3
|
+
import { DEFAULT_QUERY_SETTINGS, QUERY_SETTINGS_BANNER_LAST_CLOSED_KEY, WEEK_IN_SECONDS, } from '../constants';
|
4
|
+
import { useLastQueryExecutionSettings } from './useLastQueryExecutionSettings';
|
5
|
+
import { useQueryExecutionSettings } from './useQueryExecutionSettings';
|
6
|
+
import { useSetting } from './useSetting';
|
7
|
+
export const useChangedQuerySettings = () => {
|
8
|
+
const [bannerLastClosedTimestamp, setBannerLastClosedTimestamp] = useSetting(QUERY_SETTINGS_BANNER_LAST_CLOSED_KEY);
|
9
|
+
const [lastQuerySettings] = useLastQueryExecutionSettings();
|
10
|
+
const [currentQuerySettings] = useQueryExecutionSettings();
|
11
|
+
const changedLastExucutionSettings = lastQuerySettings
|
12
|
+
? getChangedQueryExecutionSettings(lastQuerySettings, DEFAULT_QUERY_SETTINGS)
|
13
|
+
: [];
|
14
|
+
const changedCurrentSettings = currentQuerySettings
|
15
|
+
? getChangedQueryExecutionSettings(currentQuerySettings, DEFAULT_QUERY_SETTINGS)
|
16
|
+
: [];
|
17
|
+
const hasChangedLastExucutionSettings = changedLastExucutionSettings.length > 0;
|
18
|
+
const changedLastExecutionSettingsDescriptions = lastQuerySettings
|
19
|
+
? getChangedQueryExecutionSettingsDescription({
|
20
|
+
currentSettings: lastQuerySettings,
|
21
|
+
defaultSettings: DEFAULT_QUERY_SETTINGS,
|
22
|
+
})
|
23
|
+
: {};
|
24
|
+
const changedCurrentSettingsDescriptions = currentQuerySettings
|
25
|
+
? getChangedQueryExecutionSettingsDescription({
|
26
|
+
currentSettings: currentQuerySettings,
|
27
|
+
defaultSettings: DEFAULT_QUERY_SETTINGS,
|
28
|
+
})
|
29
|
+
: {};
|
30
|
+
const isClosedRecently = bannerLastClosedTimestamp &&
|
31
|
+
Date.now() - bannerLastClosedTimestamp < WEEK_IN_SECONDS * 1000;
|
32
|
+
const isBannerShown = hasChangedLastExucutionSettings && !isClosedRecently;
|
33
|
+
const isIndicatorShown = hasChangedLastExucutionSettings && isClosedRecently;
|
34
|
+
const closeBanner = () => setBannerLastClosedTimestamp(Date.now());
|
35
|
+
const resetBanner = () => setBannerLastClosedTimestamp(undefined);
|
36
|
+
return {
|
37
|
+
isBannerShown,
|
38
|
+
isIndicatorShown,
|
39
|
+
closeBanner,
|
40
|
+
resetBanner,
|
41
|
+
changedCurrentSettings,
|
42
|
+
changedCurrentSettingsDescriptions,
|
43
|
+
changedLastExucutionSettings,
|
44
|
+
changedLastExecutionSettingsDescriptions,
|
45
|
+
};
|
46
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function useDelayed(delay?: number): boolean;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export function useDelayed(delay = 600) {
|
3
|
+
const [show, setShow] = React.useState(false);
|
4
|
+
React.useEffect(() => {
|
5
|
+
const timerId = setTimeout(() => {
|
6
|
+
setShow(true);
|
7
|
+
}, delay);
|
8
|
+
return () => {
|
9
|
+
clearTimeout(timerId);
|
10
|
+
};
|
11
|
+
}, []);
|
12
|
+
return show;
|
13
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/**
|
2
|
+
* The hook returns a stable function (an empty list of dependencies),
|
3
|
+
* but this function always calls the actual function associated with the last render.
|
4
|
+
* The returned function should be used as an event handler or inside a useEffect.
|
5
|
+
*/
|
6
|
+
export declare function useEventHandler<T extends Function>(handler?: T): T;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
/**
|
3
|
+
* The hook returns a stable function (an empty list of dependencies),
|
4
|
+
* but this function always calls the actual function associated with the last render.
|
5
|
+
* The returned function should be used as an event handler or inside a useEffect.
|
6
|
+
*/
|
7
|
+
export function useEventHandler(handler) {
|
8
|
+
const ref = React.useRef(handler);
|
9
|
+
React.useLayoutEffect(() => {
|
10
|
+
ref.current = handler;
|
11
|
+
}, [handler]);
|
12
|
+
// @ts-expect-error
|
13
|
+
return React.useCallback((...args) => {
|
14
|
+
var _a;
|
15
|
+
return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.call(ref, ...args);
|
16
|
+
}, []);
|
17
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { QuerySettings } from '../../types/store/query';
|
2
|
+
export declare const useQueryExecutionSettings: () => readonly [{
|
3
|
+
readonly tracingLevel: import("../../types/store/query").TracingLevel | undefined;
|
4
|
+
readonly queryMode: import("../../types/store/query").QueryMode;
|
5
|
+
readonly isolationLevel: import("../../types/store/query").IsolationLevel;
|
6
|
+
readonly timeout?: string;
|
7
|
+
readonly statisticsMode?: import("../../types/store/query").StatisticsMode;
|
8
|
+
}, (value: QuerySettings) => void];
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { DEFAULT_QUERY_SETTINGS, ENABLE_TRACING_LEVEL_KEY, QUERY_EXECUTION_SETTINGS_KEY, } from '../constants';
|
2
|
+
import { useSetting } from './useSetting';
|
3
|
+
export const useQueryExecutionSettings = () => {
|
4
|
+
const [enableTracingLevel] = useSetting(ENABLE_TRACING_LEVEL_KEY);
|
5
|
+
const [setting, setSetting] = useSetting(QUERY_EXECUTION_SETTINGS_KEY);
|
6
|
+
return [
|
7
|
+
{
|
8
|
+
...setting,
|
9
|
+
tracingLevel: enableTracingLevel
|
10
|
+
? setting.tracingLevel
|
11
|
+
: DEFAULT_QUERY_SETTINGS.tracingLevel,
|
12
|
+
},
|
13
|
+
setSetting,
|
14
|
+
];
|
15
|
+
};
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import type { ExplainPlanNodeData, GraphNode, Link } from '@gravity-ui/paranoid';
|
2
|
-
import type {
|
2
|
+
import type { SimplifiedPlanItem } from '../store/reducers/explainQuery/types';
|
3
|
+
import type { PlanNode, SimplifiedNode } from '../types/api/query';
|
3
4
|
export declare function preparePlan(plan: PlanNode): {
|
4
5
|
nodes: GraphNode<ExplainPlanNodeData>[];
|
5
6
|
links: Link[];
|
6
7
|
};
|
8
|
+
export declare function prepareSimplifiedPlan(plans: SimplifiedNode[]): SimplifiedPlanItem[];
|
@@ -9,7 +9,7 @@ function prepareStats(plan) {
|
|
9
9
|
if (name === 'Name') {
|
10
10
|
continue;
|
11
11
|
}
|
12
|
-
const value =
|
12
|
+
const value = typeof data === 'string' ? data : JSON.stringify(data);
|
13
13
|
section.items.push({ name, value });
|
14
14
|
}
|
15
15
|
operatorsSections.push(section);
|
@@ -25,7 +25,10 @@ function prepareStats(plan) {
|
|
25
25
|
if (CONNECTION_NODE_META_FIELDS.has(key)) {
|
26
26
|
continue;
|
27
27
|
}
|
28
|
-
attrStats.push({
|
28
|
+
attrStats.push({
|
29
|
+
name: key,
|
30
|
+
value: typeof value === 'string' ? value : JSON.stringify(value),
|
31
|
+
});
|
29
32
|
}
|
30
33
|
if (attrStats.length > 0) {
|
31
34
|
stats.push({
|
@@ -34,6 +37,19 @@ function prepareStats(plan) {
|
|
34
37
|
});
|
35
38
|
}
|
36
39
|
}
|
40
|
+
if (plan.Stats) {
|
41
|
+
const attrStats = [];
|
42
|
+
for (const [key, value] of Object.entries(plan.Stats)) {
|
43
|
+
attrStats.push({
|
44
|
+
name: key,
|
45
|
+
value: typeof value === 'string' ? value : JSON.stringify(value),
|
46
|
+
});
|
47
|
+
}
|
48
|
+
stats.push({
|
49
|
+
group: 'Stats',
|
50
|
+
stats: attrStats,
|
51
|
+
});
|
52
|
+
}
|
37
53
|
return stats;
|
38
54
|
}
|
39
55
|
function getNodeType(plan) {
|
@@ -86,3 +102,39 @@ export function preparePlan(plan) {
|
|
86
102
|
links,
|
87
103
|
};
|
88
104
|
}
|
105
|
+
export function prepareSimplifiedPlan(plans) {
|
106
|
+
var _a;
|
107
|
+
const result = [];
|
108
|
+
const stack = plans.map((plan) => ({ node: plan }));
|
109
|
+
while (stack.length > 0) {
|
110
|
+
const { node, subNodes } = stack.pop();
|
111
|
+
const plans = node['Plans'];
|
112
|
+
const operator = (_a = node['Operators']) === null || _a === void 0 ? void 0 : _a[0];
|
113
|
+
const children = subNodes || result;
|
114
|
+
if (operator) {
|
115
|
+
const { ['A-Cpu']: aCpu, ['A-Rows']: aRows, ['E-Cost']: eCost, ['E-Rows']: eRows, ['E-Size']: eSize, ['SsaProgram']: _ssaProgram, ['Name']: name, ...rest } = operator;
|
116
|
+
const newNode = {
|
117
|
+
name,
|
118
|
+
operationParams: rest,
|
119
|
+
aCpu,
|
120
|
+
aRows,
|
121
|
+
eCost,
|
122
|
+
eRows,
|
123
|
+
eSize,
|
124
|
+
children: [],
|
125
|
+
};
|
126
|
+
children.push(newNode);
|
127
|
+
if (plans) {
|
128
|
+
for (let i = plans.length - 1; i >= 0; i--) {
|
129
|
+
stack.push({ node: plans[i], subNodes: newNode.children });
|
130
|
+
}
|
131
|
+
}
|
132
|
+
}
|
133
|
+
else if (plans) {
|
134
|
+
for (let i = plans.length - 1; i >= 0; i--) {
|
135
|
+
stack.push({ node: plans[i], subNodes: children });
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
return result;
|
140
|
+
}
|
package/dist/utils/query.js
CHANGED
package/dist/utils/query.test.js
CHANGED
@@ -131,6 +131,7 @@ describe('API utils', () => {
|
|
131
131
|
describe('parseQueryExplainPlan', () => {
|
132
132
|
it('should parse explain script plan to explain scan', () => {
|
133
133
|
const plan = {};
|
134
|
+
const simplifiedPlan = {};
|
134
135
|
const tables = [];
|
135
136
|
const meta = { version: '0.2', type: 'script' };
|
136
137
|
const rawPlan = {
|
@@ -138,12 +139,14 @@ describe('API utils', () => {
|
|
138
139
|
{
|
139
140
|
Plan: plan,
|
140
141
|
tables,
|
142
|
+
SimplifiedPlan: simplifiedPlan,
|
141
143
|
},
|
142
144
|
],
|
143
145
|
meta,
|
144
146
|
};
|
145
147
|
const parsedPlan = parseQueryExplainPlan(rawPlan);
|
146
148
|
expect(parsedPlan.Plan).toEqual(plan);
|
149
|
+
expect(parsedPlan.SimplifiedPlan).toEqual(simplifiedPlan);
|
147
150
|
expect(parsedPlan.tables).toBe(tables);
|
148
151
|
expect(parsedPlan.meta).toEqual(meta);
|
149
152
|
});
|
package/dist/utils/utils.d.ts
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
export function parseJson(value
|
2
|
-
export function getValueFromLS(key:
|
3
|
-
export function bytesToSize(bytes:
|
4
|
-
export function bytesToSpeed(bytes
|
5
|
-
export function bytesToGB(bytes
|
6
|
-
export function pad9(val:
|
7
|
-
export function isNumeric(value
|
1
|
+
export declare function parseJson(value?: string | null): any;
|
2
|
+
export declare function getValueFromLS(key: string, defaultValue: string): string | undefined;
|
3
|
+
export declare function bytesToSize(bytes: number): string;
|
4
|
+
export declare function bytesToSpeed(bytes?: number | string): string;
|
5
|
+
export declare function bytesToGB(bytes?: number | string, shouldRound?: boolean): string;
|
6
|
+
export declare function pad9(val: number | string): string;
|
7
|
+
export declare function isNumeric(value?: unknown): value is number | string;
|
8
|
+
export declare function toExponential(value: number, precision?: number): string;
|
package/dist/utils/utils.js
CHANGED
@@ -28,7 +28,7 @@ export function bytesToSize(bytes) {
|
|
28
28
|
if (bytes < base) {
|
29
29
|
return String(bytes);
|
30
30
|
}
|
31
|
-
let i = parseInt(Math.floor(Math.log(bytes) / Math.log(base)), 10);
|
31
|
+
let i = parseInt(String(Math.floor(Math.log(bytes) / Math.log(base))), 10);
|
32
32
|
if (i >= sizes.length) {
|
33
33
|
i = sizes.length - 1;
|
34
34
|
}
|
@@ -40,10 +40,11 @@ export function bytesToSize(bytes) {
|
|
40
40
|
return val.toPrecision(3) + sizes[i];
|
41
41
|
}
|
42
42
|
function bytesToMB(bytes) {
|
43
|
-
|
43
|
+
const bytesNumber = Number(bytes);
|
44
|
+
if (isNaN(bytesNumber)) {
|
44
45
|
return '';
|
45
46
|
}
|
46
|
-
const val =
|
47
|
+
const val = bytesNumber / base ** 2;
|
47
48
|
if (val < 10) {
|
48
49
|
return val.toFixed(2) + sizes[2];
|
49
50
|
}
|
@@ -58,10 +59,11 @@ export function bytesToSpeed(bytes) {
|
|
58
59
|
return `${bytesToMB(bytes)}${bytes ? 'ps' : ''}`;
|
59
60
|
}
|
60
61
|
export function bytesToGB(bytes, shouldRound) {
|
61
|
-
|
62
|
+
const bytesNumber = Number(bytes);
|
63
|
+
if (isNaN(bytesNumber)) {
|
62
64
|
return 'N/A';
|
63
65
|
}
|
64
|
-
const val =
|
66
|
+
const val = bytesNumber / 1000000000;
|
65
67
|
if (shouldRound) {
|
66
68
|
return val.toFixed() + sizes[3];
|
67
69
|
}
|
@@ -76,16 +78,26 @@ export function bytesToGB(bytes, shouldRound) {
|
|
76
78
|
}
|
77
79
|
}
|
78
80
|
export function pad9(val) {
|
79
|
-
const
|
80
|
-
|
81
|
+
const stringifiedVal = String(val);
|
82
|
+
const len = stringifiedVal.length;
|
83
|
+
let result = stringifiedVal;
|
81
84
|
for (let i = len; i < 9; i++) {
|
82
85
|
result = '0' + result;
|
83
86
|
}
|
84
87
|
return result;
|
85
88
|
}
|
86
89
|
export function isNumeric(value) {
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
90
|
+
if (typeof value === 'number') {
|
91
|
+
return !isNaN(value);
|
92
|
+
}
|
93
|
+
if (typeof value === 'string') {
|
94
|
+
// need both isNaN and isNaN(parseFloat):
|
95
|
+
// - isNaN treats true/false/''/etc. as numbers, parseFloat fixes this
|
96
|
+
// - parseFloat treats '123qwe' as number, isNaN fixes this
|
97
|
+
return !isNaN(Number(value)) && !isNaN(parseFloat(value));
|
98
|
+
}
|
99
|
+
return false;
|
100
|
+
}
|
101
|
+
export function toExponential(value, precision) {
|
102
|
+
return Number(value).toExponential(precision);
|
91
103
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ydb-embedded-ui",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.13.0",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -52,7 +52,9 @@
|
|
52
52
|
"use-query-params": "^2.2.1",
|
53
53
|
"web-vitals": "^1.1.2",
|
54
54
|
"ydb-ui-components": "^4.2.0",
|
55
|
-
"zod": "^3.23.8"
|
55
|
+
"zod": "^3.23.8",
|
56
|
+
"@gravity-ui/table": "^0.5.0",
|
57
|
+
"@tanstack/react-table": "^8.19.3"
|
56
58
|
},
|
57
59
|
"scripts": {
|
58
60
|
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
package/dist/store/utils.d.ts
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
import type { AppDispatch, GetState } from '.';
|
2
|
-
export declare const nop: (result: any) => any;
|
3
|
-
export declare function createRequestActionTypes<Prefix extends string, Type extends string>(prefix: Prefix, type: Type): {
|
4
|
-
readonly REQUEST: `${Prefix}/${Type}_REQUEST`;
|
5
|
-
readonly SUCCESS: `${Prefix}/${Type}_SUCCESS`;
|
6
|
-
readonly FAILURE: `${Prefix}/${Type}_FAILURE`;
|
7
|
-
};
|
8
|
-
type CreateApiRequestParams<Actions, Response, HandledResponse> = {
|
9
|
-
actions: Actions;
|
10
|
-
request: Promise<Response>;
|
11
|
-
dataHandler?: (data: Response, getState: GetState) => HandledResponse;
|
12
|
-
};
|
13
|
-
export declare function createApiRequest<Actions extends ReturnType<typeof createRequestActionTypes>, Response, HandledResponse>({ actions, request, dataHandler, }: CreateApiRequestParams<Actions, Response, HandledResponse>): (dispatch: AppDispatch, getState: GetState) => Promise<HandledResponse | undefined>;
|
14
|
-
export type ApiRequestAction<Actions extends ReturnType<typeof createRequestActionTypes>, SuccessResponse = unknown, ErrorResponse = unknown> = {
|
15
|
-
type: Actions['REQUEST'];
|
16
|
-
} | {
|
17
|
-
type: Actions['SUCCESS'];
|
18
|
-
data: SuccessResponse;
|
19
|
-
} | {
|
20
|
-
type: Actions['FAILURE'];
|
21
|
-
error: ErrorResponse;
|
22
|
-
};
|
23
|
-
export {};
|
package/dist/store/utils.js
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
import createToast from '../utils/createToast';
|
2
|
-
import { isAxiosResponse } from '../utils/response';
|
3
|
-
import { SET_UNAUTHENTICATED } from './reducers/authentication/authentication';
|
4
|
-
export const nop = (result) => result;
|
5
|
-
export function createRequestActionTypes(prefix, type) {
|
6
|
-
return {
|
7
|
-
REQUEST: `${prefix}/${type}_REQUEST`,
|
8
|
-
SUCCESS: `${prefix}/${type}_SUCCESS`,
|
9
|
-
FAILURE: `${prefix}/${type}_FAILURE`,
|
10
|
-
};
|
11
|
-
}
|
12
|
-
export function createApiRequest({ actions, request, dataHandler = nop, }) {
|
13
|
-
const doRequest = async function (dispatch, getState) {
|
14
|
-
dispatch({
|
15
|
-
type: actions.REQUEST,
|
16
|
-
});
|
17
|
-
try {
|
18
|
-
const result = await request;
|
19
|
-
const data = dataHandler(result, getState);
|
20
|
-
dispatch({
|
21
|
-
type: actions.SUCCESS,
|
22
|
-
data,
|
23
|
-
});
|
24
|
-
return data;
|
25
|
-
}
|
26
|
-
catch (error) {
|
27
|
-
if (isAxiosResponse(error) && error.status === 401) {
|
28
|
-
dispatch({
|
29
|
-
type: SET_UNAUTHENTICATED.SUCCESS,
|
30
|
-
});
|
31
|
-
}
|
32
|
-
else if (isAxiosResponse(error) && error.status >= 500 && error.statusText) {
|
33
|
-
createToast({
|
34
|
-
name: 'Request failure',
|
35
|
-
title: 'Request failure',
|
36
|
-
type: 'error',
|
37
|
-
content: `${error.status} ${error.statusText}`,
|
38
|
-
});
|
39
|
-
}
|
40
|
-
dispatch({
|
41
|
-
type: actions.FAILURE,
|
42
|
-
error,
|
43
|
-
});
|
44
|
-
// TODO should probably throw the received error here, but this change requires a thorough revision of all api calls
|
45
|
-
return undefined;
|
46
|
-
}
|
47
|
-
};
|
48
|
-
return doRequest;
|
49
|
-
}
|
File without changes
|