ydb-embedded-ui 6.11.0 → 6.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (405) hide show
  1. package/dist/components/AutoRefreshControl/i18n/index.d.ts +1 -1
  2. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +3 -2
  3. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +9 -5
  4. package/dist/components/CriticalActionDialog/CriticalActionDialog.d.ts +5 -3
  5. package/dist/components/CriticalActionDialog/CriticalActionDialog.js +8 -7
  6. package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +1 -1
  7. package/dist/components/CriticalActionDialog/i18n/en.json +1 -0
  8. package/dist/components/CriticalActionDialog/i18n/index.d.ts +1 -1
  9. package/dist/components/DateRange/DateRange.d.ts +4 -4
  10. package/dist/components/DateRange/DateRange.js +23 -26
  11. package/dist/components/DateRange/DateRange.scss +14 -13
  12. package/dist/components/DateRange/__test__/fromDateRangeValues.test.js +80 -0
  13. package/dist/components/DateRange/__test__/getdatePickerSize.test.d.ts +1 -0
  14. package/dist/components/DateRange/__test__/getdatePickerSize.test.js +56 -0
  15. package/dist/components/DateRange/__test__/toDateRangeValues.test.d.ts +1 -0
  16. package/dist/components/DateRange/__test__/toDateRangeValues.test.js +80 -0
  17. package/dist/components/DateRange/i18n/en.json +4 -0
  18. package/dist/components/DateRange/i18n/index.d.ts +2 -0
  19. package/dist/components/DateRange/i18n/index.js +5 -0
  20. package/dist/components/DateRange/i18n/ru.json +4 -0
  21. package/dist/components/DateRange/utils.d.ts +5 -0
  22. package/dist/components/DateRange/utils.js +41 -0
  23. package/dist/components/DeveloperUILinkButton/DeveloperUILinkButton.d.ts +8 -0
  24. package/dist/components/{DeveloperUiLink/DeveloperUiLink.js → DeveloperUILinkButton/DeveloperUILinkButton.js} +3 -3
  25. package/dist/components/{DeveloperUiLink/DeveloperUiLink.scss → DeveloperUILinkButton/DeveloperUILinkButton.scss} +3 -2
  26. package/dist/components/DiskStateProgressBar/DiskStateProgressBar.d.ts +6 -1
  27. package/dist/components/DiskStateProgressBar/DiskStateProgressBar.js +22 -12
  28. package/dist/components/DiskStateProgressBar/DiskStateProgressBar.scss +45 -45
  29. package/dist/components/EntityStatus/EntityStatus.js +1 -1
  30. package/dist/components/EntityStatus/EntityStatus.scss +6 -2
  31. package/dist/components/Errors/PageError/PageError.d.ts +11 -0
  32. package/dist/components/Errors/PageError/PageError.js +19 -0
  33. package/dist/components/Errors/i18n/en.json +2 -1
  34. package/dist/components/Errors/i18n/index.d.ts +1 -1
  35. package/dist/components/Errors/i18n/ru.json +2 -1
  36. package/dist/components/Fullscreen/Fullscreen.d.ts +1 -1
  37. package/dist/components/Fullscreen/Fullscreen.js +34 -27
  38. package/dist/components/Fullscreen/Fullscreen.scss +16 -8
  39. package/dist/components/Graph/Graph.d.ts +13 -0
  40. package/dist/components/Graph/Graph.js +41 -0
  41. package/dist/components/LabelWithPopover/LabelWithPopover.d.ts +4 -1
  42. package/dist/components/LabelWithPopover/LabelWithPopover.js +1 -1
  43. package/dist/components/Loader/Loader.d.ts +2 -1
  44. package/dist/components/Loader/Loader.js +6 -1
  45. package/dist/components/LoaderWrapper/LoaderWrapper.d.ts +10 -0
  46. package/dist/components/LoaderWrapper/LoaderWrapper.js +8 -0
  47. package/dist/components/MetricChart/reducer.d.ts +2 -2
  48. package/dist/components/MonacoEditor/MonacoEditor.js +0 -2
  49. package/dist/components/NodeHostWrapper/NodeHostWrapper.d.ts +0 -1
  50. package/dist/components/NodeHostWrapper/NodeHostWrapper.js +3 -6
  51. package/dist/components/PDiskInfo/PDiskInfo.d.ts +8 -5
  52. package/dist/components/PDiskInfo/PDiskInfo.js +76 -26
  53. package/dist/components/PDiskInfo/PDiskInfo.scss +15 -1
  54. package/dist/components/PDiskInfo/i18n/en.json +11 -5
  55. package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
  56. package/dist/components/PDiskPopup/PDiskPopup.js +8 -2
  57. package/dist/components/ProgressViewer/ProgressViewer.js +3 -0
  58. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.js +13 -3
  59. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.scss +4 -0
  60. package/dist/components/QuerySettingsDescription/QuerySettingsDescription.d.ts +7 -0
  61. package/dist/components/QuerySettingsDescription/QuerySettingsDescription.js +8 -0
  62. package/dist/components/QuerySettingsDescription/QuerySettingsDescription.scss +8 -0
  63. package/dist/components/QuerySettingsDescription/index.d.ts +1 -0
  64. package/dist/components/QuerySettingsDescription/index.js +1 -0
  65. package/dist/components/VDisk/VDisk.js +3 -4
  66. package/dist/components/VDiskInfo/VDiskInfo.d.ts +4 -3
  67. package/dist/components/VDiskInfo/VDiskInfo.js +12 -5
  68. package/dist/components/VDiskInfo/VDiskInfo.scss +7 -1
  69. package/dist/components/VDiskInfo/i18n/en.json +2 -1
  70. package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
  71. package/dist/containers/App/Content.js +15 -19
  72. package/dist/containers/AsideNavigation/AsideNavigation.js +2 -1
  73. package/dist/containers/AsideNavigation/YdbInternalUser/YdbInternalUser.js +4 -4
  74. package/dist/containers/Authentication/Authentication.js +8 -10
  75. package/dist/containers/Authentication/utils.d.ts +8 -0
  76. package/dist/containers/Authentication/utils.js +15 -0
  77. package/dist/containers/Cluster/Cluster.scss +1 -4
  78. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.js +6 -6
  79. package/dist/containers/Cluster/ClusterInfo/ClusterInfo.scss +1 -1
  80. package/dist/containers/Clusters/constants.d.ts +1 -1
  81. package/dist/containers/Heatmap/Heatmap.d.ts +2 -1
  82. package/dist/containers/Heatmap/Heatmap.js +7 -6
  83. package/dist/containers/Node/Node.js +5 -7
  84. package/dist/containers/Node/Node.scss +5 -4
  85. package/dist/containers/Node/NodeStructure/NodeStructure.js +4 -4
  86. package/dist/containers/Node/NodeStructure/NodeStructure.scss +4 -20
  87. package/dist/containers/Node/NodeStructure/Pdisk.js +3 -3
  88. package/dist/containers/Nodes/Nodes.js +6 -8
  89. package/dist/containers/Nodes/getNodesColumns.js +6 -21
  90. package/dist/containers/PDiskPage/PDiskGroups/PDiskGroups.d.ts +6 -0
  91. package/dist/containers/PDiskPage/PDiskGroups/PDiskGroups.js +24 -0
  92. package/dist/containers/PDiskPage/PDiskPage.js +79 -30
  93. package/dist/containers/PDiskPage/PDiskPage.scss +8 -5
  94. package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.d.ts +7 -0
  95. package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.js +93 -0
  96. package/dist/containers/PDiskPage/PDiskSpaceDistribution/PDiskSpaceDistribution.scss +52 -0
  97. package/dist/containers/PDiskPage/PDiskSpaceDistribution/utils.d.ts +4 -0
  98. package/dist/containers/PDiskPage/PDiskSpaceDistribution/utils.js +9 -0
  99. package/dist/containers/PDiskPage/i18n/en.json +9 -1
  100. package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
  101. package/dist/containers/Storage/PDisk/PDisk.js +3 -4
  102. package/dist/containers/Storage/Storage.js +4 -6
  103. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +16 -6
  104. package/dist/containers/Tablet/Tablet.js +2 -2
  105. package/dist/containers/Tablet/TabletControls/TabletControls.js +2 -1
  106. package/dist/containers/Tablets/Tablets.js +14 -13
  107. package/dist/containers/Tenant/Acl/Acl.d.ts +2 -1
  108. package/dist/containers/Tenant/Acl/Acl.js +10 -8
  109. package/dist/containers/Tenant/Acl/Acl.scss +8 -8
  110. package/dist/containers/Tenant/Acl/i18n/en.json +6 -0
  111. package/dist/containers/Tenant/Acl/i18n/index.d.ts +2 -0
  112. package/dist/containers/Tenant/Acl/i18n/index.js +4 -0
  113. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +2 -5
  114. package/dist/containers/Tenant/Diagnostics/Describe/Describe.d.ts +2 -1
  115. package/dist/containers/Tenant/Diagnostics/Describe/Describe.js +14 -17
  116. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.js +1 -1
  117. package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +1 -0
  118. package/dist/containers/Tenant/Diagnostics/Diagnostics.js +3 -3
  119. package/dist/containers/Tenant/Diagnostics/Diagnostics.scss +3 -1
  120. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.d.ts +2 -1
  121. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +3 -3
  122. package/dist/containers/Tenant/Diagnostics/Network/Network.js +8 -11
  123. package/dist/containers/Tenant/Diagnostics/Network/Network.scss +1 -0
  124. package/dist/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -2
  125. package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +8 -10
  126. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/en.json +14 -1
  127. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.d.ts +1 -1
  128. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/index.js +1 -2
  129. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.js +36 -17
  130. package/dist/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.js +3 -4
  131. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +1 -4
  132. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +8 -5
  133. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +1 -1
  134. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.js +3 -3
  135. package/dist/containers/Tenant/Diagnostics/TenantOverview/getSectionTitle.d.ts +2 -1
  136. package/dist/containers/Tenant/Diagnostics/TenantOverview/getSectionTitle.js +2 -2
  137. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +3 -2
  138. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
  139. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +6 -5
  140. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.d.ts +2 -2
  141. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +14 -14
  142. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +7 -6
  143. package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.js +4 -4
  144. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +31 -18
  145. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.d.ts +2 -2
  146. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +56 -20
  147. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.scss +10 -6
  148. package/dist/containers/Tenant/Query/ExecuteResult/i18n/en.json +7 -0
  149. package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.d.ts +2 -0
  150. package/dist/containers/Tenant/Query/ExecuteResult/i18n/index.js +4 -0
  151. package/dist/containers/Tenant/Query/ExecuteResult/utils.d.ts +18 -0
  152. package/dist/containers/Tenant/Query/ExecuteResult/utils.js +36 -0
  153. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.d.ts +23 -1
  154. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +56 -111
  155. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.scss +1 -30
  156. package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.d.ts +7 -0
  157. package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.js +18 -0
  158. package/dist/containers/Tenant/Query/ExplainResult/components/Ast/Ast.scss +8 -0
  159. package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.d.ts +8 -0
  160. package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.js +14 -0
  161. package/dist/containers/Tenant/Query/ExplainResult/components/Graph/Graph.scss +14 -0
  162. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/MetricsCell.d.ts +6 -0
  163. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/MetricsCell.js +11 -0
  164. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationCell.d.ts +13 -0
  165. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationCell.js +48 -0
  166. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationParams.d.ts +6 -0
  167. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/OperationParams.js +66 -0
  168. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.d.ts +7 -0
  169. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.js +100 -0
  170. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/SimplifiedPlan.scss +128 -0
  171. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/types.d.ts +5 -0
  172. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/types.js +1 -0
  173. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/utils.d.ts +5 -0
  174. package/dist/containers/Tenant/Query/ExplainResult/components/SimplifiedPlan/utils.js +59 -0
  175. package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.d.ts +8 -0
  176. package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.js +11 -0
  177. package/dist/containers/Tenant/Query/ExplainResult/components/TextExplain/TextExplain.scss +14 -0
  178. package/dist/containers/Tenant/Query/ExplainResult/i18n/en.json +8 -0
  179. package/dist/containers/Tenant/Query/ExplainResult/i18n/index.d.ts +2 -0
  180. package/dist/containers/Tenant/Query/ExplainResult/i18n/index.js +4 -0
  181. package/dist/containers/Tenant/Query/Preview/Preview.js +2 -3
  182. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.js +1 -19
  183. package/dist/containers/Tenant/Query/QueryDuration/QueryDuration.js +1 -1
  184. package/dist/containers/Tenant/Query/QueryDuration/QueryDuration.scss +11 -0
  185. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +1 -1
  186. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +96 -95
  187. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.d.ts +5 -6
  188. package/dist/containers/Tenant/Query/QueryEditorControls/QueryEditorControls.js +18 -47
  189. package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.d.ts +2 -0
  190. package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.js +5 -0
  191. package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.test.d.ts +1 -0
  192. package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettings.test.js +42 -0
  193. package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.d.ts +5 -0
  194. package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.js +19 -0
  195. package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.test.d.ts +1 -0
  196. package/dist/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.test.js +56 -0
  197. package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.d.ts +2 -0
  198. package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.js +12 -0
  199. package/dist/containers/Tenant/Query/QuerySettingsBanner/QuerySettingsBanner.scss +3 -0
  200. package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.d.ts +2 -0
  201. package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.js +35 -0
  202. package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.scss +63 -0
  203. package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.d.ts +15 -0
  204. package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.js +14 -0
  205. package/dist/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsSelect.scss +19 -0
  206. package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.d.ts +215 -0
  207. package/dist/containers/Tenant/Query/QuerySettingsDialog/constants.js +131 -0
  208. package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/en.json +13 -0
  209. package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/index.d.ts +2 -0
  210. package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/index.js +5 -0
  211. package/dist/containers/Tenant/Query/QuerySettingsDialog/i18n/ru.json +13 -0
  212. package/dist/containers/Tenant/Query/i18n/en.json +17 -1
  213. package/dist/containers/Tenant/Query/i18n/index.d.ts +1 -1
  214. package/dist/containers/Tenant/Schema/CreateDirectoryDialog/CreateDirectoryDialog.d.ts +3 -2
  215. package/dist/containers/Tenant/Schema/CreateDirectoryDialog/CreateDirectoryDialog.js +2 -2
  216. package/dist/containers/Tenant/Schema/SchemaTree/SchemaTree.js +8 -8
  217. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +6 -3
  218. package/dist/containers/Tenant/Schema/SchemaViewer/columns.d.ts +2 -1
  219. package/dist/containers/Tenant/Schema/SchemaViewer/columns.js +13 -1
  220. package/dist/containers/Tenant/Schema/SchemaViewer/i18n/en.json +1 -0
  221. package/dist/containers/Tenant/Schema/SchemaViewer/i18n/index.d.ts +1 -1
  222. package/dist/containers/Tenant/Schema/SchemaViewer/prepareData.js +3 -2
  223. package/dist/containers/Tenant/Schema/SchemaViewer/types.d.ts +1 -0
  224. package/dist/containers/Tenant/Tenant.js +4 -8
  225. package/dist/containers/Tenant/TenantPages.d.ts +12 -1
  226. package/dist/containers/Tenant/TenantPages.js +1 -1
  227. package/dist/containers/Tenant/i18n/en.json +2 -2
  228. package/dist/containers/Tenant/i18n/index.d.ts +1 -1
  229. package/dist/containers/Tenant/utils/schema.js +1 -1
  230. package/dist/containers/Tenant/utils/schemaActions.d.ts +2 -2
  231. package/dist/containers/Tenant/utils/schemaActions.js +2 -2
  232. package/dist/containers/Tenants/Tenants.js +5 -8
  233. package/dist/containers/Tenants/Tenants.scss +0 -4
  234. package/dist/containers/UserSettings/i18n/en.json +3 -3
  235. package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
  236. package/dist/containers/UserSettings/settings.d.ts +2 -2
  237. package/dist/containers/UserSettings/settings.js +18 -19
  238. package/dist/containers/VDiskPage/VDiskPage.js +27 -13
  239. package/dist/containers/VDiskPage/i18n/en.json +1 -0
  240. package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
  241. package/dist/routes.js +2 -2
  242. package/dist/services/api.d.ts +59 -28
  243. package/dist/services/api.js +74 -98
  244. package/dist/services/settings.d.ts +11 -3
  245. package/dist/services/settings.js +7 -5
  246. package/dist/store/configureStore.d.ts +7 -7
  247. package/dist/store/defaultStore.d.ts +3 -3
  248. package/dist/store/reducers/api.d.ts +1 -1
  249. package/dist/store/reducers/api.js +1 -1
  250. package/dist/store/reducers/authentication/authentication.d.ts +37 -24
  251. package/dist/store/reducers/authentication/authentication.js +77 -57
  252. package/dist/store/reducers/authentication/types.d.ts +0 -8
  253. package/dist/store/reducers/capabilities/capabilities.d.ts +106 -0
  254. package/dist/store/reducers/capabilities/capabilities.js +22 -0
  255. package/dist/store/reducers/capabilities/hooks.d.ts +2 -0
  256. package/dist/store/reducers/capabilities/hooks.js +13 -0
  257. package/dist/store/reducers/cluster/cluster.d.ts +2 -2
  258. package/dist/store/reducers/clusterNodes/clusterNodes.d.ts +2 -2
  259. package/dist/store/reducers/clusters/clusters.d.ts +2 -2
  260. package/dist/store/reducers/describe.d.ts +5 -2
  261. package/dist/store/reducers/describe.js +2 -2
  262. package/dist/store/reducers/executeQuery.d.ts +7 -14
  263. package/dist/store/reducers/executeQuery.js +19 -14
  264. package/dist/store/reducers/executeTopQueries/executeTopQueries.d.ts +2 -2
  265. package/dist/store/reducers/executeTopQueries/executeTopQueries.js +19 -14
  266. package/dist/store/reducers/executeTopQueries/types.d.ts +2 -2
  267. package/dist/store/reducers/executeTopQueries/utils.js +11 -7
  268. package/dist/store/reducers/explainQuery/explainQuery.d.ts +5 -4
  269. package/dist/store/reducers/explainQuery/explainQuery.js +20 -5
  270. package/dist/store/reducers/explainQuery/types.d.ts +13 -1
  271. package/dist/store/reducers/explainQuery/utils.js +7 -2
  272. package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +58 -58
  273. package/dist/store/reducers/heatmap.d.ts +2 -2
  274. package/dist/store/reducers/heatmap.js +3 -3
  275. package/dist/store/reducers/hotKeys/hotKeys.d.ts +3 -2
  276. package/dist/store/reducers/hotKeys/hotKeys.js +3 -3
  277. package/dist/store/reducers/index.d.ts +6 -6
  278. package/dist/store/reducers/network/network.d.ts +2 -2
  279. package/dist/store/reducers/network/network.js +1 -1
  280. package/dist/store/reducers/node/node.d.ts +3 -3
  281. package/dist/store/reducers/node/selectors.d.ts +1 -1
  282. package/dist/store/reducers/node/selectors.js +2 -2
  283. package/dist/store/reducers/nodes/nodes.d.ts +3 -3
  284. package/dist/store/reducers/nodesList.d.ts +3 -3
  285. package/dist/store/reducers/overview/overview.d.ts +5 -2
  286. package/dist/store/reducers/overview/overview.js +2 -2
  287. package/dist/store/reducers/partitions/partitions.d.ts +2 -2
  288. package/dist/store/reducers/pdisk/pdisk.d.ts +3 -3
  289. package/dist/store/reducers/pdisk/pdisk.js +15 -2
  290. package/dist/store/reducers/pdisk/types.d.ts +17 -1
  291. package/dist/store/reducers/pdisk/utils.d.ts +2 -2
  292. package/dist/store/reducers/pdisk/utils.js +68 -8
  293. package/dist/store/reducers/preview.d.ts +2 -2
  294. package/dist/store/reducers/preview.js +1 -1
  295. package/dist/store/reducers/queryActions/types.d.ts +1 -1
  296. package/dist/store/reducers/schema/schema.d.ts +28 -10
  297. package/dist/store/reducers/schema/schema.js +20 -14
  298. package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +4 -2
  299. package/dist/store/reducers/schemaAcl/schemaAcl.js +9 -3
  300. package/dist/store/reducers/shardsWorkload/shardsWorkload.d.ts +2 -2
  301. package/dist/store/reducers/shardsWorkload/shardsWorkload.js +22 -6
  302. package/dist/store/reducers/shardsWorkload/types.d.ts +2 -2
  303. package/dist/store/reducers/storage/storage.d.ts +3 -3
  304. package/dist/store/reducers/tablet.d.ts +3 -3
  305. package/dist/store/reducers/tablets.d.ts +13 -13
  306. package/dist/store/reducers/tabletsFilters.d.ts +1 -1
  307. package/dist/store/reducers/tenant/tenant.d.ts +2 -2
  308. package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.d.ts +2 -2
  309. package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +1 -1
  310. package/dist/store/reducers/tenantOverview/topNodes/topNodes.d.ts +2 -2
  311. package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.d.ts +2 -2
  312. package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +1 -1
  313. package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.d.ts +2 -2
  314. package/dist/store/reducers/tenants/selectors.d.ts +31 -30
  315. package/dist/store/reducers/tenants/selectors.js +8 -2
  316. package/dist/store/reducers/tenants/tenants.d.ts +2 -2
  317. package/dist/store/reducers/topic.d.ts +44 -44
  318. package/dist/store/reducers/vdisk/vdisk.d.ts +2 -2
  319. package/dist/store/reducers/vdisk/vdisk.js +1 -1
  320. package/dist/store/reducers/viewSchema/viewSchema.d.ts +2 -2
  321. package/dist/store/reducers/viewSchema/viewSchema.js +1 -1
  322. package/dist/store/state-url-mapping.d.ts +70 -0
  323. package/dist/store/state-url-mapping.js +1 -5
  324. package/dist/styles/mixins.scss +13 -0
  325. package/dist/types/api/acl.d.ts +1 -0
  326. package/dist/types/api/capabilities.d.ts +7 -0
  327. package/dist/types/api/capabilities.js +1 -0
  328. package/dist/types/api/modifyDisk.d.ts +8 -0
  329. package/dist/types/api/modifyDisk.js +1 -0
  330. package/dist/types/api/pdisk.d.ts +65 -2
  331. package/dist/types/api/query.d.ts +39 -3
  332. package/dist/types/api/query.js +9 -1
  333. package/dist/types/api/schema/shared.d.ts +8 -0
  334. package/dist/types/api/vdisk.d.ts +33 -2
  335. package/dist/types/common.d.ts +3 -0
  336. package/dist/types/store/heatmap.d.ts +1 -0
  337. package/dist/types/store/query.d.ts +11 -1
  338. package/dist/utils/__test__/prepareQueryExplain.test.d.ts +1 -0
  339. package/dist/utils/__test__/prepareQueryExplain.test.js +115 -0
  340. package/dist/utils/constants.d.ts +13 -3
  341. package/dist/utils/constants.js +15 -3
  342. package/dist/utils/dataFormatters/dataFormatters.d.ts +0 -5
  343. package/dist/utils/dataFormatters/dataFormatters.js +3 -12
  344. package/dist/utils/developerUI/developerUI.d.ts +1 -0
  345. package/dist/utils/developerUI/developerUI.js +3 -0
  346. package/dist/utils/disks/getPDiskType.d.ts +3 -3
  347. package/dist/utils/disks/helpers.d.ts +1 -0
  348. package/dist/utils/disks/helpers.js +3 -0
  349. package/dist/utils/disks/prepareDisks.d.ts +2 -2
  350. package/dist/utils/disks/prepareDisks.js +17 -22
  351. package/dist/utils/disks/types.d.ts +7 -5
  352. package/dist/utils/hooks/index.d.ts +2 -1
  353. package/dist/utils/hooks/index.js +2 -1
  354. package/dist/utils/hooks/useChangedQuerySettings.d.ts +10 -0
  355. package/dist/utils/hooks/useChangedQuerySettings.js +46 -0
  356. package/dist/utils/hooks/useDelayed.d.ts +1 -0
  357. package/dist/utils/hooks/useDelayed.js +13 -0
  358. package/dist/utils/hooks/useEventHandler.d.ts +6 -0
  359. package/dist/utils/hooks/useEventHandler.js +17 -0
  360. package/dist/utils/hooks/useLastQueryExecutionSettings.d.ts +2 -0
  361. package/dist/utils/hooks/useLastQueryExecutionSettings.js +5 -0
  362. package/dist/utils/hooks/useQueryExecutionSettings.d.ts +8 -0
  363. package/dist/utils/hooks/useQueryExecutionSettings.js +15 -0
  364. package/dist/utils/monaco/constats.d.ts +2 -0
  365. package/dist/utils/monaco/constats.js +2 -0
  366. package/dist/utils/monaco/yql/constants.d.ts +0 -1
  367. package/dist/utils/monaco/yql/constants.js +0 -1
  368. package/dist/utils/monaco/yql/yql.completionItemProvider.js +2 -2
  369. package/dist/utils/prepareQueryExplain.d.ts +3 -1
  370. package/dist/utils/prepareQueryExplain.js +54 -2
  371. package/dist/utils/query.d.ts +24 -1
  372. package/dist/utils/query.js +41 -0
  373. package/dist/utils/query.test.js +3 -0
  374. package/dist/utils/utils.d.ts +8 -7
  375. package/dist/utils/utils.js +23 -11
  376. package/package.json +8 -2
  377. package/dist/components/DeveloperUiLink/DeveloperUiLink.d.ts +0 -8
  378. package/dist/components/NodeHostWrapper/NodeHostWrapper.scss +0 -15
  379. package/dist/containers/Node/NodeStructure/Vdisk.d.ts +0 -6
  380. package/dist/containers/Node/NodeStructure/Vdisk.js +0 -13
  381. package/dist/containers/PDiskPage/PDiskGroups.d.ts +0 -9
  382. package/dist/containers/PDiskPage/PDiskGroups.js +0 -20
  383. package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/i18n/ru.json +0 -5
  384. package/dist/containers/Tenant/Query/ExplainResult/utils.d.ts +0 -2
  385. package/dist/containers/Tenant/Query/ExplainResult/utils.js +0 -4
  386. package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.d.ts +0 -5
  387. package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.js +0 -38
  388. package/dist/store/utils.d.ts +0 -23
  389. package/dist/store/utils.js +0 -49
  390. package/dist/types/api/restartPDisk.d.ts +0 -4
  391. package/dist/utils/hooks/useQueryModes.d.ts +0 -2
  392. package/dist/utils/hooks/useQueryModes.js +0 -5
  393. package/dist/utils/monaco/index.d.ts +0 -1
  394. package/dist/utils/monaco/index.js +0 -6
  395. package/dist/utils/monaco/s-expression/constants.d.ts +0 -1
  396. package/dist/utils/monaco/s-expression/constants.js +0 -1
  397. package/dist/utils/monaco/s-expression/registerLanguage.d.ts +0 -1
  398. package/dist/utils/monaco/s-expression/registerLanguage.js +0 -59
  399. package/dist/utils/monaco/yql/registerLanguage.d.ts +0 -1
  400. package/dist/utils/monaco/yql/registerLanguage.js +0 -8
  401. package/dist/utils/monaco/yql/yql.d.ts +0 -7
  402. package/dist/utils/monaco/yql/yql.js +0 -180
  403. package/dist/utils/monaco/yql/yql.keywords.d.ts +0 -3
  404. package/dist/utils/monaco/yql/yql.keywords.js +0 -3
  405. /package/dist/{types/api/restartPDisk.js → components/DateRange/__test__/fromDateRangeValues.test.d.ts} +0 -0
