@odigos/ui-kit 0.0.45 → 0.0.47

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 (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/components/data-tab/index.d.ts +1 -0
  3. package/lib/components/toggle/index.d.ts +1 -0
  4. package/lib/components.js +8 -8
  5. package/lib/constants/strings/index.d.ts +3 -0
  6. package/lib/constants.js +1 -1
  7. package/lib/containers/data-stream-form/index.d.ts +1 -1
  8. package/lib/containers/data-stream-modal/data-stream-modal.stories.d.ts +9 -0
  9. package/lib/containers/data-stream-modal/index.d.ts +5 -0
  10. package/lib/containers/destination-modal/choose-destination/destinations-list/index.d.ts +1 -0
  11. package/lib/containers/destination-modal/choose-destination/index.d.ts +2 -2
  12. package/lib/containers/destination-modal/index.d.ts +3 -2
  13. package/lib/containers.js +71 -41
  14. package/lib/functions.js +5 -5
  15. package/lib/hooks/useSourceSelectionFormData.d.ts +4 -4
  16. package/lib/hooks.js +3 -3
  17. package/lib/icons.js +6 -6
  18. package/lib/{index-C4uhvIMP.js → index-B1IScVBT.js} +11 -10
  19. package/lib/{index-qnmhJI4d.js → index-BJpPcCBm.js} +2 -2
  20. package/lib/{index-BD7meETN.js → index-BRGQ84pJ.js} +3 -0
  21. package/lib/{index-CY3kjYr3.js → index-BUCure0Q.js} +1 -1
  22. package/lib/{index-BL1s2-bo.js → index-C4aVlsHh.js} +1 -1
  23. package/lib/{index-CnbEaeQS.js → index-C8vqcUbP.js} +2 -2
  24. package/lib/{index-DZWbhK14.js → index-CeHgnkLY.js} +1 -1
  25. package/lib/{index-BSjQAYib.js → index-CpT8LSxY.js} +3 -3
  26. package/lib/{index-C3BU6Xe-.js → index-DypjdLnz.js} +1 -1
  27. package/lib/{index-lkkeQEOt.js → index-fEP_guwb.js} +4 -4
  28. package/lib/snippets.js +7 -7
  29. package/lib/store/useSetupStore.d.ts +7 -2
  30. package/lib/store.js +1 -1
  31. package/lib/theme.js +1 -1
  32. package/lib/types/common/index.d.ts +3 -0
  33. package/lib/types/namespaces/index.d.ts +1 -0
  34. package/lib/types/sources/index.d.ts +2 -6
  35. package/lib/types.js +5 -1
  36. package/lib/{useSourceSelectionFormData-DmZnRueA.js → useSourceSelectionFormData-CMXqoHZs.js} +52 -32
  37. package/lib/{useTransition-BWC_F-Pl.js → useTransition-DsrDiKOV.js} +1 -1
  38. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.47](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.46...ui-kit-v0.0.47) (2025-06-26)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **destination-drawer:** conditionally render conditions based on length ([#198](https://github.com/odigos-io/ui-kit/issues/198)) ([a72a292](https://github.com/odigos-io/ui-kit/commit/a72a2921c5cfdeece31136c38e3e4c8d0034e4d4))
9
+
10
+ ## [0.0.46](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.45...ui-kit-v0.0.46) (2025-06-24)
11
+
12
+
13
+ ### Features
14
+
15
+ * turn on data streams ([#164](https://github.com/odigos-io/ui-kit/issues/164)) ([f7956f4](https://github.com/odigos-io/ui-kit/commit/f7956f4d9a444aa7c88d62ab9fbeeee3c523e855))
16
+
3
17
  ## [0.0.45](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.44...ui-kit-v0.0.45) (2025-06-23)
4
18
 
5
19
 
@@ -20,6 +20,7 @@ interface CheckboxProps {
20
20
  withCheckbox?: boolean;
21
21
  isCheckboxDisabled?: boolean;
22
22
  isChecked?: boolean;
23
+ isLoading?: boolean;
23
24
  onCheckboxChange?: (value: boolean) => void;
24
25
  }
25
26
  interface ExtendableProps {
@@ -6,6 +6,7 @@ interface ToggleProps {
6
6
  onChange?: (value: boolean) => void;
7
7
  disabled?: boolean;
8
8
  allowPropagation?: boolean;
9
+ flipHorizontally?: boolean;
9
10
  }
10
11
  declare const Toggle: FC<ToggleProps>;
11
12
  export { Toggle, type ToggleProps };
package/lib/components.js CHANGED
@@ -1,15 +1,15 @@
1
- import { B as Button } from './index-C4uhvIMP.js';
2
- export { a as AutocompleteInput, b as Badge, a1 as CenterThis, C as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as Divider, i as DocsButton, j as Drawer, l as DrawerFooter, k as DrawerHeader, m as Dropdown, E as ExtendArrow, F as FadeLoader, n as FieldError, o as FieldLabel, a0 as FlexColumn, $ as FlexRow, H as Header, I as IconButton, p as IconGroup, q as IconTitleBadge, r as IconWrapped, s as IconsNav, t as ImageControlled, u as Input, v as InputList, w as InputTable, x as InteractiveTable, K as KeyValueInputsList, M as Modal, a4 as ModalBody, y as MonitorsCheckboxes, z as MonitorsIcons, N as NavigationButtons, G as NoDataFound, J as NotificationNote, a3 as Overlay, S as ScrollX, L as SectionTitle, O as Segment, P as SelectionButton, Q as SkeletonLoader, R as Status, U as Stepper, a5 as TableContainer, a6 as TableTitleWrap, a7 as TableWrap, V as Text, W as TextArea, X as Toggle, T as ToggleCodeComponent, Y as Tooltip, Z as TraceLoader, a2 as VerticalScroll, _ as WarningModal } from './index-C4uhvIMP.js';
3
- export { C as CancelWarning, D as DeleteWarning } from './index-CnbEaeQS.js';
1
+ import { B as Button } from './index-B1IScVBT.js';
2
+ export { a as AutocompleteInput, b as Badge, a1 as CenterThis, C as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as Divider, i as DocsButton, j as Drawer, l as DrawerFooter, k as DrawerHeader, m as Dropdown, E as ExtendArrow, F as FadeLoader, n as FieldError, o as FieldLabel, a0 as FlexColumn, $ as FlexRow, H as Header, I as IconButton, p as IconGroup, q as IconTitleBadge, r as IconWrapped, s as IconsNav, t as ImageControlled, u as Input, v as InputList, w as InputTable, x as InteractiveTable, K as KeyValueInputsList, M as Modal, a4 as ModalBody, y as MonitorsCheckboxes, z as MonitorsIcons, N as NavigationButtons, G as NoDataFound, J as NotificationNote, a3 as Overlay, S as ScrollX, L as SectionTitle, O as Segment, P as SelectionButton, Q as SkeletonLoader, R as Status, U as Stepper, a5 as TableContainer, a6 as TableTitleWrap, a7 as TableWrap, V as Text, W as TextArea, X as Toggle, T as ToggleCodeComponent, Y as Tooltip, Z as TraceLoader, a2 as VerticalScroll, _ as WarningModal } from './index-B1IScVBT.js';
3
+ export { C as CancelWarning, D as DeleteWarning } from './index-C8vqcUbP.js';
4
4
  import React, { Component, createElement, createContext } from 'react';
5
- import { T as Theme } from './index-BD7meETN.js';
5
+ import { T as Theme } from './index-BRGQ84pJ.js';
6
6
  import './types.js';
7
- import './index-CY3kjYr3.js';
8
- import './index-qnmhJI4d.js';
7
+ import './index-BUCure0Q.js';
8
+ import './index-BJpPcCBm.js';
9
9
  import 'styled-components';
10
- import './index-DZWbhK14.js';
10
+ import './index-CeHgnkLY.js';
11
11
  import './index-BV85P9UP.js';
12
- import './useTransition-BWC_F-Pl.js';
12
+ import './useTransition-DsrDiKOV.js';
13
13
  import 'react-dom';
14
14
 
15
15
  const ErrorBoundaryContext = createContext(null);
@@ -31,6 +31,7 @@ export declare const DISPLAY_TITLES: {
31
31
  NAME_YOUR_STREAM_PLACEHOLDER: string;
32
32
  STREAM_DESCRIPTION: string;
33
33
  STREAM_CONFIRM: string;
34
+ DATA_STREAM_EXISTS_WARNING: (curr: string, next: string) => string;
34
35
  ACTION: string;
35
36
  ACTIONS: string;
36
37
  ADD_ACTION: string;
@@ -88,6 +89,8 @@ export declare const DISPLAY_TITLES: {
88
89
  TO_MODIFY_OTEL_DATA: string;
89
90
  QUICK_BACK_TO_SUMMARY: string;
90
91
  GO_TO_SUMMARY: string;
92
+ FUTURE_APPS_TITLE: string;
93
+ FUTURE_APPS_DESCRIPTION: string;
91
94
  OVERIDE: string;
92
95
  OVERIDDEN: string;
93
96
  OVERRIDE_RUNTIME_DETAILS: string;
package/lib/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ACTION_OPTIONS, B as BUTTON_TEXTS, k as DEFAULT_DATA_STREAM_NAME, D as DISPLAY_LANGUAGES, l as DISPLAY_TITLES, F as FORM_ALERTS, I as INSTRUMENTATION_RULE_OPTIONS, L as LANGUAGE_OPTIONS, M as MONITORS_OPTIONS, S as STORAGE_KEYS } from './index-BD7meETN.js';
1
+ export { A as ACTION_OPTIONS, B as BUTTON_TEXTS, k as DEFAULT_DATA_STREAM_NAME, D as DISPLAY_LANGUAGES, l as DISPLAY_TITLES, F as FORM_ALERTS, I as INSTRUMENTATION_RULE_OPTIONS, L as LANGUAGE_OPTIONS, M as MONITORS_OPTIONS, S as STORAGE_KEYS } from './index-BRGQ84pJ.js';
2
2
  export { D as DESTINATION_CATEGORIES } from './index-Dqief9td.js';
3
3
  import 'react';
4
4
  import './types.js';
@@ -1,5 +1,5 @@
1
1
  import { type FC } from 'react';
2
- import type { DataStream } from '@/types';
2
+ import { type DataStream } from '@/types';
3
3
  interface DataStreamFormProps {
4
4
  formData: DataStream;
5
5
  handleFormChange: (key: keyof DataStream, val: any) => void;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { StoryFn } from '@storybook/react';
3
+ import { type DataStreamModalProps } from '.';
4
+ declare const _default: {
5
+ title: string;
6
+ component: React.FC<DataStreamModalProps>;
7
+ };
8
+ export default _default;
9
+ export declare const Default: StoryFn<DataStreamModalProps>;
@@ -0,0 +1,5 @@
1
+ import { type FC } from 'react';
2
+ interface DataStreamModalProps {
3
+ }
4
+ declare const DataStreamModal: FC<DataStreamModalProps>;
5
+ export { DataStreamModal, type DataStreamModalProps };
@@ -4,6 +4,7 @@ interface DestinationsListProps {
4
4
  items: DestinationCategories;
5
5
  onSelectNew: (item: DestinationOption) => void;
6
6
  onSelectConfigured: (id: string) => void;
7
+ isLoadingForDestinationIds: string[];
7
8
  }
8
9
  declare const DestinationsList: FC<DestinationsListProps>;
9
10
  export { DestinationsList, type DestinationsListProps };
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
+ import { DestinationsListProps } from './destinations-list';
2
3
  import { type DestinationCategories, type DestinationOption, SignalType } from '@/types';
3
- interface Props {
4
+ interface Props extends Pick<DestinationsListProps, 'onSelectConfigured' | 'isLoadingForDestinationIds'> {
4
5
  hidden?: boolean;
5
6
  categories: DestinationCategories;
6
7
  potentialDestinations: DestinationOption[];
7
8
  onSelectNew: (item: DestinationOption, selectedMonitors: SignalType[]) => void;
8
- onSelectConfigured: (id: string) => void;
9
9
  }
10
10
  export declare const ChooseDestinationBody: React.FC<Props>;
11
11
  export {};
@@ -4,8 +4,9 @@ interface DestinationModalProps {
4
4
  isOnboarding?: boolean;
5
5
  categories: DestinationCategories;
6
6
  potentialDestinations: DestinationOption[];
7
- createDestination: (destination: DestinationFormData) => void;
8
- updateDestination: (id: string, destination: DestinationFormData) => void;
7
+ createDestination: (destination: DestinationFormData) => Promise<void>;
8
+ updateDestination: (id: string, destination: DestinationFormData) => Promise<void>;
9
+ deleteDestination: (id: string) => Promise<void>;
9
10
  testConnection: TestConnectionFunc;
10
11
  }
11
12
  declare const DestinationModal: FC<DestinationModalProps>;
package/lib/containers.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, memo, useContext, createContext, useCallback, useLayoutEffect, Fragment } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
- import { l as DISPLAY_TITLES, T as Theme, h as usePendingStore, g as useNotificationStore, b as useDrawerStore, B as BUTTON_TEXTS, c as useEntityStore, A as ACTION_OPTIONS, m as getActionIcon, f as useModalStore, F as FORM_ALERTS, d as useFilterStore, M as MONITORS_OPTIONS, $ as styleInject, i as useSelectedStore, e as useInstrumentStore, o as getInstrumentationRuleIcon, a as useDataStreamStore, n as getEntityId, S as STORAGE_KEYS, j as useSetupStore, I as INSTRUMENTATION_RULE_OPTIONS, u as useDarkMode } from './index-BD7meETN.js';
3
+ import { l as DISPLAY_TITLES, T as Theme, h as usePendingStore, g as useNotificationStore, b as useDrawerStore, B as BUTTON_TEXTS, c as useEntityStore, A as ACTION_OPTIONS, m as getActionIcon, f as useModalStore, F as FORM_ALERTS, d as useFilterStore, M as MONITORS_OPTIONS, $ as styleInject, i as useSelectedStore, e as useInstrumentStore, o as getInstrumentationRuleIcon, a as useDataStreamStore, n as getEntityId, S as STORAGE_KEYS, k as DEFAULT_DATA_STREAM_NAME, j as useSetupStore, I as INSTRUMENTATION_RULE_OPTIONS, u as useDarkMode } from './index-BRGQ84pJ.js';
4
4
  import { ActionType, ActionKeyTypes, InputTypes, FieldTypes, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, AddNodeTypes, EdgeTypes, SignalType, HeadersCollectionKeyTypes, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType, K8sResourceKind } from './types.js';
5
- import { f as DataCardFieldTypes, o as FieldLabel, C as Checkbox, n as FieldError, u as Input, w as InputTable, K as KeyValueInputsList, v as InputList, V as Text, O as Segment, L as SectionTitle, i as DocsButton, y as MonitorsCheckboxes, W as TextArea, j as Drawer, d as ConditionDetails, D as DataCard, a0 as FlexColumn, M as Modal, N as NavigationButtons, a4 as ModalBody, J as NotificationNote, a as AutocompleteInput, h as Divider, R as Status, $ as FlexRow, Y as Tooltip, r as IconWrapped, z as MonitorsIcons, a5 as TableContainer, a6 as TableTitleWrap, q as IconTitleBadge, a7 as TableWrap, x as InteractiveTable, a1 as CenterThis, G as NoDataFound, Z as TraceLoader, b as Badge, E as ExtendArrow, a2 as VerticalScroll, P as SelectionButton, B as Button, m as Dropdown, a8 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, Q as SkeletonLoader, X as Toggle, A as AddButton$1, U as Stepper, I as IconButton, e as DataCardFields, s as IconsNav, p as IconGroup } from './index-C4uhvIMP.js';
5
+ import { f as DataCardFieldTypes, o as FieldLabel, C as Checkbox, n as FieldError, u as Input, w as InputTable, K as KeyValueInputsList, v as InputList, V as Text, O as Segment, L as SectionTitle, i as DocsButton, y as MonitorsCheckboxes, W as TextArea, j as Drawer, d as ConditionDetails, D as DataCard, a0 as FlexColumn, M as Modal, N as NavigationButtons, a4 as ModalBody, J as NotificationNote, a as AutocompleteInput, h as Divider, R as Status, $ as FlexRow, Y as Tooltip, r as IconWrapped, z as MonitorsIcons, a5 as TableContainer, a6 as TableTitleWrap, q as IconTitleBadge, a7 as TableWrap, x as InteractiveTable, a1 as CenterThis, G as NoDataFound, Z as TraceLoader, b as Badge, E as ExtendArrow, a2 as VerticalScroll, P as SelectionButton, B as Button, m as Dropdown, a8 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, Q as SkeletonLoader, X as Toggle, I as IconButton, A as AddButton$1, U as Stepper, e as DataCardFields, s as IconsNav, p as IconGroup } from './index-B1IScVBT.js';
6
6
  import { i as isEmpty, s as safeJsonParse } from './index-BV85P9UP.js';
7
- import { C as CheckCircledIcon, O as OdigosLogo } from './index-DZWbhK14.js';
8
- import { C as CrossCircledIcon, O as OdigosLogoText, a as OverviewIcon, F as FilterIcon, D as DataStreamsIcon, R as RetryIcon, N as NotificationIcon, S as SlackLogo, K as KeyIcon, T as TerminalIcon } from './index-BL1s2-bo.js';
9
- import { u as useActionFormData, a as useClickNode, e as useSessionStorage, c as useDataStreamFormData, d as useDestinationFormData, b as useClickNotification, f as useSourceFormData, g as useSourceSelectionFormData } from './useSourceSelectionFormData-DmZnRueA.js';
10
- import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-BWC_F-Pl.js';
11
- import { E as EditIcon, T as TrashIcon, S as SearchIcon, P as PlusIcon$1, h as CheckIcon, A as ArrowIcon, a as CopyIcon, i as CrossIcon } from './index-CY3kjYr3.js';
12
- import { D as DeleteWarning, C as CancelWarning } from './index-CnbEaeQS.js';
13
- import { g as getConditionsBooleans, m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-qnmhJI4d.js';
14
- import { f as filterActions, m as getEntityLabel, l as getEntityIcon, v as sleep$1, o as getPlatformIcon, p as getPlatformLabel, h as formatBytes, j as getContainersIcons, q as getValueForRange, k as getDestinationIcon, g as filterSourcesByStream, e as filterSources, b as filterDestinationsByStream, a as filterDestinations, u as mapDestinationFieldsForDisplay, c as compareCondition, s as getYamlFieldsForDestination, d as deepClone, n as getMetricForEntity, r as getWorkloadId, i as getContainersInstrumentedCount, t as isOverTime } from './index-BSjQAYib.js';
7
+ import { C as CheckCircledIcon, O as OdigosLogo } from './index-CeHgnkLY.js';
8
+ import { C as CrossCircledIcon, O as OdigosLogoText, a as OverviewIcon, F as FilterIcon, D as DataStreamsIcon, R as RetryIcon, N as NotificationIcon, S as SlackLogo, K as KeyIcon, T as TerminalIcon } from './index-C4aVlsHh.js';
9
+ import { u as useActionFormData, a as useClickNode, e as useSessionStorage, c as useDataStreamFormData, d as useDestinationFormData, b as useClickNotification, f as useSourceFormData, g as useSourceSelectionFormData } from './useSourceSelectionFormData-CMXqoHZs.js';
10
+ import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-DsrDiKOV.js';
11
+ import { E as EditIcon, T as TrashIcon, S as SearchIcon, P as PlusIcon$1, h as CheckIcon, A as ArrowIcon, a as CopyIcon, i as CrossIcon } from './index-BUCure0Q.js';
12
+ import { D as DeleteWarning, C as CancelWarning } from './index-C8vqcUbP.js';
13
+ import { g as getConditionsBooleans, m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-BJpPcCBm.js';
14
+ import { f as filterActions, m as getEntityLabel, l as getEntityIcon, v as sleep$1, o as getPlatformIcon, p as getPlatformLabel, h as formatBytes, j as getContainersIcons, q as getValueForRange, k as getDestinationIcon, g as filterSourcesByStream, e as filterSources, b as filterDestinationsByStream, a as filterDestinations, u as mapDestinationFieldsForDisplay, c as compareCondition, s as getYamlFieldsForDestination, d as deepClone, n as getMetricForEntity, r as getWorkloadId, i as getContainersInstrumentedCount, t as isOverTime } from './index-CpT8LSxY.js';
15
15
  import { createPortal } from 'react-dom';
16
16
  import { m as mapExportedSignals } from './index-BlZKWuxe.js';
17
- import { N as NoteBackToSummary, E as EditButton } from './index-lkkeQEOt.js';
17
+ import { N as NoteBackToSummary, E as EditButton } from './index-fEP_guwb.js';
18
18
  import { D as DESTINATION_CATEGORIES } from './index-Dqief9td.js';
19
- import { a6 as RulesIcon, a7 as SourcesIcon, a3 as ActionsIcon, a4 as DestinationsIcon } from './index-C3BU6Xe-.js';
19
+ import { a6 as RulesIcon, a7 as SourcesIcon, a3 as ActionsIcon, a4 as DestinationsIcon } from './index-DypjdLnz.js';
20
20
 
21
21
  const buildCard$3 = (action) => {
22
22
  const { type, spec: { actionName, notes, signals, disabled, collectContainerAttributes, collectReplicaSetAttributes, collectWorkloadId, collectClusterId, labelsAttributes, annotationsAttributes, clusterAttributes, attributeNamesToDelete, renames, piiCategories, fallbackSamplingRatio, samplingPercentage, endpointsFilters, servicesNameFilters, attributeFilters, }, } = action;
@@ -14376,8 +14376,11 @@ const Container$d = styled.div `
14376
14376
  padding: 4px;
14377
14377
  `;
14378
14378
  const DataStreamForm = ({ formData, handleFormChange, formErrors }) => {
14379
+ const { dataStreams, selectedStreamName } = useDataStreamStore();
14380
+ const existingDS = useMemo(() => dataStreams.find((s) => s.name === formData.name && s.name !== selectedStreamName), [dataStreams, formData.name, selectedStreamName]);
14379
14381
  return (React.createElement(Container$d, null,
14380
- React.createElement(Input, { name: 'name', title: DISPLAY_TITLES.STREAM_NAME, placeholder: DISPLAY_TITLES.NAME_YOUR_STREAM_PLACEHOLDER, required: true, value: formData.name, onChange: ({ target: { value } }) => handleFormChange('name', value), errorMessage: formErrors['name'] })));
14382
+ React.createElement(Input, { name: 'name', title: DISPLAY_TITLES.STREAM_NAME, placeholder: DISPLAY_TITLES.NAME_YOUR_STREAM_PLACEHOLDER, required: true, value: formData.name, onChange: ({ target: { value } }) => handleFormChange('name', value), errorMessage: formErrors['name'] }),
14383
+ existingDS && React.createElement(NotificationNote, { type: StatusType.Warning, message: DISPLAY_TITLES.DATA_STREAM_EXISTS_WARNING(selectedStreamName, existingDS.name) })));
14381
14384
  };
14382
14385
 
14383
14386
  const FormContainer$3 = styled.div `
@@ -14460,9 +14463,7 @@ const SelectionRow = styled(FlexRow) `
14460
14463
  const Stretch = styled.div `
14461
14464
  width: 100%;
14462
14465
  `;
14463
- const DataStreamSelect = ({
14464
- // onClickNewDataStream,
14465
- updateDataStream, deleteDataStream, }) => {
14466
+ const DataStreamSelect = ({ onClickNewDataStream, updateDataStream, deleteDataStream }) => {
14466
14467
  const theme = Theme.useTheme();
14467
14468
  const { dataStreams, selectedStreamName, setSelectedStreamName } = useDataStreamStore();
14468
14469
  const [popupOpen, setPopupOpen] = useState(false);
@@ -14471,13 +14472,18 @@ updateDataStream, deleteDataStream, }) => {
14471
14472
  const [editOpenForDataStreamName, setEditOpenForDataStreamName] = useState('');
14472
14473
  const [deleteOpenForDataStreamName, setDeleteOpenForDataStreamName] = useState('');
14473
14474
  const [searchText, setSearchText] = useState('');
14474
- const filteredDataStreams = useMemo(() => dataStreams.filter(({ name }) => !searchText || name.toLowerCase().includes(searchText.toLowerCase())), [dataStreams, searchText]);
14475
- const rows = useMemo(() => filteredDataStreams.map(({ name }) => (React.createElement(SelectionRow, { key: `stream-${name}` },
14475
+ const rows = useMemo(() => dataStreams
14476
+ .filter(({ name }) => !searchText || name.toLowerCase().includes(searchText.toLowerCase()))
14477
+ .map(({ name }) => (React.createElement(SelectionRow, { key: `stream-${name}` },
14476
14478
  React.createElement(Stretch, null,
14477
14479
  React.createElement(SelectionButton, { label: name, isSelected: selectedStreamName === name, onClick: () => {
14478
14480
  setSelectedStreamName(name);
14479
14481
  setPopupOpen(false);
14480
- }, color: 'transparent', style: { width: '100%', justifyContent: 'flex-start' } }))))), [filteredDataStreams, selectedStreamName]);
14482
+ }, color: 'transparent', style: { width: '100%', justifyContent: 'flex-start' } })),
14483
+ name !== DEFAULT_DATA_STREAM_NAME && (React.createElement(IconButton, { onClick: () => setDeleteOpenForDataStreamName(name), tooltip: BUTTON_TEXTS.DELETE },
14484
+ React.createElement(TrashIcon, null))),
14485
+ React.createElement(IconButton, { onClick: () => setEditOpenForDataStreamName(name), tooltip: BUTTON_TEXTS.EDIT },
14486
+ React.createElement(EditIcon, null))))), [dataStreams, selectedStreamName, searchText]);
14481
14487
  return (React.createElement(React.Fragment, null,
14482
14488
  React.createElement(RelativeContainer$1, null,
14483
14489
  React.createElement(Container$c, { "$gap": 0 },
@@ -14487,7 +14493,12 @@ updateDataStream, deleteDataStream, }) => {
14487
14493
  "Data Stream: ",
14488
14494
  selectedStreamName),
14489
14495
  React.createElement(ExtendArrow, { extend: popupOpen }),
14490
- React.createElement(Badge, { label: dataStreams.length }))),
14496
+ React.createElement(Badge, { label: dataStreams.length })),
14497
+ React.createElement(Divider, { orientation: 'vertical', length: '32px', thickness: 2, margin: '0' }),
14498
+ React.createElement(AddButton$1, { onClick: () => {
14499
+ setSelectedStreamName('');
14500
+ onClickNewDataStream();
14501
+ }, label: BUTTON_TEXTS.NEW })),
14491
14502
  popupOpen && (React.createElement(AbsoluteContainer$1, { ref: containerRef },
14492
14503
  React.createElement(SelectionMenuHeader, null,
14493
14504
  React.createElement(Input, { placeholder: 'Search...', icon: SearchIcon, value: searchText, onChange: (e) => setSearchText(e.target.value) })),
@@ -14531,7 +14542,7 @@ const DataStreamSelectionForm = forwardRef(({ isModal, onClickSummary }, ref) =>
14531
14542
  validateForm,
14532
14543
  getFormValues: () => formData,
14533
14544
  }));
14534
- return (React.createElement(ModalBody, { "$isNotModal": !isModal, "$minHeight": '70vh' },
14545
+ return (React.createElement(ModalBody, { "$isNotModal": !isModal },
14535
14546
  React.createElement(FlexColumn, { "$gap": 24 },
14536
14547
  onClickSummary && React.createElement(NoteBackToSummary, { onClick: onClickSummary }),
14537
14548
  React.createElement(SectionTitle, { title: DISPLAY_TITLES.NAME_YOUR_STREAM, description: DISPLAY_TITLES.STREAM_DESCRIPTION }),
@@ -14840,7 +14851,7 @@ const DestinationDrawer = ({ categories, updateDestination, deleteDestination, t
14840
14851
  setIsFormDirty(true);
14841
14852
  setDynamicFields(...params);
14842
14853
  }, validateForm: validateForm, testConnection: testConnection }))) : (React.createElement(DataContainer$2, null,
14843
- React.createElement(ConditionDetails, { conditions: thisItem.conditions || [] }),
14854
+ thisItem.conditions?.length ? React.createElement(ConditionDetails, { conditions: thisItem.conditions }) : null,
14844
14855
  React.createElement(DataCard, { title: DISPLAY_TITLES.DESTINATION_DETAILS, data: !!thisItem ? buildCard$2(thisItem, yamlFields) : [] })))));
14845
14856
  };
14846
14857
 
@@ -14849,7 +14860,7 @@ const ListsWrapper = styled.div `
14849
14860
  flex-direction: column;
14850
14861
  gap: 12px;
14851
14862
  `;
14852
- const DestinationsList = ({ items, onSelectNew, onSelectConfigured }) => {
14863
+ const DestinationsList = ({ items, onSelectNew, onSelectConfigured, isLoadingForDestinationIds }) => {
14853
14864
  const { configuredDestinationsUpdateOnly } = useSetupStore();
14854
14865
  return items.map((category) => {
14855
14866
  const isAlreadyExisting = category.name === DESTINATION_CATEGORIES['EXISTS']['TITLE'];
@@ -14858,13 +14869,15 @@ const DestinationsList = ({ items, onSelectNew, onSelectConfigured }) => {
14858
14869
  category.items.map((item) => {
14859
14870
  // Following replaceAll() is to create a "legal" data-id (no spaces) for Cypress testing
14860
14871
  const key = `select-${category.name.replaceAll(' ', '')}-destination-${item.type}`;
14861
- const isChecked = item.selected || configuredDestinationsUpdateOnly.some((dest) => dest.id === item.id);
14862
14872
  const monitors = Object.keys(item.supportedSignals).filter((signal) => item.supportedSignals[signal].supported);
14863
- const onClick = isAlreadyExisting ? () => onSelectConfigured(item.id) : () => onSelectNew(item);
14864
14873
  const { icon, iconSrc } = getDestinationIcon(item.type);
14874
+ const isChecked = item.selected || configuredDestinationsUpdateOnly.some((dest) => dest.id === item.id);
14875
+ const isLoading = !!isLoadingForDestinationIds.find((id) => id === item.id);
14876
+ const onClick = isAlreadyExisting ? () => onSelectConfigured(item.id) : () => onSelectNew(item);
14865
14877
  return (React.createElement(DataTab, { key: key, "data-id": key, title: item.displayName, hoverText: BUTTON_TEXTS.SELECT, onClick: onClick, iconProps: { icon, iconSrc }, visualProps: { monitors, monitorsWithLabels: true }, checkboxProps: {
14866
14878
  withCheckbox: isAlreadyExisting,
14867
14879
  isChecked,
14880
+ isLoading,
14868
14881
  onCheckboxChange: () => onSelectConfigured(item.id),
14869
14882
  } }));
14870
14883
  })));
@@ -14928,7 +14941,7 @@ const createConfiguredItems = (destinations, selectedStreamName, configuredDesti
14928
14941
  },
14929
14942
  };
14930
14943
  });
14931
- const ChooseDestinationBody = ({ hidden, categories, potentialDestinations, onSelectNew, onSelectConfigured }) => {
14944
+ const ChooseDestinationBody = ({ hidden, categories, potentialDestinations, onSelectNew, onSelectConfigured, isLoadingForDestinationIds }) => {
14932
14945
  const { destinations } = useEntityStore();
14933
14946
  const { selectedStreamName } = useDataStreamStore();
14934
14947
  const { configuredDestinations, configuredDestinationsUpdateOnly } = useSetupStore();
@@ -14975,7 +14988,7 @@ const ChooseDestinationBody = ({ hidden, categories, potentialDestinations, onSe
14975
14988
  React.createElement(Divider, null),
14976
14989
  !filteredDestinations.length ? (React.createElement(NoDataFoundWrapper, null,
14977
14990
  React.createElement(NoDataFound, { title: 'No destinations found' }))) : (React.createElement(ListsContainer, null,
14978
- React.createElement(DestinationsList, { items: filteredDestinations, onSelectNew: (dest) => onSelectNew(dest, selectedMonitors), onSelectConfigured: onSelectConfigured })))));
14991
+ React.createElement(DestinationsList, { items: filteredDestinations, onSelectNew: (dest) => onSelectNew(dest, selectedMonitors), onSelectConfigured: onSelectConfigured, isLoadingForDestinationIds: isLoadingForDestinationIds })))));
14979
14992
  };
