ydb-embedded-ui 6.6.0 → 6.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (332) hide show
  1. package/dist/package.json +4 -3
  2. package/dist/src/containers/App/App.d.ts +1 -1
  3. package/dist/{containers → src/containers}/App/App.scss +5 -0
  4. package/dist/src/containers/App/Content.js +1 -1
  5. package/dist/src/containers/App/appSlots.d.ts +1 -1
  6. package/dist/src/containers/AsideNavigation/Navigation.js +1 -3
  7. package/dist/src/containers/AsideNavigation/i18n/en.json +0 -2
  8. package/dist/src/containers/AsideNavigation/i18n/index.d.ts +1 -1
  9. package/dist/src/containers/AsideNavigation/i18n/index.js +1 -2
  10. package/dist/src/containers/Cluster/i18n/index.d.ts +1 -1
  11. package/dist/src/containers/Clusters/constants.d.ts +1 -1
  12. package/dist/src/containers/Header/Header.js +17 -21
  13. package/dist/{containers → src/containers}/Header/Header.scss +14 -5
  14. package/dist/src/containers/Header/breadcrumbs.js +65 -71
  15. package/dist/src/containers/Heatmap/Heatmap.js +3 -3
  16. package/dist/src/containers/Nodes/Nodes.js +4 -4
  17. package/dist/src/containers/Nodes/VirtualNodes.js +2 -2
  18. package/dist/src/containers/Storage/Storage.js +2 -2
  19. package/dist/src/containers/Tablets/Tablets.js +8 -8
  20. package/dist/src/containers/TabletsFilters/TabletsFilters.d.ts +2 -57
  21. package/dist/src/containers/TabletsFilters/TabletsFilters.js +70 -180
  22. package/dist/src/containers/Tenant/Acl/Acl.d.ts +3 -1
  23. package/dist/src/containers/Tenant/Acl/Acl.js +7 -17
  24. package/dist/src/containers/Tenant/Diagnostics/Autorefresh/AutorefreshControl.js +4 -5
  25. package/dist/src/containers/Tenant/Diagnostics/Consumers/Consumers.js +3 -3
  26. package/dist/src/containers/Tenant/Diagnostics/Describe/Describe.d.ts +2 -2
  27. package/dist/src/containers/Tenant/Diagnostics/Describe/Describe.js +5 -6
  28. package/dist/src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.d.ts +1 -0
  29. package/dist/src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.js +3 -5
  30. package/dist/src/containers/Tenant/Diagnostics/Diagnostics.d.ts +2 -0
  31. package/dist/src/containers/Tenant/Diagnostics/Diagnostics.js +26 -50
  32. package/dist/{containers → src/containers}/Tenant/Diagnostics/Diagnostics.scss +1 -1
  33. package/dist/src/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +19 -58
  34. package/dist/src/containers/Tenant/Diagnostics/Network/Network.d.ts +2 -2
  35. package/dist/src/containers/Tenant/Diagnostics/Network/Network.js +5 -5
  36. package/dist/src/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js +1 -6
  37. package/dist/src/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.d.ts +2 -1
  38. package/dist/src/containers/Tenant/Diagnostics/Overview/ChangefeedInfo/ChangefeedInfo.js +3 -8
  39. package/dist/src/containers/Tenant/Diagnostics/Overview/Overview.d.ts +2 -2
  40. package/dist/src/containers/Tenant/Diagnostics/Overview/Overview.js +19 -21
  41. package/dist/{containers → src/containers}/Tenant/Diagnostics/Overview/TableInfo/TableInfo.scss +0 -2
  42. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicInfo/TopicInfo.d.ts +2 -1
  43. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicInfo/TopicInfo.js +3 -8
  44. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.d.ts +3 -1
  45. package/dist/src/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.js +5 -5
  46. package/dist/src/containers/Tenant/Diagnostics/Partitions/Partitions.js +4 -12
  47. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss +100 -0
  48. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.d.ts +2 -5
  49. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.js +7 -2
  50. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.d.ts +1 -6
  51. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +22 -16
  52. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.d.ts +2 -8
  53. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.js +2 -2
  54. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.d.ts +2 -2
  55. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TenantCpu.js +2 -2
  56. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.d.ts +2 -2
  57. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +4 -4
  58. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.d.ts +2 -2
  59. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +4 -4
  60. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.d.ts +2 -2
  61. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +4 -4
  62. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.d.ts +2 -1
  63. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +5 -5
  64. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantDashboard/TenantDashboard.js +3 -3
  65. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.d.ts +2 -2
  66. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.js +2 -2
  67. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.d.ts +2 -2
  68. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +4 -4
  69. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +7 -9
  70. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +3 -3
  71. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +3 -3
  72. package/dist/src/containers/Tenant/Diagnostics/TenantOverview/useHealthcheck.js +1 -1
  73. package/dist/src/containers/Tenant/Diagnostics/TopQueries/TopQueries.d.ts +2 -2
  74. package/dist/src/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +5 -5
  75. package/dist/src/containers/Tenant/Diagnostics/TopShards/TopShards.d.ts +3 -2
  76. package/dist/src/containers/Tenant/Diagnostics/TopShards/TopShards.js +8 -8
  77. package/dist/src/containers/Tenant/Info/ExternalDataSource/ExternalDataSource.js +0 -6
  78. package/dist/src/containers/Tenant/Info/ExternalTable/ExternalTable.js +0 -6
  79. package/dist/src/containers/Tenant/Info/View/View.js +0 -6
  80. package/dist/src/containers/Tenant/ObjectGeneral/ObjectGeneral.d.ts +2 -1
  81. package/dist/src/containers/Tenant/ObjectGeneral/ObjectGeneral.js +7 -13
  82. package/dist/src/containers/Tenant/ObjectSummary/ObjectSummary.d.ts +4 -4
  83. package/dist/src/containers/Tenant/ObjectSummary/ObjectSummary.js +159 -63
  84. package/dist/src/containers/Tenant/Query/Issues/Issues.js +6 -5
  85. package/dist/src/containers/Tenant/Query/Preview/Preview.d.ts +2 -1
  86. package/dist/src/containers/Tenant/Query/Preview/Preview.js +6 -6
  87. package/dist/src/containers/Tenant/Query/Query.d.ts +1 -0
  88. package/dist/{containers → src/containers}/Tenant/Query/Query.scss +1 -1
  89. package/dist/src/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +2 -0
  90. package/dist/src/containers/Tenant/Query/QueryEditor/QueryEditor.js +9 -22
  91. package/dist/src/containers/Tenant/Query/i18n/en.json +1 -1
  92. package/dist/src/containers/Tenant/Schema/SchemaTree/SchemaTree.d.ts +1 -0
  93. package/dist/src/containers/Tenant/Schema/SchemaTree/SchemaTree.js +11 -19
  94. package/dist/src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.d.ts +2 -2
  95. package/dist/src/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +13 -8
  96. package/dist/src/containers/Tenant/Schema/SchemaViewer/columns.d.ts +2 -1
  97. package/dist/src/containers/Tenant/Schema/SchemaViewer/columns.js +21 -2
  98. package/dist/src/containers/Tenant/Schema/SchemaViewer/i18n/en.json +1 -0
  99. package/dist/src/containers/Tenant/Schema/SchemaViewer/i18n/index.d.ts +1 -1
  100. package/dist/src/containers/Tenant/Schema/SchemaViewer/prepareData.js +2 -1
  101. package/dist/src/containers/Tenant/Schema/SchemaViewer/types.d.ts +1 -0
  102. package/dist/src/containers/Tenant/Tenant.js +20 -36
  103. package/dist/{containers → src/containers}/Tenant/Tenant.scss +4 -0
  104. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.d.ts +2 -0
  105. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.js +19 -0
  106. package/dist/src/containers/Tenant/TenantNavigation/TenantNavigation.scss +18 -0
  107. package/dist/src/containers/Tenant/TenantNavigation/useTenantNavigation.d.ts +9 -0
  108. package/dist/src/containers/Tenant/TenantNavigation/useTenantNavigation.js +44 -0
  109. package/dist/src/containers/Tenant/i18n/en.json +17 -0
  110. package/dist/src/containers/Tenant/i18n/index.d.ts +1 -1
  111. package/dist/src/containers/Tenant/utils/queryTemplates.d.ts +1 -0
  112. package/dist/src/containers/Tenant/utils/queryTemplates.js +12 -0
  113. package/dist/src/containers/Tenant/utils/schema.d.ts +1 -1
  114. package/dist/src/containers/Tenant/utils/schema.js +5 -6
  115. package/dist/src/containers/Tenant/utils/schemaActions.js +3 -1
  116. package/dist/src/lib.d.ts +3 -2
  117. package/dist/src/lib.js +2 -2
  118. package/dist/src/routes.d.ts +1 -1
  119. package/dist/src/routes.js +3 -1
  120. package/dist/src/services/api.d.ts +6 -1
  121. package/dist/src/services/api.js +23 -3
  122. package/dist/src/services/settings.d.ts +1 -0
  123. package/dist/src/services/settings.js +3 -2
  124. package/dist/src/store/configureStore.d.ts +36 -134
  125. package/dist/src/store/configureStore.js +2 -15
  126. package/dist/src/store/defaultStore.d.ts +17 -81
  127. package/dist/src/store/reducers/api.js +0 -1
  128. package/dist/src/store/reducers/authentication/authentication.d.ts +51 -243
  129. package/dist/src/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +196 -849
  130. package/dist/src/store/reducers/healthcheckInfo/healthcheckInfo.js +3 -3
  131. package/dist/src/store/reducers/hotKeys/hotKeys.d.ts +6 -25
  132. package/dist/src/store/reducers/hotKeys/hotKeys.js +36 -49
  133. package/dist/src/store/reducers/index.d.ts +23 -100
  134. package/dist/src/store/reducers/index.js +0 -8
  135. package/dist/src/store/reducers/node/selectors.d.ts +0 -40
  136. package/dist/src/store/reducers/nodesList.d.ts +0 -40
  137. package/dist/src/store/reducers/schema/schema.d.ts +13 -149
  138. package/dist/src/store/reducers/schema/schema.js +45 -90
  139. package/dist/src/store/reducers/schema/types.d.ts +2 -21
  140. package/dist/src/store/reducers/schemaAcl/schemaAcl.d.ts +8 -135
  141. package/dist/src/store/reducers/schemaAcl/schemaAcl.js +18 -44
  142. package/dist/src/store/reducers/settings/settings.d.ts +17 -23
  143. package/dist/src/store/reducers/settings/settings.js +40 -33
  144. package/dist/src/store/reducers/settings/types.d.ts +1 -12
  145. package/dist/src/store/reducers/tablets.d.ts +288 -41
  146. package/dist/src/store/reducers/tablets.js +8 -4
  147. package/dist/src/store/reducers/tabletsFilters.d.ts +11 -164
  148. package/dist/src/store/reducers/tabletsFilters.js +14 -76
  149. package/dist/src/store/reducers/tenants/selectors.d.ts +8 -362
  150. package/dist/src/store/reducers/topic.d.ts +0 -600
  151. package/dist/src/store/state-url-mapping.js +0 -3
  152. package/dist/src/types/api/tenant.d.ts +1 -7
  153. package/dist/src/types/api/tenant.js +0 -8
  154. package/dist/src/utils/__test__/monitoring.test.js +1 -1
  155. package/dist/src/utils/constants.d.ts +1 -1
  156. package/dist/src/utils/constants.js +1 -1
  157. package/dist/src/utils/dataFormatters/dataFormatters.d.ts +2 -1
  158. package/dist/src/utils/dataFormatters/dataFormatters.js +7 -3
  159. package/dist/src/utils/hooks/index.d.ts +1 -0
  160. package/dist/src/utils/hooks/index.js +1 -0
  161. package/dist/src/utils/hooks/useAutoRefreshInterval.d.ts +1 -0
  162. package/dist/src/utils/hooks/useAutoRefreshInterval.js +5 -0
  163. package/dist/src/utils/monitoring.d.ts +2 -1
  164. package/dist/src/utils/monitoring.js +1 -4
  165. package/dist/src/utils/utils.js +2 -1
  166. package/package.json +4 -3
  167. package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss +0 -109
  168. package/dist/src/components/InfoViewer/schemaOverview/CDCStreamOverview.d.ts +0 -6
  169. package/dist/src/components/InfoViewer/schemaOverview/CDCStreamOverview.js +0 -17
  170. package/dist/src/components/InfoViewer/schemaOverview/PersQueueGroupOverview.d.ts +0 -6
  171. package/dist/src/components/InfoViewer/schemaOverview/PersQueueGroupOverview.js +0 -20
  172. package/dist/src/components/InfoViewer/schemaOverview/index.d.ts +0 -2
  173. package/dist/src/components/InfoViewer/schemaOverview/index.js +0 -2
  174. package/dist/src/containers/AsideNavigation/i18n/ru.json +0 -10
  175. package/dist/src/containers/AsideNavigation/useNavigationMenuItems.d.ts +0 -2
  176. package/dist/src/containers/AsideNavigation/useNavigationMenuItems.js +0 -54
  177. package/dist/src/store/reducers/host.d.ts +0 -130
  178. package/dist/src/store/reducers/host.js +0 -26
  179. package/dist/src/store/reducers/hotKeys/types.d.ts +0 -10
  180. package/dist/src/store/reducers/hotKeys/types.js +0 -1
  181. package/dist/src/store/reducers/schemaAcl/types.d.ts +0 -12
  182. package/dist/src/store/reducers/schemaAcl/types.js +0 -1
  183. package/dist/src/types/store/host.d.ts +0 -15
  184. package/dist/src/types/store/host.js +0 -1
  185. package/dist/styles/constants.scss +0 -9
  186. /package/dist/{assets → src/assets}/icons/cluster.svg +0 -0
  187. /package/dist/{assets → src/assets}/icons/databases.svg +0 -0
  188. /package/dist/{assets → src/assets}/icons/disableFullscreen.svg +0 -0
  189. /package/dist/{assets → src/assets}/icons/emptyState.svg +0 -0
  190. /package/dist/{assets → src/assets}/icons/key.svg +0 -0
  191. /package/dist/{assets → src/assets}/icons/monitoring.svg +0 -0
  192. /package/dist/{assets → src/assets}/icons/network.svg +0 -0
  193. /package/dist/{assets → src/assets}/icons/user-check.svg +0 -0
  194. /package/dist/{assets → src/assets}/icons/user-secret.svg +0 -0
  195. /package/dist/{assets → src/assets}/icons/ydb.svg +0 -0
  196. /package/dist/{assets → src/assets}/illustrations/dark/403.svg +0 -0
  197. /package/dist/{assets → src/assets}/illustrations/dark/error.svg +0 -0
  198. /package/dist/{assets → src/assets}/illustrations/dark/thumbsUp.svg +0 -0
  199. /package/dist/{assets → src/assets}/illustrations/light/403.svg +0 -0
  200. /package/dist/{assets → src/assets}/illustrations/light/error.svg +0 -0
  201. /package/dist/{assets → src/assets}/illustrations/light/thumbsUp.svg +0 -0
  202. /package/dist/{components → src/components}/BasicNodeViewer/BasicNodeViewer.scss +0 -0
  203. /package/dist/{components → src/components}/CellWithPopover/CellWithPopover.scss +0 -0
  204. /package/dist/{components → src/components}/CircularProgressBar/CircularProgressBar.scss +0 -0
  205. /package/dist/{components → src/components}/CriticalActionDialog/CriticalActionDialog.scss +0 -0
  206. /package/dist/{components → src/components}/DateRange/DateRange.scss +0 -0
  207. /package/dist/{components → src/components}/DiagnosticCard/DiagnosticCard.scss +0 -0
  208. /package/dist/{components → src/components}/DiskPageTitle/DiskPageTitle.scss +0 -0
  209. /package/dist/{components → src/components}/DiskStateProgressBar/DiskStateProgressBar.scss +0 -0
  210. /package/dist/{components → src/components}/Divider/Divider.scss +0 -0
  211. /package/dist/{components → src/components}/EmptyState/EmptyState.scss +0 -0
  212. /package/dist/{components → src/components}/EntityStatus/EntityStatus.scss +0 -0
  213. /package/dist/{components → src/components}/ErrorBoundary/ErrorBoundary.scss +0 -0
  214. /package/dist/{components → src/components}/FullNodeViewer/FullNodeViewer.scss +0 -0
  215. /package/dist/{components → src/components}/Fullscreen/Fullscreen.scss +0 -0
  216. /package/dist/{components → src/components}/InfoViewer/InfoViewer.scss +0 -0
  217. /package/dist/{components → src/components}/InfoViewerSkeleton/InfoViewerSkeleton.scss +0 -0
  218. /package/dist/{components → src/components}/LagPopoverContent/LagPopoverContent.scss +0 -0
  219. /package/dist/{components → src/components}/LinkWithIcon/LinkWithIcon.scss +0 -0
  220. /package/dist/{components → src/components}/Loader/Loader.scss +0 -0
  221. /package/dist/{components → src/components}/MetricChart/MetricChart.scss +0 -0
  222. /package/dist/{components → src/components}/MonitoringButton/MonitoringButton.scss +0 -0
  223. /package/dist/{components → src/components}/NodeHostWrapper/NodeHostWrapper.scss +0 -0
  224. /package/dist/{components → src/components}/PDiskInfo/PDiskInfo.scss +0 -0
  225. /package/dist/{components → src/components}/PDiskPopup/PDiskPopup.scss +0 -0
  226. /package/dist/{components → src/components}/PageMeta/PageMeta.scss +0 -0
  227. /package/dist/{components → src/components}/PoolBar/PoolBar.scss +0 -0
  228. /package/dist/{components → src/components}/PoolUsage/PoolUsage.scss +0 -0
  229. /package/dist/{components → src/components}/PoolsGraph/PoolsGraph.scss +0 -0
  230. /package/dist/{components → src/components}/ProgressViewer/ProgressViewer.scss +0 -0
  231. /package/dist/{components → src/components}/QueryExecutionStatus/QueryExecutionStatus.scss +0 -0
  232. /package/dist/{components → src/components}/QueryResultTable/QueryResultTable.scss +0 -0
  233. /package/dist/{components → src/components}/ResizeableDataTable/ResizeableDataTable.scss +0 -0
  234. /package/dist/{components → src/components}/Search/Search.scss +0 -0
  235. /package/dist/{components → src/components}/ShortyString/ShortyString.scss +0 -0
  236. /package/dist/{components → src/components}/SpeedMultiMeter/SpeedMultiMeter.scss +0 -0
  237. /package/dist/{components → src/components}/SplitPane/SplitPane.scss +0 -0
  238. /package/dist/{components → src/components}/Stack/Stack.scss +0 -0
  239. /package/dist/{components → src/components}/StatusIcon/StatusIcon.scss +0 -0
  240. /package/dist/{components → src/components}/TableSkeleton/TableSkeleton.scss +0 -0
  241. /package/dist/{components → src/components}/TableWithControlsLayout/TableWithControlsLayout.scss +0 -0
  242. /package/dist/{components → src/components}/Tablet/Tablet.scss +0 -0
  243. /package/dist/{components → src/components}/TabletIcon/TabletIcon.scss +0 -0
  244. /package/dist/{components → src/components}/TabletsOverall/TabletsOverall.scss +0 -0
  245. /package/dist/{components → src/components}/TabletsStatistic/TabletsStatistic.scss +0 -0
  246. /package/dist/{components → src/components}/Tag/Tag.scss +0 -0
  247. /package/dist/{components → src/components}/Tags/Tags.scss +0 -0
  248. /package/dist/{components → src/components}/TimeFrameSelector/TimeFrameSelector.scss +0 -0
  249. /package/dist/{components → src/components}/TooltipsContent/NodeEndpointsTooltipContent/NodeEndpointsTooltipContent.scss +0 -0
  250. /package/dist/{components → src/components}/TruncatedQuery/TruncatedQuery.scss +0 -0
  251. /package/dist/{components → src/components}/UsageLabel/UsageLabel.scss +0 -0
  252. /package/dist/{components → src/components}/User/User.scss +0 -0
  253. /package/dist/{components → src/components}/VDisk/VDisk.scss +0 -0
  254. /package/dist/{components → src/components}/VDiskInfo/VDiskInfo.scss +0 -0
  255. /package/dist/{components → src/components}/VDiskPopup/VDiskPopup.scss +0 -0
  256. /package/dist/{components → src/components}/VirtualTable/VirtualTable.scss +0 -0
  257. /package/dist/{containers → src/containers}/AppWithClusters/ExtendedCluster/ExtendedCluster.scss +0 -0
  258. /package/dist/{containers → src/containers}/AsideNavigation/AsideNavigation.scss +0 -0
  259. /package/dist/{containers → src/containers}/AsideNavigation/YdbInternalUser/YdbInternalUser.scss +0 -0
  260. /package/dist/{containers → src/containers}/Authentication/Authentication.scss +0 -0
  261. /package/dist/{containers → src/containers}/Cluster/Cluster.scss +0 -0
  262. /package/dist/{containers → src/containers}/Cluster/ClusterInfo/ClusterInfo.scss +0 -0
  263. /package/dist/{containers → src/containers}/Cluster/VersionsBar/VersionsBar.scss +0 -0
  264. /package/dist/{containers → src/containers}/Clusters/Clusters.scss +0 -0
  265. /package/dist/{containers → src/containers}/Heatmap/Heatmap.scss +0 -0
  266. /package/dist/{containers → src/containers}/Heatmap/Histogram/Histogram.scss +0 -0
  267. /package/dist/{containers → src/containers}/Node/Node.scss +0 -0
  268. /package/dist/{containers → src/containers}/Node/NodeStructure/NodeStructure.scss +0 -0
  269. /package/dist/{containers → src/containers}/Nodes/Nodes.scss +0 -0
  270. /package/dist/{containers → src/containers}/PDiskPage/PDiskPage.scss +0 -0
  271. /package/dist/{containers → src/containers}/ReduxTooltip/ReduxTooltip.scss +0 -0
  272. /package/dist/{containers → src/containers}/Storage/PDisk/PDisk.scss +0 -0
  273. /package/dist/{containers → src/containers}/Storage/Storage.scss +0 -0
  274. /package/dist/{containers → src/containers}/Storage/StorageGroups/StorageGroups.scss +0 -0
  275. /package/dist/{containers → src/containers}/Storage/StorageNodes/StorageNodes.scss +0 -0
  276. /package/dist/{containers → src/containers}/Storage/UsageFilter/UsageFilter.scss +0 -0
  277. /package/dist/{containers → src/containers}/Tablet/Tablet.scss +0 -0
  278. /package/dist/{containers → src/containers}/TabletsFilters/TabletsFilters.scss +0 -0
  279. /package/dist/{containers → src/containers}/Tenant/Acl/Acl.scss +0 -0
  280. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Autorefresh/AutorefreshControl.scss +0 -0
  281. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Consumers/Consumers.scss +0 -0
  282. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Consumers/Headers/Headers.scss +0 -0
  283. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Consumers/TopicStats/ConsumersTopicStats.scss +0 -0
  284. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Consumers/columns/Columns.scss +0 -0
  285. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Describe/Describe.scss +0 -0
  286. /package/dist/{containers → src/containers}/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss +0 -0
  287. /package/dist/{containers → src/containers}/Tenant/Diagnostics/HotKeys/HotKeys.scss +0 -0
  288. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Network/Network.scss +0 -0
  289. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Network/NodeNetwork/NodeNetwork.scss +0 -0
  290. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.scss +0 -0
  291. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Overview/TopicStats/TopicStats.scss +0 -0
  292. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Partitions/Headers/Headers.scss +0 -0
  293. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Partitions/Partitions.scss +0 -0
  294. /package/dist/{containers → src/containers}/Tenant/Diagnostics/Partitions/columns/Columns.scss +0 -0
  295. /package/dist/{containers → src/containers}/Tenant/Diagnostics/TenantOverview/Healthcheck/IssuesViewer/IssueTree.scss +0 -0
  296. /package/dist/{containers → src/containers}/Tenant/Diagnostics/TenantOverview/Healthcheck/IssuesViewer/IssueTreeItem/IssueTreeItem.scss +0 -0
  297. /package/dist/{containers → src/containers}/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricCard/MetricCard.scss +0 -0
  298. /package/dist/{containers → src/containers}/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.scss +0 -0
  299. /package/dist/{containers → src/containers}/Tenant/Diagnostics/TenantOverview/TenantDashboard/TenantDashboard.scss +0 -0
  300. /package/dist/{containers → src/containers}/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +0 -0
  301. /package/dist/{containers → src/containers}/Tenant/Diagnostics/TopQueries/TopQueries.scss +0 -0
  302. /package/dist/{containers → src/containers}/Tenant/Diagnostics/TopShards/TopShards.scss +0 -0
  303. /package/dist/{containers → src/containers}/Tenant/Info/ExternalDataSource/ExternalDataSource.scss +0 -0
  304. /package/dist/{containers → src/containers}/Tenant/Info/ExternalTable/ExternalTable.scss +0 -0
  305. /package/dist/{containers → src/containers}/Tenant/Info/View/View.scss +0 -0
  306. /package/dist/{containers → src/containers}/Tenant/ObjectGeneral/ObjectGeneral.scss +0 -0
  307. /package/dist/{containers → src/containers}/Tenant/ObjectSummary/ObjectSummary.scss +0 -0
  308. /package/dist/{containers → src/containers}/Tenant/Query/ExecuteResult/ExecuteResult.scss +0 -0
  309. /package/dist/{containers → src/containers}/Tenant/Query/ExplainResult/ExplainResult.scss +0 -0
  310. /package/dist/{containers → src/containers}/Tenant/Query/Issues/Issues.scss +0 -0
  311. /package/dist/{containers → src/containers}/Tenant/Query/Preview/Preview.scss +0 -0
  312. /package/dist/{containers → src/containers}/Tenant/Query/QueriesHistory/QueriesHistory.scss +0 -0
  313. /package/dist/{containers → src/containers}/Tenant/Query/QueryDuration/QueryDuration.scss +0 -0
  314. /package/dist/{containers → src/containers}/Tenant/Query/QueryEditor/QueryEditor.scss +0 -0
  315. /package/dist/{containers → src/containers}/Tenant/Query/QueryEditorControls/QueryEditorControls.scss +0 -0
  316. /package/dist/{containers → src/containers}/Tenant/Query/SaveQuery/SaveQuery.scss +0 -0
  317. /package/dist/{containers → src/containers}/Tenant/Query/SavedQueries/SavedQueries.scss +0 -0
  318. /package/dist/{containers → src/containers}/Tenant/Schema/SchemaViewer/SchemaViewer.scss +0 -0
  319. /package/dist/{containers → src/containers}/Tenant/utils/ToggleButton.scss +0 -0
  320. /package/dist/{containers → src/containers}/Tenants/Tenants.scss +0 -0
  321. /package/dist/{containers → src/containers}/UserSettings/UserSettings.scss +0 -0
  322. /package/dist/{containers → src/containers}/VDiskPage/VDiskPage.scss +0 -0
  323. /package/dist/{containers → src/containers}/Versions/GroupedNodesTree/GroupedNodesTree.scss +0 -0
  324. /package/dist/{containers → src/containers}/Versions/NodesTreeTitle/NodesTreeTitle.scss +0 -0
  325. /package/dist/{containers → src/containers}/Versions/Versions.scss +0 -0
  326. /package/dist/{index.css → src/index.css} +0 -0
  327. /package/dist/{styles → src/styles}/mixins.scss +0 -0
  328. /package/dist/{styles → src/styles}/themes/dark-hc.scss +0 -0
  329. /package/dist/{styles → src/styles}/themes/dark.scss +0 -0
  330. /package/dist/{styles → src/styles}/themes/light-hc.scss +0 -0
  331. /package/dist/{styles → src/styles}/themes/light.scss +0 -0
  332. /package/dist/{styles → src/styles}/themes.scss +0 -0