@@ -7,7 +7,7 @@ import { QueryResultTable } from '../../../../components/QueryResultTable';
7
7
  import { previewApi } from '../../../../store/reducers/preview';
8
8
  import { setShowPreview } from '../../../../store/reducers/schema/schema';
9
9
  import { cn } from '../../../../utils/cn';
10
- import { useAutoRefreshInterval, useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
10
+ import { useAutoRefreshInterval, useTypedDispatch } from '../../../../utils/hooks';
11
11
  import { parseQueryErrorToString } from '../../../../utils/query';
12
12
  import { isExternalTableType, isTableType } from '../../utils/schema';
13
13
  import i18n from '../i18n';
@@ -17,7 +17,6 @@ export const Preview = ({ database, path, type }) => {
17
17
  const dispatch = useTypedDispatch();
18
18
  const isPreviewAvailable = isTableType(type);
19
19
  const [autoRefreshInterval] = useAutoRefreshInterval();
20
- const isFullscreen = useTypedSelector((state) => state.fullscreen);
21
20
  const query = `--!syntax_v1\nselect * from \`${path}\` limit 32`;
22
21
  const { currentData, isFetching, error } = previewApi.useSendQueryQuery({ database, query, action: isExternalTableType(type) ? 'execute-query' : 'execute-scan' }, { pollingInterval: autoRefreshInterval, skip: !isPreviewAvailable });
23
22
  const loading = isFetching && currentData === undefined;
@@ -39,5 +38,5 @@ export const Preview = ({ database, path, type }) => {
39
38
  message = (_jsx("div", { className: b('message-container', 'error'), children: parseQueryErrorToString(error) }));
40
39
  }
41
40
  const content = message !== null && message !== void 0 ? message : (_jsx("div", { className: b('result'), children: _jsx(QueryResultTable, { data: data.result, columns: data.columns }) }));
42
- return (_jsxs("div", { className: b(), children: [renderHeader(), isFullscreen ? _jsx(Fullscreen, { children: content }) : content] }));
41
+ return (_jsxs("div", { className: b(), children: [renderHeader(), _jsx(Fullscreen, { children: content })] }));
43
42
  };
@@ -5,8 +5,7 @@ import { selectQueriesHistory } from '../../../../store/reducers/executeQuery';
5
5
  import { TENANT_QUERY_TABS_ID } from '../../../../store/reducers/tenant/constants';
6
6
  import { setQueryTab } from '../../../../store/reducers/tenant/tenant';
7
7
  import { cn } from '../../../../utils/cn';
8
- import { useQueryModes, useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
9
- import { QUERY_MODES, QUERY_SYNTAX } from '../../../../utils/query';
8
+ import { useTypedDispatch, useTypedSelector } from '../../../../utils/hooks';
10
9
  import { MAX_QUERY_HEIGHT, QUERY_TABLE_SETTINGS } from '../../utils/constants';
11
10
  import i18n from '../i18n';
12
11
  import './QueriesHistory.scss';
@@ -14,17 +13,9 @@ const b = cn('ydb-queries-history');
14
13
  const QUERIES_HISTORY_COLUMNS_WIDTH_LS_KEY = 'queriesHistoryTableColumnsWidth';
15
14
  function QueriesHistory({ changeUserInput }) {
16
15
  const dispatch = useTypedDispatch();
17
- const [queryMode, setQueryMode] = useQueryModes();
18
16
  const queriesHistory = useTypedSelector(selectQueriesHistory);
19
17
  const reversedHistory = [...queriesHistory].reverse();
20
18
  const onQueryClick = (query) => {
21
- if (query.syntax === QUERY_SYNTAX.pg && queryMode !== QUERY_MODES.pg) {
22
- setQueryMode(QUERY_MODES.pg);
23
- }
24
- else if (query.syntax !== QUERY_SYNTAX.pg && queryMode === QUERY_MODES.pg) {
25
- // Set query mode for queries with yql syntax
26
- setQueryMode(QUERY_MODES.script);
27
- }
28
19
  changeUserInput({ input: query.queryText });
29
20
  dispatch(setQueryTab(TENANT_QUERY_TABS_ID.newQuery));
30
21
  };
@@ -38,15 +29,6 @@ function QueriesHistory({ changeUserInput }) {
38
29
  sortable: false,
39
30
  width: 600,
40
31
  },
41
- {
42
- name: 'syntax',
43
- header: 'Syntax',
44
- render: ({ row }) => {
45
- return row.syntax === QUERY_SYNTAX.pg ? 'PostgreSQL' : 'YQL';
46
- },
47
- sortable: false,
48
- width: 200,
49
- },
50
32
  ];
51
33
  return (_jsx("div", { className: b(), children: _jsx(ResizeableDataTable, { columnsWidthLSKey: QUERIES_HISTORY_COLUMNS_WIDTH_LS_KEY, columns: columns, data: reversedHistory, settings: QUERY_TABLE_SETTINGS, emptyDataMessage: i18n('history.empty'), onRowClick: (row) => onQueryClick(row), rowClassName: () => b('table-row') }) }));
52
34
  }
@@ -10,5 +10,5 @@ export const QueryDuration = ({ duration }) => {
10
10
  return null;
11
11
  }
12
12
  const parsedDuration = formatDurationToShortTimeFormat(parseUsToMs(duration), 1);
13
- return (_jsx("span", { className: b(), children: _jsx(LabelWithPopover, { className: b('item-with-popover'), contentClassName: b('popover'), text: parsedDuration, popoverContent: i18n('query-duration.description') }) }));
13
+ return (_jsx("span", { className: b(), children: _jsx(LabelWithPopover, { className: b('item-with-popover'), contentClassName: b('popover-content'), text: parsedDuration, popoverClassName: b('popover'), popoverContent: i18n('query-duration.description'), buttonProps: { className: b('popover-button') } }) }));
14
14
  };