14980
14993
 
14981
14994
  const Container$8 = styled.div `
@@ -14989,17 +15002,18 @@ const SideMenuWrapper = styled.div `
14989
15002
  display: none;
14990
15003
  }
14991
15004
  `;
14992
- const DestinationModal = ({ isOnboarding, categories, potentialDestinations, createDestination, updateDestination, testConnection }) => {
15005
+ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, createDestination, updateDestination, deleteDestination, testConnection }) => {
14993
15006
  const { destinations } = useEntityStore();
14994
15007
  const { selectedStreamName } = useDataStreamStore();
14995
15008
  const { currentModal, setCurrentModal } = useModalStore();
14996
- const { addConfiguredDestination, addConfiguredDestinationUpdateOnly } = useSetupStore();
15009
+ const { addConfiguredDestination, addConfiguredDestinationUpdateOnly, removeConfiguredDestinationUpdateOnly, configuredDestinationsUpdateOnly } = useSetupStore();
14997
15010
  const isOpen = currentModal === EntityTypes.Destination;
14998
15011
  const [selectedItem, setSelectedItem] = useState(undefined);
14999
15012
  const { formData, formErrors, handleFormChange, resetFormData, validateForm, setYamlFields, dynamicFields, setDynamicFields, loadFormWithDrawerItem } = useDestinationFormData({
15000
15013
  supportedSignals: selectedItem?.supportedSignals,
15001
15014
  preLoadedFields: selectedItem?.fields,
15002
15015
  });
15016
+ const [isLoadingForDestinationIds, setIsLoadingForDestinationIds] = useState([]);
15003
15017
  const getDestPayload = (alreadyConfigDest) => {
15004
15018
  const fields = {};
15005
15019
  if (!alreadyConfigDest) {
@@ -15025,7 +15039,7 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
15025
15039
  },
15026
15040
  };
15027
15041
  };
15028
- const handleAdd = (alreadyConfigDest) => {
15042
+ const handleAdd = async (alreadyConfigDest) => {
15029
15043
  // Handle new cases from onboarding
15030
15044
  if (isOnboarding && !alreadyConfigDest) {
15031
15045
  const payload = getDestPayload();
@@ -15034,7 +15048,13 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
15034
15048
  // Handle already configured cases from onboarding
15035
15049
  else if (isOnboarding && alreadyConfigDest) {
15036
15050
  const payload = getDestPayload(alreadyConfigDest);
15037
- addConfiguredDestinationUpdateOnly(payload);
15051
+ const alreadyAdded = configuredDestinationsUpdateOnly.some((dest) => dest.id === alreadyConfigDest.id);
15052
+ if (alreadyAdded) {
15053
+ removeConfiguredDestinationUpdateOnly(alreadyConfigDest);
15054
+ }
15055
+ else {
15056
+ addConfiguredDestinationUpdateOnly(payload);
15057
+ }
15038
15058
  }
15039
15059
  // Handle new cases from overview
15040
15060
  else if (!isOnboarding && !alreadyConfigDest) {
@@ -15043,8 +15063,15 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
15043
15063
  // Handle already configured cases from overview
15044
15064
  else if (!isOnboarding && alreadyConfigDest) {
15045
15065
  const payload = getDestPayload(alreadyConfigDest);
15046
- const payloadForm = loadFormWithDrawerItem(payload);
15047
- updateDestination(alreadyConfigDest.id, payloadForm);
15066
+ const alreadyAdded = payload.dataStreamNames.some((streamName) => streamName === selectedStreamName);
15067
+ setIsLoadingForDestinationIds((prev) => [...prev, alreadyConfigDest.id]);
15068
+ if (alreadyAdded) {
15069
+ await deleteDestination(alreadyConfigDest.id);
15070
+ }
15071
+ else {
15072
+ await updateDestination(alreadyConfigDest.id, loadFormWithDrawerItem(payload));
15073
+ }
15074
+ setIsLoadingForDestinationIds((prev) => prev.filter((id) => id !== alreadyConfigDest.id));
15048
15075
  }
15049
15076
  else {
15050
15077
  console.warn('DestinationModal: handleAdd: No action taken, no destination or already configured destination found');
@@ -15115,7 +15142,7 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
15115
15142
  { stepNumber: 2, title: DISPLAY_TITLES.CONNECTION },
15116
15143
  ] })),
15117
15144
  React.createElement(ModalBody, { style: { margin: '32px 24px 12px 24px' } },
15118
- React.createElement(ChooseDestinationBody, { hidden: selectedItem !== undefined, categories: categories, potentialDestinations: potentialDestinations, onSelectNew: handleSelectNew, onSelectConfigured: handleSelectConfigured }),
15145
+ React.createElement(ChooseDestinationBody, { hidden: selectedItem !== undefined, categories: categories, potentialDestinations: potentialDestinations, onSelectNew: handleSelectNew, onSelectConfigured: handleSelectConfigured, isLoadingForDestinationIds: isLoadingForDestinationIds }),
15119
15146
  selectedItem && (React.createElement(DestinationForm, { categoryItem: selectedItem, formData: formData, formErrors: formErrors, handleFormChange: handleFormChange, dynamicFields: dynamicFields, setDynamicFields: setDynamicFields, validateForm: validateForm, testConnection: testConnection }))))));
15120
15147
  };
15121
15148
 
@@ -15192,7 +15219,7 @@ const DestinationSelectionForm = ({ isSourcesListEmpty, goToSources, categories,
15192
15219
  React.createElement(PlusIcon$1, null),
15193
15220
  React.createElement(Text, { color: theme.colors.secondary, size: 14, decoration: 'underline', family: 'secondary' }, DISPLAY_TITLES.ADD_DESTINATION))),
15194
15221
  React.createElement(DestinationList, { categories: categories, withDelete: true }))),
15195
- React.createElement(DestinationModal, { isOnboarding: true, categories: categories, potentialDestinations: potentialDestinations, updateDestination: () => { }, createDestination: () => { }, testConnection: testConnection })));
15222
+ React.createElement(DestinationModal, { isOnboarding: true, categories: categories, potentialDestinations: potentialDestinations, updateDestination: async () => { }, createDestination: async () => { }, deleteDestination: async () => { }, testConnection: testConnection })));
15196
15223
  };
15197
15224
 
15198
15225
  const columns$2 = [
@@ -15242,7 +15269,7 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
15242
15269
  },
15243
15270
  {
15244
15271
  columnKey: 'conditions',
15245
- component: () => React.createElement(TableCellConditions, { conditions: dest.conditions || [], id: dest.id }),
15272
+ component: () => (dest.conditions?.length ? React.createElement(TableCellConditions, { conditions: dest.conditions, id: dest.id }) : null),
15246
15273
  },
15247
15274
  {
15248
15275
  columnKey: 'signals',
@@ -16001,7 +16028,7 @@ const NotSourcesWrapper = styled(CenterThis) `
16001
16028
  const SelectionCount = styled(Text) `
16002
16029
  width: 18px;
16003
16030
  `;