@@ -1,116 +1,72 @@
1
1
  import { createSelector } from '@reduxjs/toolkit';
2
2
  import { isEntityWithMergedImplementation } from '../../../containers/Tenant/utils/schema';
3
- import { settingsManager } from '../../../services/settings';
4
- import { AUTO_REFRESH_INTERVAL } from '../../../utils/constants';
5
- import { createApiRequest, createRequestActionTypes } from '../../utils';
6
- export const FETCH_SCHEMA = createRequestActionTypes('schema', 'FETCH_SCHEMA');
7
- const PRELOAD_SCHEMAS = 'schema/PRELOAD_SCHEMAS';
8
- const SET_SCHEMA = 'schema/SET_SCHEMA';
3
+ import { api } from '../api';
9
4
  const SET_SHOW_PREVIEW = 'schema/SET_SHOW_PREVIEW';
10
- export const SET_AUTOREFRESH_INTERVAL = 'schema/SET_AUTOREFRESH_INTERVAL';
11
- const RESET_LOADING_STATE = 'schema/RESET_LOADING_STATE';
12
- const autoRefreshLS = Number(settingsManager.readUserSettingsValue(AUTO_REFRESH_INTERVAL, 0));
13
5
  export const initialState = {
14
6
  loading: true,
15
- wasLoaded: false,
16
7
  data: {},
17
8
  currentSchemaPath: undefined,
18
- autorefresh: isNaN(autoRefreshLS) ? 0 : autoRefreshLS,
19
9
  showPreview: false,
20
10
  };
