ydb-embedded-ui 6.6.1 → 6.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. package/dist/package.json +31 -30
  2. package/dist/src/components/InfoViewer/InfoViewer.d.ts +1 -1
  3. package/dist/src/components/InfoViewer/InfoViewer.js +2 -1
  4. package/dist/src/components/InfoViewer/i18n/en.json +2 -1
  5. package/dist/src/components/InfoViewer/i18n/index.d.ts +1 -1
  6. package/dist/src/components/InfoViewer/i18n/index.js +1 -2
  7. package/dist/src/containers/App/App.d.ts +1 -1
  8. package/dist/src/containers/App/Content.js +1 -1
  9. package/dist/src/containers/App/appSlots.d.ts +1 -1
  10. package/dist/src/containers/AppWithClusters/AppWithClusters.js +1 -1
  11. package/dist/src/containers/AsideNavigation/Navigation.js +1 -3
  12. package/dist/src/containers/AsideNavigation/i18n/en.json +0 -2
  13. package/dist/src/containers/AsideNavigation/i18n/index.d.ts +1 -1
  14. package/dist/src/containers/AsideNavigation/i18n/index.js +1 -2
  15. package/dist/src/containers/Cluster/i18n/index.d.ts +1 -1
  16. package/dist/src/containers/Clusters/constants.d.ts +1 -1
  17. package/dist/src/containers/Header/Header.js +17 -21
  18. package/dist/src/containers/Header/Header.scss +14 -5
  19. package/dist/src/containers/Header/breadcrumbs.js +65 -71
  20. package/dist/src/containers/Heatmap/Heatmap.js +3 -3
  21. package/dist/src/containers/Nodes/Nodes.js +4 -4
  22. package/dist/src/containers/Nodes/VirtualNodes.js +2 -2
  23. package/dist/src/containers/Storage/Storage.js +2 -2
  24. package/dist/src/containers/Storage/StorageGroups/getStorageGroupsColumns.js +4 -3
  25. package/dist/src/containers/Tablets/Tablets.js +8 -8
  26. package/dist/src/containers/TabletsFilters/TabletsFilters.d.ts +2 -57
  27. package/dist/src/containers/TabletsFilters/TabletsFilters.js +70 -180
  28. package/dist/src/containers/Tenant/Acl/Acl.d.ts +3 -1
  29. package/dist/src/containers/Tenant/Acl/Acl.js +85 -69
  30. package/dist/src/containers/Tenant/Acl/Acl.scss +14 -9
  31. package/dist/src/containers/Tenant/Diagnostics/Autorefresh/AutorefreshControl.js +4 -5
  32. package/dist/src/containers/Tenant/Diagnostics/Consumers/Consumers.js +3 -3
  33. package/dist/src/containers/Tenant/Diagnostics/Describe/Describe.d.ts +2 -2
  34. package/dist/src/containers/Tenant/Diagnostics/Describe/Describe.js +5 -6
  35. package/dist/src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.d.ts +1 -0
  36. package/dist/src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.js +3 -5
  37. package/dist/src/containers/Tenant/Diagnostics/Diagnostics.d.ts +2 -0
  38. package/dist/src/containers/Tenant/Diagnostics/Diagnostics.js +26 -50
  39. package/dist/src/containers/Tenant/Diagnostics/Diagnostics.scss +1 -1
  40. package/dist/src/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +19 -58
  41. package/dist/src/containers/Tenant/Diagnostics/Network/Network.d.ts +2 -2
  42. package/dist/src/containers/Tenant/Diagnostics/Network/Network.js +5 -5
  43. package/dist/src/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js +1 -6
  44. package/dist/src/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.d.ts +2 -1
  45. package/dist/src/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.js +3 -8
  46. package/dist/src/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -2
  47. package/dist/src/containers/Tenant/Diagnostics/Overview/Overview.js +19 -21
  48. package/dist/src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.js +3 -3
  49. package/dist/src/containers/Tenant/Diagnostics/Overview/TableInfo/TableInfo.scss +0 -2
  50. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicInfo/TopicInfo.d.ts +2 -1
  51. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicInfo/TopicInfo.js +3 -8
  52. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.d.ts +3 -1
  53. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.js +5 -5
  54. package/dist/src/containers/Tenant/Diagnostics/Partitions/Partitions.js +4 -12
  55. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss +48 -57
  56. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.d.ts +2 -5
  57. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.js +7 -2
  58. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.d.ts +1 -6
  59. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +22 -16
  60. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.d.ts +2 -8
  61. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.js +2 -2
  62. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.d.ts +2 -2
  63. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.js +2 -2
  64. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.d.ts +2 -2
  65. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +4 -4
  66. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.d.ts +2 -2
  67. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +4 -4
  68. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.d.ts +2 -2
  69. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +4 -4
  70. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.d.ts +2 -1
  71. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +5 -5
  72. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantDashboard/TenantDashboard.js +3 -3
  73. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.d.ts +2 -2
  74. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.js +2 -2
  75. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.d.ts +2 -2
  76. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +4 -4
  77. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +7 -9
  78. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +3 -3
  79. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +3 -3
  80. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
  81. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/useHealthcheck.js +1 -1
  82. package/dist/src/containers/Tenant/Diagnostics/TopQueries/TopQueries.d.ts +2 -2
  83. package/dist/src/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +5 -5
  84. package/dist/src/containers/Tenant/Diagnostics/TopShards/TopShards.d.ts +3 -2
  85. package/dist/src/containers/Tenant/Diagnostics/TopShards/TopShards.js +8 -8
  86. package/dist/src/containers/Tenant/EntityTitle/EntityTitle.d.ts +6 -0
  87. package/dist/src/containers/Tenant/EntityTitle/EntityTitle.js +11 -0
  88. package/dist/src/containers/Tenant/Info/ExternalDataSource/ExternalDataSource.js +0 -6
  89. package/dist/src/containers/Tenant/Info/ExternalTable/ExternalTable.js +0 -6
  90. package/dist/src/containers/Tenant/Info/View/View.js +0 -6
  91. package/dist/src/containers/Tenant/ObjectGeneral/ObjectGeneral.d.ts +2 -1
  92. package/dist/src/containers/Tenant/ObjectGeneral/ObjectGeneral.js +7 -13
  93. package/dist/src/containers/Tenant/ObjectSummary/ObjectSummary.d.ts +4 -4
  94. package/dist/src/containers/Tenant/ObjectSummary/ObjectSummary.js +159 -63
  95. package/dist/src/containers/Tenant/Query/Issues/Issues.js +6 -5
  96. package/dist/src/containers/Tenant/Query/Preview/Preview.d.ts +2 -1
  97. package/dist/src/containers/Tenant/Query/Preview/Preview.js +6 -6
  98. package/dist/src/containers/Tenant/Query/Query.d.ts +1 -0
  99. package/dist/src/containers/Tenant/Query/Query.scss +1 -1
  100. package/dist/src/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +2 -0
  101. package/dist/src/containers/Tenant/Query/QueryEditor/QueryEditor.js +9 -22
  102. package/dist/src/containers/Tenant/Query/i18n/en.json +1 -1
  103. package/dist/src/containers/Tenant/Schema/SchemaTree/SchemaTree.d.ts +1 -0
  104. package/dist/src/containers/Tenant/Schema/SchemaTree/SchemaTree.js +11 -19
  105. package/dist/src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.d.ts +2 -2
  106. package/dist/src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +13 -8
  107. package/dist/src/containers/Tenant/Schema/SchemaViewer/columns.d.ts +2 -1
  108. package/dist/src/containers/Tenant/Schema/SchemaViewer/columns.js +21 -2
  109. package/dist/src/containers/Tenant/Schema/SchemaViewer/i18n/en.json +1 -0
  110. package/dist/src/containers/Tenant/Schema/SchemaViewer/i18n/index.d.ts +1 -1
  111. package/dist/src/containers/Tenant/Schema/SchemaViewer/prepareData.js +2 -1
  112. package/dist/src/containers/Tenant/Schema/SchemaViewer/types.d.ts +1 -0
  113. package/dist/src/containers/Tenant/Tenant.js +20 -36
  114. package/dist/src/containers/Tenant/Tenant.scss +4 -0
  115. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.d.ts +2 -0
  116. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.js +19 -0
  117. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.scss +18 -0
  118. package/dist/src/containers/Tenant/TenantNavigation/useTenantNavigation.d.ts +9 -0
  119. package/dist/src/containers/Tenant/TenantNavigation/useTenantNavigation.js +44 -0
  120. package/dist/src/containers/Tenant/i18n/en.json +22 -1
  121. package/dist/src/containers/Tenant/i18n/index.d.ts +1 -1
  122. package/dist/src/containers/Tenant/utils/index.d.ts +1 -0
  123. package/dist/src/containers/Tenant/utils/index.js +6 -0
  124. package/dist/src/containers/Tenant/utils/queryTemplates.d.ts +4 -0
  125. package/dist/src/containers/Tenant/utils/queryTemplates.js +32 -0
  126. package/dist/src/containers/Tenant/utils/schemaActions.js +18 -2
  127. package/dist/src/containers/UserSettings/Setting.d.ts +7 -9
  128. package/dist/src/containers/UserSettings/Setting.js +13 -28
  129. package/dist/src/containers/UserSettings/UserSettings.d.ts +0 -2
  130. package/dist/src/containers/UserSettings/UserSettings.js +3 -6
  131. package/dist/src/containers/UserSettings/i18n/en.json +2 -2
  132. package/dist/src/containers/UserSettings/settings.js +3 -3
  133. package/dist/src/lib.d.ts +1 -1
  134. package/dist/src/lib.js +1 -1
  135. package/dist/src/routes.d.ts +1 -1
  136. package/dist/src/routes.js +3 -1
  137. package/dist/src/services/api.d.ts +6 -1
  138. package/dist/src/services/api.js +24 -3
  139. package/dist/src/services/settings.d.ts +1 -0
  140. package/dist/src/services/settings.js +3 -2
  141. package/dist/src/store/configureStore.d.ts +36 -134
  142. package/dist/src/store/configureStore.js +2 -15
  143. package/dist/src/store/defaultStore.d.ts +17 -81
  144. package/dist/src/store/reducers/api.js +0 -1
  145. package/dist/src/store/reducers/authentication/authentication.d.ts +51 -243
  146. package/dist/src/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +196 -849
  147. package/dist/src/store/reducers/healthcheckInfo/healthcheckInfo.js +3 -3
  148. package/dist/src/store/reducers/hotKeys/hotKeys.d.ts +6 -25
  149. package/dist/src/store/reducers/hotKeys/hotKeys.js +36 -49
  150. package/dist/src/store/reducers/index.d.ts +23 -100
  151. package/dist/src/store/reducers/index.js +0 -8
  152. package/dist/src/store/reducers/node/selectors.d.ts +0 -40
  153. package/dist/src/store/reducers/nodesList.d.ts +0 -40
  154. package/dist/src/store/reducers/schema/schema.d.ts +13 -149
  155. package/dist/src/store/reducers/schema/schema.js +45 -90
  156. package/dist/src/store/reducers/schema/types.d.ts +2 -21
  157. package/dist/src/store/reducers/schemaAcl/schemaAcl.d.ts +8 -135
  158. package/dist/src/store/reducers/schemaAcl/schemaAcl.js +18 -44
  159. package/dist/src/store/reducers/settings/settings.d.ts +17 -23
  160. package/dist/src/store/reducers/settings/settings.js +40 -33
  161. package/dist/src/store/reducers/settings/types.d.ts +1 -12
  162. package/dist/src/store/reducers/tablets.d.ts +288 -41
  163. package/dist/src/store/reducers/tablets.js +8 -4
  164. package/dist/src/store/reducers/tabletsFilters.d.ts +11 -164
  165. package/dist/src/store/reducers/tabletsFilters.js +14 -76
  166. package/dist/src/store/reducers/tenants/selectors.d.ts +8 -362
  167. package/dist/src/store/reducers/topic.d.ts +0 -600
  168. package/dist/src/store/state-url-mapping.js +0 -3
  169. package/dist/src/styles/mixins.scss +5 -0
  170. package/dist/src/styles/themes.scss +1 -1
  171. package/dist/src/types/api/acl.d.ts +2 -1
  172. package/dist/src/types/api/schema/schema.d.ts +5 -0
  173. package/dist/src/utils/constants.d.ts +1 -1
  174. package/dist/src/utils/constants.js +1 -1
  175. package/dist/src/utils/dataFormatters/dataFormatters.d.ts +2 -1
  176. package/dist/src/utils/dataFormatters/dataFormatters.js +7 -3
  177. package/dist/src/utils/hooks/index.d.ts +1 -0
  178. package/dist/src/utils/hooks/index.js +1 -0
  179. package/dist/src/utils/hooks/useAutoRefreshInterval.d.ts +1 -0
  180. package/dist/src/utils/hooks/useAutoRefreshInterval.js +5 -0
  181. package/dist/src/utils/utils.js +2 -1
  182. package/package.json +31 -30
  183. package/dist/src/components/InfoViewer/i18n/ru.json +0 -4
  184. package/dist/src/components/InfoViewer/schemaOverview/CDCStreamOverview.d.ts +0 -6
  185. package/dist/src/components/InfoViewer/schemaOverview/CDCStreamOverview.js +0 -17
  186. package/dist/src/components/InfoViewer/schemaOverview/PersQueueGroupOverview.d.ts +0 -6
  187. package/dist/src/components/InfoViewer/schemaOverview/PersQueueGroupOverview.js +0 -20
  188. package/dist/src/components/InfoViewer/schemaOverview/index.d.ts +0 -2
  189. package/dist/src/components/InfoViewer/schemaOverview/index.js +0 -2
  190. package/dist/src/containers/AsideNavigation/i18n/ru.json +0 -10
  191. package/dist/src/containers/AsideNavigation/useNavigationMenuItems.d.ts +0 -2
  192. package/dist/src/containers/AsideNavigation/useNavigationMenuItems.js +0 -54
  193. package/dist/src/containers/UserSettings/UserSettings.scss +0 -9
  194. package/dist/src/store/reducers/host.d.ts +0 -130
  195. package/dist/src/store/reducers/host.js +0 -26
  196. package/dist/src/store/reducers/hotKeys/types.d.ts +0 -10
  197. package/dist/src/store/reducers/hotKeys/types.js +0 -1
  198. package/dist/src/store/reducers/schemaAcl/types.d.ts +0 -12
  199. package/dist/src/store/reducers/schemaAcl/types.js +0 -1
  200. package/dist/src/types/store/host.d.ts +0 -15
  201. package/dist/src/types/store/host.js +0 -1