16004
- const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesAndSources, selectedNamespace, onSelectNamespace, selectedSources, onSelectSource }) => {
16031
+ const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesAndSources, selectedNamespace, onSelectNamespace, selectedSources, onSelectSource, selectedFutureApps, onSelectFutureApps, }) => {
16005
16032
  const theme = Theme.useTheme();
16006
16033
  const { namespacesLoading } = useEntityStore();
16007
16034
  const matrix = Object.entries(filteredNamespacesAndSources || {});
@@ -16011,6 +16038,7 @@ const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesA
16011
16038
  const NamespaceIcon = getEntityIcon(EntityTypes.Namespace);
16012
16039
  return (React.createElement(Container$4, { "$isModal": isModal }, matrix.map(([namespace, sources]) => {
16013
16040
  const sourcesForNamespace = selectedSources?.[namespace] || [];
16041
+ const futureAppsForNamespace = selectedFutureApps?.[namespace]?.selected || false;
16014
16042
  const onlySelectedSources = sourcesForNamespace.filter(({ selected }) => selected);
16015
16043
  const isNamespaceLoaded = sourcesForNamespace.length > 0;
16016
16044
  const isNamespaceSelected = selectedNamespace === namespace;
@@ -16027,6 +16055,9 @@ const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesA
16027
16055
  React.createElement(NamespaceIcon, null),
16028
16056
  React.createElement(Text, null, namespace)),
16029
16057
  React.createElement(FlexRow, { "$gap": 12 },
16058
+ onSelectFutureApps && (React.createElement(React.Fragment, null,
16059
+ React.createElement(Toggle, { title: DISPLAY_TITLES.FUTURE_APPS_TITLE, tooltip: DISPLAY_TITLES.FUTURE_APPS_DESCRIPTION, initialValue: futureAppsForNamespace, onChange: (bool) => onSelectFutureApps(bool, namespace), flipHorizontally: true }),
16060
+ React.createElement(Divider, { orientation: 'vertical', length: '12px', margin: '0' }))),
16030
16061
  React.createElement(SelectionCount, { size: 10, color: theme.text.grey }, isNamespaceLoaded ? `${onlySelectedSources.length}/${sources.length}` : null),
16031
16062
  onSelectNamespace && React.createElement(ExtendArrow, { extend: isNamespaceSelected }))),
16032
16063
  (isNamespaceSelected || !onSelectNamespace) &&
@@ -16060,16 +16091,15 @@ const Container$3 = styled.div `
16060
16091
  height: fit-content;
16061
16092
  overflow-y: scroll;
16062
16093
  `;
16063
- const SetupSummary = ({
16064
- // onEditStream,
16065
- onEditSources, onEditDestinations, categories, }) => {
16066
- // const { selectedStreamName } = useDataStreamStore();
16094
+ const SetupSummary = ({ onEditStream, onEditSources, onEditDestinations, categories }) => {
16095
+ const { selectedStreamName } = useDataStreamStore();
16067
16096
  const { configuredSources, configuredDestinations, configuredDestinationsUpdateOnly } = useSetupStore();
16068
16097
  const sourceCount = useMemo(() => Object.values(configuredSources).reduce((total, sourceList) => total + sourceList.filter((s) => s.selected).length, 0), [configuredSources]);
16069
16098
  return (React.createElement(ModalBody, { "$isNotModal": true },
16070
16099
  React.createElement(FlexColumn, { "$gap": 12 },
16071
16100
  React.createElement(SectionTitle, { title: DISPLAY_TITLES.SUMMARY, description: DISPLAY_TITLES.STREAM_CONFIRM }),
16072
16101
  React.createElement(Container$3, null,
16102
+ React.createElement(DataCard, { title: DISPLAY_TITLES.STREAM_NAME, action: () => React.createElement(EditButton, { onClick: onEditStream }), data: [{ title: '', value: selectedStreamName }] }),
16073
16103
  React.createElement(DataCard, { title: DISPLAY_TITLES.SELECTED_SOURCES, titleBadge: sourceCount, action: () => React.createElement(EditButton, { onClick: onEditSources }) },
16074
16104
  React.createElement(SourceList, { filteredNamespacesAndSources: configuredSources, withInstances: false })),
16075
16105
  React.createElement(DataCard, { title: DISPLAY_TITLES.SELECTED_DESTINATIONS, titleBadge: configuredDestinations.length + configuredDestinationsUpdateOnly.length, action: () => React.createElement(EditButton, { onClick: onEditDestinations }) },
package/lib/functions.js CHANGED
@@ -1,13 +1,13 @@
1
- export { c as capitalizeFirstLetter, f as flattenObjectKeys, g as getConditionsBooleans, a as getMonitorIcon, b as getStatusIcon, i as isValidVersion, m as mapConditions, n as numbersOnly, p as parseBooleanFromString, d as parseJsonStringToPrettyString, r as removeEmptyValuesFromObject, s as safeJsonStringify, e as splitCamelString } from './index-qnmhJI4d.js';
2
- export { c as compareCondition, d as deepClone, f as filterActions, a as filterDestinations, b as filterDestinationsByStream, e as filterSources, g as filterSourcesByStream, h as formatBytes, j as getContainersIcons, i as getContainersInstrumentedCount, k as getDestinationIcon, l as getEntityIcon, m as getEntityLabel, n as getMetricForEntity, o as getPlatformIcon, p as getPlatformLabel, q as getValueForRange, r as getWorkloadId, s as getYamlFieldsForDestination, t as isOverTime, u as mapDestinationFieldsForDisplay, v as sleep } from './index-BSjQAYib.js';
3
- export { m as getActionIcon, n as getEntityId, o as getInstrumentationRuleIcon, p as getProgrammingLanguageIcon } from './index-BD7meETN.js';
1
+ export { c as capitalizeFirstLetter, f as flattenObjectKeys, g as getConditionsBooleans, a as getMonitorIcon, b as getStatusIcon, i as isValidVersion, m as mapConditions, n as numbersOnly, p as parseBooleanFromString, d as parseJsonStringToPrettyString, r as removeEmptyValuesFromObject, s as safeJsonStringify, e as splitCamelString } from './index-BJpPcCBm.js';
2
+ export { c as compareCondition, d as deepClone, f as filterActions, a as filterDestinations, b as filterDestinationsByStream, e as filterSources, g as filterSourcesByStream, h as formatBytes, j as getContainersIcons, i as getContainersInstrumentedCount, k as getDestinationIcon, l as getEntityIcon, m as getEntityLabel, n as getMetricForEntity, o as getPlatformIcon, p as getPlatformLabel, q as getValueForRange, r as getWorkloadId, s as getYamlFieldsForDestination, t as isOverTime, u as mapDestinationFieldsForDisplay, v as sleep } from './index-CpT8LSxY.js';
3
+ export { m as getActionIcon, n as getEntityId, o as getInstrumentationRuleIcon, p as getProgrammingLanguageIcon } from './index-BRGQ84pJ.js';
4
4
  export { g as getIdFromSseTarget, i as isLegalK8sLabel, m as mapExportedSignals } from './index-BlZKWuxe.js';
5
5
  import { EntityTypes } from './types.js';
6
6
  export { i as isEmpty, s as safeJsonParse } from './index-BV85P9UP.js';
7
7
  import 'react';
8
8
  import 'styled-components';
9
- import './index-DZWbhK14.js';
10
- import './index-C3BU6Xe-.js';
9
+ import './index-CeHgnkLY.js';
10
+ import './index-DypjdLnz.js';
11
11
 
12
12
  const cleanObjectEmptyStringsValues = (obj) => {
13
13
  const cleanArray = (arr) => arr.filter((item) => {
@@ -1,7 +1,7 @@
1
1
  import { type Dispatch, type SetStateAction } from 'react';
2
2
  import { EntityTypes, type FetchSingleNamespace } from '@/types';
3
3
  import { type AvailableSource, type AvailableSourcesByNamespace, type NamespaceSelectionFormData, type SourceSelectionFormData } from '@/store';
4
- export type SelectedNamespace = string;
4
+ export type NamespaceName = string;
5
5
  interface UseSourceFormDataParams {
6
6
  fetchSingleNamespace: FetchSingleNamespace;
7
7
  }
@@ -11,11 +11,11 @@ export interface UseSourceSelectionFormData {
11
11
  getApiSourcesPayload: () => SourceSelectionFormData;
12
12
  getApiFutureAppsPayload: () => NamespaceSelectionFormData;
13
13
  selectedNamespace: string;
14
- onSelectNamespace: (namespace: SelectedNamespace, selectAll?: boolean) => void;
14
+ onSelectNamespace: (namespace: NamespaceName, selectAll?: boolean) => void;
15
15
  selectedSources: SourceSelectionFormData;
16
- onSelectSource: (source: AvailableSource, namespace?: SelectedNamespace) => void;
16
+ onSelectSource: (source: AvailableSource, namespace?: NamespaceName) => void;
17
17
  selectedFutureApps: NamespaceSelectionFormData;
18
- onSelectFutureApps: (bool: boolean, namespace?: SelectedNamespace) => void;
18
+ onSelectFutureApps: (bool: boolean, namespace?: NamespaceName) => void;
19
19
  searchText: string;
20
20
  setSearchText: Dispatch<SetStateAction<string>>;
21
21
  searchBy: EntityTypes;
package/lib/hooks.js CHANGED
@@ -1,7 +1,7 @@
1
- export { u as useActionFormData, a as useClickNode, b as useClickNotification, c as useDataStreamFormData, d as useDestinationFormData, e as useSessionStorage, f as useSourceFormData, g as useSourceSelectionFormData } from './useSourceSelectionFormData-DmZnRueA.js';
2
- export { u as useContainerSize, a as useCopy, b as useGenericForm, c as useInstrumentationRuleFormData, d as useKeyDown, e as useOnClickOutside, f as useTimeAgo, g as useTransition } from './useTransition-BWC_F-Pl.js';
1
+ export { u as useActionFormData, a as useClickNode, b as useClickNotification, c as useDataStreamFormData, d as useDestinationFormData, e as useSessionStorage, f as useSourceFormData, g as useSourceSelectionFormData } from './useSourceSelectionFormData-CMXqoHZs.js';
2
+ export { u as useContainerSize, a as useCopy, b as useGenericForm, c as useInstrumentationRuleFormData, d as useKeyDown, e as useOnClickOutside, f as useTimeAgo, g as useTransition } from './useTransition-DsrDiKOV.js';
3
3
  import './types.js';
4
- import './index-BD7meETN.js';
4
+ import './index-BRGQ84pJ.js';
5
5
  import 'react';
6
6
  import 'styled-components';
7
7
  import './index-BV85P9UP.js';
package/lib/icons.js CHANGED
@@ -1,10 +1,10 @@
1
- import { T as Theme } from './index-BD7meETN.js';
2
- export { q as AddClusterInfoIcon, x as CPlusPlusLogo, y as CSharpLogo, C as CodeAttributesIcon, r as DeleteAttributeIcon, z as DotnetLogo, E as ElixirLogo, G as GoLogo, H as HeadersCollectionIcon, t as ImageErrorIcon, J as JavaLogo, K as K8sLogo, v as KafkaLogo, N as MysqlLogo, O as NginxLogo, Q as NodejsLogo, w as PayloadCollectionIcon, U as PhpLogo, P as PiiMaskingIcon, V as PostgresLogo, W as PythonLogo, X as RedisLogo, R as RenameAttributeIcon, Y as RubyLogo, Z as RustLogo, s as SamplerIcon, _ as SwiftLogo } from './index-BD7meETN.js';
3
- export { C as CheckCircledIcon, E as ErrorTriangleIcon, I as InfoIcon, L as LogsIcon, M as MetricsIcon, O as OdigosLogo, T as TracesIcon, W as WarningTriangleIcon } from './index-DZWbhK14.js';
4
- export { C as CrossCircledIcon, D as DataStreamsIcon, F as FilterIcon, K as KeyIcon, N as NotificationIcon, O as OdigosLogoText, a as OverviewIcon, R as RetryIcon, S as SlackLogo, T as TerminalIcon } from './index-BL1s2-bo.js';
5
- export { A as ArrowIcon, h as CheckIcon, C as CodeIcon, a as CopyIcon, i as CrossIcon, E as EditIcon, b as EditedIcon, c as ExtendArrowIcon, f as EyeClosedIcon, g as EyeOpenIcon, L as ListIcon, M as MinusIcon, N as NoDataIcon, d as NotebookIcon, P as PlusIcon, S as SearchIcon, e as SortArrowsIcon, T as TrashIcon, X as XIcon } from './index-CY3kjYr3.js';
1
+ import { T as Theme } from './index-BRGQ84pJ.js';
2
+ export { q as AddClusterInfoIcon, x as CPlusPlusLogo, y as CSharpLogo, C as CodeAttributesIcon, r as DeleteAttributeIcon, z as DotnetLogo, E as ElixirLogo, G as GoLogo, H as HeadersCollectionIcon, t as ImageErrorIcon, J as JavaLogo, K as K8sLogo, v as KafkaLogo, N as MysqlLogo, O as NginxLogo, Q as NodejsLogo, w as PayloadCollectionIcon, U as PhpLogo, P as PiiMaskingIcon, V as PostgresLogo, W as PythonLogo, X as RedisLogo, R as RenameAttributeIcon, Y as RubyLogo, Z as RustLogo, s as SamplerIcon, _ as SwiftLogo } from './index-BRGQ84pJ.js';
3
+ export { C as CheckCircledIcon, E as ErrorTriangleIcon, I as InfoIcon, L as LogsIcon, M as MetricsIcon, O as OdigosLogo, T as TracesIcon, W as WarningTriangleIcon } from './index-CeHgnkLY.js';
4
+ export { C as CrossCircledIcon, D as DataStreamsIcon, F as FilterIcon, K as KeyIcon, N as NotificationIcon, O as OdigosLogoText, a as OverviewIcon, R as RetryIcon, S as SlackLogo, T as TerminalIcon } from './index-C4aVlsHh.js';
5
+ export { A as ArrowIcon, h as CheckIcon, C as CodeIcon, a as CopyIcon, i as CrossIcon, E as EditIcon, b as EditedIcon, c as ExtendArrowIcon, f as EyeClosedIcon, g as EyeOpenIcon, L as ListIcon, M as MinusIcon, N as NoDataIcon, d as NotebookIcon, P as PlusIcon, S as SearchIcon, e as SortArrowsIcon, T as TrashIcon, X as XIcon } from './index-BUCure0Q.js';
6
6
  import React from 'react';
7
- export { a3 as ActionsIcon, A as AlaudaLogo, a as AlibabaCloudLogo, b as AppDynamicsLogo, c as AwsCloudwatchLogo, d as AwsS3Logo, e as AwsXrayLogo, f as AxiomLogo, B as BetterStackLogo, g as BlobStorageLogo, h as BonreeLogo, C as CauselyLogo, i as ChecklyLogo, j as ChronosphereLogo, k as ClickhouseLogo, l as CoralogixLogo, D as Dash0Logo, m as DatadogLogo, a4 as DestinationsIcon, n as DynatraceLogo, E as ElasticApmLogo, o as ElasticSearchLogo, G as GigapipeLogo, p as GoogleCloudPlatformLogo, q as GrafanaLogo, r as GreptimeLogo, s as GroundcoverLogo, H as HoneycombLogo, t as HyperDxLogo, I as InstanaLogo, J as JaegerLogo, K as KloudmateLogo, L as Last9Logo, u as LightstepLogo, v as LogzioLogo, w as LokiLogo, x as LumigoLogo, M as MiddlewareLogo, a5 as NamespacesIcon, N as NewRelicLogo, O as ObserveLogo, y as OneUptimeLogo, z as OpenObserveLogo, F as OpenTelemetryLogo, P as OpsVerseLogo, Q as OracleLogo, R as PrometheusLogo, S as QrynLogo, T as QuickwitLogo, a6 as RulesIcon, U as SeqLogo, W as SignozLogo, a7 as SourcesIcon, X as SplunkLogo, Y as SumoLogicLogo, Z as TelemetryHubLogo, _ as TempoLogo, $ as TingyunLogo, a0 as TraceloopLogo, a1 as UptraceLogo, a2 as VictoriaMetricsLogo, V as VmLogo } from './index-C3BU6Xe-.js';
7
+ export { a3 as ActionsIcon, A as AlaudaLogo, a as AlibabaCloudLogo, b as AppDynamicsLogo, c as AwsCloudwatchLogo, d as AwsS3Logo, e as AwsXrayLogo, f as AxiomLogo, B as BetterStackLogo, g as BlobStorageLogo, h as BonreeLogo, C as CauselyLogo, i as ChecklyLogo, j as ChronosphereLogo, k as ClickhouseLogo, l as CoralogixLogo, D as Dash0Logo, m as DatadogLogo, a4 as DestinationsIcon, n as DynatraceLogo, E as ElasticApmLogo, o as ElasticSearchLogo, G as GigapipeLogo, p as GoogleCloudPlatformLogo, q as GrafanaLogo, r as GreptimeLogo, s as GroundcoverLogo, H as HoneycombLogo, t as HyperDxLogo, I as InstanaLogo, J as JaegerLogo, K as KloudmateLogo, L as Last9Logo, u as LightstepLogo, v as LogzioLogo, w as LokiLogo, x as LumigoLogo, M as MiddlewareLogo, a5 as NamespacesIcon, N as NewRelicLogo, O as ObserveLogo, y as OneUptimeLogo, z as OpenObserveLogo, F as OpenTelemetryLogo, P as OpsVerseLogo, Q as OracleLogo, R as PrometheusLogo, S as QrynLogo, T as QuickwitLogo, a6 as RulesIcon, U as SeqLogo, W as SignozLogo, a7 as SourcesIcon, X as SplunkLogo, Y as SumoLogicLogo, Z as TelemetryHubLogo, _ as TempoLogo, $ as TingyunLogo, a0 as TraceloopLogo, a1 as UptraceLogo, a2 as VictoriaMetricsLogo, V as VmLogo } from './index-DypjdLnz.js';
8
8
  import './types.js';
9
9
  import 'styled-components';
10
10
 
@@ -1,13 +1,13 @@
1
1
  import React, { useState, useEffect, useRef, forwardRef, createElement, useCallback, useMemo, Fragment } from 'react';
2
- import { T as Theme, t as ImageErrorIcon, M as MONITORS_OPTIONS, g as useNotificationStore, l as DISPLAY_TITLES, L as LANGUAGE_OPTIONS, F as FORM_ALERTS, p as getProgrammingLanguageIcon, D as DISPLAY_LANGUAGES, B as BUTTON_TEXTS } from './index-BD7meETN.js';
2
+ import { T as Theme, t as ImageErrorIcon, M as MONITORS_OPTIONS, g as useNotificationStore, l as DISPLAY_TITLES, L as LANGUAGE_OPTIONS, F as FORM_ALERTS, p as getProgrammingLanguageIcon, D as DISPLAY_LANGUAGES, B as BUTTON_TEXTS } from './index-BRGQ84pJ.js';
3
3
  import { StatusType, OtherStatus, ProgrammingLanguages, SortDirection, IntrumentationStatus, InputTypes, FieldTypes } from './types.js';
4
- import { M as MinusIcon, h as CheckIcon, L as ListIcon, C as CodeIcon, c as ExtendArrowIcon, E as EditIcon, i as CrossIcon, T as TrashIcon, e as SortArrowsIcon, b as EditedIcon, a as CopyIcon, d as NotebookIcon, X as XIcon, f as EyeClosedIcon, g as EyeOpenIcon, N as NoDataIcon, S as SearchIcon, P as PlusIcon, A as ArrowIcon } from './index-CY3kjYr3.js';
5
- import { b as getStatusIcon, r as removeEmptyValuesFromObject, s as safeJsonStringify, f as flattenObjectKeys, m as mapConditions, g as getConditionsBooleans, c as capitalizeFirstLetter, a as getMonitorIcon, i as isValidVersion, d as parseJsonStringToPrettyString, e as splitCamelString, p as parseBooleanFromString, n as numbersOnly } from './index-qnmhJI4d.js';
4
+ import { M as MinusIcon, h as CheckIcon, L as ListIcon, C as CodeIcon, c as ExtendArrowIcon, E as EditIcon, i as CrossIcon, T as TrashIcon, e as SortArrowsIcon, b as EditedIcon, a as CopyIcon, d as NotebookIcon, X as XIcon, f as EyeClosedIcon, g as EyeOpenIcon, N as NoDataIcon, S as SearchIcon, P as PlusIcon, A as ArrowIcon } from './index-BUCure0Q.js';
5
+ import { b as getStatusIcon, r as removeEmptyValuesFromObject, s as safeJsonStringify, f as flattenObjectKeys, m as mapConditions, g as getConditionsBooleans, c as capitalizeFirstLetter, a as getMonitorIcon, i as isValidVersion, d as parseJsonStringToPrettyString, e as splitCamelString, p as parseBooleanFromString, n as numbersOnly } from './index-BJpPcCBm.js';
6
6
  import styled, { css } from 'styled-components';
7
7
  import { s as safeJsonParse, i as isEmpty } from './index-BV85P9UP.js';
8
- import { b as useGenericForm, e as useOnClickOutside, d as useKeyDown, u as useContainerSize, a as useCopy, g as useTransition } from './useTransition-BWC_F-Pl.js';
8
+ import { b as useGenericForm, e as useOnClickOutside, d as useKeyDown, u as useContainerSize, a as useCopy, g as useTransition } from './useTransition-DsrDiKOV.js';
9
9
  import ReactDOM from 'react-dom';
10
- import { I as InfoIcon } from './index-DZWbhK14.js';
10
+ import { I as InfoIcon } from './index-CeHgnkLY.js';
11
11
 
12
12
  const TextWrapper$2 = styled.div `
13
13
  color: ${({ $color, theme }) => $color || theme.text.secondary};
@@ -4303,7 +4303,7 @@ const SubText = styled(Text) `
4303
4303
  font-size: 10px;
4304
4304
  color: ${({ theme }) => theme.text.grey};
4305
4305
  `;
4306
- const DataTab = ({ title, subTitle, hoverText, onClick, renderActions, iconProps: { icon, icons, iconSrc, iconSrcs } = {}, visualProps: { status, faded, bgColor, bgColorHover, monitors, monitorsWithLabels, componentsUnderTitles } = {}, checkboxProps: { withCheckbox, isCheckboxDisabled, isChecked, onCheckboxChange } = {}, extendableProps: { withExtend, isExtended, renderExtended } = {}, ...props }) => {
4306
+ const DataTab = ({ title, subTitle, hoverText, onClick, renderActions, iconProps: { icon, icons, iconSrc, iconSrcs } = {}, visualProps: { status, faded, bgColor, bgColorHover, monitors, monitorsWithLabels, componentsUnderTitles } = {}, checkboxProps: { withCheckbox, isCheckboxDisabled, isChecked, isLoading: isCheckboxLoading, onCheckboxChange } = {}, extendableProps: { withExtend, isExtended, renderExtended } = {}, ...props }) => {
4307
4307
  const theme = Theme.useTheme();
4308
4308
  const [extend, setExtend] = useState(isExtended || false);
4309
4309
  const [textMaxWidth, setTextMaxWidth] = useState(0);
@@ -4324,7 +4324,7 @@ const DataTab = ({ title, subTitle, hoverText, onClick, renderActions, iconProps
4324
4324
  return (React.createElement(Container$m, { ref: containerRef, "$status": status, "$faded": faded, "$bgColor": bgColor, "$bgColorHover": bgColorHover, "$withClick": !!onClick, onClick: onClick, ...props },
4325
4325
  React.createElement(FlexRow, { "$gap": 8 },
4326
4326
  React.createElement(FlexRow, { "$gap": 16 },
4327
- withCheckbox && React.createElement(Checkbox, { value: isChecked, onChange: onCheckboxChange, disabled: isCheckboxDisabled }),
4327
+ isCheckboxLoading ? React.createElement(FadeLoader, null) : withCheckbox ? React.createElement(Checkbox, { value: isChecked, onChange: onCheckboxChange, disabled: isCheckboxDisabled }) : null,
4328
4328
  !!icons?.length || !!iconSrcs?.length ? (React.createElement(IconGroup, { icons: icons, iconSrcs: iconSrcs, status: status, id: `${title}-${subTitle}` })) : !!icon || !!iconSrc ? (React.createElement(IconWrapped, { icon: icon, src: iconSrc, status: status })) : null),
4329
4329
  React.createElement(FlexColumn, { "$gap": 4 },
4330
4330
  title && React.createElement(ScrollX, { maxWidth: textMaxWidth, text: title, textSize: 14 }),
@@ -6314,7 +6314,7 @@ const ToggleSwitch = styled.div `
6314
6314
  transition: background-color 0.3s, transform 0.3s;
6315
6315
  }
6316
6316
  `;
6317
- const Toggle = ({ title, tooltip, initialValue = false, onChange, disabled, allowPropagation = false }) => {
6317
+ const Toggle = ({ title, tooltip, initialValue = false, onChange, disabled, allowPropagation = false, flipHorizontally }) => {
6318
6318
  const [isActive, setIsActive] = useState(initialValue);
6319
6319
  useEffect(() => setIsActive(initialValue), [initialValue]);
6320
6320
  const handleToggle = (e) => {
@@ -6328,9 +6328,10 @@ const Toggle = ({ title, tooltip, initialValue = false, onChange, disabled, allo
6328
6328
  setIsActive((prev) => !prev);
6329
6329
  };
6330
6330
  return (React.createElement(Container$2, { "$disabled": disabled, onClick: handleToggle },
6331
- React.createElement(ToggleSwitch, { "$disabled": disabled, "$isActive": isActive }),
6331
+ !flipHorizontally && React.createElement(ToggleSwitch, { "$disabled": disabled, "$isActive": isActive }),
6332
6332
  React.createElement(Tooltip, { text: tooltip, withIcon: true },
6333
- React.createElement(Text, { size: 14 }, title))));
6333
+ React.createElement(Text, { size: 14 }, title)),
6334
+ flipHorizontally && React.createElement(ToggleSwitch, { "$disabled": disabled, "$isActive": isActive })));
6334
6335
  };
6335
6336
 
6336
6337
  function getDefaultExportFromCjs (x) {
@@ -1,8 +1,8 @@
1
1
  import { StatusType, OtherStatus, SignalType } from './types.js';
2
2
  import 'react';
3
- import './index-BD7meETN.js';
3
+ import './index-BRGQ84pJ.js';
4
4
  import 'styled-components';
5
- import { T as TracesIcon, M as MetricsIcon, L as LogsIcon, O as OdigosLogo, I as InfoIcon, W as WarningTriangleIcon, E as ErrorTriangleIcon, C as CheckCircledIcon } from './index-DZWbhK14.js';
5
+ import { T as TracesIcon, M as MetricsIcon, L as LogsIcon, O as OdigosLogo, I as InfoIcon, W as WarningTriangleIcon, E as ErrorTriangleIcon, C as CheckCircledIcon } from './index-CeHgnkLY.js';
6
6
 
7
7
  const capitalizeFirstLetter = (string) => {
8
8
  return string.charAt(0).toUpperCase() + string.slice(1);
@@ -917,6 +917,7 @@ const DISPLAY_TITLES = {
917
917
  NAME_YOUR_STREAM_PLACEHOLDER: 'e.g. Highest priority',
918
918
  STREAM_DESCRIPTION: 'Provide a clear and descriptive name for your pipeline to ensure its purpose is easily understood by you and your team.',
919
919
  STREAM_CONFIRM: 'Confirm your new Data Stream',
920
+ DATA_STREAM_EXISTS_WARNING: (curr, next) => `A Data Stream with this name already exists, you can still rename the current "${curr}", but it will merge into the existing "${next}".`,
920
921
  ACTION: 'Action',
921
922
  ACTIONS: 'Actions',
922
923
  ADD_ACTION: 'Add Action',
@@ -974,6 +975,8 @@ const DISPLAY_TITLES = {
974
975
  TO_MODIFY_OTEL_DATA: 'To modify OpenTelemetry data',
975
976
  QUICK_BACK_TO_SUMMARY: 'When you finish editing you can quickly go back to the summary.',
976
977
  GO_TO_SUMMARY: 'Go to summary',
978
+ FUTURE_APPS_TITLE: 'Auto-instrument new apps',
979
+ FUTURE_APPS_DESCRIPTION: 'When enabled, new applications will be instrumented automatically and included in the current data stream.',
977
980
  OVERIDE: 'Override',
978
981
  OVERIDDEN: 'Overridden',
979
982
  OVERRIDE_RUNTIME_DETAILS: 'Override Runtime Details',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { T as Theme } from './index-BD7meETN.js';
2
+ import { T as Theme } from './index-BRGQ84pJ.js';
3
3
 
4
4
  const ArrowIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
5
  const theme = Theme.useTheme();
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { T as Theme } from './index-BD7meETN.js';
2
+ import { T as Theme } from './index-BRGQ84pJ.js';
3
3
 
4
4
  const OdigosLogoText = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
5
  const theme = Theme.useTheme();
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { _ as WarningModal } from './index-C4uhvIMP.js';
2
+ import { _ as WarningModal } from './index-B1IScVBT.js';
3
3
  import { StatusType, EntityTypes } from './types.js';
4
- import './index-BD7meETN.js';
4
+ import './index-BRGQ84pJ.js';
5
5
  import 'styled-components';
6
6
 
7
7
  const CancelWarning = ({ isOpen, noOverlay, name, onApprove, onDeny }) => {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { T as Theme } from './index-BD7meETN.js';
2
+ import { T as Theme } from './index-BRGQ84pJ.js';
3
3
 
4
4
  const OdigosLogo = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
5
  const theme = Theme.useTheme();
@@ -1,9 +1,9 @@
1
1
  import { StatusType, DestinationTypes, EntityTypes, PlatformType } from './types.js';
2
- import { k as DEFAULT_DATA_STREAM_NAME, p as getProgrammingLanguageIcon, v as KafkaLogo, K as K8sLogo } from './index-BD7meETN.js';
2
+ import { k as DEFAULT_DATA_STREAM_NAME, p as getProgrammingLanguageIcon, v as KafkaLogo, K as K8sLogo } from './index-BRGQ84pJ.js';
3
3
  import 'react';
4
4
  import 'styled-components';
5
- import { e as AwsXrayLogo, a2 as VictoriaMetricsLogo, a1 as UptraceLogo, a0 as TraceloopLogo, $ as TingyunLogo, _ as TempoLogo, Z as TelemetryHubLogo, Y as SumoLogicLogo, X as SplunkLogo, W as SignozLogo, U as SeqLogo, d as AwsS3Logo, T as QuickwitLogo, G as GigapipeLogo, S as QrynLogo, R as PrometheusLogo, F as OpenTelemetryLogo, Q as OracleLogo, P as OpsVerseLogo, z as OpenObserveLogo, y as OneUptimeLogo, O as ObserveLogo, N as NewRelicLogo, M as MiddlewareLogo, x as LumigoLogo, w as LokiLogo, v as LogzioLogo, u as LightstepLogo, L as Last9Logo, K as KloudmateLogo, J as JaegerLogo, I as InstanaLogo, t as HyperDxLogo, H as HoneycombLogo, s as GroundcoverLogo, r as GreptimeLogo, q as GrafanaLogo, p as GoogleCloudPlatformLogo, o as ElasticSearchLogo, E as ElasticApmLogo, n as DynatraceLogo, m as DatadogLogo, D as Dash0Logo, l as CoralogixLogo, c as AwsCloudwatchLogo, k as ClickhouseLogo, j as ChronosphereLogo, i as ChecklyLogo, C as CauselyLogo, h as BonreeLogo, B as BetterStackLogo, g as BlobStorageLogo, f as AxiomLogo, b as AppDynamicsLogo, a as AlibabaCloudLogo, A as AlaudaLogo, a6 as RulesIcon, a3 as ActionsIcon, a4 as DestinationsIcon, a7 as SourcesIcon, a5 as NamespacesIcon, V as VmLogo } from './index-C3BU6Xe-.js';
6
- import { O as OdigosLogo } from './index-DZWbhK14.js';
5
+ import { e as AwsXrayLogo, a2 as VictoriaMetricsLogo, a1 as UptraceLogo, a0 as TraceloopLogo, $ as TingyunLogo, _ as TempoLogo, Z as TelemetryHubLogo, Y as SumoLogicLogo, X as SplunkLogo, W as SignozLogo, U as SeqLogo, d as AwsS3Logo, T as QuickwitLogo, G as GigapipeLogo, S as QrynLogo, R as PrometheusLogo, F as OpenTelemetryLogo, Q as OracleLogo, P as OpsVerseLogo, z as OpenObserveLogo, y as OneUptimeLogo, O as ObserveLogo, N as NewRelicLogo, M as MiddlewareLogo, x as LumigoLogo, w as LokiLogo, v as LogzioLogo, u as LightstepLogo, L as Last9Logo, K as KloudmateLogo, J as JaegerLogo, I as InstanaLogo, t as HyperDxLogo, H as HoneycombLogo, s as GroundcoverLogo, r as GreptimeLogo, q as GrafanaLogo, p as GoogleCloudPlatformLogo, o as ElasticSearchLogo, E as ElasticApmLogo, n as DynatraceLogo, m as DatadogLogo, D as Dash0Logo, l as CoralogixLogo, c as AwsCloudwatchLogo, k as ClickhouseLogo, j as ChronosphereLogo, i as ChecklyLogo, C as CauselyLogo, h as BonreeLogo, B as BetterStackLogo, g as BlobStorageLogo, f as AxiomLogo, b as AppDynamicsLogo, a as AlibabaCloudLogo, A as AlaudaLogo, a6 as RulesIcon, a3 as ActionsIcon, a4 as DestinationsIcon, a7 as SourcesIcon, a5 as NamespacesIcon, V as VmLogo } from './index-DypjdLnz.js';
6
+ import { O as OdigosLogo } from './index-CeHgnkLY.js';
7
7
  import { s as safeJsonParse } from './index-BV85P9UP.js';
8
8
 
9
9
  const compareCondition = (renderCondition, fields) => {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { T as Theme } from './index-BD7meETN.js';
2
+ import { T as Theme } from './index-BRGQ84pJ.js';
3
3
 
4
4
  const VmLogo = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
5
  const theme = Theme.useTheme();
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { T as Theme, B as BUTTON_TEXTS, l as DISPLAY_TITLES } from './index-BD7meETN.js';
3
- import { E as EditIcon } from './index-CY3kjYr3.js';
4
- import { B as Button, V as Text, J as NotificationNote } from './index-C4uhvIMP.js';
2
+ import { T as Theme, B as BUTTON_TEXTS, l as DISPLAY_TITLES } from './index-BRGQ84pJ.js';
3
+ import { E as EditIcon } from './index-BUCure0Q.js';
4
+ import { B as Button, V as Text, J as NotificationNote } from './index-B1IScVBT.js';
5
5
  import { StatusType } from './types.js';
6
6
  import 'styled-components';
7
- import { I as InfoIcon } from './index-DZWbhK14.js';
7
+ import { I as InfoIcon } from './index-CeHgnkLY.js';
8
8
 
9
9
  const EditButton = ({ label, onClick, variant = 'tertiary', ...props }) => {
10
10
  const theme = Theme.useTheme();
package/lib/snippets.js CHANGED
@@ -1,12 +1,12 @@
1
- export { A as AddButton } from './index-C4uhvIMP.js';
2
- export { E as EditButton, N as NoteBackToSummary } from './index-lkkeQEOt.js';
1
+ export { A as AddButton } from './index-B1IScVBT.js';
2
+ export { E as EditButton, N as NoteBackToSummary } from './index-fEP_guwb.js';
3
3
  import 'react';
4
- import './index-BD7meETN.js';
4
+ import './index-BRGQ84pJ.js';
5
5
  import './types.js';
6
6
  import 'styled-components';
7
- import './index-CY3kjYr3.js';
8
- import './index-qnmhJI4d.js';
9
- import './index-DZWbhK14.js';
7
+ import './index-BUCure0Q.js';
8
+ import './index-BJpPcCBm.js';
9
+ import './index-CeHgnkLY.js';
10
10
  import './index-BV85P9UP.js';
11
- import './useTransition-BWC_F-Pl.js';
11
+ import './useTransition-DsrDiKOV.js';
12
12
  import 'react-dom';
@@ -1,5 +1,5 @@
1
1
  import type { Destination, Source } from '@/types';
2
- export type AvailableSource = Pick<Source, 'name' | 'kind' | 'selected' | 'numberOfInstances'>;
2
+ export type AvailableSource = Pick<Source, 'namespace' | 'name' | 'kind' | 'selected' | 'numberOfInstances'>;
3
3
  export interface AvailableSourcesByNamespace {
4
4
  [namespace: string]: AvailableSource[];
5
5
  }
@@ -9,8 +9,13 @@ export type SelectedSource = AvailableSource & {
9
9
  export interface SourceSelectionFormData {
10
10
  [namespace: string]: SelectedSource[];
11
11
  }
12
+ export type SelectedNamespace = {
13
+ namespace: string;
14
+ selected: boolean;
15
+ currentStreamName: string;
16
+ };
12
17
  export interface NamespaceSelectionFormData {
13
- [namespace: string]: boolean;
18
+ [namespace: string]: SelectedNamespace;
14
19
  }
15
20
  export interface ISetupState {
16
21
  availableSources: AvailableSourcesByNamespace;
package/lib/store.js CHANGED
@@ -1,4 +1,4 @@
1
- export { u as useDarkMode, a as useDataStreamStore, b as useDrawerStore, c as useEntityStore, d as useFilterStore, e as useInstrumentStore, f as useModalStore, g as useNotificationStore, h as usePendingStore, i as useSelectedStore, j as useSetupStore } from './index-BD7meETN.js';
1
+ export { u as useDarkMode, a as useDataStreamStore, b as useDrawerStore, c as useEntityStore, d as useFilterStore, e as useInstrumentStore, f as useModalStore, g as useNotificationStore, h as usePendingStore, i as useSelectedStore, j as useSetupStore } from './index-BRGQ84pJ.js';
2
2
  import 'react';
3
3
  import './types.js';
4
4
  import 'styled-components';
package/lib/theme.js CHANGED
@@ -1,4 +1,4 @@
1
- export { T as default } from './index-BD7meETN.js';
1
+ export { T as default } from './index-BRGQ84pJ.js';
2
2
  import 'styled-components';
3
3
  import 'react';
4
4
  import './types.js';
@@ -63,6 +63,9 @@ export declare enum EntityTypes {
63
63
  Action = "Action",
64
64
  InstrumentationRule = "InstrumentationRule"
65
65
  }
66
+ export declare enum OtherEntityTypes {
67
+ DataStream = "DataStream"
68
+ }
66
69
  export declare enum FieldTypes {
67
70
  Input = "input",
68
71
  MultiInput = "multiInput",
@@ -2,6 +2,7 @@ import type { Source } from '../sources';
2
2
  export interface Namespace {
3
3
  name: string;
4
4
  selected: boolean;
5
+ dataStreamNames: string[];
5
6
  sources?: Source[];
6
7
  }
7
8
  export type FetchSingleNamespace = (payload: {
@@ -1,5 +1,5 @@
1
- import { SelectedSource } from '@/store';
2
1
  import { type Condition, ProgrammingLanguages } from '../common';
2
+ import type { NamespaceSelectionFormData, SourceSelectionFormData } from '@/store';
3
3
  export declare enum K8sResourceKind {
4
4
  Deployment = "Deployment",
5
5
  DaemonSet = "DaemonSet",
@@ -34,8 +34,4 @@ export interface SourceFormData {
34
34
  language?: ProgrammingLanguages | null;
35
35
  version?: string;
36
36
  }
37
- export type PersistSources = (selectAppsList: {
38
- [namespace: string]: SelectedSource[];
39
- }, futureSelectAppsList: {
40
- [namespace: string]: boolean;
41
- }) => void;
37
+ export type PersistSources = (selectAppsList: SourceSelectionFormData, futureSelectAppsList: NamespaceSelectionFormData) => void;
package/lib/types.js CHANGED
@@ -131,6 +131,10 @@ var EntityTypes;
131
131
  EntityTypes["Action"] = "Action";
132
132
  EntityTypes["InstrumentationRule"] = "InstrumentationRule";
133
133
  })(EntityTypes || (EntityTypes = {}));
134
+ var OtherEntityTypes;
135
+ (function (OtherEntityTypes) {
136
+ OtherEntityTypes["DataStream"] = "DataStream";
137
+ })(OtherEntityTypes || (OtherEntityTypes = {}));
134
138
  var FieldTypes;
135
139
  (function (FieldTypes) {
136
140
  FieldTypes["Input"] = "input";
@@ -309,4 +313,4 @@ var K8sResourceKind;
309
313
  K8sResourceKind["CronJob"] = "CronJob";
310
314
  })(K8sResourceKind || (K8sResourceKind = {}));
311
315
 
312
- export { ActionCategory, ActionKeyTypes, ActionType, AddNodeTypes, BooleanOperation, CodeAttributesKeyTypes, Crud, DestinationTypes, EdgeTypes, EntityTypes, FieldTypes, HeadersCollectionKeyTypes, InputTypes, InstrumentationRuleType, IntrumentationStatus, JsonOperation, K8sResourceKind, NodeTypes, NumberOperation, OtherStatus, PayloadCollectionKeyTypes, PlatformType, ProgrammingLanguages, SignalType, SortDirection, StatusType, StringOperation, Tier };
316
+ export { ActionCategory, ActionKeyTypes, ActionType, AddNodeTypes, BooleanOperation, CodeAttributesKeyTypes, Crud, DestinationTypes, EdgeTypes, EntityTypes, FieldTypes, HeadersCollectionKeyTypes, InputTypes, InstrumentationRuleType, IntrumentationStatus, JsonOperation, K8sResourceKind, NodeTypes, NumberOperation, OtherEntityTypes, OtherStatus, PayloadCollectionKeyTypes, PlatformType, ProgrammingLanguages, SignalType, SortDirection, StatusType, StringOperation, Tier };
@@ -1,9 +1,9 @@
1
1
  import { ActionKeyTypes, ActionType, StatusType, AddNodeTypes, EntityTypes, FieldTypes } from './types.js';
2
- import { g as useNotificationStore, F as FORM_ALERTS, f as useModalStore, b as useDrawerStore, c as useEntityStore, a as useDataStreamStore, j as useSetupStore } from './index-BD7meETN.js';
2
+ import { g as useNotificationStore, F as FORM_ALERTS, f as useModalStore, b as useDrawerStore, c as useEntityStore, a as useDataStreamStore, j as useSetupStore } from './index-BRGQ84pJ.js';
3
3
  import { useState, useEffect, useMemo } from 'react';
4
4
  import 'styled-components';
5
5
  import { i as isEmpty, s as safeJsonParse } from './index-BV85P9UP.js';
6
- import { b as useGenericForm } from './useTransition-BWC_F-Pl.js';
6
+ import { b as useGenericForm } from './useTransition-DsrDiKOV.js';
7
7
  import { g as getIdFromSseTarget, i as isLegalK8sLabel, m as mapExportedSignals } from './index-BlZKWuxe.js';
8
8
 
9
9
  const INITIAL$2 = {
@@ -454,31 +454,43 @@ const useSourceFormData = () => {
454
454
  };
455
455
  };
456
456
 
457
- const mapSourceToAvailableSource = (source, selectedStreamName, selectAll) => {
458
- const sourceIsInCurrentStream = source.dataStreamNames?.includes(selectedStreamName) || source.currentStreamName === selectedStreamName;
459
- const selected = typeof selectAll === 'boolean' ? selectAll : sourceIsInCurrentStream ? source.selected : false;
457
+ const mapToAvailableSource = (source, selectedStreamName, selectAll) => {
458
+ const isBooleanOverride = typeof selectAll === 'boolean';
459
+ const isInCurrentStream = source.dataStreamNames?.includes(selectedStreamName) || source.currentStreamName === selectedStreamName;
460
+ const selected = (isBooleanOverride ? selectAll : source.selected) || false;
460
461
  return {
462
+ namespace: source.namespace,
461
463
  name: source.name,
462
464
  kind: source.kind,
463
- selected,
465
+ selected: isInCurrentStream || isBooleanOverride ? selected : false,
464
466
  numberOfInstances: source.numberOfInstances,
465
467
  };
466
468
  };
467
- const mapSourceToSelectedSource = (source, selectedStreamName, selectAll) => {
469
+ const mapToSelectedSource = (source, selectedStreamName, selectAll) => {
468
470
  return {
469
- ...mapSourceToAvailableSource(source, selectedStreamName, selectAll),
471
+ ...mapToAvailableSource(source, selectedStreamName, selectAll),
472
+ currentStreamName: selectedStreamName,
473
+ };
474
+ };
475
+ const mapToSelectedNamespace = (ns, selectedStreamName, selectAll) => {
476
+ const isBooleanOverride = typeof selectAll === 'boolean';
477
+ const isInCurrentStream = ns.dataStreamNames?.includes(selectedStreamName);
478
+ const selected = (isBooleanOverride ? selectAll : ns.selected) || false;
479
+ return {
480
+ namespace: ns.name,
481
+ selected: isInCurrentStream || isBooleanOverride ? selected : false,
470
482
  currentStreamName: selectedStreamName,
471
483
  };
472
484
  };
473
485
  const mergeAvailableAndSelectedSources = (available, selected, currentStreamName) => {
474
486
  const payload = {};
475
487
  Object.entries(available).forEach(([namespace, sources]) => {
476
- payload[namespace] = sources.map((s) => mapSourceToSelectedSource(s, currentStreamName));
488
+ payload[namespace] = sources.map((s) => mapToSelectedSource(s, currentStreamName));
477
489
  });
478
490
  Object.entries(selected).forEach(([namespace, sources]) => {
479
491
  sources.forEach((s) => {
480
492
  const foundIdx = payload[namespace].findIndex((src) => src.name === s.name && src.kind === s.kind);
481
- const mapped = mapSourceToSelectedSource(s, currentStreamName);
493
+ const mapped = mapToSelectedSource(s, currentStreamName);
482
494
  if (foundIdx !== -1) {
483
495
  payload[namespace][foundIdx] = mapped;
484
496
  }
@@ -501,25 +513,25 @@ const useSourceSelectionFormData = (params) => {
501
513
  const [selectedNamespace, setSelectedNamespace] = useState('');
502
514
  const [selectedFutureApps, setSelectedFutureApps] = useState(configuredFutureApps);
503
515
  const [selectedSources, setSelectedSources] = useState(mergeAvailableAndSelectedSources(availableSourcesFromStore, configuredSources, selectedStreamName));
504
- const fetchAndSetThisNamespace = (ns, selectAll) => {
505
- fetchSingleNamespace?.({ variables: { namespaceName: ns } }).then(({ data }) => {
516
+ const fetchAndSetThisNamespace = async (ns, selectAll) => {
517
+ if (fetchSingleNamespace) {
518
+ const { data } = await fetchSingleNamespace({ variables: { namespaceName: ns.name } });
506
519
  const { name, sources = [] } = data?.computePlatform?.k8sActualNamespace || {};
507
520
  if (!name)
508
521
  return;
509
- // initialize sources for this namespace
510
522
  setRecordedInitialSources((prev) => ({
511
523
  ...prev,
512
- [name]: sources.map((s) => mapSourceToAvailableSource(s, selectedStreamName)),
524
+ [name]: sources.map((s) => mapToAvailableSource(s, selectedStreamName)),
513
525
  }));
514
526
  setSelectedSources((prev) => ({
515
527
  ...prev,
516
- [name]: typeof selectAll !== 'boolean' && prev[name]?.length ? prev[name] : sources.map((s) => mapSourceToSelectedSource(s, selectedStreamName, selectAll)),
528
+ [name]: typeof selectAll !== 'boolean' && prev[name]?.length ? prev[name] : sources.map((s) => mapToSelectedSource(s, selectedStreamName, selectAll)),
517
529
  }));
518
- });
530
+ }
519
531
  };
520
532
  useEffect(() => {
521
533
  if (!!namespaces?.length) {
522
- // initialize all states (to avoid undefined errors)
534
+ // initialize empty states to avoid undefined errors
523
535
  setRecordedInitialSources((prev) => {
524
536
  const payload = { ...prev };
525
537
  namespaces.forEach(({ name }) => (payload[name] = payload[name] || []));
@@ -532,22 +544,28 @@ const useSourceSelectionFormData = (params) => {
532
544
  });
533
545
  setSelectedFutureApps((prev) => {
534
546
  const payload = { ...prev };
535
- namespaces.forEach(({ name, selected }) => (payload[name] = payload[name] || selected || false));
547
+ namespaces.forEach((ns) => (payload[ns.name] = payload[ns.name] || mapToSelectedNamespace(ns, selectedStreamName)));
536
548
  return payload;
537
549
  });
538
- namespaces.forEach(({ name }) => fetchAndSetThisNamespace(name));
550
+ (async () => {
551
+ for await (const ns of namespaces)
552
+ await fetchAndSetThisNamespace(ns);
553
+ })();
539
554
  }
540
- }, [namespaces]);
555
+ }, [namespaces, selectedStreamName]);
541
556
  // form filters
542
557
  const [searchText, setSearchText] = useState('');
543
558
  const [searchBy, setSearchBy] = useState(EntityTypes.Source);
544
559
  const [showSelectedOnly, setShowSelectedOnly] = useState(false);
545
- const onSelectNamespace = (ns, selectAll) => {
546
- setSelectedNamespace((prev) => (prev === ns && typeof selectAll !== 'boolean' ? '' : ns));
547
- fetchAndSetThisNamespace(ns, selectAll);
560
+ const onSelectNamespace = (nsName, selectAll) => {
561
+ const ns = namespaces.find((namespace) => namespace.name === nsName);
562
+ if (ns) {
563
+ setSelectedNamespace((prev) => (prev === nsName && typeof selectAll !== 'boolean' ? '' : nsName));
564
+ fetchAndSetThisNamespace(ns, selectAll);
565
+ }
548
566
  };
549
- const onSelectSource = (source, namespace) => {
550
- const id = namespace || selectedNamespace;
567
+ const onSelectSource = (source, nsName) => {
568
+ const id = nsName || selectedNamespace;
551
569
  if (!id)
552
570
  return;
553
571
  const arr = [...(selectedSources[id] || [])];
@@ -562,11 +580,13 @@ const useSourceSelectionFormData = (params) => {
562
580
  }
563
581
  setSelectedSources((prev) => ({ ...prev, [id]: arr }));
564
582
  };
565
- const onSelectFutureApps = (bool, namespace) => {
566
- const id = namespace || selectedNamespace;
583
+ const onSelectFutureApps = (bool, nsName) => {
584
+ const id = nsName || selectedNamespace;
567
585
  if (!id)
568
586
  return;
569
- setSelectedFutureApps((prev) => ({ ...prev, [id]: bool }));
587
+ const ns = namespaces.find((namespace) => namespace.name === nsName);
588
+ if (ns)
589
+ setSelectedFutureApps((prev) => ({ ...prev, [id]: mapToSelectedNamespace(ns, selectedStreamName, bool) }));
570
590
  };
571
591
  const filteredNamespacesAndSources = useMemo(() => {
572
592
  const isSearchOk = (targetText, entityType) => !searchText || searchBy !== entityType || (searchBy === entityType && targetText.toLowerCase().includes(searchText));
@@ -585,7 +605,7 @@ const useSourceSelectionFormData = (params) => {
585
605
  const payload = {};
586
606
  Object.entries(selectedSources).forEach(([namespace, sources]) => {
587
607
  sources.forEach((source) => {
588
- const foundInitial = availableSources[namespace]?.find((initialSource) => initialSource.name === source.name && initialSource.kind === source.kind);
608
+ const foundInitial = availableSources[namespace]?.find((src) => src.name === source.name && src.kind === source.kind);
589
609
  if (foundInitial?.selected !== source.selected) {
590
610
  if (!payload[namespace])
591
611
  payload[namespace] = [];
@@ -598,10 +618,10 @@ const useSourceSelectionFormData = (params) => {
598
618
  // This is to filter the user-specific-selections, therebey minimizing the amount of data sent to the API on "persist namespaces".
599
619
  const getApiFutureAppsPayload = () => {
600
620
  const payload = {};
601
- Object.entries(selectedFutureApps).forEach(([namespace, selected]) => {
621
+ Object.entries(selectedFutureApps).forEach(([namespace, obj]) => {
602
622
  const foundInitial = namespaces?.find((ns) => ns.name === namespace);
603
- if (foundInitial?.selected !== selected) {
604
- payload[namespace] = selected;
623
+ if ((obj.selected && !foundInitial?.dataStreamNames?.includes(selectedStreamName)) || (!obj.selected && foundInitial?.dataStreamNames?.includes(selectedStreamName))) {
624
+ payload[namespace] = obj;
605
625
  }
606
626
  });
607
627
  return payload;
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useRef, useEffect, useCallback } from 'react';
2
- import { g as useNotificationStore } from './index-BD7meETN.js';
2
+ import { g as useNotificationStore } from './index-BRGQ84pJ.js';
3
3
  import { CodeAttributesKeyTypes, PayloadCollectionKeyTypes } from './types.js';
4
4
  import styled from 'styled-components';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "author": "Odigos",
5
5
  "repository": {
6
6
  "type": "git",