21
11
  const schema = (state = initialState, action) => {
22
- var _a;
23
12
  switch (action.type) {
24
- case FETCH_SCHEMA.REQUEST: {
25
- return Object.assign(Object.assign({}, state), { loading: true });
26
- }
27
- case FETCH_SCHEMA.SUCCESS: {
28
- const isCurrentSchema = !state.currentSchemaPath || state.currentSchemaPath === action.data.path;
29
- const newData = Object.assign(Object.assign({}, state.data), action.data.data);
30
- if (!isCurrentSchema) {
31
- return Object.assign(Object.assign({}, state), { data: newData });
32
- }
33
- return Object.assign(Object.assign({}, state), { error: undefined, data: newData, currentSchema: action.data.currentSchema, currentSchemaPath: action.data.path, loading: false, wasLoaded: true });
34
- }
35
- case FETCH_SCHEMA.FAILURE: {
36
- if ((_a = action.error) === null || _a === void 0 ? void 0 : _a.isCancelled) {
37
- return state;
38
- }
39
- return Object.assign(Object.assign({}, state), { error: action.error, loading: false });
40
- }
41
- case PRELOAD_SCHEMAS: {
42
- return Object.assign(Object.assign({}, state), { data: Object.assign(Object.assign({}, action.data), state.data) });
43
- }
44
- case SET_SCHEMA: {
45
- return Object.assign(Object.assign({}, state), { currentSchemaPath: action.data });
46
- }
47
- case SET_AUTOREFRESH_INTERVAL: {
48
- return Object.assign(Object.assign({}, state), { autorefresh: action.data });
49
- }
50
13
  case SET_SHOW_PREVIEW: {
51
14
  return Object.assign(Object.assign({}, state), { showPreview: action.data });
52
15
  }
53
- case RESET_LOADING_STATE: {
54
- return Object.assign(Object.assign({}, state), { wasLoaded: initialState.wasLoaded });
55
- }
56
16
  default:
57
17
  return state;
58
18
  }
59
19
  };