@@ -7,10 +7,21 @@
7
7
  color: var(--g-color-text-complementary);
8
8
 
9
9
  &__item-with-popover {
10
+ display: flex;
11
+
10
12
  white-space: nowrap;
11
13
  }
12
14
 
13
15
  &__popover {
16
+ display: flex;
17
+ align-items: center;
18
+ }
19
+
20
+ &__popover-content {
14
21
  max-width: 300px;
15
22
  }
23
+
24
+ &__popover-button {
25
+ display: flex;
26
+ }
16
27
  }
@@ -24,9 +24,9 @@ interface QueryEditorProps {
24
24
  }
25
25
  declare function QueryEditor(props: QueryEditorProps): import("react/jsx-runtime").JSX.Element;
26
26
  declare const _default: import("react-redux").ConnectedComponent<typeof QueryEditor, {
27
+ type?: EPathType;
27
28
  theme: string;
28
29
  path: string;
29
- type?: EPathType;
30
30
  tenantName: string;
31
31
  changeUserInput: (arg: {
32
32
  input: string;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
+ import { isEqual } from 'lodash';
3
4
  import throttle from 'lodash/throttle';
4
5
  import { connect } from 'react-redux';
5
6
  import { MonacoEditor } from '../../../../components/MonacoEditor/MonacoEditor';
@@ -9,15 +10,18 @@ import { explainQueryApi } from '../../../../store/reducers/explainQuery/explain
9
10
  import { setQueryAction } from '../../../../store/reducers/queryActions/queryActions';
10
11
  import { setShowPreview } from '../../../../store/reducers/schema/schema';
11
12
  import { cn } from '../../../../utils/cn';
12
- import { DEFAULT_IS_QUERY_RESULT_COLLAPSED, DEFAULT_SIZE_RESULT_PANE_KEY, LAST_USED_QUERY_ACTION_KEY, QUERY_USE_MULTI_SCHEMA_KEY, } from '../../../../utils/constants';
13
- import { useQueryModes, useSetting } from '../../../../utils/hooks';
14
- import { LANGUAGE_YQL_ID } from '../../../../utils/monaco/yql/constants';
13
+ import { DEFAULT_IS_QUERY_RESULT_COLLAPSED, DEFAULT_SIZE_RESULT_PANE_KEY, ENABLE_TRACING_LEVEL_KEY, LAST_USED_QUERY_ACTION_KEY, QUERY_USE_MULTI_SCHEMA_KEY, } from '../../../../utils/constants';
14
+ import { useEventHandler, useQueryExecutionSettings, useSetting } from '../../../../utils/hooks';
15
+ import { useChangedQuerySettings } from '../../../../utils/hooks/useChangedQuerySettings';
16
+ import { useLastQueryExecutionSettings } from '../../../../utils/hooks/useLastQueryExecutionSettings';
17
+ import { YQL_LANGUAGE_ID } from '../../../../utils/monaco/constats';
15
18
  import { QUERY_ACTIONS } from '../../../../utils/query';
16
19
  import { PaneVisibilityActionTypes, paneVisibilityToggleReducerCreator, } from '../../utils/paneVisibilityToggleHelpers';
17
20
  import { ExecuteResult } from '../ExecuteResult/ExecuteResult';
18
21
  import { ExplainResult } from '../ExplainResult/ExplainResult';
19
22
  import { Preview } from '../Preview/Preview';
20
23
  import { QueryEditorControls } from '../QueryEditorControls/QueryEditorControls';
24
+ import { QuerySettingsDialog } from '../QuerySettingsDialog/QuerySettingsDialog';
21
25
  import { SaveQueryDialog } from '../SaveQuery/SaveQuery';
22
26
  import i18n from '../i18n';
23
27
  import { useEditorOptions } from './helpers';
@@ -28,10 +32,6 @@ const RESULT_TYPES = {
28
32
  EXECUTE: 'execute',
29
33
  EXPLAIN: 'explain',
30
34
  };
31
- const MONACO_HOT_KEY_ACTIONS = {
32
- sendQuery: 'sendQuery',
33
- sendSelectedQuery: 'sendSelectedQuery',
34
- };
35
35
  const b = cn('query-editor');
36
36
  const initialTenantCommonInfoState = {
37
37
  triggerExpand: false,
@@ -40,14 +40,16 @@ const initialTenantCommonInfoState = {
40
40
  };
41
41
  function QueryEditor(props) {
42
42
  const editorOptions = useEditorOptions();
43
- const { tenantName, path, setTenantPath: setPath, setQueryAction, executeQuery, type, theme, changeUserInput, showPreview, } = props;
43
+ const { tenantName, path, setTenantPath: setPath, executeQuery, type, theme, changeUserInput, showPreview, } = props;
44
44
  const { tenantPath: savedPath } = executeQuery;
45
45
  const [resultType, setResultType] = React.useState(RESULT_TYPES.EXECUTE);
46
46
  const [isResultLoaded, setIsResultLoaded] = React.useState(false);
47
- const [queryMode, setQueryMode] = useQueryModes();
47
+ const [querySettings] = useQueryExecutionSettings();
48
+ const [enableTracingLevel] = useSetting(ENABLE_TRACING_LEVEL_KEY);
49
+ const [lastQueryExecutionSettings, setLastQueryExecutionSettings] = useLastQueryExecutionSettings();
50
+ const { resetBanner } = useChangedQuerySettings();
48
51
  const [useMultiSchema] = useSetting(QUERY_USE_MULTI_SCHEMA_KEY);
49
52
  const [lastUsedQueryAction, setLastUsedQueryAction] = useSetting(LAST_USED_QUERY_ACTION_KEY);
50
- const [monacoHotKey, setMonacoHotKey] = React.useState(null);
51
53
  const [sendExecuteQuery, executeQueryResult] = executeQueryApi.useExecuteQueryMutation();
52
54
  const [sendExplainQuery, explainQueryResult] = explainQueryApi.useExplainQueryMutation();
53
55
  React.useEffect(() => {
@@ -59,22 +61,6 @@ function QueryEditor(props) {
59
61
  }
60
62
  }, [changeUserInput, setPath, tenantName, savedPath]);
61
63
  const [resultVisibilityState, dispatchResultVisibilityState] = React.useReducer(paneVisibilityToggleReducerCreator(DEFAULT_IS_QUERY_RESULT_COLLAPSED), initialTenantCommonInfoState);
62
- const editorRef = React.useRef();
63
- React.useEffect(() => {
64
- const updateEditor = () => {
65
- if (editorRef.current) {
66
- editorRef.current.layout();
67
- }
68
- };
69
- const onChangeWindow = throttle(() => {
70
- updateEditor();
71
- }, 100);
72
- updateEditor();
73
- window.addEventListener('resize', onChangeWindow);
74
- return () => {
75
- window.removeEventListener('resize', onChangeWindow);
76
- };
77
- }, []);
78
64
  React.useEffect(() => {
79
65
  dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerCollapse);
80
66
  }, []);
@@ -86,41 +72,28 @@ function QueryEditor(props) {
86
72
  dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerCollapse);
87
73
  }
88
74
  }, [props.showPreview, isResultLoaded]);
89
- React.useEffect(() => {
75
+ const getLastQueryText = useEventHandler(() => {
90
76
  var _a;
91
- const { input, history } = executeQuery;
92
- const hasUnsavedInput = input
93
- ? input !== ((_a = history.queries[history.queries.length - 1]) === null || _a === void 0 ? void 0 : _a.queryText)
94
- : false;
95
- if (hasUnsavedInput) {
96
- window.onbeforeunload = (e) => {
97
- e.preventDefault();
98
- // Chrome requires returnValue to be set
99
- e.returnValue = '';
100
- };
101
- }
102
- else {
103
- window.onbeforeunload = null;
104
- }
105
- return () => {
106
- window.onbeforeunload = null;
107
- };
108
- }, [executeQuery]);
109
- const handleSendExecuteClick = (mode, text) => {
77
+ const { history } = executeQuery;
78
+ return ((_a = history.queries[history.queries.length - 1]) === null || _a === void 0 ? void 0 : _a.queryText) || '';
79
+ });
80
+ const handleSendExecuteClick = useEventHandler((text) => {
110
81
  var _a;
111
- if (!mode) {
112
- return;
113
- }
114
82
  const { input, history } = executeQuery;
115
83
  const schema = useMultiSchema ? 'multi' : 'modern';
116
84
  const query = text !== null && text !== void 0 ? text : input;
117
85
  setLastUsedQueryAction(QUERY_ACTIONS.execute);
86
+ if (!isEqual(lastQueryExecutionSettings, querySettings)) {
87
+ resetBanner();
88
+ setLastQueryExecutionSettings(querySettings);
89
+ }
118
90
  setResultType(RESULT_TYPES.EXECUTE);
119
91
  sendExecuteQuery({
120
92
  query,
121
93
  database: tenantName,
122
- mode,
94
+ querySettings,
123
95
  schema,
96
+ enableTracingLevel,
124
97
  });
125
98
  setIsResultLoaded(true);
126
99
  props.setShowPreview(false);
@@ -128,60 +101,45 @@ function QueryEditor(props) {
128
101
  if (!text) {
129
102
  const { queries, currentIndex } = history;
130
103
  if (query !== ((_a = queries[currentIndex]) === null || _a === void 0 ? void 0 : _a.queryText)) {
131
- props.saveQueryToHistory(input, mode);
104
+ props.saveQueryToHistory(input);
132
105
  }
133
106
  }
134
107
  dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerExpand);
108
+ });
109
+ const handleSettingsClick = () => {
110
+ props.setQueryAction('settings');
111
+ props.setShowPreview(false);
135
112
  };
136
- const handleGetExplainQueryClick = (mode) => {
113
+ const handleGetExplainQueryClick = useEventHandler(() => {
137
114
  const { input } = executeQuery;
138
115
  setLastUsedQueryAction(QUERY_ACTIONS.explain);
116
+ if (!isEqual(lastQueryExecutionSettings, querySettings)) {
117
+ resetBanner();
118
+ setLastQueryExecutionSettings(querySettings);
119
+ }
139
120
  setResultType(RESULT_TYPES.EXPLAIN);
140
121
  sendExplainQuery({
141
122
  query: input,
142
123
  database: tenantName,
143
- mode: mode,
124
+ querySettings,
125
+ enableTracingLevel,
144
126
  });
145
127
  setIsResultLoaded(true);
146
128
  props.setShowPreview(false);
147
129
  dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerExpand);
148
- };
149
- React.useEffect(() => {
150
- var _a, _b;
151
- if (monacoHotKey === null) {
152
- return;
130
+ });
131
+ const handleSendQuery = useEventHandler(() => {
132
+ if (lastUsedQueryAction === QUERY_ACTIONS.explain) {
133
+ handleGetExplainQueryClick();
153
134
  }
154
- setMonacoHotKey(null);
155
- switch (monacoHotKey) {
156
- case MONACO_HOT_KEY_ACTIONS.sendQuery: {
157
- if (lastUsedQueryAction === QUERY_ACTIONS.explain) {
158
- handleGetExplainQueryClick(queryMode);
159
- }
160
- else {
161
- handleSendExecuteClick(queryMode);
162
- }
163
- break;
164
- }
165
- case MONACO_HOT_KEY_ACTIONS.sendSelectedQuery: {
166
- const selection = (_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.getSelection();
167
- const model = (_b = editorRef.current) === null || _b === void 0 ? void 0 : _b.getModel();
168
- if (selection && model) {
169
- const text = model.getValueInRange({
170
- startLineNumber: selection.getSelectionStart().lineNumber,
171
- startColumn: selection.getSelectionStart().column,
172
- endLineNumber: selection.getPosition().lineNumber,
173
- endColumn: selection.getPosition().column,
174
- });
175
- handleSendExecuteClick(queryMode, text);
176
- }
177
- break;
178
- }
135
+ else {
136
+ handleSendExecuteClick();
179
137
  }
180
- // eslint-disable-next-line react-hooks/exhaustive-deps
181
- }, [monacoHotKey]);
138
+ });
182
139
  const editorDidMount = (editor, monaco) => {
183
140
  const keybindings = getKeyBindings(monaco);
184
- editorRef.current = editor;
141
+ initResizeHandler(editor);
142
+ initUserPrompt(editor, getLastQueryText);
185
143
  editor.focus();
186
144
  editor.addAction({
187
145
  id: 'sendQuery',
@@ -195,7 +153,7 @@ function QueryEditor(props) {
195
153
  contextMenuOrder: 1,
196
154
  // Method that will be executed when the action is triggered.
197
155
  // @param editor The editor instance is passed in as a convenience
198
- run: () => setMonacoHotKey(MONACO_HOT_KEY_ACTIONS.sendQuery),
156
+ run: () => handleSendQuery(),
199
157
  });
200
158
  const canSendSelectedText = editor.createContextKey('canSendSelectedText', false);
201
159
  editor.onDidChangeCursorSelection(({ selection, secondarySelections }) => {
@@ -211,7 +169,19 @@ function QueryEditor(props) {
211
169
  precondition: 'canSendSelectedText',
212
170
  contextMenuGroupId: CONTEXT_MENU_GROUP_ID,
213
171
  contextMenuOrder: 1,
214
- run: () => setMonacoHotKey(MONACO_HOT_KEY_ACTIONS.sendSelectedQuery),
172
+ run: (e) => {
173
+ const selection = e.getSelection();
174
+ const model = e.getModel();
175
+ if (selection && model) {
176
+ const text = model.getValueInRange({
177
+ startLineNumber: selection.getSelectionStart().lineNumber,
178
+ startColumn: selection.getSelectionStart().column,
179
+ endLineNumber: selection.getPosition().lineNumber,
180
+ endColumn: selection.getPosition().column,
181
+ });
182
+ handleSendExecuteClick(text);
183
+ }
184
+ },
215
185
  });
216
186
  editor.addAction({
217
187
  id: 'previous-query',
@@ -238,7 +208,7 @@ function QueryEditor(props) {
238
208
  label: i18n('action.save-query'),
239
209
  keybindings: [keybindings.saveQuery],
240
210
  run: () => {
241
- setQueryAction('save');
211
+ props.setQueryAction('save');
242
212
  },
243
213
  });
244
214
  };
@@ -255,11 +225,11 @@ function QueryEditor(props) {
255
225
  dispatchResultVisibilityState(PaneVisibilityActionTypes.clear);
256
226
  };
257
227
  const renderControls = () => {
258
- return (_jsx(QueryEditorControls, { onRunButtonClick: handleSendExecuteClick, runIsLoading: executeQueryResult.isLoading, onExplainButtonClick: handleGetExplainQueryClick, explainIsLoading: explainQueryResult.isLoading, disabled: !executeQuery.input, onUpdateQueryMode: setQueryMode, queryMode: queryMode, highlightedAction: lastUsedQueryAction }));
228
+ return (_jsx(QueryEditorControls, { handleSendExecuteClick: handleSendExecuteClick, onSettingsButtonClick: handleSettingsClick, runIsLoading: executeQueryResult.isLoading, handleGetExplainQueryClick: handleGetExplainQueryClick, explainIsLoading: explainQueryResult.isLoading, disabled: !executeQuery.input, highlightedAction: lastUsedQueryAction }));
259
229
  };
260
230
  return (_jsxs("div", { className: b(), children: [_jsxs(SplitPane, { direction: "vertical", defaultSizePaneKey: DEFAULT_SIZE_RESULT_PANE_KEY, triggerCollapse: resultVisibilityState.triggerCollapse, triggerExpand: resultVisibilityState.triggerExpand, minSize: [0, 52], collapsedSizes: [100, 0], onSplitStartDragAdditional: onSplitStartDragAdditional, children: [_jsxs("div", { className: b('pane-wrapper', {
261
231
  top: true,
262
- }), children: [_jsx("div", { className: b('monaco-wrapper'), children: _jsx("div", { className: b('monaco'), children: _jsx(MonacoEditor, { language: LANGUAGE_YQL_ID, value: executeQuery.input, options: editorOptions, onChange: onChange, editorDidMount: editorDidMount, theme: `vs-${theme}` }) }) }), renderControls()] }), _jsx("div", { className: b('pane-wrapper'), children: _jsx(Result, { executeQueryData: executeQueryResult.data, executeQueryError: executeQueryResult.error, explainQueryData: explainQueryResult.data, explainQueryError: explainQueryResult.error, explainQueryLoading: explainQueryResult.isLoading, resultVisibilityState: resultVisibilityState, onExpandResultHandler: onExpandResultHandler, onCollapseResultHandler: onCollapseResultHandler, type: type, theme: theme, resultType: resultType, tenantName: tenantName, path: path, showPreview: showPreview }) })] }), _jsx(SaveQueryDialog, {})] }));
232
+ }), children: [_jsx("div", { className: b('monaco-wrapper'), children: _jsx("div", { className: b('monaco'), children: _jsx(MonacoEditor, { language: YQL_LANGUAGE_ID, value: executeQuery.input, options: editorOptions, onChange: onChange, editorDidMount: editorDidMount, theme: `vs-${theme}` }) }) }), renderControls()] }), _jsx("div", { className: b('pane-wrapper'), children: _jsx(Result, { executeQueryData: executeQueryResult.data, executeQueryError: executeQueryResult.error, explainQueryData: explainQueryResult.data, explainQueryError: explainQueryResult.error, explainQueryLoading: explainQueryResult.isLoading, resultVisibilityState: resultVisibilityState, onExpandResultHandler: onExpandResultHandler, onCollapseResultHandler: onCollapseResultHandler, type: type, theme: theme, resultType: resultType, tenantName: tenantName, path: path, showPreview: showPreview }) })] }), _jsx(SaveQueryDialog, {}), _jsx(QuerySettingsDialog, {})] }));
263
233
  }