@@ -4,25 +4,30 @@ import DataTable from '@gravity-ui/react-data-table';
4
4
  import { skipToken } from '@reduxjs/toolkit/query';
5
5
  import { ResizeableDataTable } from '../../../../components/ResizeableDataTable/ResizeableDataTable';
6
6
  import { TableSkeleton } from '../../../../components/TableSkeleton/TableSkeleton';
7
+ import { schemaApi } from '../../../../store/reducers/schema/schema';
7
8
  import { viewSchemaApi } from '../../../../store/reducers/viewSchema/viewSchema';
8
9
  import { DEFAULT_TABLE_SETTINGS } from '../../../../utils/constants';
9
- import { useTypedSelector } from '../../../../utils/hooks';
10
10
  import { isColumnEntityType, isExternalTableType, isRowTableType, isViewType, } from '../../utils/schema';
11
11
  import { SCHEMA_COLUMNS_WIDTH_LS_KEY, SCHEMA_TABLE_COLUMS_IDS, getColumnTableColumns, getExternalTableColumns, getRowTableColumns, getViewColumns, } from './columns';
12
12
  import { prepareSchemaData, prepareViewSchema } from './prepareData';
13
13
  import { b } from './shared';
14
14
  import './SchemaViewer.scss';
15
15
  export const SchemaViewer = ({ type, path, tenantName, extended = false }) => {
16
- const { data: schemaData, loading } = useTypedSelector((state) => state.schema);
17
- const currentObjectData = path ? schemaData[path] : undefined;
18
- const viewSchemaRequestParams = isViewType(type) && path && tenantName ? { path, database: tenantName } : skipToken;
16
+ const { currentData: schemaData, isFetching } = schemaApi.endpoints.getSchema.useQueryState({
17
+ path,
18
+ });
19
+ const loading = isFetching && schemaData === undefined;
20
+ const viewSchemaRequestParams = isViewType(type) ? { path, database: tenantName } : skipToken;
19
21
  const { data: viewColumnsData, isLoading: isViewSchemaLoading } = viewSchemaApi.useGetViewSchemaQuery(viewSchemaRequestParams);
20
22
  const tableData = React.useMemo(() => {
21
23
  if (isViewType(type)) {
22
24
  return prepareViewSchema(viewColumnsData);
23
25
  }
24
- return prepareSchemaData(type, currentObjectData);
25
- }, [currentObjectData, type, viewColumnsData]);
26
+ return prepareSchemaData(type, schemaData);
27
+ }, [schemaData, type, viewColumnsData]);
28
+ const hasAutoIncrement = React.useMemo(() => {
29
+ return tableData.some((i) => i.autoIncrement);
30
+ }, [tableData]);
26
31
  const columns = React.useMemo(() => {
27
32
  if (isViewType(type)) {
28
33
  return getViewColumns();
@@ -34,10 +39,10 @@ export const SchemaViewer = ({ type, path, tenantName, extended = false }) => {
34
39
  return getColumnTableColumns();
35
40
  }
36
41
  if (isRowTableType(type)) {
37
- return getRowTableColumns(extended);
42
+ return getRowTableColumns(extended, hasAutoIncrement);
38
43
  }
39
44
  return [];
40
- }, [type, extended]);
45
+ }, [type, extended, hasAutoIncrement]);
41
46
  const renderContent = () => {
42
47
  if (loading || isViewSchemaLoading) {
43
48
  return _jsx(TableSkeleton, {});
@@ -6,6 +6,7 @@ export declare const SCHEMA_TABLE_COLUMS_IDS: {
6
6
  isKeyColumn: "isKeyColumn";
7
7
  type: "type";
8
8
  notNull: "notNull";
9
+ autoIncrement: "autoIncrement";
9
10
  familyName: "familyName";
10
11
  prefferedPoolKind: "prefferedPoolKind";
11
12
  columnCodec: "columnCodec";
@@ -13,4 +14,4 @@ export declare const SCHEMA_TABLE_COLUMS_IDS: {
13
14
  export declare function getViewColumns(): SchemaColumn[];
14
15
  export declare function getExternalTableColumns(): SchemaColumn[];
15
16
  export declare function getColumnTableColumns(): SchemaColumn[];
16
- export declare function getRowTableColumns(extended: boolean): SchemaColumn[];
17
+ export declare function getRowTableColumns(extended: boolean, hasAutoIncrement: boolean): SchemaColumn[];
@@ -11,6 +11,7 @@ export const SCHEMA_TABLE_COLUMS_IDS = {
11
11
  isKeyColumn: 'isKeyColumn',
12
12
  type: 'type',
13
13
  notNull: 'notNull',
14
+ autoIncrement: 'autoIncrement',
14
15
  familyName: 'familyName',
15
16
  prefferedPoolKind: 'prefferedPoolKind',
16
17
  columnCodec: 'columnCodec',
@@ -68,6 +69,21 @@ const notNullColumn = {
68
69
  return undefined;
69
70
  },
70
71
  };
72
+ const autoIncrementColumn = {
73
+ name: SCHEMA_TABLE_COLUMS_IDS.autoIncrement,
74
+ get header() {
75
+ return i18n('column-title.autoIncrement');
76
+ },
77
+ width: 100,
78
+ // Table should start with notNull columns on sort click
79
+ defaultOrder: DataTable.DESCENDING,
80
+ render: ({ row }) => {
81
+ if (row.autoIncrement) {
82
+ return '\u2713';
83
+ }
84
+ return undefined;
85
+ },
86
+ };
71
87
  const familyColumn = {
72
88
  name: SCHEMA_TABLE_COLUMS_IDS.familyName,
73
89
  get header() {
@@ -101,10 +117,13 @@ export function getExternalTableColumns() {
101
117
  export function getColumnTableColumns() {
102
118
  return [idColumn, keyColumn, nameColumn, typeColumn, notNullColumn];
103
119
  }
104
- export function getRowTableColumns(extended) {
120
+ export function getRowTableColumns(extended, hasAutoIncrement) {
105
121
  const rowTableColumns = [idColumn, keyColumn, nameColumn, typeColumn, notNullColumn];
106
122
  if (extended) {
107
- return rowTableColumns.concat(familyColumn, mediaColumn, compressionColumn);
123
+ rowTableColumns.push(familyColumn, mediaColumn, compressionColumn);
124
+ }
125
+ if (hasAutoIncrement) {
126
+ rowTableColumns.push(autoIncrementColumn);
108
127
  }
109
128
  return rowTableColumns;
110
129
  }
@@ -4,6 +4,7 @@
4
4
  "column-title.key": "Key",
5
5
  "column-title.type": "Type",
6
6
  "column-title.notNull": "NotNull",
7
+ "column-title.autoIncrement": "AutoIncrement",
7
8
  "column-title.family": "Family",
8
9
  "column-title.media": "Media",
9
10
  "column-title.compression": "Compression"
@@ -1,2 +1,2 @@
1
- declare const _default: (key: "column-title.id" | "column-title.name" | "column-title.key" | "column-title.type" | "column-title.notNull" | "column-title.family" | "column-title.media" | "column-title.compression", params?: import("@gravity-ui/i18n").Params | undefined) => string;
1
+ declare const _default: (key: "column-title.id" | "column-title.name" | "column-title.key" | "column-title.type" | "column-title.notNull" | "column-title.autoIncrement" | "column-title.family" | "column-title.media" | "column-title.compression", params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
2
  export default _default;
@@ -31,7 +31,7 @@ function prepareRowTableSchema(data = {}) {
31
31
  const keyAccessorsMap = getKeyColumnsSortAccessorMap(KeyColumnIds);
32
32
  const preparedColumns = Columns === null || Columns === void 0 ? void 0 : Columns.map((column) => {
33
33
  var _a, _b;
34
- const { Id, Name, NotNull, Type, Family } = column;
34
+ const { Id, Name, NotNull, Type, Family, DefaultFromSequence } = column;
35
35
  const isKeyColumn = Boolean(KeyColumnIds === null || KeyColumnIds === void 0 ? void 0 : KeyColumnIds.find((keyColumnId) => keyColumnId === Id));
36
36
  // Values in keyAccessorsMap are always negative, so it will be 1 for not key columns
37
37
  const keyAccessor = Id && keyAccessorsMap[Id] ? keyAccessorsMap[Id] : 1;
@@ -47,6 +47,7 @@ function prepareRowTableSchema(data = {}) {
47
47
  keyAccessor,
48
48
  type: Type,
49
49
  notNull: NotNull,
50
+ autoIncrement: Boolean(DefaultFromSequence),
50
51
  familyName,
51
52
  prefferedPoolKind,
52
53
  columnCodec,
@@ -7,6 +7,7 @@ export interface SchemaData {
7
7
  keyAccessor?: number;
8
8
  type?: string;
9
9
  notNull?: boolean;
10
+ autoIncrement?: boolean;
10
11
  familyName?: string;
11
12
  prefferedPoolKind?: string;
12
13
  columnCodec?: string;
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import qs from 'qs';
4
3
  import { Helmet } from 'react-helmet-async';
5
- import { useLocation } from 'react-router';
4
+ import { StringParam, useQueryParams } from 'use-query-params';
6
5
  import { AccessDenied } from '../../components/Errors/403';
6
+ import { Loader } from '../../components/Loader';
7
7
  import SplitPane from '../../components/SplitPane';
8
8
  import { setHeaderBreadcrumbs } from '../../store/reducers/header/header';
9
- import { getSchema } from '../../store/reducers/schema/schema';
9
+ import { schemaApi } from '../../store/reducers/schema/schema';
10
10
  import { cn } from '../../utils/cn';
11
11
  import { DEFAULT_IS_TENANT_SUMMARY_COLLAPSED, DEFAULT_SIZE_TENANT_KEY } from '../../utils/constants';
12
- import { useTypedDispatch, useTypedSelector } from '../../utils/hooks';
12
+ import { useTypedDispatch } from '../../utils/hooks';
13
13
  import ObjectGeneral from './ObjectGeneral/ObjectGeneral';
14
14
  import { ObjectSummary } from './ObjectSummary/ObjectSummary';
15
15
  import i18n from './i18n';
@@ -27,25 +27,13 @@ const getTenantSummaryState = () => {
27
27
  function Tenant(props) {
28
28
  var _a;
29
29
  const [summaryVisibilityState, dispatchSummaryVisibilityAction] = React.useReducer(paneVisibilityToggleReducerCreator(DEFAULT_IS_TENANT_SUMMARY_COLLAPSED), undefined, getTenantSummaryState);
30
+ const [{ name: tenantName, schema }] = useQueryParams({ name: StringParam, schema: StringParam });
31
+ if (!tenantName) {
32
+ throw new Error('Tenant name is not defined');
33
+ }
30
34
  const previousTenant = React.useRef();
31
- const { currentSchemaPath, currentSchema: currentItem = {} } = useTypedSelector((state) => state.schema);
32
- const { PathType: preloadedPathType, PathSubType: preloadedPathSubType } = useTypedSelector((state) => {
33
- var _a, _b;
34
- return currentSchemaPath
35
- ? (_b = (_a = state.schema.data[currentSchemaPath]) === null || _a === void 0 ? void 0 : _a.PathDescription) === null || _b === void 0 ? void 0 : _b.Self
36
- : undefined;
37
- }) || {};
38
- const { PathType: currentPathType, PathSubType: currentPathSubType } = ((_a = currentItem.PathDescription) === null || _a === void 0 ? void 0 : _a.Self) || {};
39
- const { error: { status: schemaStatus = 200 } = {} } = useTypedSelector((state) => state.schema);
40
- const dispatch = useTypedDispatch();
41
- const location = useLocation();
42
- const queryParams = qs.parse(location.search, {
43
- ignoreQueryPrefix: true,
44
- });
45
- const { name } = queryParams;
46
- const tenantName = name;
47
35
  React.useEffect(() => {
48
- if (tenantName && typeof tenantName === 'string' && previousTenant.current !== tenantName) {
36
+ if (previousTenant.current !== tenantName) {
49
37
  const register = async () => {
50
38
  const { registerYQLCompletionItemProvider } = await import('../../utils/monaco/yql/yql.completionItemProvider');
51
39
  registerYQLCompletionItemProvider(tenantName);
@@ -54,20 +42,17 @@ function Tenant(props) {
54
42
  previousTenant.current = tenantName;
55
43
  }
56
44
  }, [tenantName]);
45
+ const dispatch = useTypedDispatch();
57
46
  React.useEffect(() => {
58
- dispatch(getSchema({ path: tenantName }));
59
- }, [tenantName, dispatch]);
60
- React.useEffect(() => {
61
- //TODO: should be refactored when move to @reduxjs/toolkit/query
62
- if (currentSchemaPath && currentSchemaPath !== tenantName) {
63
- dispatch(getSchema({ path: currentSchemaPath }));
64
- }
65
- }, [currentSchemaPath, dispatch, tenantName]);
66
- React.useEffect(() => {
67
- if (tenantName) {
68
- dispatch(setHeaderBreadcrumbs('tenant', { tenantName }));
69
- }
47
+ dispatch(setHeaderBreadcrumbs('tenant', { tenantName }));
70
48
  }, [tenantName, dispatch]);
49
+ const path = schema !== null && schema !== void 0 ? schema : tenantName;
50
+ const { currentData: currentItem, error, isLoading, } = schemaApi.useGetSchemaQuery({ path }, { refetchOnMountOrArgChange: true });
51
+ const { PathType: currentPathType, PathSubType: currentPathSubType } = ((_a = currentItem === null || currentItem === void 0 ? void 0 : currentItem.PathDescription) === null || _a === void 0 ? void 0 : _a.Self) || {};
52
+ let showBlockingError = false;
53
+ if (error && typeof error === 'object' && 'status' in error) {
54
+ showBlockingError = error.status === 403;
55
+ }
71
56
  const onCollapseSummaryHandler = () => {
72
57
  dispatchSummaryVisibilityAction(PaneVisibilityActionTypes.triggerCollapse);
73
58
  };
@@ -77,8 +62,7 @@ function Tenant(props) {
77
62
  const onSplitStartDragAdditional = () => {
78
63
  dispatchSummaryVisibilityAction(PaneVisibilityActionTypes.clear);
79
64
  };
80
- const showBlockingError = schemaStatus === 403;
81
- const title = currentSchemaPath || tenantName || i18n('page.title');
82
- return (_jsxs("div", { className: b(), children: [_jsx(Helmet, { defaultTitle: `${title} — YDB Monitoring`, titleTemplate: `%s — ${title} — YDB Monitoring` }), showBlockingError ? (_jsx(AccessDenied, {})) : (_jsxs(SplitPane, { defaultSizePaneKey: DEFAULT_SIZE_TENANT_KEY, defaultSizes: [25, 75], triggerCollapse: summaryVisibilityState.triggerCollapse, triggerExpand: summaryVisibilityState.triggerExpand, minSize: [36, 200], onSplitStartDragAdditional: onSplitStartDragAdditional, children: [_jsx(ObjectSummary, { type: preloadedPathType || currentPathType, subType: preloadedPathSubType || currentPathSubType, tenantName: tenantName, onCollapseSummary: onCollapseSummaryHandler, onExpandSummary: onExpandSummaryHandler, isCollapsed: summaryVisibilityState.collapsed }), _jsx(ObjectGeneral, { type: preloadedPathType || currentPathType, additionalTenantProps: props.additionalTenantProps, additionalNodesProps: props.additionalNodesProps, tenantName: tenantName })] }))] }));
65
+ const title = path || i18n('page.title');
66
+ return (_jsxs("div", { className: b(), children: [_jsx(Helmet, { defaultTitle: `${title} YDB Monitoring`, titleTemplate: `%s — ${title} — YDB Monitoring` }), showBlockingError ? (_jsx(AccessDenied, {})) : (_jsxs(SplitPane, { defaultSizePaneKey: DEFAULT_SIZE_TENANT_KEY, defaultSizes: [25, 75], triggerCollapse: summaryVisibilityState.triggerCollapse, triggerExpand: summaryVisibilityState.triggerExpand, minSize: [36, 200], onSplitStartDragAdditional: onSplitStartDragAdditional, children: [_jsx(ObjectSummary, { type: currentPathType, subType: currentPathSubType, tenantName: tenantName, path: path, onCollapseSummary: onCollapseSummaryHandler, onExpandSummary: onExpandSummaryHandler, isCollapsed: summaryVisibilityState.collapsed }), _jsx("div", { className: b('main'), children: isLoading ? (_jsx(Loader, { size: "l" })) : (_jsx(ObjectGeneral, { type: currentPathType, additionalTenantProps: props.additionalTenantProps, additionalNodesProps: props.additionalNodesProps, tenantName: tenantName, path: path })) })] }))] }));
83
67
  }
84
68
  export default Tenant;
@@ -5,4 +5,8 @@
5
5
 
6
6
  @include body-2-typography();
7
7
  @include flex-container();
8
+
9
+ &__main {
10
+ flex-grow: 1;
11
+ }
8
12
  }
@@ -0,0 +1,2 @@
1
+ import './TenantNavigation.scss';
2
+ export declare const TenantNavigation: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon, RadioButton } from '@gravity-ui/uikit';
3
+ import { cn } from '../../../utils/cn';
4
+ import { useTenantNavigation } from './useTenantNavigation';
5
+ import './TenantNavigation.scss';
6
+ const b = cn('ydb-tenant-navigation');
7
+ const transformItemToOption = ({ id, title, icon }) => {
8
+ const content = (_jsxs("span", { className: b('item'), children: [_jsx(Icon, { data: icon, size: 16, className: b('icon') }), _jsx("span", { className: b('text'), children: title })] }));
9
+ return { value: id, content };
10
+ };
11
+ export const TenantNavigation = () => {
12
+ const navigationItems = useTenantNavigation();
13
+ const handleUpdate = (value) => {
14
+ const nextItem = navigationItems.find((item) => item.id === value);
15
+ nextItem === null || nextItem === void 0 ? void 0 : nextItem.onForward();
16
+ };
17
+ const getCurrentItem = () => navigationItems.find((item) => item.current) || navigationItems[0];
18
+ return (_jsx("div", { className: b(), children: _jsx(RadioButton, { width: "auto", onUpdate: handleUpdate, size: "l", className: b('body'), value: getCurrentItem().id, options: navigationItems.map(transformItemToOption) }) }));
19
+ };
@@ -0,0 +1,18 @@
1
+ .ydb-tenant-navigation {
2
+ padding: 12px 16px 8px;
3
+
4
+ &__item {
5
+ display: flex;
6
+ align-items: center;
7
+ gap: 5px;
8
+ }
9
+
10
+ &__icon {
11
+ flex-shrink: 0;
12
+ }
13
+ &__text {
14
+ overflow: hidden;
15
+
16
+ text-overflow: ellipsis;
17
+ }
18
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare function useTenantNavigation(): {
3
+ id: "query" | "diagnostics";
4
+ title: string;
5
+ icon: ((props: React.SVGProps<SVGSVGElement>) => React.JSX.Element) | ((props: React.SVGProps<SVGSVGElement>) => React.JSX.Element);
6
+ path: string;
7
+ current: boolean;
8
+ onForward: () => void;
9
+ }[];
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { Pulse, Terminal } from '@gravity-ui/icons';
3
+ import { useHistory, useLocation } from 'react-router';
4
+ import routes, { parseQuery } from '../../../routes';
5
+ import { TENANT_PAGE, TENANT_PAGES_IDS } from '../../../store/reducers/tenant/constants';
6
+ import { TENANT_INITIAL_PAGE_KEY } from '../../../utils/constants';
7
+ import { useSetting, useTypedSelector } from '../../../utils/hooks';
8
+ import { getTenantPath } from '../TenantPages';
9
+ import i18n from '../i18n';
10
+ const pagesList = ['query', 'diagnostics'];
11
+ const mapPageToIcon = {
12
+ query: Terminal,
13
+ diagnostics: Pulse,
14
+ };
15
+ export function useTenantNavigation() {
16
+ const history = useHistory();
17
+ const location = useLocation();
18
+ const queryParams = parseQuery(location);
19
+ const [, setInitialTenantPage] = useSetting(TENANT_INITIAL_PAGE_KEY);
20
+ const { tenantPage } = useTypedSelector((state) => state.tenant);
21
+ const menuItems = React.useMemo(() => {
22
+ if (location.pathname !== routes.tenant) {
23
+ return [];
24
+ }
25
+ const items = pagesList.map((key) => {
26
+ const pageId = TENANT_PAGES_IDS[key];
27
+ const pagePath = getTenantPath(Object.assign(Object.assign({}, queryParams), { [TENANT_PAGE]: pageId }));
28
+ const nextItem = {
29
+ id: pageId,
30
+ title: i18n(`pages.${key}`),
31
+ icon: mapPageToIcon[key],
32
+ path: pagePath,
33
+ current: tenantPage === pageId,
34
+ onForward: () => {
35
+ setInitialTenantPage(pageId);
36
+ history.push(pagePath);
37
+ },
38
+ };
39
+ return nextItem;
40
+ });
41
+ return items;
42
+ }, [tenantPage, setInitialTenantPage, location.pathname, history, queryParams]);
43
+ return menuItems;
44
+ }
@@ -1,10 +1,27 @@
1
1
  {
2
2
  "page.title": "Database",
3
+ "pages.query": "Query",
4
+ "pages.diagnostics": "Diagnostics",
3
5
  "acl.owner": "Owner",
4
6
  "acl.empty": "No Acl data",
5
7
  "summary.navigation": "Navigation",
6
8
  "summary.showPreview": "Show preview",
9
+ "summary.source-type": "Source Type",
10
+ "summary.data-source": "Data Source",
7
11
  "summary.copySchemaPath": "Copy schema path",
12
+ "summary.type": "Type",
13
+ "summary.subtype": "SubType",
14
+ "summary.id": "Id",
15
+ "summary.version": "Version",
16
+ "summary.created": "Created",
17
+ "summary.partitions": "Partitions count",
18
+ "summary.paths": "Paths",
19
+ "summary.shards": "Shards",
20
+ "summary.state": "State",
21
+ "summary.mode": "Mode",
22
+ "summary.format": "Format",
23
+ "summary.retention": "Retention",
24
+ "label.read-only": "ReadOnly",
8
25
  "actions.copied": "The path is copied to the clipboard",
9
26
  "actions.notCopied": "Couldn’t copy the path",
10
27
  "actions.copyPath": "Copy path",
@@ -12,6 +29,8 @@
12
29
  "actions.createTable": "Create table...",
13
30
  "actions.createExternalTable": "Create external table...",
14
31
  "actions.createTopic": "Create topic...",
32
+ "actions.createColumnTable": "Create column table...",
33
+ "actions.createAsyncReplication": "Create async replication...",
15
34
  "actions.createView": "Create view...",
16
35
  "actions.dropTable": "Drop table...",
17
36
  "actions.dropTopic": "Drop topic...",
@@ -19,5 +38,7 @@
19
38
  "actions.alterTable": "Alter table...",
20
39
  "actions.alterTopic": "Alter topic...",
21
40
  "actions.selectQuery": "Select query...",
22
- "actions.upsertQuery": "Upsert query..."
41
+ "actions.upsertQuery": "Upsert query...",
42
+ "actions.alterReplication": "Alter async replicaton...",
43
+ "actions.dropReplication": "Drop async replicaton..."
23
44
  }
@@ -1,2 +1,2 @@
1
- declare const _default: (key: "page.title" | "acl.owner" | "acl.empty" | "summary.navigation" | "summary.showPreview" | "summary.copySchemaPath" | "actions.copied" | "actions.notCopied" | "actions.copyPath" | "actions.openPreview" | "actions.createTable" | "actions.createExternalTable" | "actions.createTopic" | "actions.createView" | "actions.dropTable" | "actions.dropTopic" | "actions.dropView" | "actions.alterTable" | "actions.alterTopic" | "actions.selectQuery" | "actions.upsertQuery", params?: import("@gravity-ui/i18n").Params | undefined) => string;
1
+ declare const _default: (key: "page.title" | "pages.query" | "pages.diagnostics" | "acl.owner" | "acl.empty" | "summary.navigation" | "summary.showPreview" | "summary.source-type" | "summary.data-source" | "summary.copySchemaPath" | "summary.type" | "summary.subtype" | "summary.id" | "summary.version" | "summary.created" | "summary.partitions" | "summary.paths" | "summary.shards" | "summary.state" | "summary.mode" | "summary.format" | "summary.retention" | "label.read-only" | "actions.copied" | "actions.notCopied" | "actions.copyPath" | "actions.openPreview" | "actions.createTable" | "actions.createExternalTable" | "actions.createTopic" | "actions.createColumnTable" | "actions.createAsyncReplication" | "actions.createView" | "actions.dropTable" | "actions.dropTopic" | "actions.dropView" | "actions.alterTable" | "actions.alterTopic" | "actions.selectQuery" | "actions.upsertQuery" | "actions.alterReplication" | "actions.dropReplication", params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
2
  export default _default;
@@ -1,2 +1,3 @@
1
1
  import type { TPathDescription } from '../../../types/api/schema';
2
2
  export declare const getEntityName: (pathDescription?: TPathDescription) => string | undefined;
3
+ export declare const isReadOnlyTable: (pathDescription?: TPathDescription) => boolean | undefined;
@@ -3,3 +3,9 @@ export const getEntityName = (pathDescription) => {
3
3
  const { PathType, PathSubType } = (pathDescription === null || pathDescription === void 0 ? void 0 : pathDescription.Self) || {};
4
4
  return mapPathTypeToEntityName(PathType, PathSubType);
5
5
  };
6
+ export const isReadOnlyTable = (pathDescription) => {
7
+ var _a;
8
+ return (_a = pathDescription === null || pathDescription === void 0 ? void 0 : pathDescription.UserAttributes) === null || _a === void 0 ? void 0 : _a.some(({ Key, Value }) => {
9
+ return Key === '__async_replica' && Value === 'true';
10
+ });
11
+ };
@@ -1,4 +1,6 @@
1
1
  export declare const createTableTemplate: (path: string) => string;
2
+ export declare const createColumnTableTemplate: (path: string) => string;
3
+ export declare const createAsyncReplicationTemplate: () => string;
2
4
  export declare const alterTableTemplate: (path: string) => string;
3
5
  export declare const selectQueryTemplate: (path: string) => string;
4
6
  export declare const upsertQueryTemplate: (path: string) => string;
@@ -9,3 +11,5 @@ export declare const alterTopicTemplate: (path: string) => string;
9
11
  export declare const dropTopicTemplate: (path: string) => string;
10
12
  export declare const createViewTemplate: (path: string) => string;
11
13
  export declare const dropViewTemplate: (path: string) => string;
14
+ export declare const dropAsyncReplicationTemplate: (path: string) => string;
15
+ export declare const alterAsyncReplicationTemplate: (path: string) => string;
@@ -30,6 +30,32 @@ WITH (
30
30
  -- if some keys are missing in a table when making multiple single queries by the primary key.
31
31
  )`;
32
32
  };
33
+ export const createColumnTableTemplate = (path) => {
34
+ return `-- docs: https://ydb.tech/en/docs/yql/reference/syntax/create_table#olap-tables
35
+ CREATE TABLE \`${path}/ydb_column_table\` (
36
+ id Int64 NOT NULL,
37
+ author Text,
38
+ title Text,
39
+ body Text,
40
+ PRIMARY KEY (id)
41
+ )
42
+ PARTITION BY HASH(id)
43
+ WITH (STORE = COLUMN)`;
44
+ };
45
+ export const createAsyncReplicationTemplate = () => {
46
+ return `CREATE OBJECT secret_name (TYPE SECRET) WITH value="secret_value";
47
+
48
+ CREATE ASYNC REPLICATION my_replication
49
+ FOR \`/remote_database/table_name\` AS \`local_table_name\` --[, \`/remote_database/another_table_name\` AS \`another_local_table_name\` ...]
50
+ WITH (
51
+ CONNECTION_STRING="grpcs://mydb.ydb.tech:2135/?database=/remote_database",
52
+ TOKEN_SECRET_NAME = "secret_name"
53
+ -- ENDPOINT="mydb.ydb.tech:2135",
54
+ -- DATABASE=\`/remote_database\`,
55
+ -- USER="user",
56
+ -- PASSWORD_SECRET_NAME="your_password"
57
+ );`;
58
+ };
33
59
  export const alterTableTemplate = (path) => {
34
60
  return `ALTER TABLE \`${path}\`
35
61
  ADD COLUMN is_deleted Bool;`;
@@ -111,3 +137,9 @@ export const createViewTemplate = (path) => {
111
137
  export const dropViewTemplate = (path) => {
112
138
  return `DROP VIEW \`${path}\`;`;
113
139
  };
140
+ export const dropAsyncReplicationTemplate = (path) => {
141
+ return `DROP ASYNC REPLICATION \`${path}\`;`;
142
+ };
143
+ export const alterAsyncReplicationTemplate = (path) => {
144
+ return `ALTER ASYNC REPLICATION \`${path}\` SET (STATE = "DONE", FAILOVER_MODE = "FORCE");`;
145
+ };
@@ -4,7 +4,7 @@ import { TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID } from '../../../store/reducers/
4
4
  import { setQueryTab, setTenantPage } from '../../../store/reducers/tenant/tenant';
5
5
  import createToast from '../../../utils/createToast';
6
6
  import i18n from '../i18n';
7
- import { alterTableTemplate, alterTopicTemplate, createExternalTableTemplate, createTableTemplate, createTopicTemplate, createViewTemplate, dropExternalTableTemplate, dropTopicTemplate, dropViewTemplate, selectQueryTemplate, upsertQueryTemplate, } from './queryTemplates';
7
+ import { alterAsyncReplicationTemplate, alterTableTemplate, alterTopicTemplate, createAsyncReplicationTemplate, createColumnTableTemplate, createExternalTableTemplate, createTableTemplate, createTopicTemplate, createViewTemplate, dropAsyncReplicationTemplate, dropExternalTableTemplate, dropTopicTemplate, dropViewTemplate, selectQueryTemplate, upsertQueryTemplate, } from './queryTemplates';
8
8
  const bindActions = (path, dispatch, additionalEffects) => {
9
9
  const { setActivePath, setQueryMode } = additionalEffects;
10
10
  const inputQuery = (tmpl, mode) => () => {
@@ -18,6 +18,10 @@ const bindActions = (path, dispatch, additionalEffects) => {
18
18
  };
19
19
  return {
20
20
  createTable: inputQuery(createTableTemplate, 'script'),
21
+ createColumnTable: inputQuery(createColumnTableTemplate, 'script'),
22
+ createAsyncReplication: inputQuery(createAsyncReplicationTemplate, 'script'),
23
+ alterAsyncReplication: inputQuery(alterAsyncReplicationTemplate, 'script'),
24
+ dropAsyncReplication: inputQuery(dropAsyncReplicationTemplate, 'script'),
21
25
  alterTable: inputQuery(alterTableTemplate, 'script'),
22
26
  selectQuery: inputQuery(selectQueryTemplate),
23
27
  upsertQuery: inputQuery(upsertQueryTemplate),
@@ -55,6 +59,11 @@ export const getActions = (dispatch, additionalEffects) => (path, type) => {
55
59
  [copyItem],
56
60
  [
57
61
  { text: i18n('actions.createTable'), action: actions.createTable },
62
+ { text: i18n('actions.createColumnTable'), action: actions.createColumnTable },
63
+ {
64
+ text: i18n('actions.createAsyncReplication'),
65
+ action: actions.createAsyncReplication,
66
+ },
58
67
  { text: i18n('actions.createTopic'), action: actions.createTopic },
59
68
  { text: i18n('actions.createView'), action: actions.createView },
60
69
  ],
@@ -93,11 +102,18 @@ export const getActions = (dispatch, additionalEffects) => (path, type) => {
93
102
  [{ text: i18n('actions.selectQuery'), action: actions.selectQuery }],
94
103
  [{ text: i18n('actions.dropView'), action: actions.dropView }],
95
104
  ];
105
+ const ASYNC_REPLICATION_SET = [
106
+ [copyItem],
107
+ [
108
+ { text: i18n('actions.alterReplication'), action: actions.alterAsyncReplication },
109
+ { text: i18n('actions.dropReplication'), action: actions.dropAsyncReplication },
110
+ ],
111
+ ];
96
112
  const JUST_COPY = [copyItem];
97
113
  // verbose mapping to guarantee a correct actions set for new node types
98
114
  // TS will error when a new type is added in the lib but is not mapped here
99
115
  const nodeTypeToActions = {
100
- async_replication: JUST_COPY,
116
+ async_replication: ASYNC_REPLICATION_SET,
101
117
  database: DIR_SET,
102
118
  directory: DIR_SET,
103
119
  table: TABLE_SET,
@@ -1,11 +1,16 @@
1
1
  /// <reference types="react" />
2
+ export interface SettingsInfoFieldProps {
3
+ type: 'info';
4
+ title: string;
5
+ description?: React.ReactNode;
6
+ content: React.ReactNode;
7
+ }
2
8
  export type SettingsElementType = 'switch' | 'radio';
3
9
  export interface SettingProps {
4
10
  type?: SettingsElementType;
5
11
  title: string;
6
12
  description?: React.ReactNode;
7
13
  settingKey: string;
8
- helpPopoverContent?: React.ReactNode;
9
14
  options?: {
10
15
  value: string;
11
16
  content: string;
@@ -13,11 +18,4 @@ export interface SettingProps {
13
18
  defaultValue?: unknown;
14
19
  onValueUpdate?: VoidFunction;
15
20
  }
16
- export declare const Setting: ({ type, settingKey, title, description, helpPopoverContent, options, defaultValue, onValueUpdate, }: SettingProps) => import("react/jsx-runtime").JSX.Element;
17
- export interface SettingsInfoFieldProps {
18
- type: 'info';
19
- title: string;
20
- description?: React.ReactNode;
21
- content: React.ReactNode;
22
- }
23
- export declare const SettingsInfoField: ({ title, description, content }: SettingsInfoFieldProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const Setting: ({ type, settingKey, options, defaultValue, onValueUpdate, }: SettingProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,40 +1,25 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Settings } from '@gravity-ui/navigation';
3
2
  import { RadioButton, Switch } from '@gravity-ui/uikit';
4
- import { LabelWithPopover } from '../../components/LabelWithPopover/LabelWithPopover';
5
3
  import { useSetting } from '../../utils/hooks';
6
- import { b } from './UserSettings';
7
- export const Setting = ({ type = 'switch', settingKey, title, description, helpPopoverContent, options, defaultValue, onValueUpdate, }) => {
4
+ export const Setting = ({ type = 'switch', settingKey, options, defaultValue, onValueUpdate, }) => {
8
5
  const [settingValue, setValue] = useSetting(settingKey, defaultValue);
9
6
  const onUpdate = (value) => {
10
7
  setValue(value);
11
8
  onValueUpdate === null || onValueUpdate === void 0 ? void 0 : onValueUpdate();
12
9
  };
13
- const renderTitleComponent = (value) => {
14
- if (helpPopoverContent) {
15
- return (_jsx(LabelWithPopover, { className: b('item-with-popup'), contentClassName: b('popup'), text: value, popoverContent: helpPopoverContent }));
10
+ switch (type) {
11
+ case 'switch': {
12
+ return _jsx(Switch, { checked: Boolean(settingValue), onUpdate: onUpdate });
16
13
  }
17
- return value;
18
- };
19
- const getSettingsElement = (elementType) => {
20
- switch (elementType) {
21
- case 'switch': {
22
- return _jsx(Switch, { checked: Boolean(settingValue), onUpdate: onUpdate });
23
- }
24
- case 'radio': {
25
- if (!options) {
26
- return null;
27
- }
28
- return (_jsx(RadioButton, { value: String(settingValue), onUpdate: onUpdate, children: options.map(({ value, content }) => {
29
- return (_jsx(RadioButton.Option, { value: value, children: content }, value));
30
- }) }));
31
- }
32
- default:
14
+ case 'radio': {
15
+ if (!options) {
33
16
  return null;
17
+ }
18
+ return (_jsx(RadioButton, { value: String(settingValue), onUpdate: onUpdate, children: options.map(({ value, content }) => {
19
+ return (_jsx(RadioButton.Option, { value: value, children: content }, value));
20
+ }) }));
34
21
  }
35
- };
36
- return (_jsx(Settings.Item, { title: title, highlightedTitle: title, description: description, renderTitleComponent: renderTitleComponent, children: getSettingsElement(type) }));
37
- };
38
- export const SettingsInfoField = ({ title, description, content }) => {
39
- return (_jsx(Settings.Item, { title: title, highlightedTitle: title, description: description, children: content }));
22
+ default:
23
+ return null;
24
+ }
40
25
  };
@@ -1,6 +1,4 @@
1
1
  import type { YDBEmbeddedUISettings } from './settings';
2
- import './UserSettings.scss';
3
- export declare const b: import("@bem-react/classname").ClassNameFormatter;
4
2
  interface UserSettingsProps {
5
3
  settings?: YDBEmbeddedUISettings;
6
4
  }