60
- export function getSchema({ path }) {
61
- const request = window.api.getSchema({ path });
62
- return createApiRequest({
63
- request,
64
- actions: FETCH_SCHEMA,
65
- dataHandler: (data) => {
66
- const newData = {};
67
- if (data === null || data === void 0 ? void 0 : data.Path) {
68
- newData[data.Path] = data;
69
- }
70
- return {
71
- path: data === null || data === void 0 ? void 0 : data.Path,
72
- currentSchema: data !== null && data !== void 0 ? data : undefined,
73
- data: newData,
74
- };
75
- },
76
- });
77
- }
78
- export function setCurrentSchemaPath(currentSchemaPath) {
79
- return {
80
- type: SET_SCHEMA,
81
- data: currentSchemaPath,
82
- };
83
- }
84
- export function setAutorefreshInterval(interval) {
85
- return (dispatch) => {
86
- settingsManager.setUserSettingsValue(AUTO_REFRESH_INTERVAL, interval);
87
- dispatch({
88
- type: SET_AUTOREFRESH_INTERVAL,
89
- data: interval,
90
- });
91
- };
92
- }
93
20
  export function setShowPreview(value) {
94
21
  return {
95
22
  type: SET_SHOW_PREVIEW,
96
23
  data: value,
97
24
  };
98
25
  }
