@odigos/ui-kit 0.0.51 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/components.js +10 -10
  3. package/lib/constants.js +2 -2
  4. package/lib/containers.js +56 -32
  5. package/lib/functions.js +7 -7
  6. package/lib/hooks/useInstrumentationRuleFormData.d.ts +1 -1
  7. package/lib/hooks.js +614 -7
  8. package/lib/icons.js +6 -6
  9. package/lib/{index-BC03UmY5.js → index-118aa476.js} +4 -3
  10. package/lib/{index-CPMIZB66.js → index-159d94f2.js} +4 -4
  11. package/lib/{index-Coq_Nro0.js → index-1b057bd1.js} +2 -2
  12. package/lib/{index-Dbs7YARA.js → index-4c55824c.js} +2 -2
  13. package/lib/{index-1-F2f04H.js → index-4dd6a1ce.js} +170 -116
  14. package/lib/{index-H8TwBQHm.js → index-974c5344.js} +1 -1
  15. package/lib/{index-CMsBAVAn.js → index-b833b336.js} +1 -1
  16. package/lib/{index-CyHOJpMl.js → index-f40b593d.js} +1 -1
  17. package/lib/{index-LgzkJ05H.js → index-f64b0a7d.js} +1 -1
  18. package/lib/snippets.js +26 -10
  19. package/lib/store.js +1 -1
  20. package/lib/theme.js +1 -1
  21. package/lib/{useTransition-DmHfJSEP.js → useTransition-53e46214.js} +29 -23
  22. package/package.json +17 -17
  23. package/lib/components/auto-complete-input/auto-complete-input.stories.d.ts +0 -9
  24. package/lib/components/badge/badge.stories.d.ts +0 -13
  25. package/lib/components/button/button.stories.d.ts +0 -9
  26. package/lib/components/cancel-warning/cancel-warning.stories.d.ts +0 -9
  27. package/lib/components/checkbox/checkbox.stories.d.ts +0 -9
  28. package/lib/components/code/code.stories.d.ts +0 -9
  29. package/lib/components/condition-details/condition-details.stories.d.ts +0 -14
  30. package/lib/components/data-card/data-card.stories.d.ts +0 -11
  31. package/lib/components/data-finger/data-finger.stories.d.ts +0 -9
  32. package/lib/components/data-tab/data-tab.stories.d.ts +0 -15
  33. package/lib/components/delete-warning/delete-warning.stories.d.ts +0 -9
  34. package/lib/components/describe-row/describe-row.stories.d.ts +0 -9
  35. package/lib/components/divider/divider.stories.d.ts +0 -9
  36. package/lib/components/docs-button/docs-button.stories.d.ts +0 -9
  37. package/lib/components/drawer/drawer.stories.d.ts +0 -10
  38. package/lib/components/dropdown/dropdown.stories.d.ts +0 -10
  39. package/lib/components/error-boundary/error-boundary.stories.d.ts +0 -11
  40. package/lib/components/extend-arrow/extend-arrow.stories.d.ts +0 -9
  41. package/lib/components/fade-loader/fade-loader.stories.d.ts +0 -9
  42. package/lib/components/field-error/field-error.stories.d.ts +0 -11
  43. package/lib/components/field-label/field-label.stories.d.ts +0 -9
  44. package/lib/components/header/header.stories.d.ts +0 -9
  45. package/lib/components/icon-button/icon-button.stories.d.ts +0 -9
  46. package/lib/components/icon-group/icon-group.stories.d.ts +0 -16
  47. package/lib/components/icon-title-badge/icon-title-badge.stories.d.ts +0 -9
  48. package/lib/components/icon-wrapped/icon-wrapped.stories.d.ts +0 -10
  49. package/lib/components/icons-nav/icons-nav.stories.d.ts +0 -9
  50. package/lib/components/image-controlled/image-controlled.stories.d.ts +0 -9
  51. package/lib/components/input/input.stories.d.ts +0 -9
  52. package/lib/components/input-list/input-list.stories.d.ts +0 -9
  53. package/lib/components/input-table/input-table.stories.d.ts +0 -9
  54. package/lib/components/interactive-table/interactive-table.stories.d.ts +0 -12
  55. package/lib/components/key-value-input-list/key-value-input-list.stories.d.ts +0 -11
  56. package/lib/components/modal/modal.stories.d.ts +0 -9
  57. package/lib/components/monitors-checkboxes/monitors-checkboxes.stories.d.ts +0 -9
  58. package/lib/components/monitors-icons/monitors-icons.stories.d.ts +0 -9
  59. package/lib/components/navigation-buttons/navigation-buttons.stories.d.ts +0 -9
  60. package/lib/components/no-data-found/no-data-found.stories.d.ts +0 -9
  61. package/lib/components/notification-note/notification-note.stories.d.ts +0 -10
  62. package/lib/components/popup/popup.stories.d.ts +0 -9
  63. package/lib/components/popup-form/popup-form.stories.d.ts +0 -10
  64. package/lib/components/scroll-x/scroll-x.stories.d.ts +0 -10
  65. package/lib/components/section-title/section-title.stories.d.ts +0 -9
  66. package/lib/components/segment/segment.stories.d.ts +0 -9
  67. package/lib/components/selection-button/selection-button.stories.d.ts +0 -9
  68. package/lib/components/skeleton-loader/skeleton-loader.stories.d.ts +0 -9
  69. package/lib/components/status/status.stories.d.ts +0 -9
  70. package/lib/components/stepper/stepper.stories.d.ts +0 -9
  71. package/lib/components/tag/tag.stories.d.ts +0 -13
  72. package/lib/components/text/text.stories.d.ts +0 -9
  73. package/lib/components/textarea/textarea.stories.d.ts +0 -9
  74. package/lib/components/toggle/toggle.stories.d.ts +0 -9
  75. package/lib/components/tooltip/tooltip.stories.d.ts +0 -11
  76. package/lib/components/trace-loader/trace-loader.stories.d.ts +0 -9
  77. package/lib/components/warning-modal/warning-modal.stories.d.ts +0 -9
  78. package/lib/containers/action-drawer/action-drawer.stories.d.ts +0 -9
  79. package/lib/containers/action-form/action-form.stories.d.ts +0 -9
  80. package/lib/containers/action-modal/action-modal.stories.d.ts +0 -9
  81. package/lib/containers/action-table/action-table.stories.d.ts +0 -9
  82. package/lib/containers/await-pipeline/await-pipeline.stories.d.ts +0 -9
  83. package/lib/containers/compute-platform-select/compute-platform-select.stories.d.ts +0 -9
  84. package/lib/containers/compute-platforms/compute-platforms.stories.d.ts +0 -9
  85. package/lib/containers/compute-platforms-actions-menu/compute-platforms-actions-menu.stories.d.ts +0 -9
  86. package/lib/containers/data-flow/data-flow.stories.d.ts +0 -9
  87. package/lib/containers/data-flow-actions-menu/data-flow-actions-menu.stories.d.ts +0 -11
  88. package/lib/containers/data-stream-drawer/data-stream-drawer.stories.d.ts +0 -9
  89. package/lib/containers/data-stream-form/data-stream-form.stories.d.ts +0 -9
  90. package/lib/containers/data-stream-modal/data-stream-modal.stories.d.ts +0 -9
  91. package/lib/containers/data-stream-selection-form/data-stream-selection-form.stories.d.ts +0 -9
  92. package/lib/containers/destination-drawer/destination-drawer.stories.d.ts +0 -9
  93. package/lib/containers/destination-form/destination-form.stories.d.ts +0 -9
  94. package/lib/containers/destination-modal/destination-modal.stories.d.ts +0 -9
  95. package/lib/containers/destination-selection-form/destination-selection-form.stories.d.ts +0 -9
  96. package/lib/containers/destination-table/destination-table.stories.d.ts +0 -9
  97. package/lib/containers/dropdowns/connection-status-dropdown/connection-status-dropdown.stories.d.ts +0 -9
  98. package/lib/containers/dropdowns/connection-type-dropdown/connection-type-dropdown.stories.d.ts +0 -9
  99. package/lib/containers/dropdowns/error-dropdown/error-dropdown.stories.d.ts +0 -9
  100. package/lib/containers/dropdowns/kind-dropdown/error-dropdown.stories.d.ts +0 -9
  101. package/lib/containers/dropdowns/language-dropdown/language-dropdown.stories.d.ts +0 -9
  102. package/lib/containers/dropdowns/monitor-dropdown/monitor-dropdown.stories.d.ts +0 -9
  103. package/lib/containers/dropdowns/namespace-dropdown/namespace-dropdown.stories.d.ts +0 -9
  104. package/lib/containers/instrumentation-rule-drawer/instrumentation-rule-drawer.stories.d.ts +0 -9
  105. package/lib/containers/instrumentation-rule-form/instrumentation-rule-form.stories.d.ts +0 -9
  106. package/lib/containers/instrumentation-rule-modal/instrumentation-rule-modal.stories.d.ts +0 -9
  107. package/lib/containers/instrumentation-rule-table/instrumentation-rule-table.stories.d.ts +0 -9
  108. package/lib/containers/multi-source-control/multi-source-control.stories.d.ts +0 -9
  109. package/lib/containers/notification-manager/notification-manager.stories.d.ts +0 -9
  110. package/lib/containers/overview-drawer/overview-drawer.stories.d.ts +0 -9
  111. package/lib/containers/service-map/service-map.stories.d.ts +0 -9
  112. package/lib/containers/setup-summary/setup-summary.stories.d.ts +0 -9
  113. package/lib/containers/side-nav/side-nav.stories.d.ts +0 -9
  114. package/lib/containers/slack-invite/slack-invite.stories.d.ts +0 -9
  115. package/lib/containers/source-drawer/source-drawer.stories.d.ts +0 -9
  116. package/lib/containers/source-form/source-form.stories.d.ts +0 -9
  117. package/lib/containers/source-modal/source-modal.stories.d.ts +0 -9
  118. package/lib/containers/source-selection-form/source-selection-form.stories.d.ts +0 -9
  119. package/lib/containers/source-table/source-table.stories.d.ts +0 -9
  120. package/lib/containers/system-overview/system-overview.stories.d.ts +0 -9
  121. package/lib/containers/table-cell-conditions/table-cell-conditions.stories.d.ts +0 -9
  122. package/lib/containers/toast-list/toast-list.stories.d.ts +0 -9
  123. package/lib/containers/toggle-dark-mode/toggle-dark-mode.stories.d.ts +0 -9
  124. package/lib/icons/actions/add-cluster-info-icon/add-cluster-info-icon.stories.d.ts +0 -8
  125. package/lib/icons/actions/delete-attribute-icon/delete-attribute-icon.stories.d.ts +0 -8
  126. package/lib/icons/actions/pii-masking-icon/pii-masking-icon.stories.d.ts +0 -8
  127. package/lib/icons/actions/rename-attribute-icon/rename-attribute-icon.stories.d.ts +0 -8
  128. package/lib/icons/actions/sampler-icon/sampler-icon.stories.d.ts +0 -8
  129. package/lib/icons/brand/odigos-logo/odigos-logo.stories.d.ts +0 -8
  130. package/lib/icons/brand/odigos-logo-text/odigos-logo-text.stories.d.ts +0 -8
  131. package/lib/icons/common/arrow-icon/arrow-icon.stories.d.ts +0 -8
  132. package/lib/icons/common/avatar-icon/avatar-icon.stories.d.ts +0 -8
  133. package/lib/icons/common/code-brackets-icon/code-brackets-icon.stories.d.ts +0 -8
  134. package/lib/icons/common/code-icon/code-icon.stories.d.ts +0 -8
  135. package/lib/icons/common/command-icon/command-icon.stories.d.ts +0 -8
  136. package/lib/icons/common/copy-icon/copy-icon.stories.d.ts +0 -8
  137. package/lib/icons/common/edit-icon/edit-icon.stories.d.ts +0 -8
  138. package/lib/icons/common/edited-icon/edited-icon.stories.d.ts +0 -8
  139. package/lib/icons/common/extend-arrow-icon/extend-arrow-icon.stories.d.ts +0 -8
  140. package/lib/icons/common/filter-icon/filter-icon.stories.d.ts +0 -8
  141. package/lib/icons/common/folder-icon/folder-icon.stories.d.ts +0 -8
  142. package/lib/icons/common/image-error-icon/image-error-icon.stories.d.ts +0 -8
  143. package/lib/icons/common/key-icon/key-icon.stories.d.ts +0 -8
  144. package/lib/icons/common/list-icon/list-icon.stories.d.ts +0 -8
  145. package/lib/icons/common/no-data-icon/no-data-icon.stories.d.ts +0 -8
  146. package/lib/icons/common/notebook-icon/notebook-icon.stories.d.ts +0 -8
  147. package/lib/icons/common/notification-icon/notification-icon.stories.d.ts +0 -8
  148. package/lib/icons/common/retry-icon/retry-icon.stories.d.ts +0 -8
  149. package/lib/icons/common/search-icon/search-icon.stories.d.ts +0 -8
  150. package/lib/icons/common/sort-arrows-icon/sort-arrows-icon.stories.d.ts +0 -8
  151. package/lib/icons/common/terminal-icon/terminal-icon.stories.d.ts +0 -8
  152. package/lib/icons/common/trash-icon/trash-icon.stories.d.ts +0 -8
  153. package/lib/icons/common/user-group-icon/user-group-icon.stories.d.ts +0 -8
  154. package/lib/icons/common/user-icon/user-icon.stories.d.ts +0 -8
  155. package/lib/icons/common/x-icon/x-icon.stories.d.ts +0 -8
  156. package/lib/icons/compute-platform/k8s-logo/k8s-logo.stories.d.ts +0 -8
  157. package/lib/icons/compute-platform/vm-logo/vm-logo.stories.d.ts +0 -8
  158. package/lib/icons/destinations/alauda-logo/alauda-logo.stories.d.ts +0 -8
  159. package/lib/icons/destinations/alibaba-cloud-logo/alibaba-cloud-logo.stories.d.ts +0 -8
  160. package/lib/icons/destinations/app-dynamics-logo/app-dynamics-logo.stories.d.ts +0 -8
  161. package/lib/icons/destinations/aws-cloudwatch-logo/aws-cloudwatch-logo.stories.d.ts +0 -8
  162. package/lib/icons/destinations/aws-s3-logo/aws-s3-logo.stories.d.ts +0 -8
  163. package/lib/icons/destinations/aws-xray-logo/aws-xray-logo.stories.d.ts +0 -8
  164. package/lib/icons/destinations/axiom-logo/axiom-logo.stories.d.ts +0 -8
  165. package/lib/icons/destinations/better-stack-logo/better-stack-logo.stories.d.ts +0 -8
  166. package/lib/icons/destinations/blob-storage-logo/blob-storage-logo.stories.d.ts +0 -8
  167. package/lib/icons/destinations/bonree-logo/bonree-logo.stories.d.ts +0 -8
  168. package/lib/icons/destinations/causely-logo/causely-logo.stories.d.ts +0 -8
  169. package/lib/icons/destinations/checkly-logo/checkly-logo.stories.d.ts +0 -8
  170. package/lib/icons/destinations/chronosphere-logo/chronosphere-logo.stories.d.ts +0 -8
  171. package/lib/icons/destinations/clickhouse-logo/clickhouse-logo.stories.d.ts +0 -8
  172. package/lib/icons/destinations/coralogix-logo/coralogix-logo.stories.d.ts +0 -8
  173. package/lib/icons/destinations/dash0-logo/dash0-logo.stories.d.ts +0 -8
  174. package/lib/icons/destinations/datadog-logo/datadog-logo.stories.d.ts +0 -8
  175. package/lib/icons/destinations/dynatrace-logo/dynatrace-logo.stories.d.ts +0 -8
  176. package/lib/icons/destinations/elastic-apm-logo/elastic-apm-logo.stories.d.ts +0 -8
  177. package/lib/icons/destinations/elastic-search-logo/elastic-search-logo.stories.d.ts +0 -8
  178. package/lib/icons/destinations/gigapipe-logo/gigapipe-logo.stories.d.ts +0 -8
  179. package/lib/icons/destinations/google-cloud-platform-logo/google-cloud-platform-logo.stories.d.ts +0 -8
  180. package/lib/icons/destinations/google-cloud-storage-logo/google-cloud-storage-logo.stories.d.ts +0 -8
  181. package/lib/icons/destinations/grafana-logo/grafana-logo.stories.d.ts +0 -8
  182. package/lib/icons/destinations/greptime-logo/greptime-logo.stories.d.ts +0 -8
  183. package/lib/icons/destinations/groundcover-logo/groundcover-logo.stories.d.ts +0 -8
  184. package/lib/icons/destinations/honeycomb-logo/honeycomb-logo.stories.d.ts +0 -8
  185. package/lib/icons/destinations/hyperdx-logo/hyperdx-logo.stories.d.ts +0 -8
  186. package/lib/icons/destinations/instana-logo/instana-logo.stories.d.ts +0 -8
  187. package/lib/icons/destinations/jaeger-logo/jaeger-logo.stories.d.ts +0 -8
  188. package/lib/icons/destinations/kafka-logo/kafka-logo.stories.d.ts +0 -8
  189. package/lib/icons/destinations/kloudmate-logo/kloudmate-logo.stories.d.ts +0 -8
  190. package/lib/icons/destinations/last9-logo/last9-logo.stories.d.ts +0 -8
  191. package/lib/icons/destinations/lightstep-logo/lightstep-logo.stories.d.ts +0 -8
  192. package/lib/icons/destinations/logzio-logo/logzio-logo.stories.d.ts +0 -8
  193. package/lib/icons/destinations/loki-logo/loki-logo.stories.d.ts +0 -8
  194. package/lib/icons/destinations/lumigo-logo/lumigo-logo.stories.d.ts +0 -8
  195. package/lib/icons/destinations/middleware-logo/middleware-logo.stories.d.ts +0 -8
  196. package/lib/icons/destinations/new-relic-logo/new-relic-logo.stories.d.ts +0 -8
  197. package/lib/icons/destinations/observe-logo/observe-logo.stories.d.ts +0 -8
  198. package/lib/icons/destinations/one-uptime-logo/one-uptime-logo.stories.d.ts +0 -8
  199. package/lib/icons/destinations/open-observe-logo/open-observe-logo.stories.d.ts +0 -8
  200. package/lib/icons/destinations/open-telemetry-logo/open-telemetry-logo.stories.d.ts +0 -8
  201. package/lib/icons/destinations/ops-verse-logo/ops-verse-logo.stories.d.ts +0 -8
  202. package/lib/icons/destinations/oracle-logo/oracle-logo.stories.d.ts +0 -8
  203. package/lib/icons/destinations/prometheus-logo/prometheus-logo.stories.d.ts +0 -8
  204. package/lib/icons/destinations/qryn-logo/qryn-logo.stories.d.ts +0 -8
  205. package/lib/icons/destinations/quickwit-logo/quickwit-logo.stories.d.ts +0 -8
  206. package/lib/icons/destinations/sentry-logo/sentry-logo.stories.d.ts +0 -8
  207. package/lib/icons/destinations/seq-logo/seq-logo.stories.d.ts +0 -8
  208. package/lib/icons/destinations/signoz-logo/signoz-logo.stories.d.ts +0 -8
  209. package/lib/icons/destinations/splunk-logo/splunk-logo.stories.d.ts +0 -8
  210. package/lib/icons/destinations/sumo-logic-logo/sumo-logic-logo.stories.d.ts +0 -8
  211. package/lib/icons/destinations/telemetry-hub-logo/telemetry-hub-logo.stories.d.ts +0 -8
  212. package/lib/icons/destinations/tempo-logo/tempo-logo.stories.d.ts +0 -8
  213. package/lib/icons/destinations/tingyun-logo/tingyun-logo.stories.d.ts +0 -8
  214. package/lib/icons/destinations/traceloop-logo/traceloop-logo.stories.d.ts +0 -8
  215. package/lib/icons/destinations/uptrace-logo/uptrace-logo.stories.d.ts +0 -8
  216. package/lib/icons/destinations/victoria-metrics-logo/victoria-metrics-logo.stories.d.ts +0 -8
  217. package/lib/icons/instrumentation-rules/code-attributes-icon/code-attributes-icon.stories.d.ts +0 -8
  218. package/lib/icons/instrumentation-rules/custom-instrumentation-icon/custom-instrumentation-icon.stories.d.ts +0 -7
  219. package/lib/icons/instrumentation-rules/headers-collection-icon/headers-collection-icon.stories.d.ts +0 -8
  220. package/lib/icons/instrumentation-rules/payload-collection-icon/payload-collection-icon.stories.d.ts +0 -8
  221. package/lib/icons/math/minus-circled-icon/minus-circled-icon.stories.d.ts +0 -8
  222. package/lib/icons/math/minus-icon/minus-icon.stories.d.ts +0 -8
  223. package/lib/icons/math/plus-circled-icon/plus-circled-icon.stories.d.ts +0 -8
  224. package/lib/icons/math/plus-icon/plus-icon.stories.d.ts +0 -8
  225. package/lib/icons/monitors/logs-icon/logs-icon.stories.d.ts +0 -8
  226. package/lib/icons/monitors/metrics-icon/metrics-icon.stories.d.ts +0 -8
  227. package/lib/icons/monitors/traces-icon/traces-icon.stories.d.ts +0 -8
  228. package/lib/icons/on-off/eye-closed-icon/eye-closed-icon.stories.d.ts +0 -8
  229. package/lib/icons/on-off/eye-open-icon/eye-open-icon.stories.d.ts +0 -8
  230. package/lib/icons/on-off/light-off-icon/light-off-icon.stories.d.ts +0 -8
  231. package/lib/icons/on-off/light-on-icon/light-on-icon.stories.d.ts +0 -8
  232. package/lib/icons/on-off/moon-icon/moon-icon.stories.d.ts +0 -8
  233. package/lib/icons/on-off/sun-icon/sun-icon.stories.d.ts +0 -8
  234. package/lib/icons/overview/actions-icon/actions-icon.stories.d.ts +0 -8
  235. package/lib/icons/overview/connections-icon/connections-icon.stories.d.ts +0 -8
  236. package/lib/icons/overview/data-streams-icon/data-streams-icon.stories.d.ts +0 -8
  237. package/lib/icons/overview/destinations-icon/destinations-icon.stories.d.ts +0 -8
  238. package/lib/icons/overview/namespaces-icon/namespaces-icon.stories.d.ts +0 -8
  239. package/lib/icons/overview/overview-icon/overview-icon.stories.d.ts +0 -8
  240. package/lib/icons/overview/rules-icon/rules-icon.stories.d.ts +0 -8
  241. package/lib/icons/overview/service-map-icon/service-map-icon.stories.d.ts +0 -8
  242. package/lib/icons/overview/sources-icon/sources-icon.stories.d.ts +0 -8
  243. package/lib/icons/overview/trace-view-icon/trace-view-icon.stories.d.ts +0 -8
  244. package/lib/icons/programming-languages/c-plus-plus-logo/c-plus-plus-logo.stories.d.ts +0 -8
  245. package/lib/icons/programming-languages/c-sharp-logo/c-sharp-logo.stories.d.ts +0 -8
  246. package/lib/icons/programming-languages/dotnet-logo/dotnet-logo.stories.d.ts +0 -8
  247. package/lib/icons/programming-languages/elixir-logo/elixir-logo.stories.d.ts +0 -8
  248. package/lib/icons/programming-languages/go-logo/go-logo.stories.d.ts +0 -8
  249. package/lib/icons/programming-languages/java-logo/java-logo.stories.d.ts +0 -8
  250. package/lib/icons/programming-languages/mysql-logo/mysql-logo.stories.d.ts +0 -8
  251. package/lib/icons/programming-languages/nginx-logo/nginx-logo.stories.d.ts +0 -8
  252. package/lib/icons/programming-languages/nodejs-logo/nodejs-logo.stories.d.ts +0 -8
  253. package/lib/icons/programming-languages/php-logo/php-logo.stories.d.ts +0 -8
  254. package/lib/icons/programming-languages/postgres-logo/postgres-logo.stories.d.ts +0 -8
  255. package/lib/icons/programming-languages/python-logo/python-logo.stories.d.ts +0 -8
  256. package/lib/icons/programming-languages/redis-logo/redis-logo.stories.d.ts +0 -8
  257. package/lib/icons/programming-languages/ruby-logo/ruby-logo.stories.d.ts +0 -8
  258. package/lib/icons/programming-languages/rust-logo/rust-logo.stories.d.ts +0 -8
  259. package/lib/icons/programming-languages/swift-logo/swift-logo.stories.d.ts +0 -8
  260. package/lib/icons/social/slack-logo/slack-logo.stories.d.ts +0 -8
  261. package/lib/icons/status/check-circled-icon/check-circled-icon.stories.d.ts +0 -8
  262. package/lib/icons/status/check-icon/check-icon.stories.d.ts +0 -8
  263. package/lib/icons/status/cross-circled-icon/cross-circled-icon.stories.d.ts +0 -8
  264. package/lib/icons/status/cross-icon/cross-icon.stories.d.ts +0 -8
  265. package/lib/icons/status/error-round-icon/error-round-icon.stories.d.ts +0 -8
  266. package/lib/icons/status/error-triangle-icon/error-triangle-icon.stories.d.ts +0 -8
  267. package/lib/icons/status/info-icon/info-icon.stories.d.ts +0 -8
  268. package/lib/icons/status/warning-triangle-icon/warning-triangle-icon.stories.d.ts +0 -8
  269. package/lib/index-4BmryHdH.js +0 -23
  270. package/lib/snippets/note-back-to-summary/note-back-to-summary.stories.d.ts +0 -9
  271. package/lib/useSourceSelectionFormData-CwggurLH.js +0 -614
  272. /package/lib/{index-Dqief9td.js → index-1cb4f9e2.js} +0 -0
  273. /package/lib/{index-BlZKWuxe.js → index-6a6bea6e.js} +0 -0
  274. /package/lib/{index-BnvrwbRB.js → index-ec555530.js} +0 -0