264
234
  const mapStateToProps = (state) => {
265
235
  return {
@@ -282,14 +252,45 @@ function Result({ executeQueryData, executeQueryError, explainQueryData, explain
282
252
  }
283
253
  if (resultType === RESULT_TYPES.EXECUTE) {
284
254
  if (executeQueryData || executeQueryError) {
285
- const { stats, ...data } = executeQueryData || {};
286
- return (_jsx(ExecuteResult, { data: data, stats: stats, error: executeQueryError, isResultsCollapsed: resultVisibilityState.collapsed, onExpandResults: onExpandResultHandler, onCollapseResults: onCollapseResultHandler }));
255
+ return (_jsx(ExecuteResult, { data: executeQueryData, error: executeQueryError, isResultsCollapsed: resultVisibilityState.collapsed, onExpandResults: onExpandResultHandler, onCollapseResults: onCollapseResultHandler, theme: theme }));
287
256
  }
288
257
  return null;
289
258
  }
290
259
  if (resultType === RESULT_TYPES.EXPLAIN) {
291
- const { plan, ast } = explainQueryData || {};
292
- return (_jsx(ExplainResult, { error: explainQueryError, explain: plan, ast: ast, loading: explainQueryLoading, theme: theme, isResultsCollapsed: resultVisibilityState.collapsed, onExpandResults: onExpandResultHandler, onCollapseResults: onCollapseResultHandler }));
260
+ const { plan, ast, simplifiedPlan } = explainQueryData || {};
261
+ return (_jsx(ExplainResult, { error: explainQueryError, explain: plan, simplifiedPlan: simplifiedPlan, ast: ast, loading: explainQueryLoading, theme: theme, isResultsCollapsed: resultVisibilityState.collapsed, onExpandResults: onExpandResultHandler, onCollapseResults: onCollapseResultHandler }));
293
262
  }
294
263
  return null;
295
264
  }
265
+ function initResizeHandler(editor) {
266
+ const layoutEditor = throttle(() => {
267
+ editor.layout();
268
+ }, 100);
269
+ editor.layout();
270
+ window.addEventListener('resize', layoutEditor);
271
+ editor.onDidDispose(() => {
272
+ window.removeEventListener('resize', layoutEditor);
273
+ });
274
+ }
275
+ function initUserPrompt(editor, getInitialText) {
276
+ setUserPrompt(editor.getValue(), getInitialText());
277
+ editor.onDidChangeModelContent(() => {
278
+ setUserPrompt(editor.getValue(), getInitialText());
279
+ });
280
+ editor.onDidDispose(() => {
281
+ window.onbeforeunload = null;
282
+ });
283
+ }
284
+ function setUserPrompt(text, initialText) {
285
+ const hasUnsavedInput = text ? text !== initialText : false;
286
+ if (hasUnsavedInput) {
287
+ window.onbeforeunload = (e) => {
288
+ e.preventDefault();
289
+ // Chrome requires returnValue to be set
290
+ e.returnValue = '';
291
+ };
292
+ }
293
+ else {
294
+ window.onbeforeunload = null;
295
+ }
296
+ }
@@ -1,14 +1,13 @@
1
- import type { QueryAction, QueryMode } from '../../../../types/store/query';
1
+ import type { QueryAction } from '../../../../types/store/query';
2
2
  import './QueryEditorControls.scss';
3
3
  interface QueryEditorControlsProps {
4
- onRunButtonClick: (mode?: QueryMode) => void;
4
+ handleSendExecuteClick: () => void;
5
+ onSettingsButtonClick: () => void;
5
6
  runIsLoading: boolean;
6
- onExplainButtonClick: (mode?: QueryMode) => void;
7
+ handleGetExplainQueryClick: () => void;
7
8
  explainIsLoading: boolean;
8
9
  disabled: boolean;
9
- onUpdateQueryMode: (mode: QueryMode) => void;
10
- queryMode: QueryMode;
11
10
  highlightedAction: QueryAction;
12
11
  }
13
- export declare const QueryEditorControls: ({ onRunButtonClick, runIsLoading, onExplainButtonClick, explainIsLoading, disabled, onUpdateQueryMode, queryMode, highlightedAction, }: QueryEditorControlsProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const QueryEditorControls: ({ handleSendExecuteClick, onSettingsButtonClick, runIsLoading, handleGetExplainQueryClick, explainIsLoading, disabled, highlightedAction, }: QueryEditorControlsProps) => import("react/jsx-runtime").JSX.Element;
14
13
  export {};
@@ -1,57 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { ChevronDown, PlayFill } from '@gravity-ui/icons';
4
- import { Button, DropdownMenu, Icon } from '@gravity-ui/uikit';
5
- import { LabelWithPopover } from '../../../../components/LabelWithPopover';
2
+ import { Gear, PlayFill } from '@gravity-ui/icons';
3
+ import { Button, Icon, Tooltip } from '@gravity-ui/uikit';
4
+ import QuerySettingsDescription from '../../../../components/QuerySettingsDescription/QuerySettingsDescription';
6
5
  import { cn } from '../../../../utils/cn';
7
- import { QUERY_MODES, QUERY_MODES_TITLES } from '../../../../utils/query';
6
+ import { useChangedQuerySettings } from '../../../../utils/hooks/useChangedQuerySettings';
8
7
  import { SaveQuery } from '../SaveQuery/SaveQuery';
9
8
  import i18n from '../i18n';
10
9
  import './QueryEditorControls.scss';
11
- const queryModeSelectorQa = 'query-mode-selector';
12
- const queryModeSelectorPopupQa = 'query-mode-selector-popup';
13
10
  const b = cn('ydb-query-editor-controls');
14
- const QueryModeSelectorOptions = {
15
- [QUERY_MODES.script]: {
16
- title: QUERY_MODES_TITLES[QUERY_MODES.script],
17
- description: i18n('method-description.script'),
18
- },
19
- [QUERY_MODES.scan]: {
20
- title: QUERY_MODES_TITLES[QUERY_MODES.scan],
21
- description: i18n('method-description.scan'),
22
- },
23
- [QUERY_MODES.data]: {
24
- title: QUERY_MODES_TITLES[QUERY_MODES.data],
25
- description: i18n('method-description.data'),
26
- },
27
- [QUERY_MODES.query]: {
28
- title: QUERY_MODES_TITLES[QUERY_MODES.query],
29
- description: i18n('method-description.query'),
30
- },
31
- [QUERY_MODES.pg]: {
32
- title: QUERY_MODES_TITLES[QUERY_MODES.pg],
33
- description: i18n('method-description.pg'),
34
- },
11
+ const SettingsButton = ({ onClick, runIsLoading }) => {
12
+ const { changedCurrentSettings, changedCurrentSettingsDescriptions } = useChangedQuerySettings();
13
+ const extraGearProps = changedCurrentSettings.length > 0
14
+ ? { view: 'outlined-info', selected: true }
15
+ : null;
16
+ return (_jsx(Tooltip, { disabled: changedCurrentSettings.length === 0, content: _jsx(QuerySettingsDescription, { prefix: i18n('gear.tooltip'), querySettings: changedCurrentSettingsDescriptions }), openDelay: 0, placement: ['top-start'], children: _jsxs(Button, { onClick: onClick, loading: runIsLoading, className: b('gear-button'), ...extraGearProps, children: [_jsx(Icon, { data: Gear, size: 16 }), extraGearProps ? (_jsxs("div", { className: b('changed-settings'), children: ["(", changedCurrentSettings.length, ")"] })) : null] }) }));
35
17
  };
36
- export const QueryEditorControls = ({ onRunButtonClick, runIsLoading, onExplainButtonClick, explainIsLoading, disabled, onUpdateQueryMode, queryMode, highlightedAction, }) => {
37
- const querySelectorMenuItems = React.useMemo(() => {
38
- return Object.entries(QueryModeSelectorOptions).map(([mode, { title, description }]) => {
39
- return {
40
- text: (_jsx(LabelWithPopover, { className: b('item-with-popover'), contentClassName: b('popover'), text: title, popoverContent: description })),
41
- action: () => {
42
- onUpdateQueryMode(mode);
43
- },
44
- };
45
- });
46
- }, [onUpdateQueryMode]);
18
+ export const QueryEditorControls = ({ handleSendExecuteClick, onSettingsButtonClick, runIsLoading, handleGetExplainQueryClick, explainIsLoading, disabled, highlightedAction, }) => {
47
19
  const runView = highlightedAction === 'execute' ? 'action' : undefined;
48
20
  const explainView = highlightedAction === 'explain' ? 'action' : undefined;
49
- return (_jsxs("div", { className: b(), children: [_jsxs("div", { className: b('left'), children: [_jsxs(Button, { onClick: () => {
50
- onRunButtonClick(queryMode);
51
- }, disabled: disabled, loading: runIsLoading, view: runView, children: [_jsx(Icon, { data: PlayFill, size: 14 }), 'Run'] }), _jsx(Button, { onClick: () => {
52
- onExplainButtonClick(queryMode);
53
- }, disabled: disabled, loading: explainIsLoading, view: explainView, children: "Explain" }), _jsx("div", { className: b('mode-selector'), children: _jsx(DropdownMenu, { items: querySelectorMenuItems, popupProps: {
54
- className: b('mode-selector__popup'),
55
- qa: queryModeSelectorPopupQa,
56
- }, switcher: _jsx(Button, { className: b('mode-selector__button'), qa: queryModeSelectorQa, children: _jsxs("span", { className: b('mode-selector__button-content'), children: [`${i18n('controls.query-mode-selector_type')} ${QueryModeSelectorOptions[queryMode].title}`, _jsx(Icon, { data: ChevronDown })] }) }) }) })] }), _jsx(SaveQuery, { isSaveButtonDisabled: disabled })] }));
21
+ const onRunButtonClick = () => {
22
+ handleSendExecuteClick();
23
+ };
24
+ const onExplainButtonClick = () => {
25
+ handleGetExplainQueryClick();
26
+ };
27
+ return (_jsxs("div", { className: b(), children: [_jsxs("div", { className: b('left'), children: [_jsxs(Button, { onClick: onRunButtonClick, disabled: disabled, loading: runIsLoading, view: runView, className: b('run-button'), children: [_jsx(Icon, { data: PlayFill, size: 14 }), 'Run'] }), _jsx(Button, { onClick: onExplainButtonClick, disabled: disabled, loading: explainIsLoading, view: explainView, children: "Explain" }), _jsx(SettingsButton, { onClick: onSettingsButtonClick, runIsLoading: runIsLoading })] }), _jsx(SaveQuery, { isSaveButtonDisabled: disabled })] }));
57
28
  };
@@ -0,0 +1,2 @@
1
+ import type { QuerySettings } from '../../../../../types/store/query';
2
+ export default function getChangedQueryExecutionSettings(currentSettings: QuerySettings, defaultSettings: QuerySettings): (keyof QuerySettings)[];
@@ -0,0 +1,5 @@
1
+ export default function getChangedQueryExecutionSettings(currentSettings, defaultSettings) {
2
+ const currentMap = new Map(Object.entries(currentSettings));
3
+ const defaultMap = new Map(Object.entries(defaultSettings));
4
+ return Array.from(currentMap.keys()).filter((key) => currentMap.get(key) !== defaultMap.get(key));
5
+ }
@@ -0,0 +1,42 @@
1
+ import { ISOLATION_LEVELS, QUERY_MODES, STATISTICS_MODES, TRACING_LEVELS, } from '../../../../../utils/query';
2
+ const DEFAULT_QUERY_SETTINGS = {
3
+ queryMode: QUERY_MODES.script,
4
+ isolationLevel: ISOLATION_LEVELS.serializable,
5
+ timeout: '60',
6
+ statisticsMode: STATISTICS_MODES.none,
7
+ tracingLevel: TRACING_LEVELS.detailed,
8
+ };
9
+ import getChangedQueryExecutionSettings from './getChangedQueryExecutionSettings';
10
+ describe('getChangedQueryExecutionSettings', () => {
11
+ it('should return an empty array if no settings have changed', () => {
12
+ const currentSettings = { ...DEFAULT_QUERY_SETTINGS };
13
+ const result = getChangedQueryExecutionSettings(currentSettings, DEFAULT_QUERY_SETTINGS);
14
+ expect(result).toEqual([]);
15
+ });
16
+ it('should return the keys of settings that have changed', () => {
17
+ const currentSettings = {
18
+ ...DEFAULT_QUERY_SETTINGS,
19
+ queryMode: QUERY_MODES.data,
20
+ timeout: '30',
21
+ };
22
+ const result = getChangedQueryExecutionSettings(currentSettings, DEFAULT_QUERY_SETTINGS);
23
+ expect(result).toEqual(['queryMode', 'timeout']);
24
+ });
25
+ it('should return all keys if all settings have changed', () => {
26
+ const currentSettings = {
27
+ queryMode: QUERY_MODES.data,
28
+ isolationLevel: ISOLATION_LEVELS.onlinero,
29
+ timeout: '90',
30
+ statisticsMode: STATISTICS_MODES.basic,
31
+ tracingLevel: TRACING_LEVELS.basic,
32
+ };
33
+ const result = getChangedQueryExecutionSettings(currentSettings, DEFAULT_QUERY_SETTINGS);
34
+ expect(result).toEqual([
35
+ 'queryMode',
36
+ 'isolationLevel',
37
+ 'timeout',
38
+ 'statisticsMode',
39
+ 'tracingLevel',
40
+ ]);
41
+ });
42
+ });
@@ -0,0 +1,5 @@
1
+ import type { QuerySettings } from '../../../../../types/store/query';
2
+ export default function getChangedQueryExecutionSettingsDescription({ currentSettings, defaultSettings, }: {
3
+ currentSettings: QuerySettings;
4
+ defaultSettings: QuerySettings;
5
+ }): Record<string, string>;
@@ -0,0 +1,19 @@
1
+ import { QUERY_SETTINGS_FIELD_SETTINGS } from '../../QuerySettingsDialog/constants';
2
+ import getChangedQueryExecutionSettings from './getChangedQueryExecutionSettings';
3
+ export default function getChangedQueryExecutionSettingsDescription({ currentSettings, defaultSettings, }) {
4
+ const keys = getChangedQueryExecutionSettings(currentSettings, defaultSettings);
5
+ const result = {};
6
+ keys.forEach((key) => {
7
+ var _a;
8
+ const settings = QUERY_SETTINGS_FIELD_SETTINGS[key];
9
+ const currentValue = currentSettings[key];
10
+ if ('options' in settings) {
11
+ const content = (_a = settings.options.find((option) => option.value === currentValue)) === null || _a === void 0 ? void 0 : _a.content;
12
+ result[settings.title] = content;
13
+ }
14
+ else {
15
+ result[settings.title] = currentValue;
16
+ }
17
+ });
18
+ return result;
19
+ }