99
- // only stores data for paths that are not in the store yet
100
- // existing paths are ignored
101
- export function preloadSchemas(data) {
102
- return {
103
- type: PRELOAD_SCHEMAS,
104
- data,
105
- };
106
- }
107
- export function resetLoadingState() {
108
- return {
109
- type: RESET_LOADING_STATE,
110
- };
111
- }
112
- const selectSchemaChildren = (state, path) => { var _a, _b; return path ? (_b = (_a = state.schema.data[path]) === null || _a === void 0 ? void 0 : _a.PathDescription) === null || _b === void 0 ? void 0 : _b.Children : undefined; };
113
- export const selectSchemaData = (state, path) => path ? state.schema.data[path] : undefined;
26
+ export default schema;
27
+ export const schemaApi = api.injectEndpoints({
28
+ endpoints: (builder) => ({
29
+ getSchema: builder.query({
30
+ queryFn: async ({ path }, { signal }) => {
31
+ try {
32
+ const data = await window.api.getSchema({ path }, { signal });
33
+ return { data: data !== null && data !== void 0 ? data : {} };
34
+ }
35
+ catch (error) {
36
+ return { error };
37
+ }
38
+ },
39
+ keepUnusedDataFor: Infinity,
40
+ forceRefetch: ({ endpointState }) => {
41
+ const data = endpointState === null || endpointState === void 0 ? void 0 : endpointState.data;
42
+ if (data && typeof data === 'object' && 'partial' in data && data.partial) {
43
+ return true;
44
+ }
45
+ return false;
46
+ },
47
+ onQueryStarted: async ({ path }, { dispatch, getState, queryFulfilled }) => {
48
+ const { data } = await queryFulfilled;
49
+ if (data) {
50
+ const state = getState();
51
+ const { PathDescription: { Children = [] } = {} } = data;
52
+ for (const child of Children) {
53
+ const { Name = '' } = child;
54
+ const childPath = `${path}/${Name}`;
55
+ const cachedData = schemaApi.endpoints.getSchema.select({ path: childPath })(state).data;
56
+ if (!cachedData) {
57
+ // not full data, but it contains PathType, which ensures seamless switch between nodes
58
+ dispatch(schemaApi.util.upsertQueryData('getSchema', { path: childPath }, { PathDescription: { Self: child }, partial: true }));
59
+ }
60
+ }
61
+ }
62
+ },
63
+ }),
64
+ }),
65
+ overrideExisting: 'throw',
66
+ });
67
+ const getSchemaSelector = createSelector((path) => path, (path) => schemaApi.endpoints.getSchema.select({ path }));
68
+ const selectGetSchema = createSelector((state) => state, (_state, path) => getSchemaSelector(path), (state, selectTabletsInfo) => selectTabletsInfo(state).data);
69
+ const selectSchemaChildren = (state, path) => { var _a, _b; return (_b = (_a = selectGetSchema(state, path)) === null || _a === void 0 ? void 0 : _a.PathDescription) === null || _b === void 0 ? void 0 : _b.Children; };
114
70
  export const selectSchemaMergedChildrenPaths = createSelector([
115
71
  (_, path) => path,
116
72
  (_, _path, type) => type,
@@ -120,4 +76,3 @@ export const selectSchemaMergedChildrenPaths = createSelector([
120
76
  ? children === null || children === void 0 ? void 0 : children.map(({ Name }) => path + '/' + Name)
121
77
  : undefined;
122
78
  });
123
- export default schema;
@@ -1,29 +1,10 @@
1
- import type { IResponseError } from '../../../types/api/error';
2
1
  import type { TEvDescribeSchemeResult } from '../../../types/api/schema';
3
- import type { ApiRequestAction } from '../../utils';
4
- import type { FETCH_SCHEMA, SET_AUTOREFRESH_INTERVAL, preloadSchemas, resetLoadingState, setCurrentSchemaPath, setShowPreview } from './schema';
2
+ import type { setShowPreview } from './schema';
5
3
  export type SchemaData = Record<string, TEvDescribeSchemeResult>;
6
4
  export interface SchemaState {
7
- loading: boolean;
8
- wasLoaded: boolean;
9
- data: SchemaData;
10
- currentSchema?: TEvDescribeSchemeResult;
11
- currentSchemaPath?: string;
12
- autorefresh: number;
13
5
  showPreview: boolean;
14
- error?: IResponseError;
15
6
  }
16
- export interface SchemaHandledResponse {
17
- path?: string;
18
- currentSchema?: TEvDescribeSchemeResult;
19
- data?: SchemaData;
20
- }
21
- type SchemaApiRequestAction = ApiRequestAction<typeof FETCH_SCHEMA, SchemaHandledResponse, IResponseError>;
22
- export type SchemaAction = SchemaApiRequestAction | (ReturnType<typeof setCurrentSchemaPath> | {
23
- type: typeof SET_AUTOREFRESH_INTERVAL;
24
- data: number;
25
- } | ReturnType<typeof setShowPreview> | ReturnType<typeof preloadSchemas> | ReturnType<typeof resetLoadingState>);
7
+ export type SchemaAction = ReturnType<typeof setShowPreview>;
26
8
  export interface SchemaStateSlice {
27
9
  schema: SchemaState;
28
10
  }
29
- export {};
@@ -1,135 +1,8 @@
1
- import type { Reducer } from '@reduxjs/toolkit';
2
- import type { SchemaAclAction, SchemaAclState } from './types';
3
- export declare const FETCH_SCHEMA_ACL: {
4
- readonly REQUEST: "schemaAcl/FETCH_SCHEMA_ACL_REQUEST";
5
- readonly SUCCESS: "schemaAcl/FETCH_SCHEMA_ACL_SUCCESS";
6
- readonly FAILURE: "schemaAcl/FETCH_SCHEMA_ACL_FAILURE";
7
- };
8
- declare const schemaAcl: Reducer<SchemaAclState, SchemaAclAction>;
9
- export declare function getSchemaAcl({ path }: {
10
- path: string;
11
- }): (dispatch: import("redux-thunk").ThunkDispatch<{
12
- api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
13
- singleClusterMode: boolean;
14
- cluster: import("../cluster/types").ClusterState;
15
- tenant: import("../tenant/types").TenantState;
16
- tooltip: import("../../../types/store/tooltip").ITooltipState;
17
- tablets: import("../../../types/store/tablets").TabletsState;
18
- schema: import("../schema/types").SchemaState;
19
- host: import("../../../types/store/host").IHostState;
20
- tenants: import("../tenants/types").TenantsState;
21
- partitions: import("../partitions/types").PartitionsState;
22
- executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
23
- tabletsFilters: {
24
- loading: boolean;
25
- requestTime: number;
26
- data: undefined;
27
- wasLoaded: boolean;
28
- stateFilter: never[];
29
- typeFilter: never[];
30
- } | {
31
- tabletsData: any;
32
- nodes: any;
33
- loading: boolean;
34
- wasLoaded: boolean;
35
- timeoutForRequest: number;
36
- error: undefined;
37
- data: undefined;
38
- stateFilter: never[];
39
- typeFilter: never[];
40
- } | {
41
- error: any;
42
- loading: boolean;
43
- data: undefined;
44
- wasLoaded: boolean;
45
- stateFilter: never[];
46
- typeFilter: never[];
47
- } | {
48
- stateFilter: any;
49
- data: undefined;
50
- loading: boolean;
51
- wasLoaded: boolean;
52
- typeFilter: never[];
53
- } | {
54
- typeFilter: any;
55
- data: undefined;
56
- loading: boolean;
57
- wasLoaded: boolean;
58
- stateFilter: never[];
59
- };
60
- heatmap: import("../../../types/store/heatmap").IHeatmapState;
61
- settings: import("../settings/types").SettingsState;
62
- schemaAcl: SchemaAclState;
63
- executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
64
- shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
65
- hotKeys: import("../hotKeys/types").HotKeysState;
66
- authentication: import("../authentication/types").AuthenticationState;
67
- header: import("../header/types").HeaderState;
68
- saveQuery: string | null;
69
- fullscreen: boolean;
70
- clusters: import("../clusters/types").ClustersFilters;
71
- }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
72
- api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
73
- singleClusterMode: boolean;
74
- cluster: import("../cluster/types").ClusterState;
75
- tenant: import("../tenant/types").TenantState;
76
- tooltip: import("../../../types/store/tooltip").ITooltipState;
77
- tablets: import("../../../types/store/tablets").TabletsState;
78
- schema: import("../schema/types").SchemaState;
79
- host: import("../../../types/store/host").IHostState;
80
- tenants: import("../tenants/types").TenantsState;
81
- partitions: import("../partitions/types").PartitionsState;
82
- executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
83
- tabletsFilters: {
84
- loading: boolean;
85
- requestTime: number;
86
- data: undefined;
87
- wasLoaded: boolean;
88
- stateFilter: never[];
89
- typeFilter: never[];
90
- } | {
91
- tabletsData: any;
92
- nodes: any;
93
- loading: boolean;
94
- wasLoaded: boolean;
95
- timeoutForRequest: number;
96
- error: undefined;
97
- data: undefined;
98
- stateFilter: never[];
99
- typeFilter: never[];
100
- } | {
101
- error: any;
102
- loading: boolean;
103
- data: undefined;
104
- wasLoaded: boolean;
105
- stateFilter: never[];
106
- typeFilter: never[];
107
- } | {
108
- stateFilter: any;
109
- data: undefined;
110
- loading: boolean;
111
- wasLoaded: boolean;
112
- typeFilter: never[];
113
- } | {
114
- typeFilter: any;
115
- data: undefined;
116
- loading: boolean;
117
- wasLoaded: boolean;
118
- stateFilter: never[];
119
- };
120
- heatmap: import("../../../types/store/heatmap").IHeatmapState;
121
- settings: import("../settings/types").SettingsState;
122
- schemaAcl: SchemaAclState;
123
- executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
124
- shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
125
- hotKeys: import("../hotKeys/types").HotKeysState;
126
- authentication: import("../authentication/types").AuthenticationState;
127
- header: import("../header/types").HeaderState;
128
- saveQuery: string | null;
129
- fullscreen: boolean;
130
- clusters: import("../clusters/types").ClustersFilters;
131
- }) => Promise<unknown>;
132
- export declare const setAclWasNotLoaded: () => {
133
- readonly type: "schemaAcl/SET_DATA_WAS_NOT_LOADED";
134
- };
135
- export default schemaAcl;
1
+ export declare const schemaAclApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, {
2
+ getSchemaAcl: import("@reduxjs/toolkit/query").QueryDefinition<{
3
+ path: string;
4
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, "All", {
5
+ acl: import("../../../types/api/acl").TACE[] | undefined;
6
+ owner: string | undefined;
7
+ } | undefined, "api">;
8
+ }, "api", "All", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
@@ -1,44 +1,18 @@
1
- import { createApiRequest, createRequestActionTypes } from '../../utils';
2
- export const FETCH_SCHEMA_ACL = createRequestActionTypes('schemaAcl', 'FETCH_SCHEMA_ACL');
3
- const SET_ACL_WAS_NOT_LOADED = 'schemaAcl/SET_DATA_WAS_NOT_LOADED';
4
- const initialState = {
5
- loading: false,
6
- wasLoaded: false,
7
- };
8
- const schemaAcl = (state = initialState, action) => {
9
- var _a, _b, _c;
10
- switch (action.type) {
11
- case FETCH_SCHEMA_ACL.REQUEST: {
12
- return Object.assign(Object.assign({}, state), { loading: true });
13
- }
14
- case FETCH_SCHEMA_ACL.SUCCESS: {
15
- const acl = (_a = action.data.Common) === null || _a === void 0 ? void 0 : _a.ACL;
16
- const owner = (_b = action.data.Common) === null || _b === void 0 ? void 0 : _b.Owner;
17
- return Object.assign(Object.assign({}, state), { acl,
18
- owner, loading: false, wasLoaded: true, error: undefined });
19
- }
20
- case FETCH_SCHEMA_ACL.FAILURE: {
21
- if ((_c = action.error) === null || _c === void 0 ? void 0 : _c.isCancelled) {
22
- return state;
23
- }
24
- return Object.assign(Object.assign({}, state), { error: action.error, loading: false });
25
- }
26
- case SET_ACL_WAS_NOT_LOADED: {
27
- return Object.assign(Object.assign({}, state), { wasLoaded: false });
28
- }
29
- default:
30
- return state;
31
- }
32
- };
33
- export function getSchemaAcl({ path }) {
34
- return createApiRequest({
35
- request: window.api.getSchemaAcl({ path }),
36
- actions: FETCH_SCHEMA_ACL,
37
- });
38
- }
39
- export const setAclWasNotLoaded = () => {
40
- return {
41
- type: SET_ACL_WAS_NOT_LOADED,
42
- };
43
- };
44
- export default schemaAcl;
1
+ import { api } from '../api';
2
+ export const schemaAclApi = api.injectEndpoints({
3
+ endpoints: (build) => ({
4
+ getSchemaAcl: build.query({
5
+ queryFn: async ({ path }, { signal }) => {
6
+ try {
7
+ const data = await window.api.getSchemaAcl({ path }, { signal });
8
+ return { data: { acl: data.Common.ACL, owner: data.Common.Owner } };
9
+ }
10
+ catch (error) {
11
+ return { error };
12
+ }
13
+ },
14
+ providesTags: ['All'],
15
+ }),
16
+ }),
17
+ overrideExisting: 'throw',
18
+ });
@@ -1,28 +1,22 @@
1
- import type { Reducer, ThunkAction } from '@reduxjs/toolkit';
2
- import type { RootState } from '../..';
3
- import type { SettingsObject } from '../../../services/settings';
4
- import type { ProblemFilterValue, SetSettingValueAction, SettingsAction, SettingsRootStateSlice, SettingsState } from './types';
5
- export declare const SET_SETTING_VALUE = "settings/SET_VALUE";
6
- export declare const SET_USER_SETTINGS = "settings/SET_USER_SETTINGS";
1
+ import type { Store } from '@reduxjs/toolkit';
2
+ import type { AppDispatch } from '../../defaultStore';
3
+ import type { ProblemFilterValue, SettingsState } from './types';
7
4
  export declare const ProblemFilterValues: {
8
5
  readonly ALL: "All";
9
6
  readonly PROBLEMS: "With problems";
10
7
  };
11
- export declare const initialState: {
12
- problemFilter: "All";
13
- userSettings: SettingsObject;
14
- systemSettings: SettingsObject;
8
+ export declare const initialState: SettingsState;
9
+ export declare const changeFilter: import("@reduxjs/toolkit").ActionCreatorWithPayload<ProblemFilterValue, "settings/changeFilter">;
10
+ export declare const getSettingValue: import("reselect").Selector<{
11
+ settings: SettingsState;
12
+ }, unknown, [name: string]> & {
13
+ unwrapped: (state: SettingsState, name: string) => unknown;
14
+ }, selectProblemFilter: import("reselect").Selector<{
15
+ settings: SettingsState;
16
+ }, ProblemFilterValue, []> & {
17
+ unwrapped: (state: SettingsState) => ProblemFilterValue;
15
18
  };
16
- declare const settings: Reducer<SettingsState, SettingsAction>;
17
- export declare const setSettingValue: (name: string, value: unknown) => ThunkAction<void, RootState, unknown, SetSettingValueAction>;
18
- export declare const setUserSettings: (data: SettingsObject) => {
19
- readonly type: "settings/SET_USER_SETTINGS";
20
- readonly data: SettingsObject;
21
- };
22
- export declare const getSettingValue: (state: SettingsRootStateSlice, name: string) => unknown;
23
- export declare const changeFilter: (filter: ProblemFilterValue) => {
24
- readonly type: "settings/CHANGE_PROBLEM_FILTER";
25
- readonly data: ProblemFilterValue;
26
- };
27
- export declare const selectProblemFilter: (state: SettingsRootStateSlice) => ProblemFilterValue;
28
- export default settings;
19
+ export declare const setSettingValue: (name: string, value: unknown) => (dispatch: AppDispatch) => void;
20
+ export declare function syncUserSettingsFromLS(store: Store): void;
21
+ declare const _default: import("redux").Reducer<SettingsState>;
22
+ export default _default;
@@ -1,7 +1,6 @@
1
+ import { createSlice } from '@reduxjs/toolkit';
1
2
  import { DEFAULT_USER_SETTINGS, settingsManager } from '../../../services/settings';
2
- const CHANGE_PROBLEM_FILTER = 'settings/CHANGE_PROBLEM_FILTER';
3
- export const SET_SETTING_VALUE = 'settings/SET_VALUE';
4
- export const SET_USER_SETTINGS = 'settings/SET_USER_SETTINGS';
3
+ import { parseJson } from '../../../utils/utils';
5
4
  export const ProblemFilterValues = {
6
5
  ALL: 'All',
7
6
  PROBLEMS: 'With problems',
@@ -13,38 +12,46 @@ export const initialState = {
13
12
  userSettings,
14
13
  systemSettings,
15
14
  };
16
- const settings = (state = initialState, action) => {
17
- switch (action.type) {
18
- case CHANGE_PROBLEM_FILTER:
19
- return Object.assign(Object.assign({}, state), { problemFilter: action.data });
20
- case SET_SETTING_VALUE: {
21
- const newSettings = Object.assign(Object.assign({}, state.userSettings), { [action.data.name]: action.data.value });
22
- return Object.assign(Object.assign({}, state), { userSettings: newSettings });
23
- }
24
- case SET_USER_SETTINGS: {
25
- return Object.assign(Object.assign({}, state), { userSettings: Object.assign(Object.assign({}, state.userSettings), action.data) });
26
- }
27
- default:
28
- return state;
29
- }
30
- };
15
+ const settingsSlice = createSlice({
16
+ name: 'settings',
17
+ initialState,
18
+ reducers: (create) => ({
19
+ changeFilter: create.reducer((state, action) => {
20
+ state.problemFilter = action.payload;
21
+ }),
22
+ setSettingValue: create.reducer((state, action) => {
23
+ state.userSettings[action.payload.name] = action.payload.value;
24
+ }),
25
+ }),
26
+ selectors: {
27
+ getSettingValue: (state, name) => state.userSettings[name],
28
+ selectProblemFilter: (state) => state.problemFilter,
29
+ },
30
+ });
31
+ export const { changeFilter } = settingsSlice.actions;
32
+ export const { getSettingValue, selectProblemFilter } = settingsSlice.selectors;
31
33
  export const setSettingValue = (name, value) => {
32
34
  return (dispatch) => {
33
- dispatch({ type: SET_SETTING_VALUE, data: { name, value } });
35
+ dispatch(settingsSlice.actions.setSettingValue({ name, value }));
34
36
  settingsManager.setUserSettingsValue(name, value);
35
37
  };
36
38
  };
37
- export const setUserSettings = (data) => {
38
- return { type: SET_USER_SETTINGS, data };
39
- };
40
- export const getSettingValue = (state, name) => {
41
- return state.settings.userSettings[name];
42
- };
43
- export const changeFilter = (filter) => {
44
- return {
45
- type: CHANGE_PROBLEM_FILTER,
46
- data: filter,
47
- };
48
- };
49
- export const selectProblemFilter = (state) => state.settings.problemFilter;
50
- export default settings;
39
+ export function syncUserSettingsFromLS(store) {
40
+ if (typeof window === 'undefined') {
41
+ return;
42
+ }
43
+ window.addEventListener('storage', (event) => {
44
+ if (event.key && event.key in DEFAULT_USER_SETTINGS) {
45
+ const name = event.key;
46
+ let value = DEFAULT_USER_SETTINGS[name];
47
+ if (event.newValue !== null) {
48
+ value = parseJson(event.newValue);
49
+ }
50
+ store.dispatch(settingsSlice.actions.setSettingValue({
51
+ name,
52
+ value,
53
+ }));
54
+ }
55
+ });
56
+ }
57
+ export default settingsSlice.reducer;
@@ -1,20 +1,9 @@
1
1
  import type { SettingsObject } from '../../../services/settings';
2
2
  import type { ValueOf } from '../../../types/common';
3
- import type { ProblemFilterValues, SET_SETTING_VALUE, changeFilter, setUserSettings } from './settings';
3
+ import type { ProblemFilterValues } from './settings';
4
4
  export type ProblemFilterValue = ValueOf<typeof ProblemFilterValues>;
5
5
  export interface SettingsState {
6
6
  problemFilter: ProblemFilterValue;
7
7
  userSettings: SettingsObject;
8
8
  systemSettings: SettingsObject;
9
9
  }
10
- export type SetSettingValueAction = {
11
- type: typeof SET_SETTING_VALUE;
12
- data: {
13
- name: string;
14
- value: unknown;
15
- };
16
- };
17
- export type SettingsAction = ReturnType<typeof changeFilter> | ReturnType<typeof setUserSettings> | SetSettingValueAction;
18
- export interface SettingsRootStateSlice {
19
- settings: SettingsState;
20
- }