@@ -1,614 +0,0 @@
1
- import { ActionKeyTypes, ActionType, StatusType, EntityTypes, FieldTypes } from './types.js';
2
- import { h as useNotificationStore, F as FORM_ALERTS, c as useDrawerStore, d as useEntityStore, b as useDataStreamStore, k as useSetupStore } from './index-BC03UmY5.js';
3
- import { useState, useEffect, useMemo } from 'react';
4
- import 'styled-components';
5
- import { i as isEmpty, s as safeJsonParse } from './index-BnvrwbRB.js';
6
- import { c as useGenericForm } from './useTransition-DmHfJSEP.js';
7
- import { g as getIdFromSseTarget, i as isLegalK8sLabel, m as mapExportedSignals } from './index-BlZKWuxe.js';
8
-
9
- const INITIAL$2 = {
10
- // @ts-expect-error - we know that the field name is in the parsedFields
11
- type: '',
12
- name: '',
13
- notes: '',
14
- signals: [],
15
- disabled: false,
16
- clusterAttributes: null,
17
- renames: null,
18
- attributeNamesToDelete: null,
19
- piiCategories: null,
20
- fallbackSamplingRatio: null,
21
- samplingPercentage: null,
22
- endpointsFilters: null,
23
- servicesNameFilters: null,
24
- attributeFilters: null,
25
- };
26
- const useActionFormData = () => {
27
- const { addNotification } = useNotificationStore();
28
- const { formData, formErrors, handleFormChange, handleErrorChange, resetFormData } = useGenericForm(INITIAL$2);
29
- const validateForm = (params) => {
30
- const errors = {};
31
- let ok = true;
32
- Object.entries(formData).forEach(([k, v]) => {
33
- switch (k) {
34
- case 'type':
35
- case 'signals':
36
- if (isEmpty(v))
37
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
38
- break;
39
- case ActionKeyTypes.ClusterAttributes:
40
- if (formData.type === ActionType.AddClusterInfo && isEmpty(v))
41
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
42
- break;
43
- case ActionKeyTypes.Renames:
44
- if (formData.type === ActionType.RenameAttributes && isEmpty(v))
45
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
46
- break;
47
- case ActionKeyTypes.AttributeNamesToDelete:
48
- if (formData.type === ActionType.DeleteAttributes && isEmpty(v))
49
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
50
- break;
51
- case ActionKeyTypes.PiiCategories:
52
- if (formData.type === ActionType.PiiMasking && isEmpty(v))
53
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
54
- break;
55
- case ActionKeyTypes.FallbackSamplingRatio:
56
- if (formData.type === ActionType.ErrorSampler && isEmpty(v))
57
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
58
- break;
59
- case ActionKeyTypes.SamplingPercentage:
60
- if (formData.type === ActionType.ProbabilisticSampler && isEmpty(v))
61
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
62
- break;
63
- case ActionKeyTypes.EndpointsFilters:
64
- if (formData.type === ActionType.LatencySampler) {
65
- if (isEmpty(v))
66
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
67
- v?.forEach((endpoint) => {
68
- if (endpoint.httpRoute.charAt(0) !== '/')
69
- errors[k] = FORM_ALERTS.LATENCY_HTTP_ROUTE;
70
- });
71
- }
72
- break;
73
- case ActionKeyTypes.ServicesNameFilters:
74
- if (formData.type === ActionType.ServiceNameSampler) {
75
- if (isEmpty(v))
76
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
77
- v?.forEach((objV) => {
78
- if (isEmpty(objV))
79
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
80
- });
81
- }
82
- break;
83
- case ActionKeyTypes.AttributeFilters:
84
- if (formData.type === ActionType.SpanAttributeSampler && isEmpty(v))
85
- errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
86
- break;
87
- }
88
- });
89
- ok = !Object.values(errors).length;
90
- if (!ok && params?.withAlert) {
91
- addNotification({
92
- type: StatusType.Warning,
93
- title: params.alertTitle,
94
- message: FORM_ALERTS.REQUIRED_FIELDS,
95
- hideFromHistory: true,
96
- });
97
- }
98
- handleErrorChange(undefined, undefined, errors);
99
- return ok;
100
- };
101
- const loadFormWithDrawerItem = ({ type, spec }) => {
102
- const updatedData = {
103
- ...INITIAL$2,
104
- type,
105
- };
106
- Object.entries(spec).forEach(([k, v]) => {
107
- if (!!v) {
108
- switch (k) {
109
- case 'actionName': {
110
- updatedData['name'] = v;
111
- break;
112
- }
113
- case 'type':
114
- case 'notes':
115
- case 'signals':
116
- case 'disabled':
117
- case ActionKeyTypes.CollectContainerAttributes:
118
- case ActionKeyTypes.CollectReplicaSetAttributes:
119
- case ActionKeyTypes.CollectWorkloadId:
120
- case ActionKeyTypes.CollectClusterId:
121
- case ActionKeyTypes.LabelsAttributes:
122
- case ActionKeyTypes.AnnotationsAttributes:
123
- case ActionKeyTypes.ClusterAttributes:
124
- case ActionKeyTypes.AttributeNamesToDelete:
125
- case ActionKeyTypes.Renames:
126
- case ActionKeyTypes.PiiCategories:
127
- case ActionKeyTypes.FallbackSamplingRatio:
128
- case ActionKeyTypes.SamplingPercentage:
129
- case ActionKeyTypes.EndpointsFilters:
130
- case ActionKeyTypes.ServicesNameFilters:
131
- case ActionKeyTypes.AttributeFilters: {
132
- // @ts-expect-error - we know that the field name is in the parsedFields
133
- updatedData[k] = v;
134
- break;
135
- }
136
- }
137
- }
138
- });
139
- handleFormChange(undefined, undefined, updatedData);
140
- };
141
- return {
142
- formData,
143
- formErrors,
144
- handleFormChange,
145
- resetFormData,
146
- validateForm,
147
- loadFormWithDrawerItem,
148
- };
149
- };
150
-
151
- const useClickNotification = () => {
152
- const { setDrawerType, setDrawerEntityId } = useDrawerStore();
153
- const { markAsDismissed, markAsSeen } = useNotificationStore();
154
- const onClickNotification = (notif, options) => {
155
- const { id, crdType, target } = notif;
156
- const { dismissToast } = options || {};
157
- if (crdType && target) {
158
- switch (crdType) {
159
- case EntityTypes.InstrumentationRule:
160
- setDrawerType(EntityTypes.InstrumentationRule);
161
- setDrawerEntityId(getIdFromSseTarget(target, EntityTypes.InstrumentationRule));
162
- break;
163
- case EntityTypes.Source:
164
- case 'InstrumentationConfig':
165
- case 'InstrumentationInstance':
166
- setDrawerType(EntityTypes.Source);
167
- setDrawerEntityId(getIdFromSseTarget(target, EntityTypes.Source));
168
- break;
169
- case EntityTypes.Action:
170
- setDrawerType(EntityTypes.Action);
171
- setDrawerEntityId(getIdFromSseTarget(target, EntityTypes.Action));
172
- break;
173
- case EntityTypes.Destination:
174
- case 'Destination':
175
- setDrawerType(EntityTypes.Destination);
176
- setDrawerEntityId(getIdFromSseTarget(target, EntityTypes.Destination));
177
- break;
178
- default:
179
- console.warn('notif click not handled for:', { crdType, target });
180
- break;
181
- }
182
- }
183
- markAsSeen(id);
184
- if (dismissToast)
185
- markAsDismissed(id);
186
- };
187
- return { onClickNotification };
188
- };
189
-
190
- const useDataStreamFormData = (initialFormData) => {
191
- const { addNotification } = useNotificationStore();
192
- const { formData, handleFormChange, formErrors, handleErrorChange, resetFormData } = useGenericForm(initialFormData);
193
- const validateForm = (params) => {
194
- const errors = {};
195
- let isValid = true;
196
- if (!formData['name']) {
197
- isValid = false;
198
- errors['name'] = FORM_ALERTS.FIELD_IS_REQUIRED;
199
- }
200
- else if (!isLegalK8sLabel(formData['name'])) {
201
- isValid = false;
202
- errors['name'] = FORM_ALERTS.ILLEGAL_K8S_LABEL;
203
- }
204
- else {
205
- errors['name'] = undefined;
206
- }
207
- if (!isValid && params?.withAlert) {
208
- addNotification({
209
- type: StatusType.Warning,
210
- title: params.alertTitle,
211
- message: FORM_ALERTS.REQUIRED_FIELDS,
212
- hideFromHistory: true,
213
- });
214
- }
215
- handleErrorChange(undefined, undefined, errors);
216
- return isValid;
217
- };
218
- const loadFormWithDrawerItem = ({ name }) => {
219
- const updatedData = {
220
- ...initialFormData,
221
- name,
222
- };
223
- handleFormChange(undefined, undefined, updatedData);
224
- };
225
- return {
226
- formData,
227
- formErrors,
228
- handleFormChange,
229
- resetFormData,
230
- validateForm,
231
- loadFormWithDrawerItem,
232
- };
233
- };
234
-
235
- const INITIAL$1 = {
236
- // @ts-expect-error - form should be initialized with empty values
237
- type: '',
238
- name: '',
239
- exportedSignals: {
240
- logs: false,
241
- metrics: false,
242
- traces: false,
243
- },
244
- fields: [],
245
- };
246
- const buildFormDynamicFields = (fields) => {
247
- return fields
248
- .filter((f) => !!f)
249
- .map((f) => {
250
- const { name, componentType, componentProperties, displayName, initialValue, renderCondition } = f;
251
- switch (componentType) {
252
- case FieldTypes.Dropdown: {
253
- const componentPropertiesJson = safeJsonParse(componentProperties, {});
254
- const options = Array.isArray(componentPropertiesJson.values)
255
- ? componentPropertiesJson.values.map((value) => ({
256
- id: value,
257
- value,
258
- }))
259
- : Object.entries(componentPropertiesJson.values).map(([key, value]) => ({
260
- id: key,
261
- value,
262
- }));
263
- return {
264
- name,
265
- componentType: componentType,
266
- title: displayName,
267
- value: initialValue,
268
- placeholder: componentPropertiesJson.placeholder || 'Select an option',
269
- options,
270
- renderCondition,
271
- ...componentPropertiesJson,
272
- };
273
- }
274
- default: {
275
- const componentPropertiesJson = safeJsonParse(componentProperties, {});
276
- return {
277
- name,
278
- componentType,
279
- title: displayName,
280
- value: initialValue,
281
- renderCondition,
282
- ...componentPropertiesJson,
283
- };
284
- }
285
- }
286
- });
287
- };
288
- const useDestinationFormData = (params) => {
289
- const { supportedSignals, preLoadedFields } = params || {};
290
- const { addNotification } = useNotificationStore();
291
- const { formData, formErrors, handleFormChange, handleErrorChange, resetFormData } = useGenericForm(INITIAL$1);
292
- const [yamlFields, setYamlFields] = useState([]);
293
- const [dynamicFields, setDynamicFields] = useState([]);
294
- useEffect(() => {
295
- if (yamlFields) {
296
- setDynamicFields(buildFormDynamicFields(yamlFields).map((field) => {
297
- // if we have preloaded fields, we need to set the value of the field
298
- // (this can be from an odigos-detected-destination during create, or from an existing destination during edit/update)
299
- if (!!preLoadedFields) {
300
- const parsedFields = typeof preLoadedFields === 'string' ? safeJsonParse(preLoadedFields, {}) : preLoadedFields;
301
- if (field.name in parsedFields) {
302
- return {
303
- ...field,
304
- // @ts-expect-error - we know that the field name is in the parsedFields
305
- value: parsedFields[field.name],
306
- };
307
- }
308
- }
309
- return field;
310
- }));
311
- }
312
- else {
313
- setDynamicFields([]);
314
- }
315
- }, [yamlFields, preLoadedFields]);
316
- useEffect(() => {
317
- if (dynamicFields) {
318
- const mapped = dynamicFields.map((field) => ({
319
- key: field.name,
320
- value: field.value,
321
- }));
322
- handleFormChange('fields', mapped);
323
- }
324
- }, [dynamicFields]);
325
- useEffect(() => {
326
- if (supportedSignals && mapExportedSignals(formData.exportedSignals).length === 0) {
327
- const { logs, metrics, traces } = supportedSignals;
328
- handleFormChange('exportedSignals', {
329
- logs: logs.supported,
330
- metrics: metrics.supported,
331
- traces: traces.supported,
332
- });
333
- }
334
- }, [supportedSignals, formData]);
335
- const validateForm = (params) => {
336
- const errors = {};
337
- let ok = true;
338
- dynamicFields.forEach(({ name, value, required }) => {
339
- if (required && !value) {
340
- ok = false;
341
- errors[name] = FORM_ALERTS.FIELD_IS_REQUIRED;
342
- }
343
- });
344
- if (!ok && params?.withAlert) {
345
- addNotification({
346
- type: StatusType.Warning,
347
- title: params.alertTitle,
348
- message: FORM_ALERTS.REQUIRED_FIELDS,
349
- hideFromHistory: true,
350
- });
351
- }
352
- handleErrorChange(undefined, undefined, errors);
353
- return ok;
354
- };
355
- const loadFormWithDrawerItem = ({ destinationType: { type }, name, exportedSignals, fields }) => {
356
- const updatedData = {
357
- ...INITIAL$1,
358
- type,
359
- name,
360
- exportedSignals,
361
- fields: Object.entries(safeJsonParse(fields, {})).map(([key, value]) => ({ key, value })),
362
- };
363
- handleFormChange(undefined, undefined, updatedData);
364
- return updatedData;
365
- };
366
- return {
367
- formData,
368
- formErrors,
369
- handleFormChange,
370
- resetFormData,
371
- validateForm,
372
- loadFormWithDrawerItem,
373
- yamlFields,
374
- setYamlFields,
375
- dynamicFields,
376
- setDynamicFields,
377
- };
378
- };
379
-
380
- const useSessionStorage = () => {
381
- const getItemSS = (key, defaultValue) => {
382
- const item = sessionStorage.getItem(key);
383
- return item ? safeJsonParse(item, defaultValue) : defaultValue;
384
- };
385
- const setItemSS = (key, value) => {
386
- sessionStorage.setItem(key, JSON.stringify(value));
387
- };
388
- const removeItemSS = (key) => {
389
- sessionStorage.removeItem(key);
390
- };
391
- return { getItemSS, setItemSS, removeItemSS };
392
- };
393
-
394
- const INITIAL = {
395
- otelServiceName: '',
396
- currentStreamName: '',
397
- };
398
- const useSourceFormData = () => {
399
- const { formData, formErrors, handleFormChange, handleErrorChange, resetFormData } = useGenericForm(INITIAL);
400
- const validateForm = () => {
401
- // We don't have any specific validations for this form yet
402
- handleErrorChange(undefined, undefined, {});
403
- return true;
404
- };
405
- const loadFormWithDrawerItem = ({ otelServiceName, name }) => {
406
- const updatedData = {
407
- ...INITIAL,
408
- otelServiceName: otelServiceName || name || '',
409
- };
410
- handleFormChange(undefined, undefined, updatedData);
411
- };
412
- return {
413
- formData,
414
- formErrors,
415
- handleFormChange,
416
- resetFormData,
417
- validateForm,
418
- loadFormWithDrawerItem,
419
- };
420
- };
421
-
422
- const mapToAvailableSource = (source, selectedStreamName, selectAll) => {
423
- const isBooleanOverride = typeof selectAll === 'boolean';
424
- const isInCurrentStream = source.dataStreamNames?.includes(selectedStreamName) || source.currentStreamName === selectedStreamName;
425
- const selected = (isBooleanOverride ? selectAll : source.selected) || false;
426
- return {
427
- namespace: source.namespace,
428
- name: source.name,
429
- kind: source.kind,
430
- selected: isInCurrentStream || isBooleanOverride ? selected : false,
431
- numberOfInstances: source.numberOfInstances,
432
- };
433
- };
434
- const mapToSelectedSource = (source, selectedStreamName, selectAll) => {
435
- return {
436
- ...mapToAvailableSource(source, selectedStreamName, selectAll),
437
- currentStreamName: selectedStreamName,
438
- };
439
- };
440
- const mapToSelectedNamespace = (ns, selectedStreamName, selectAll) => {
441
- const isBooleanOverride = typeof selectAll === 'boolean';
442
- const isInCurrentStream = ns.dataStreamNames?.includes(selectedStreamName);
443
- const selected = (isBooleanOverride ? selectAll : ns.selected) || false;
444
- return {
445
- namespace: ns.name,
446
- selected: isInCurrentStream || isBooleanOverride ? selected : false,
447
- currentStreamName: selectedStreamName,
448
- };
449
- };
450
- const mergeAvailableAndSelectedSources = (available, selected, currentStreamName) => {
451
- const payload = {};
452
- Object.entries(available).forEach(([namespace, sources]) => {
453
- payload[namespace] = sources.map((s) => mapToSelectedSource(s, currentStreamName));
454
- });
455
- Object.entries(selected).forEach(([namespace, sources]) => {
456
- sources.forEach((s) => {
457
- const foundIdx = payload[namespace].findIndex((src) => src.name === s.name && src.kind === s.kind);
458
- const mapped = mapToSelectedSource(s, currentStreamName);
459
- if (foundIdx !== -1) {
460
- payload[namespace][foundIdx] = mapped;
461
- }
462
- else {
463
- payload[namespace].push(mapped);
464
- }
465
- });
466
- });
467
- return payload;
468
- };
469
- const useSourceSelectionFormData = (params) => {
470
- const { fetchSingleNamespace } = params || {};
471
- const { namespaces } = useEntityStore();
472
- const { selectedStreamName } = useDataStreamStore();
473
- // only for "onboarding" - get unsaved values and set to state
474
- // (this is to persist the values when user navigates back to this page)
475
- const { configuredSources, configuredFutureApps, availableSources: availableSourcesFromStore } = useSetupStore();
476
- // Keeps intial values fetched from API, so we can later filter the user-specific-selections, therebey minimizing the amount of data sent to the API on "persist sources".
477
- const [availableSources, setRecordedInitialSources] = useState(availableSourcesFromStore);
478
- const [selectedNamespace, setSelectedNamespace] = useState('');
479
- const [selectedFutureApps, setSelectedFutureApps] = useState(configuredFutureApps);
480
- const [selectedSources, setSelectedSources] = useState(mergeAvailableAndSelectedSources(availableSourcesFromStore, configuredSources, selectedStreamName));
481
- const fetchAndSetThisNamespace = async (ns, selectAll) => {
482
- if (fetchSingleNamespace) {
483
- const { data } = await fetchSingleNamespace({ variables: { namespaceName: ns.name } });
484
- const { name, sources = [] } = data?.computePlatform?.k8sActualNamespace || {};
485
- if (!name)
486
- return;
487
- setRecordedInitialSources((prev) => ({
488
- ...prev,
489
- [name]: sources.map((s) => mapToAvailableSource(s, selectedStreamName)),
490
- }));
491
- setSelectedSources((prev) => ({
492
- ...prev,
493
- [name]: typeof selectAll !== 'boolean' && prev[name]?.length ? prev[name] : sources.map((s) => mapToSelectedSource(s, selectedStreamName, selectAll)),
494
- }));
495
- }
496
- };
497
- useEffect(() => {
498
- if (!!namespaces?.length) {
499
- // initialize empty states to avoid undefined errors
500
- setRecordedInitialSources((prev) => {
501
- const payload = { ...prev };
502
- namespaces.forEach(({ name }) => (payload[name] = payload[name] || []));
503
- return payload;
504
- });
505
- setSelectedSources((prev) => {
506
- const payload = { ...prev };
507
- namespaces.forEach(({ name }) => (payload[name] = payload[name] || []));
508
- return payload;
509
- });
510
- setSelectedFutureApps((prev) => {
511
- const payload = { ...prev };
512
- namespaces.forEach((ns) => (payload[ns.name] = payload[ns.name] || mapToSelectedNamespace(ns, selectedStreamName)));
513
- return payload;
514
- });
515
- (async () => {
516
- for await (const ns of namespaces)
517
- await fetchAndSetThisNamespace(ns);
518
- })();
519
- }
520
- }, [namespaces, selectedStreamName]);
521
- // form filters
522
- const [searchText, setSearchText] = useState('');
523
- const [searchBy, setSearchBy] = useState(EntityTypes.Source);
524
- const [showSelectedOnly, setShowSelectedOnly] = useState(false);
525
- const onSelectNamespace = (nsName, selectAll) => {
526
- const ns = namespaces.find((namespace) => namespace.name === nsName);
527
- if (ns) {
528
- setSelectedNamespace((prev) => (prev === nsName && typeof selectAll !== 'boolean' ? '' : nsName));
529
- fetchAndSetThisNamespace(ns, selectAll);
530
- }
531
- };
532
- const onSelectSource = (source, nsName) => {
533
- const id = nsName || selectedNamespace;
534
- if (!id)
535
- return;
536
- const arr = [...(selectedSources[id] || [])];
537
- const foundIdx = arr.findIndex(({ name, kind }) => name === source.name && kind === source.kind);
538
- if (foundIdx !== -1) {
539
- // Replace the item with a new object to avoid mutating a possibly read-only object
540
- const updatedItem = { ...arr[foundIdx], selected: !arr[foundIdx].selected, currentStreamName: selectedStreamName };
541
- arr[foundIdx] = updatedItem;
542
- }
543
- else {
544
- arr.push({ ...source, selected: true, currentStreamName: selectedStreamName });
545
- }
546
- setSelectedSources((prev) => ({ ...prev, [id]: arr }));
547
- };
548
- const onSelectFutureApps = (bool, nsName) => {
549
- const id = nsName || selectedNamespace;
550
- if (!id)
551
- return;
552
- const ns = namespaces.find((namespace) => namespace.name === nsName);
553
- if (ns)
554
- setSelectedFutureApps((prev) => ({ ...prev, [id]: mapToSelectedNamespace(ns, selectedStreamName, bool) }));
555
- };
556
- const filteredNamespacesAndSources = useMemo(() => {
557
- const isSearchOk = (targetText, entityType) => !searchText || searchBy !== entityType || (searchBy === entityType && targetText.toLowerCase().includes(searchText));
558
- const isOnlySelectedOk = (source) => !showSelectedOnly || source.selected;
559
- const payload = {};
560
- const filteredNamespacesMatrix = Object.entries(selectedSources).filter(([ns]) => {
561
- return isSearchOk(ns, EntityTypes.Namespace);
562
- });
563
- filteredNamespacesMatrix.forEach(([ns, srcs]) => {
564
- payload[ns] = srcs.filter((src) => isSearchOk(src.name, EntityTypes.Source) && isOnlySelectedOk(src));
565
- });
566
- return payload;
567
- }, [selectedSources, searchText, searchBy, showSelectedOnly]);
568
- // This is to filter the user-specific-selections, therebey minimizing the amount of data sent to the API on "persist sources".
569
- const getApiSourcesPayload = () => {
570
- const payload = {};
571
- Object.entries(selectedSources).forEach(([namespace, sources]) => {
572
- sources.forEach((source) => {
573
- const foundInitial = availableSources[namespace]?.find((src) => src.name === source.name && src.kind === source.kind);
574
- if (foundInitial?.selected !== source.selected) {
575
- if (!payload[namespace])
576
- payload[namespace] = [];
577
- payload[namespace].push(source);
578
- }
579
- });
580
- });
581
- return payload;
582
- };
583
- // This is to filter the user-specific-selections, therebey minimizing the amount of data sent to the API on "persist namespaces".
584
- const getApiFutureAppsPayload = () => {
585
- const payload = {};
586
- Object.entries(selectedFutureApps).forEach(([namespace, obj]) => {
587
- const foundInitial = namespaces?.find((ns) => ns.name === namespace);
588
- if ((obj.selected && !foundInitial?.dataStreamNames?.includes(selectedStreamName)) || (!obj.selected && foundInitial?.dataStreamNames?.includes(selectedStreamName))) {
589
- payload[namespace] = obj;
590
- }
591
- });
592
- return payload;
593
- };
594
- return {
595
- availableSources,
596
- filteredNamespacesAndSources,
597
- getApiSourcesPayload,
598
- getApiFutureAppsPayload,
599
- selectedNamespace,
600
- onSelectNamespace,
601
- selectedSources,
602
- onSelectSource,
603
- selectedFutureApps,
604
- onSelectFutureApps,
605
- searchText,
606
- setSearchText,
607
- searchBy,
608
- setSearchBy,
609
- showSelectedOnly,
610
- setShowSelectedOnly,
611
- };
612
- };
613
-
614
- export { useClickNotification as a, useDataStreamFormData as b, useDestinationFormData as c, useSessionStorage as d, useSourceFormData as e, useSourceSelectionFormData as f, useActionFormData as u };
File without changes
File without changes
File without changes