@odigos/ui-kit 0.0.29 → 0.0.30

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.30](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.29...ui-kit-v0.0.30) (2025-05-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * add action buttons for data streams dropdown ([#123](https://github.com/odigos-io/ui-kit/issues/123)) ([438635f](https://github.com/odigos-io/ui-kit/commit/438635fa308ed6070215a0afb353a026784f1fbb))
9
+ * add no-data to search results ([#128](https://github.com/odigos-io/ui-kit/issues/128)) ([d1f4d36](https://github.com/odigos-io/ui-kit/commit/d1f4d36e0c1ffa8261f88b62e178532a5c8fdc85))
10
+
3
11
  ## [0.0.29](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.28...ui-kit-v0.0.29) (2025-05-20)
4
12
 
5
13
 
package/lib/components.js CHANGED
@@ -1,19 +1,19 @@
1
- import { B as Button } from './index-qzll74wE.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-qzll74wE.js';
3
- export { C as CancelWarning, D as DeleteWarning } from './index-CPGUhlkI.js';
1
+ import { B as Button } from './index-nltUpkWT.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-nltUpkWT.js';
3
+ export { C as CancelWarning, D as DeleteWarning } from './index-BGK1nMOD.js';
4
4
  import React, { Component, createElement, createContext } from 'react';
5
5
  import Theme from './theme.js';
6
6
  import 'styled-components';
7
7
  import './index-BJxaoI0G.js';
8
8
  import './types.js';
9
9
  import './index-BZS1ijMm.js';
10
- import './index-B7MM_DAw.js';
10
+ import './index-DGuOxbBR.js';
11
11
  import './index-CFnxjzaW.js';
12
12
  import './index-DGel4E-Z.js';
13
13
  import './index-DMXaEyAB.js';
14
14
  import './index-CJs4RDHU.js';
15
15
  import './index-IKusBlIE.js';
16
- import './useTransition-n4huKtX2.js';
16
+ import './useTransition-B65KBqdK.js';
17
17
  import 'react-dom';
18
18
 
19
19
  const ErrorBoundaryContext = createContext(null);
@@ -1,3 +1,4 @@
1
+ export declare const DEFAULT_DATA_STREAM_NAME = "default";
1
2
  export declare const FORM_ALERTS: {
2
3
  REQUIRED_FIELDS: string;
3
4
  FIELD_IS_REQUIRED: string;
@@ -92,4 +93,6 @@ export declare const BUTTON_TEXTS: {
92
93
  NEXT: string;
93
94
  TEST: string;
94
95
  TEST_CONNECTION: string;
96
+ INSTRUMENT: string;
97
+ UNINSTRUMENT: string;
95
98
  };
package/lib/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ACTION_OPTIONS, B as BUTTON_TEXTS, D as DISPLAY_TITLES, F as FORM_ALERTS, I as INSTRUMENTATION_RULE_OPTIONS, M as MONITORS_OPTIONS } from './index-B7MM_DAw.js';
1
+ export { A as ACTION_OPTIONS, B as BUTTON_TEXTS, D as DEFAULT_DATA_STREAM_NAME, a as DISPLAY_TITLES, F as FORM_ALERTS, I as INSTRUMENTATION_RULE_OPTIONS, M as MONITORS_OPTIONS } from './index-DGuOxbBR.js';
2
2
  export { D as DESTINATION_CATEGORIES } from './index-Dqief9td.js';
3
3
  import './types.js';
4
4
  import './index-CFnxjzaW.js';
@@ -1,6 +1,9 @@
1
1
  import { type FC } from 'react';
2
+ import type { DataStream } from '@/types';
2
3
  interface DataStreamSelectProps {
3
4
  onClickNewDataStream: () => void;
5
+ updateDataStream: (dataStreamName: string, dataStream: DataStream) => void;
6
+ deleteDataStream: (dataStreamName: string) => void;
4
7
  }
5
8
  declare const DataStreamSelect: FC<DataStreamSelectProps>;
6
9
  export { DataStreamSelect, type DataStreamSelectProps };
@@ -1,4 +1,6 @@
1
+ import { CSSProperties } from 'react';
1
2
  export declare const RelativeContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
3
  export declare const AbsoluteContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
4
  $hidden?: boolean;
5
+ $padding?: CSSProperties["padding"];
4
6
  }>> & string;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { StoryFn } from '@storybook/react';
3
+ import { type DataStreamDrawerProps } from '.';
4
+ declare const _default: {
5
+ title: string;
6
+ component: React.FC<DataStreamDrawerProps>;
7
+ };
8
+ export default _default;
9
+ export declare const Default: StoryFn<DataStreamDrawerProps>;
@@ -0,0 +1,10 @@
1
+ import { type FC } from 'react';
2
+ import type { DataStream } from '@/types';
3
+ interface DataStreamDrawerProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ dataStreamName: string;
7
+ updateDataStream: (dataStreamName: string, dataStream: DataStream) => void;
8
+ }
9
+ declare const DataStreamDrawer: FC<DataStreamDrawerProps>;
10
+ export { DataStreamDrawer, type DataStreamDrawerProps };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { StoryFn } from '@storybook/react';
3
+ import { type DataStreamFormProps } from '.';
4
+ declare const _default: {
5
+ title: string;
6
+ component: React.FC<DataStreamFormProps>;
7
+ };
8
+ export default _default;
9
+ export declare const Default: StoryFn<DataStreamFormProps>;
@@ -0,0 +1,8 @@
1
+ import { type FC } from 'react';
2
+ import type { DataStream } from '@/types';
3
+ interface DataStreamFormProps {
4
+ formData: DataStream;
5
+ handleFormChange: (key: keyof DataStream, val: any) => void;
6
+ }
7
+ declare const DataStreamForm: FC<DataStreamFormProps>;
8
+ export { DataStreamForm, type DataStreamFormProps };
@@ -8,6 +8,8 @@ export * from './compute-platforms/index';
8
8
  export * from './compute-platforms-actions-menu/index';
9
9
  export * from './data-flow/index';
10
10
  export * from './data-flow-actions-menu/index';
11
+ export * from './data-stream-drawer/index';
12
+ export * from './data-stream-form/index';
11
13
  export * from './data-stream-selection-form/index';
12
14
  export * from './destination-drawer/index';
13
15
  export * from './destination-form/index';
@@ -5,6 +5,7 @@ interface OverviewDrawerProps extends PropsWithChildren {
5
5
  width?: number;
6
6
  title: string;
7
7
  titleTooltip?: string;
8
+ hideEditTitleFromEdit?: boolean;
8
9
  icons?: SVG[];
9
10
  iconSrcs?: string[];
10
11
  isEdit?: boolean;
package/lib/containers.js CHANGED
@@ -1,23 +1,23 @@
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 { D as DISPLAY_TITLES, A as ACTION_OPTIONS, F as FORM_ALERTS, M as MONITORS_OPTIONS, B as BUTTON_TEXTS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-B7MM_DAw.js';
3
+ import { a as DISPLAY_TITLES, B as BUTTON_TEXTS, A as ACTION_OPTIONS, F as FORM_ALERTS, M as MONITORS_OPTIONS, D as DEFAULT_DATA_STREAM_NAME, I as INSTRUMENTATION_RULE_OPTIONS } from './index-DGuOxbBR.js';
4
4
  import { ActionType, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, AddNodeTypes, EdgeTypes, FieldTypes, SignalType, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType } 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-qzll74wE.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-nltUpkWT.js';
6
6
  import { h as usePendingStore, g as useNotificationStore, b as useDrawerStore, c as useEntityStore, f as useModalStore, d as useFilterStore, s as styleInject, i as useSelectedStore, e as useInstrumentStore, a as useDataStreamStore, k as getEntityId, j as useSetupStore, u as useDarkMode } from './index-DMXaEyAB.js';
7
7
  import Theme from './theme.js';
8
8
  import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
9
9
  import { i as CheckCircledIcon, O as OdigosLogo } from './index-IKusBlIE.js';
10
10
  import { C as CrossCircledIcon, O as OdigosLogoText, a as OverviewIcon, F as FilterIcon, D as DataStreamsIcon, N as NotificationIcon, S as SlackLogo, K as KeyIcon, T as TerminalIcon } from './index-CamnKrev.js';
11
11
  import { g as getActionIcon, a as getInstrumentationRuleIcon } from './index-CFnxjzaW.js';
12
- import { u as useActionFormData, a as useClickNode, c as useDestinationFormData, b as useClickNotification, d as useSourceFormData, e as useSourceSelectionFormData } from './useSourceSelectionFormData-Bw2p1Fr4.js';
13
- import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, b as useGenericForm, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-n4huKtX2.js';
12
+ import { u as useActionFormData, a as useClickNode, c as useDataStreamFormData, d as useDestinationFormData, b as useClickNotification, e as useSourceFormData, f as useSourceSelectionFormData } from './useSourceSelectionFormData-BWz8fTJr.js';
13
+ import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-B65KBqdK.js';
14
14
  import { E as EditIcon } from './index-CWbxXTof.js';
15
15
  import { T as TrashIcon, S as SearchIcon, P as PlusIcon$1, f as CheckIcon, A as ArrowIcon, a as CopyIcon, g as CrossIcon } from './index-BJxaoI0G.js';
16
- import { D as DeleteWarning, C as CancelWarning } from './index-CPGUhlkI.js';
16
+ import { D as DeleteWarning, C as CancelWarning } from './index-BGK1nMOD.js';
17
17
  import { m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-CJs4RDHU.js';
18
18
  import { f as filterActions, i as getConditionsBooleans, n as getEntityLabel, m as getEntityIcon, v as sleep$1, p as getPlatformIcon, q as getPlatformLabel, h as formatBytes, k as getContainersIcons, r as getValueForRange, l as getDestinationIcon, u as mapExportedSignals, g as filterSourcesByStream, e as filterSources, b as filterDestinationsByStream, a as filterDestinations, c as compareCondition, d as deepClone, o as getMetricForEntity, s as getWorkloadId, j as getContainersInstrumentedCount, t as isOverTime } from './index-DYNMhZMX.js';
19
19
  import { createPortal } from 'react-dom';
20
- import { N as NoteBackToSummary, E as EditButton } from './index-CnBjimup.js';
20
+ import { N as NoteBackToSummary, E as EditButton } from './index-B46Mcu9H.js';
21
21
  import { D as DESTINATION_CATEGORIES } from './index-Dqief9td.js';
22
22
  import { a6 as RulesIcon, a7 as SourcesIcon, a3 as ActionsIcon, a4 as DestinationsIcon } from './index-BbbCCewR.js';
23
23
  import './index-DGel4E-Z.js';
@@ -305,7 +305,7 @@ const CustomFields$1 = ({ actionType, value, setValue, formErrors }) => {
305
305
  return Component ? React.createElement(Component, { value: value, setValue: setValue, formErrors: formErrors }) : null;
306
306
  };
307
307
 
308
- const Container$n = styled.div `
308
+ const Container$o = styled.div `
309
309
  display: flex;
310
310
  flex-direction: column;
311
311
  gap: 24px;
@@ -316,7 +316,7 @@ const FieldTitle$1 = styled(Text) `
316
316
  `;
317
317
  const ActionForm = ({ isUpdate, action, formData, formErrors, handleFormChange }) => {
318
318
  const theme = Theme.useTheme();
319
- return (React.createElement(Container$n, null,
319
+ return (React.createElement(Container$o, null,
320
320
  isUpdate && (React.createElement("div", null,
321
321
  React.createElement(FieldTitle$1, null, "Status"),
322
322
  React.createElement(Segment, { options: [
@@ -330,7 +330,7 @@ const ActionForm = ({ isUpdate, action, formData, formErrors, handleFormChange }
330
330
  React.createElement(TextArea, { title: 'Notes', value: formData['notes'], onChange: ({ target: { value } }) => handleFormChange('notes', value), errorMessage: formErrors['notes'] })));
331
331
  };
332
332
 
333
- const OverviewDrawer = forwardRef(({ children, width = 640, title, titleTooltip, icons, iconSrcs, isEdit = false, isFormDirty = false, isLastItem = false, onEdit, onSave, onDelete, onCancel, tabs }, drawerRef) => {
333
+ const OverviewDrawer = forwardRef(({ children, width = 640, title, titleTooltip, hideEditTitleFromEdit, icons, iconSrcs, isEdit = false, isFormDirty = false, isLastItem = false, onEdit, onSave, onDelete, onCancel, tabs }, drawerRef) => {
334
334
  const theme = Theme.useTheme();
335
335
  const { isThisPending } = usePendingStore();
336
336
  const { addNotification } = useNotificationStore();
@@ -414,7 +414,7 @@ const OverviewDrawer = forwardRef(({ children, width = 640, title, titleTooltip,
414
414
  onClick: isPending ? () => handlePending(isSource ? 'uninstrument' : 'delete') : clickDelete,
415
415
  children: (React.createElement(React.Fragment, null,
416
416
  React.createElement(TrashIcon, null),
417
- React.createElement(Text, { color: theme.text.error, size: 14, family: 'secondary', decoration: 'underline' }, isSource ? 'Uninstrument' : 'Delete'))),
417
+ React.createElement(Text, { color: theme.text.error, size: 14, family: 'secondary', decoration: 'underline' }, isSource ? BUTTON_TEXTS.UNINSTRUMENT : BUTTON_TEXTS.DELETE))),
418
418
  });
419
419
  return (React.createElement(React.Fragment, null,
420
420
  React.createElement(Drawer, { isOpen: true, onClose: isEdit ? clickCancel : closeDrawer, closeOnEscape: !isDeleteModalOpen && !isCancelModalOpen, width: `${width + 64}px`, header: {
@@ -422,7 +422,7 @@ const OverviewDrawer = forwardRef(({ children, width = 640, title, titleTooltip,
422
422
  iconSrcs,
423
423
  title,
424
424
  titleTooltip,
425
- replaceTitleWith: !isSource && isEdit ? React.createElement(EditTitle, { ref: titleRef, title: title }) : undefined,
425
+ replaceTitleWith: !hideEditTitleFromEdit && isEdit ? React.createElement(EditTitle, { ref: titleRef, title: title }) : undefined,
426
426
  actionButtons,
427
427
  tabs,
428
428
  }, footer: {
@@ -432,25 +432,27 @@ const OverviewDrawer = forwardRef(({ children, width = 640, title, titleTooltip,
432
432
  'data-id': 'drawer-save',
433
433
  variant: 'primary',
434
434
  onClick: clickSave,
435
- children: 'save',
435
+ children: BUTTON_TEXTS.SAVE,
436
436
  },
437
437
  {
438
438
  'data-id': 'drawer-cancel',
439
439
  variant: 'secondary',
440
440
  onClick: clickCancel,
441
- children: 'cancel',
442
- },
443
- ],
444
- rightButtons: [
445
- {
446
- 'data-id': 'drawer-delete',
447
- variant: 'tertiary',
448
- onClick: clickDelete,
449
- children: (React.createElement(React.Fragment, null,
450
- React.createElement(TrashIcon, null),
451
- React.createElement(Text, { size: 14, color: theme.text.error, family: 'secondary', decoration: 'underline' }, "delete"))),
441
+ children: BUTTON_TEXTS.CANCEL,
452
442
  },
453
443
  ],
444
+ rightButtons: onDelete
445
+ ? [
446
+ {
447
+ 'data-id': 'drawer-delete',
448
+ variant: 'tertiary',
449
+ onClick: clickDelete,
450
+ children: (React.createElement(React.Fragment, null,
451
+ React.createElement(TrashIcon, null),
452
+ React.createElement(Text, { size: 14, color: theme.text.error, family: 'secondary', decoration: 'underline' }, BUTTON_TEXTS.DELETE))),
453
+ },
454
+ ]
455
+ : [],
454
456
  } }, children),
455
457
  React.createElement(DeleteWarning, { isOpen: isDeleteModalOpen, noOverlay: true, name: `${drawerType}${title ? ` (${title})` : ''}`, type: drawerType, isLastItem: isLastItem, onApprove: handleDelete, onDeny: closeWarningModals }),
456
458
  React.createElement(CancelWarning, { isOpen: isCancelModalOpen, noOverlay: true, name: 'edit mode', onApprove: handleCancel, onDeny: closeWarningModals })));
@@ -468,7 +470,7 @@ const EditTitle = forwardRef(({ title }, ref) => {
468
470
  return React.createElement(Input, { "data-id": 'title', value: inputValue, onChange: (e) => setInputValue(e.target.value) });
469
471
  });
470
472
 
471
- const FormContainer$3 = styled.div `
473
+ const FormContainer$4 = styled.div `
472
474
  width: 100%;
473
475
  height: 100%;
474
476
  max-height: calc(100vh - 220px);
@@ -526,7 +528,7 @@ const ActionDrawer = ({ updateAction, deleteAction }) => {
526
528
  setIsFormDirty(false);
527
529
  }
528
530
  };
529
- return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.spec.actionName || thisItem.type, icons: [getActionIcon(thisItem.type)], isEdit: isEditing, isFormDirty: isFormDirty, onEdit: handleEdit, onSave: handleSave, onDelete: handleDelete, onCancel: handleCancel }, isEditing && thisOptionType ? (React.createElement(FormContainer$3, null,
531
+ return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.spec.actionName || thisItem.type, icons: [getActionIcon(thisItem.type)], isEdit: isEditing, isFormDirty: isFormDirty, onEdit: handleEdit, onSave: handleSave, onDelete: handleDelete, onCancel: handleCancel }, isEditing && thisOptionType ? (React.createElement(FormContainer$4, null,
530
532
  React.createElement(ActionForm, { isUpdate: true, action: thisOptionType, formData: formData, formErrors: formErrors, handleFormChange: (...params) => {
531
533
  setIsFormDirty(true);
532
534
  handleFormChange(...params);
@@ -752,7 +754,7 @@ const ActionTable = ({ maxHeight, maxWidth }) => {
752
754
  React.createElement(NoDataFound, null)))));
753
755
  };
754
756
 
755
- const Container$m = styled(FlexColumn) `
757
+ const Container$n = styled(FlexColumn) `
756
758
  // width: 100vw;
757
759
  // height: 100vh;
758
760
  gap: 64px;
@@ -765,7 +767,7 @@ const TextWrap = styled(FlexColumn) `
765
767
  align-items: center;
766
768
  justify-content: center;
767
769
  `;
768
- const Title$3 = styled(Text) `
770
+ const Title$4 = styled(Text) `
769
771
  text-align: center;
770
772
  font-size: 24px;
771
773
  `;
@@ -786,12 +788,12 @@ const AwaitPipeline = () => {
786
788
  useEffect(() => {
787
789
  awaitPipeline();
788
790
  }, []);
789
- return (React.createElement(Container$m, null,
791
+ return (React.createElement(Container$n, null,
790
792
  React.createElement(OdigosLogoText, { size: 100 }),
791
793
  React.createElement(TraceLoader, { width: 400 }),
792
794
  React.createElement(TextWrap, null,
793
795
  React.createElement(FlexRow, { "$gap": 16 },
794
- React.createElement(Title$3, null, "Preparing your workspace..."),
796
+ React.createElement(Title$4, null, "Preparing your workspace..."),
795
797
  React.createElement(Badge, { label: `${progress}%` })),
796
798
  React.createElement(Description, null, "It can take up to a few minutes. Grab a cup of coffee, look out a window, and enjoy your free moment!"))));
797
799
  };
@@ -811,7 +813,7 @@ const Tab = styled(FlexRow) `
811
813
  }
812
814
  `}
813
815
  `;
814
- const Title$2 = styled(Text) `
816
+ const Title$3 = styled(Text) `
815
817
  font-size: 14px;
816
818
  margin-right: 10px;
817
819
  color: ${({ theme }) => theme.text.secondary};
@@ -866,7 +868,7 @@ const ComputePlatformSelect = ({ connections, selected, onSelect, onViewAll }) =
866
868
  return (React.createElement(RelativeContainer$3, { ref: containerRef },
867
869
  React.createElement(Tab, { "$withSelect": withSelect, onClick: () => setIsOpen((prev) => !prev) },
868
870
  React.createElement(LogoWrap, null, !!Icon ? React.createElement(Icon, { size: 20, fill: theme.text.info }) : React.createElement(OverviewIcon, { fill: theme.text.info })),
869
- React.createElement(Title$2, null, selected?.name || selected?.id || 'no platform'),
871
+ React.createElement(Title$3, null, selected?.name || selected?.id || 'no platform'),
870
872
  withSelect && (React.createElement(PushToEnd$1, null,
871
873
  React.createElement(ExtendArrow, { extend: isOpen, align: 'right' })))),
872
874
  isOpen && withSelect && (React.createElement(AbsoluteContainer$3, null,
@@ -1025,14 +1027,14 @@ const KindDropdown = ({ sources, title = 'Kind', value, onSelect, onDeselect, ..
1025
1027
  return React.createElement(Dropdown, { disabled: !options?.length, title: title, placeholder: 'All', options: options, value: value, onSelect: onSelect, onDeselect: onDeselect, ...props });
1026
1028
  };
1027
1029
 
1028
- const Container$l = styled.div `
1030
+ const Container$m = styled.div `
1029
1031
  display: flex;
1030
1032
  align-items: center;
1031
1033
  margin: 20px 0;
1032
1034
  padding: 0 16px;
1033
1035
  gap: 8px;
1034
1036
  `;
1035
- const Title$1 = styled(Text) `
1037
+ const Title$2 = styled(Text) `
1036
1038
  font-size: 24px;
1037
1039
  white-space: nowrap;
1038
1040
  `;
@@ -1045,10 +1047,10 @@ const ComputePlatformsActionsMenu = ({ connections }) => {
1045
1047
  useEffect(() => {
1046
1048
  return () => clearAll();
1047
1049
  }, [clearAll]);
1048
- return (React.createElement(Container$l, null,
1050
+ return (React.createElement(Container$m, null,
1049
1051
  React.createElement(FlexRow, { "$gap": 16 },
1050
1052
  React.createElement(FlexRow, { "$gap": 12 },
1051
- React.createElement(Title$1, null, "Compute platforms"),
1053
+ React.createElement(Title$2, null, "Compute platforms"),
1052
1054
  React.createElement(Badge, { label: connections.length, filled: !!connections.length })),
1053
1055
  React.createElement(Divider, { orientation: 'vertical', length: '20px', margin: '0' }),
1054
1056
  React.createElement(SearchAndFilterWrapper, null,
@@ -12802,7 +12804,7 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
12802
12804
  */
12803
12805
  memo(ResizeControl);
12804
12806
 
12805
- const Container$k = styled(FlexColumn) `
12807
+ const Container$l = styled(FlexColumn) `
12806
12808
  align-items: center !important;
12807
12809
  justify-content: center;
12808
12810
  align-self: stretch;
@@ -12825,7 +12827,7 @@ const Container$k = styled(FlexColumn) `
12825
12827
  const TitleWrapper = styled(FlexRow) `
12826
12828
  gap: 4px;
12827
12829
  `;
12828
- const Title = styled(Text) `
12830
+ const Title$1 = styled(Text) `
12829
12831
  font-size: 14px;
12830
12832
  font-weight: 600;
12831
12833
  `;
@@ -12839,24 +12841,24 @@ const AddNode = memo(({ id: nodeId, data }) => {
12839
12841
  const { isThisPending } = usePendingStore();
12840
12842
  const entity = nodeId.split('-')[0];
12841
12843
  const isPending = isThisPending({ entityType: entity });
12842
- return (React.createElement(Container$k, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
12844
+ return (React.createElement(Container$l, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
12843
12845
  isPending ? (React.createElement(Fragment, null,
12844
12846
  React.createElement(TitleWrapper, null,
12845
12847
  React.createElement(FadeLoader, null),
12846
- React.createElement(Title, { family: 'secondary' },
12848
+ React.createElement(Title$1, { family: 'secondary' },
12847
12849
  "adding ",
12848
12850
  entity,
12849
12851
  "s")),
12850
12852
  React.createElement(SubTitle, null, "Just a few more seconds..."))) : (React.createElement(Fragment, null,
12851
12853
  React.createElement(TitleWrapper, null,
12852
12854
  React.createElement(PlusIcon$1, null),
12853
- React.createElement(Title, { family: 'secondary', decoration: 'underline' }, title)),
12855
+ React.createElement(Title$1, { family: 'secondary', decoration: 'underline' }, title)),
12854
12856
  React.createElement(SubTitle, null, subTitle))),
12855
12857
  React.createElement(Handle, { type: 'target', position: Position.Left, style: { visibility: 'hidden' } }),
12856
12858
  React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } })));
12857
12859
  });
12858
12860
 
12859
- const Container$j = styled.div `
12861
+ const Container$k = styled.div `
12860
12862
  width: ${({ $nodeWidth }) => `${$nodeWidth}px`};
12861
12863
  `;
12862
12864
  const BaseNode = memo(({ id: nodeId, data }) => {
@@ -12889,7 +12891,7 @@ const BaseNode = memo(({ id: nodeId, data }) => {
12889
12891
  }
12890
12892
  setSelectedSources(namespaces);
12891
12893
  };
12892
- return (React.createElement(Container$j, { "data-id": nodeId, "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
12894
+ return (React.createElement(Container$k, { "data-id": nodeId, "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
12893
12895
  React.createElement(DataTab, { title: title, subTitle: subTitle, onClick: () => { }, renderActions: renderActions, iconProps: {
12894
12896
  icon: icon,
12895
12897
  icons: icons,
@@ -12909,19 +12911,19 @@ const BaseNode = memo(({ id: nodeId, data }) => {
12909
12911
  React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } })));
12910
12912
  });
12911
12913
 
12912
- const Container$i = styled.div `
12914
+ const Container$j = styled.div `
12913
12915
  width: ${({ $nodeWidth }) => `${$nodeWidth}px`};
12914
12916
  height: ${({ $nodeHeight }) => `${$nodeHeight}px`};
12915
12917
  opacity: 0;
12916
12918
  `;
12917
12919
  const EdgedNode = memo(({ data }) => {
12918
12920
  const { nodeWidth, nodeHeight } = data;
12919
- return (React.createElement(Container$i, { "$nodeWidth": nodeWidth, "$nodeHeight": nodeHeight, className: 'nowheel nodrag' },
12921
+ return (React.createElement(Container$j, { "$nodeWidth": nodeWidth, "$nodeHeight": nodeHeight, className: 'nowheel nodrag' },
12920
12922
  React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } }),
12921
12923
  React.createElement(Handle, { type: 'target', position: Position.Left, style: { visibility: 'hidden' } })));
12922
12924
  });
12923
12925
 
12924
- const Container$h = styled.div `
12926
+ const Container$i = styled.div `
12925
12927
  width: ${({ $nodeWidth }) => $nodeWidth}px;
12926
12928
  height: ${({ $nodeHeight }) => $nodeHeight}px;
12927
12929
  background: transparent;
@@ -12930,7 +12932,7 @@ const Container$h = styled.div `
12930
12932
  `;
12931
12933
  const FrameNode = memo(({ data }) => {
12932
12934
  const { nodeWidth, nodeHeight } = data;
12933
- return (React.createElement(Container$h, { "$nodeWidth": nodeWidth, "$nodeHeight": nodeHeight, className: 'nowheel nodrag' },
12935
+ return (React.createElement(Container$i, { "$nodeWidth": nodeWidth, "$nodeHeight": nodeHeight, className: 'nowheel nodrag' },
12934
12936
  React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } }),
12935
12937
  React.createElement(Handle, { type: 'target', position: Position.Left, style: { visibility: 'hidden' } })));
12936
12938
  });
@@ -12945,7 +12947,7 @@ const nodeConfig = {
12945
12947
  };
12946
12948
 
12947
12949
  const { framePadding: framePadding$3 } = nodeConfig;
12948
- const Container$g = styled.div `
12950
+ const Container$h = styled.div `
12949
12951
  position: relative;
12950
12952
  z-index: 1;
12951
12953
  width: fit-content;
@@ -12993,7 +12995,7 @@ const ScrollNode = memo(({ data, ...rest }) => {
12993
12995
  current?.addEventListener('scroll', handleScroll);
12994
12996
  return () => current?.removeEventListener('scroll', handleScroll);
12995
12997
  }, [onScroll]);
12996
- return (React.createElement(Container$g, { ref: containerRef, "$nodeHeight": nodeHeight, className: 'nowheel nodrag' },
12998
+ return (React.createElement(Container$h, { ref: containerRef, "$nodeHeight": nodeHeight, className: 'nowheel nodrag' },
12997
12999
  items.map((item) => (React.createElement(BaseNodeWrapper, { key: item.id, onClick: (e) => {
12998
13000
  e.stopPropagation();
12999
13001
  // @ts-ignore
@@ -13003,7 +13005,7 @@ const ScrollNode = memo(({ data, ...rest }) => {
13003
13005
  React.createElement(BottomOverlay, { "$hide": isBottomOfList })));
13004
13006
  });
13005
13007
 
13006
- const Container$f = styled.div `
13008
+ const Container$g = styled.div `
13007
13009
  position: relative;
13008
13010
  width: ${({ $nodeWidth }) => `${$nodeWidth}px`};
13009
13011
  padding: 12px 0px 16px 0px;
@@ -13072,7 +13074,7 @@ const HeaderNode = memo(({ id: nodeId, data }) => {
13072
13074
  setSelectedSources({});
13073
13075
  }
13074
13076
  };
13075
- return (React.createElement(Container$f, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
13077
+ return (React.createElement(Container$g, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
13076
13078
  entityType === EntityTypes.Source && (React.createElement(SelectorWrapper, null,
13077
13079
  React.createElement(Checkbox, { partiallyChecked: hasSelected && sources?.length !== totalSelectedSources, value: hasSelected && sources?.length === totalSelectedSources, onChange: onSelect, disabled: !sources?.length }))),
13078
13080
  React.createElement(IconTitleBadge, { icon: Icon, title: title, badge: isSourceAwaitingInstrumentation ? `${instrumentingPercent}%` : badge, badgeTooltip: badgeTooltip, loading: isFetching && !isSourceAwaitingInstrumentation }),
@@ -13134,12 +13136,12 @@ const LabeledEdge = memo(({ id, sourceX, sourceY, targetX, targetY, sourcePositi
13134
13136
  React.createElement(Tooltip, { text: 'Heads up! The data-flow metrics you see are calculated over 10-second intervals.' }, data?.label)))));
13135
13137
  });
13136
13138
 
13137
- const Container$e = styled.div `
13139
+ const Container$f = styled.div `
13138
13140
  width: ${({ $nodeWidth }) => `${$nodeWidth}px`};
13139
13141
  `;
13140
13142
  const SkeletonNode = memo(({ id: nodeId, data }) => {
13141
13143
  const { nodeWidth } = data;
13142
- return (React.createElement(Container$e, { "data-id": nodeId, "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
13144
+ return (React.createElement(Container$f, { "data-id": nodeId, "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
13143
13145
  React.createElement(SkeletonLoader, { size: 3 })));
13144
13146
  });
13145
13147
 
@@ -13634,7 +13636,7 @@ const buildDestinationNodes = ({ loading, entities, positions, unfilteredCount }
13634
13636
  return nodes;
13635
13637
  };
13636
13638
 
13637
- const Container$d = styled.div `
13639
+ const Container$e = styled.div `
13638
13640
  width: 100%;
13639
13641
  height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove})`};
13640
13642
  position: relative;
@@ -13710,7 +13712,7 @@ const DataFlow = ({ heightToRemove, metrics }) => {
13710
13712
  });
13711
13713
  handleNodesChanged(ruleNodes, EntityTypes.InstrumentationRule);
13712
13714
  }, [instrumentationRules, instrumentationRulesLoading, positions[EntityTypes.InstrumentationRule]]);
13713
- return (React.createElement(Container$d, { ref: containerRef, "$heightToRemove": heightToRemove },
13715
+ return (React.createElement(Container$e, { ref: containerRef, "$heightToRemove": heightToRemove },
13714
13716
  React.createElement(Flow, { nodes: nodes, edges: edges, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange })));
13715
13717
  };
13716
13718
 
@@ -13723,11 +13725,12 @@ const AbsoluteContainer$2 = styled.div `
13723
13725
  top: calc(100% + 8px);
13724
13726
  left: 0;
13725
13727
  z-index: 1;
13728
+ width: 420px;
13729
+ padding: ${({ $padding }) => $padding || 'unset'};
13730
+ display: ${({ $hidden }) => ($hidden ? 'none' : 'block')};
13726
13731
  background-color: ${({ theme }) => theme.colors.dropdown_bg};
13727
13732
  border: ${({ theme }) => `1px solid ${theme.colors.border}`};
13728
13733
  border-radius: 24px;
13729
- width: 420px;
13730
- display: ${({ $hidden }) => ($hidden ? 'none' : 'block')};
13731
13734
  `;
13732
13735
 
13733
13736
  const buildSearchResults = ({ instrumentationRules, sources, actions, destinations, searchText, selectedCategory }) => {
@@ -13809,6 +13812,10 @@ const SearchResults = ({ searchText, onClose }) => {
13809
13812
  searchText,
13810
13813
  selectedCategory,
13811
13814
  }), [instrumentationRules, sources, actions, destinations, selectedStreamName, searchText, selectedCategory]);
13815
+ if (!searchResults.length) {
13816
+ return (React.createElement(AbsoluteContainer$2, { "$padding": '12px' },
13817
+ React.createElement(NoDataFound, null)));
13818
+ }
13812
13819
  return (React.createElement(AbsoluteContainer$2, null,
13813
13820
  React.createElement(HorizontalScroll, { style: { borderBottom: `1px solid ${!searchResults.length ? 'transparent' : theme.colors.border}` } }, categories.map(({ category, label, count }) => !!count && (React.createElement(SelectionButton, { key: `category-select-${category}`, label: label, badgeLabel: count, isSelected: selectedCategory === category, onClick: () => setSelectedCategory(category) })))),
13814
13821
  searchResults.map(({ category, label, entities }, catIdx) => !!entities.length && (React.createElement(Fragment, { key: `category-list-${category}` },
@@ -13930,6 +13937,58 @@ const Filters$1 = () => {
13930
13937
  React.createElement(ActionButton$1, { variant: 'tertiary', onClick: onReset, "$color": theme.text.error }, "Reset"))))));
13931
13938
  };
13932
13939
 
13940
+ const Container$d = styled.div `
13941
+ display: flex;
13942
+ flex-direction: column;
13943
+ gap: 24px;
13944
+ padding: 4px;
13945
+ `;
13946
+ const DataStreamForm = ({ formData, handleFormChange }) => {
13947
+ return (React.createElement(Container$d, null,
13948
+ React.createElement(Input, { name: 'name', title: DISPLAY_TITLES.STREAM_NAME, required: true, value: formData.name, onChange: ({ target: { value } }) => handleFormChange('name', value) })));
13949
+ };
13950
+
13951
+ const FormContainer$3 = styled.div `
13952
+ width: 100%;
13953
+ height: 100%;
13954
+ max-height: calc(100vh - 220px);
13955
+ overflow: overlay;
13956
+ overflow-y: auto;
13957
+ `;
13958
+ const DataStreamDrawer = ({ isOpen, onClose, dataStreamName, updateDataStream }) => {
13959
+ const { dataStreams } = useDataStreamStore();
13960
+ const drawerRef = useRef(null);
13961
+ const [isFormDirty, setIsFormDirty] = useState(false);
13962
+ const { formData, handleFormChange, resetFormData, loadFormWithDrawerItem } = useDataStreamFormData({ name: dataStreamName });
13963
+ const thisItem = useMemo(() => {
13964
+ if (!isOpen)
13965
+ return null;
13966
+ const found = dataStreams?.find((x) => x.name === dataStreamName);
13967
+ if (found)
13968
+ loadFormWithDrawerItem(found);
13969
+ return found;
13970
+ }, [isOpen, dataStreams, dataStreamName]);
13971
+ if (!thisItem)
13972
+ return null;
13973
+ const handleCancel = () => {
13974
+ resetFormData();
13975
+ setIsFormDirty(false);
13976
+ onClose();
13977
+ };
13978
+ const handleSave = () => {
13979
+ updateDataStream(dataStreamName, formData);
13980
+ setIsFormDirty(false);
13981
+ onClose();
13982
+ };
13983
+ const memoizedHandleFormChange = useCallback((key, val) => {
13984
+ handleFormChange(key, val);
13985
+ setIsFormDirty(true);
13986
+ }, [handleFormChange]);
13987
+ return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.name, icons: [DataStreamsIcon], hideEditTitleFromEdit: true, isEdit: true, isFormDirty: isFormDirty, onSave: handleSave, onCancel: handleCancel },
13988
+ React.createElement(FormContainer$3, null,
13989
+ React.createElement(DataStreamForm, { formData: formData, handleFormChange: memoizedHandleFormChange }))));
13990
+ };
13991
+
13933
13992
  const RelativeContainer$1 = styled.div `
13934
13993
  position: relative;
13935
13994
  `;
@@ -13941,6 +14000,9 @@ const Container$c = styled(FlexRow) `
13941
14000
  max-height: 28px;
13942
14001
  }
13943
14002
  `;
14003
+ const Title = styled(Text) `
14004
+ text-wrap: nowrap;
14005
+ `;
13944
14006
  const AbsoluteContainer$1 = styled.div `
13945
14007
  position: absolute;
13946
14008
  top: calc(100% + 8px);
@@ -13951,36 +14013,64 @@ const AbsoluteContainer$1 = styled.div `
13951
14013
  border-radius: 24px;
13952
14014
  width: 420px;
13953
14015
  `;
13954
- const SelectionMenuHeadWrap = styled.div `
14016
+ const SelectionMenuHeader = styled.div `
13955
14017
  border-bottom: ${({ theme }) => `1px solid ${theme.colors.border}`};
13956
14018
  padding: 12px;
13957
14019
  `;
13958
- const SelectionWrap = styled(VerticalScroll) `
14020
+ const SelectionContent = styled(VerticalScroll) `
13959
14021
  max-height: 240px;
13960
14022
  `;
13961
- const DataStreamSelect = ({ onClickNewDataStream }) => {
14023
+ const SelectionRow = styled(FlexRow) `
14024
+ width: 100%;
14025
+ `;
14026
+ const Stretch = styled.div `
14027
+ width: 100%;
14028
+ `;
14029
+ const DataStreamSelect = ({ onClickNewDataStream, updateDataStream, deleteDataStream }) => {
13962
14030
  const theme = Theme.useTheme();
13963
14031
  const { dataStreams, selectedStreamName, setSelectedStreamName } = useDataStreamStore();
13964
- const containerRef = useRef(null);
13965
14032
  const [popupOpen, setPopupOpen] = useState(false);
14033
+ const containerRef = useRef(null);
13966
14034
  useOnClickOutside(containerRef, () => setPopupOpen(false));
14035
+ const [editOpenForDataStreamName, setEditOpenForDataStreamName] = useState('');
14036
+ const [deleteOpenForDataStreamName, setDeleteOpenForDataStreamName] = useState('');
13967
14037
  const [searchText, setSearchText] = useState('');
13968
14038
  const filteredDataStreams = useMemo(() => dataStreams.filter(({ name }) => !searchText || name.toLowerCase().includes(searchText.toLowerCase())), [dataStreams, searchText]);
13969
- return (React.createElement(RelativeContainer$1, null,
13970
- React.createElement(Container$c, { "$gap": 0 },
13971
- React.createElement(Button, { variant: 'tertiary', onClick: () => setPopupOpen((prev) => !prev) },
13972
- React.createElement(DataStreamsIcon, { fill: theme.text.info }),
13973
- React.createElement(Text, null, selectedStreamName),
13974
- React.createElement(ExtendArrow, { extend: popupOpen })),
13975
- React.createElement(Divider, { orientation: 'vertical', length: '32px', thickness: 2, margin: '0' }),
13976
- React.createElement(AddButton$1, { onClick: onClickNewDataStream, label: BUTTON_TEXTS.NEW })),
13977
- popupOpen && (React.createElement(AbsoluteContainer$1, { ref: containerRef },
13978
- React.createElement(SelectionMenuHeadWrap, null,
13979
- React.createElement(Input, { placeholder: 'Search...', icon: SearchIcon, value: searchText, onChange: (e) => setSearchText(e.target.value) })),
13980
- React.createElement(SelectionWrap, null, filteredDataStreams.map(({ name }) => (React.createElement(SelectionButton, { key: `stream-${name}`, label: name, isSelected: selectedStreamName === name, onClick: () => {
14039
+ const rows = useMemo(() => filteredDataStreams.map(({ name }) => (React.createElement(SelectionRow, { key: `stream-${name}` },
14040
+ React.createElement(Stretch, null,
14041
+ React.createElement(SelectionButton, { label: name, isSelected: selectedStreamName === name, onClick: () => {
13981
14042
  setSelectedStreamName(name);
13982
14043
  setPopupOpen(false);
13983
- }, color: 'transparent', style: { width: '100%', justifyContent: 'flex-start' } }))))))));
14044
+ }, color: 'transparent', style: { width: '100%', justifyContent: 'flex-start' } })),
14045
+ name !== DEFAULT_DATA_STREAM_NAME && (React.createElement(IconButton, { onClick: () => setDeleteOpenForDataStreamName(name), tooltip: BUTTON_TEXTS.DELETE },
14046
+ React.createElement(TrashIcon, null))),
14047
+ React.createElement(IconButton, { onClick: () => setEditOpenForDataStreamName(name), tooltip: BUTTON_TEXTS.EDIT },
14048
+ React.createElement(EditIcon, null))))), [filteredDataStreams, selectedStreamName]);
14049
+ return (React.createElement(React.Fragment, null,
14050
+ React.createElement(RelativeContainer$1, null,
14051
+ React.createElement(Container$c, { "$gap": 0 },
14052
+ React.createElement(Button, { variant: 'tertiary', onClick: () => setPopupOpen((prev) => !prev) },
14053
+ React.createElement(DataStreamsIcon, { fill: theme.text.info }),
14054
+ React.createElement(Title, null,
14055
+ "Data Stream: ",
14056
+ selectedStreamName),
14057
+ React.createElement(ExtendArrow, { extend: popupOpen }),
14058
+ React.createElement(Badge, { label: dataStreams.length })),
14059
+ React.createElement(Divider, { orientation: 'vertical', length: '32px', thickness: 2, margin: '0' }),
14060
+ React.createElement(AddButton$1, { onClick: onClickNewDataStream, label: BUTTON_TEXTS.NEW })),
14061
+ popupOpen && (React.createElement(AbsoluteContainer$1, { ref: containerRef },
14062
+ React.createElement(SelectionMenuHeader, null,
14063
+ React.createElement(Input, { placeholder: 'Search...', icon: SearchIcon, value: searchText, onChange: (e) => setSearchText(e.target.value) })),
14064
+ React.createElement(SelectionContent, null, rows)))),
14065
+ React.createElement(DeleteWarning, { isOpen: deleteOpenForDataStreamName !== '', name: deleteOpenForDataStreamName, onApprove: () => {
14066
+ deleteDataStream(deleteOpenForDataStreamName);
14067
+ setDeleteOpenForDataStreamName('');
14068
+ }, onDeny: () => {
14069
+ setDeleteOpenForDataStreamName('');
14070
+ } }),
14071
+ React.createElement(DataStreamDrawer, { isOpen: editOpenForDataStreamName !== '', onClose: () => {
14072
+ setEditOpenForDataStreamName('');
14073
+ }, dataStreamName: editOpenForDataStreamName, updateDataStream: updateDataStream })));
13984
14074
  };
13985
14075
 
13986
14076
  const Container$b = styled.div `
@@ -13994,10 +14084,10 @@ const Container$b = styled.div `
13994
14084
  const PushToEnd = styled.div `
13995
14085
  margin-left: auto;
13996
14086
  `;
13997
- const DataFlowActionsMenu = ({ addEntity, onClickNewDataStream }) => {
14087
+ const DataFlowActionsMenu = ({ addEntity, onClickNewDataStream, updateDataStream, deleteDataStream }) => {
13998
14088
  const { setCurrentModal } = useModalStore();
13999
14089
  return (React.createElement(Container$b, null,
14000
- onClickNewDataStream && React.createElement(DataStreamSelect, { onClickNewDataStream: onClickNewDataStream }),
14090
+ React.createElement(DataStreamSelect, { onClickNewDataStream: onClickNewDataStream, updateDataStream: updateDataStream, deleteDataStream: deleteDataStream }),
14001
14091
  React.createElement(Search, null),
14002
14092
  React.createElement(Filters$1, null),
14003
14093
  addEntity && (React.createElement(PushToEnd, null,
@@ -14005,25 +14095,13 @@ const DataFlowActionsMenu = ({ addEntity, onClickNewDataStream }) => {
14005
14095
  };
14006
14096
 
14007
14097
  const DataStreamSelectionForm = forwardRef(({ isModal, onClickSummary }, ref) => {
14008
- const { selectedStreamName, dataStreams } = useDataStreamStore();
14009
- const { formData, handleFormChange, formErrors, handleErrorChange } = useGenericForm({
14010
- name: selectedStreamName,
14011
- });
14098
+ const { dataStreams, selectedStreamName } = useDataStreamStore();
14099
+ const dataStreamOptions = useMemo(() => dataStreams.map(({ name }) => ({ label: name })), [dataStreams]);
14100
+ const { formData, handleFormChange, formErrors, validateForm } = useDataStreamFormData({ name: selectedStreamName });
14012
14101
  useImperativeHandle(ref, () => ({
14013
- validateForm: () => {
14014
- let isValid = true;
14015
- if (!formData['name']) {
14016
- isValid = false;
14017
- handleErrorChange('name', FORM_ALERTS.FIELD_IS_REQUIRED);
14018
- }
14019
- else {
14020
- handleErrorChange('name', undefined);
14021
- }
14022
- return isValid;
14023
- },
14102
+ validateForm,
14024
14103
  getFormValues: () => formData,
14025
14104
  }));
14026
- const dataStreamOptions = useMemo(() => dataStreams.map(({ name }) => ({ label: name })), [dataStreams]);
14027
14105
  return (React.createElement(ModalBody, { "$isNotModal": !isModal, "$minHeight": '70vh' },
14028
14106
  React.createElement(FlexColumn, { "$gap": 24 },
14029
14107
  onClickSummary && React.createElement(NoteBackToSummary, { onClick: onClickSummary }),
@@ -15773,7 +15851,7 @@ const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) =>
15773
15851
  setIsFormDirty(false);
15774
15852
  setIsEditing(false);
15775
15853
  };
15776
- return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.otelServiceName || thisItem.name, titleTooltip: 'This attribute is used to identify the name of the service (service.name) that is generating telemetry data.', icons: getContainersIcons(thisItem.containers), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: selectedTab === Tabs.Overview ? handleEdit : undefined, onSave: handleSave, onDelete: selectedTab === Tabs.Overview ? handleDelete : undefined, onCancel: handleCancel, isLastItem: sourcesByStream.length === 1, tabs: [
15854
+ return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.otelServiceName || thisItem.name, titleTooltip: 'This attribute is used to identify the name of the service (service.name) that is generating telemetry data.', hideEditTitleFromEdit: true, icons: getContainersIcons(thisItem.containers), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: selectedTab === Tabs.Overview ? handleEdit : undefined, onSave: handleSave, onDelete: selectedTab === Tabs.Overview ? handleDelete : undefined, onCancel: handleCancel, isLastItem: sourcesByStream.length === 1, tabs: [
15777
15855
  {
15778
15856
  label: Tabs.Overview,
15779
15857
  onClick: () => setSelectedTab(Tabs.Overview),
@@ -16247,4 +16325,4 @@ const ToggleDarkMode = () => {
16247
16325
  React.createElement(Background, { "$darkMode": darkMode })));
16248
16326
  };
16249
16327
 
16250
- export { ActionDrawer, ActionForm, ActionModal, ActionTable, AwaitPipeline, ComputePlatformSelect, ComputePlatforms, ComputePlatformsActionsMenu, ConnectionStatusDropdown, ConnectionTypeDropdown, DataFlow, DataFlowActionsMenu, DataStreamSelectionForm, DestinationDrawer, DestinationForm, DestinationModal, DestinationSelectionForm, DestinationTable, ErrorDropdown, InstrumentationRuleDrawer, InstrumentationRuleForm, InstrumentationRuleModal, InstrumentationRuleTable, KindDropdown, LanguageDropdown, MonitorDropdown, MultiSourceControl, NamespaceDropdown, NavIconIds, NotificationManager, OverviewDrawer, SetupSummary, SideNav, SlackInvite, SourceDrawer, SourceForm, SourceModal, SourceSelectionForm, SourceTable, SystemOverview, TableCellConditions, ToastList, ToggleDarkMode };
16328
+ export { ActionDrawer, ActionForm, ActionModal, ActionTable, AwaitPipeline, ComputePlatformSelect, ComputePlatforms, ComputePlatformsActionsMenu, ConnectionStatusDropdown, ConnectionTypeDropdown, DataFlow, DataFlowActionsMenu, DataStreamDrawer, DataStreamForm, DataStreamSelectionForm, DestinationDrawer, DestinationForm, DestinationModal, DestinationSelectionForm, DestinationTable, ErrorDropdown, InstrumentationRuleDrawer, InstrumentationRuleForm, InstrumentationRuleModal, InstrumentationRuleTable, KindDropdown, LanguageDropdown, MonitorDropdown, MultiSourceControl, NamespaceDropdown, NavIconIds, NotificationManager, OverviewDrawer, SetupSummary, SideNav, SlackInvite, SourceDrawer, SourceForm, SourceModal, SourceSelectionForm, SourceTable, SystemOverview, TableCellConditions, ToastList, ToggleDarkMode };
@@ -3,6 +3,7 @@ export * from './useClickNode';
3
3
  export * from './useClickNotification';
4
4
  export * from './useContainerSize';
5
5
  export * from './useCopy';
6
+ export * from './useDataStreamFormData';
6
7
  export * from './useDestinationFormData';
7
8
  export * from './useGenericForm';
8
9
  export * from './useInstrumentationRuleFormData';
@@ -0,0 +1,12 @@
1
+ import { DataStream } from '@/types';
2
+ export declare const useDataStreamFormData: (initialFormData: DataStream) => {
3
+ formData: DataStream;
4
+ formErrors: Partial<Record<"name", string>>;
5
+ handleFormChange: (key?: string | undefined, val?: any, obj?: DataStream | undefined) => void;
6
+ resetFormData: () => void;
7
+ validateForm: (params?: {
8
+ withAlert?: boolean;
9
+ alertTitle?: string;
10
+ }) => boolean;
11
+ loadFormWithDrawerItem: ({ name }: DataStream) => void;
12
+ };
package/lib/hooks.js CHANGED
@@ -1,11 +1,11 @@
1
- export { u as useActionFormData, a as useClickNode, b as useClickNotification, c as useDestinationFormData, d as useSourceFormData, e as useSourceSelectionFormData } from './useSourceSelectionFormData-Bw2p1Fr4.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-n4huKtX2.js';
1
+ export { u as useActionFormData, a as useClickNode, b as useClickNotification, c as useDataStreamFormData, d as useDestinationFormData, e as useSourceFormData, f as useSourceSelectionFormData } from './useSourceSelectionFormData-BWz8fTJr.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-B65KBqdK.js';
3
3
  import './types.js';
4
4
  import 'react';
5
5
  import './index-DMXaEyAB.js';
6
6
  import 'styled-components';
7
7
  import './index-BZS1ijMm.js';
8
- import './index-B7MM_DAw.js';
8
+ import './index-DGuOxbBR.js';
9
9
  import './index-CFnxjzaW.js';
10
10
  import './index-DGel4E-Z.js';
11
11
  import './theme.js';
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import Theme from './theme.js';
3
3
  import { E as EditIcon } from './index-CWbxXTof.js';
4
- import { B as BUTTON_TEXTS, D as DISPLAY_TITLES } from './index-B7MM_DAw.js';
5
- import { B as Button, V as Text, J as NotificationNote } from './index-qzll74wE.js';
4
+ import { B as BUTTON_TEXTS, a as DISPLAY_TITLES } from './index-DGuOxbBR.js';
5
+ import { B as Button, V as Text, J as NotificationNote } from './index-nltUpkWT.js';
6
6
  import { StatusType } from './types.js';
7
7
  import './index-DMXaEyAB.js';
8
8
  import 'styled-components';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { _ as WarningModal } from './index-qzll74wE.js';
2
+ import { _ as WarningModal } from './index-nltUpkWT.js';
3
3
  import { StatusType, EntityTypes } from './types.js';
4
4
  import './index-DMXaEyAB.js';
5
5
  import 'styled-components';
@@ -125,6 +125,7 @@ const MONITORS_OPTIONS = [
125
125
  },
126
126
  ];
127
127
 
128
+ const DEFAULT_DATA_STREAM_NAME = 'default';
128
129
  const FORM_ALERTS = {
129
130
  REQUIRED_FIELDS: 'Required fields are missing',
130
131
  FIELD_IS_REQUIRED: 'This field is required',
@@ -219,6 +220,8 @@ const BUTTON_TEXTS = {
219
220
  NEXT: 'Next',
220
221
  TEST: 'Test',
221
222
  TEST_CONNECTION: 'Test Connection',
223
+ INSTRUMENT: 'Instrument',
224
+ UNINSTRUMENT: 'Uninstrument',
222
225
  };
223
226
 
224
- export { ACTION_OPTIONS as A, BUTTON_TEXTS as B, DISPLAY_TITLES as D, FORM_ALERTS as F, INSTRUMENTATION_RULE_OPTIONS as I, MONITORS_OPTIONS as M };
227
+ export { ACTION_OPTIONS as A, BUTTON_TEXTS as B, DEFAULT_DATA_STREAM_NAME as D, FORM_ALERTS as F, INSTRUMENTATION_RULE_OPTIONS as I, MONITORS_OPTIONS as M, DISPLAY_TITLES as a };
@@ -4,10 +4,10 @@ import styled, { css } from 'styled-components';
4
4
  import { M as MinusIcon, f as CheckIcon, L as ListIcon, C as CodeIcon, E as ExtendArrowIcon, c as SortArrowsIcon, a as CopyIcon, b as NotebookIcon, X as XIcon, d as EyeClosedIcon, e as EyeOpenIcon, N as NoDataIcon, g as CrossIcon, S as SearchIcon, P as PlusIcon, T as TrashIcon, A as ArrowIcon } from './index-BJxaoI0G.js';
5
5
  import { StatusType, OtherStatus, SortDirection, ProgrammingLanguages } from './types.js';
6
6
  import { s as safeJsonParse, i as isEmpty } from './index-BZS1ijMm.js';
7
- import { M as MONITORS_OPTIONS, B as BUTTON_TEXTS } from './index-B7MM_DAw.js';
7
+ import { M as MONITORS_OPTIONS, B as BUTTON_TEXTS } from './index-DGuOxbBR.js';
8
8
  import { b as getStatusIcon, r as removeEmptyValuesFromObject, s as safeJsonStringify, f as flattenObjectKeys, m as mapConditions, c as capitalizeFirstLetter, g as getMonitorIcon, p as parseJsonStringToPrettyString, a as getProgrammingLanguageIcon, d as splitCamelString } from './index-CJs4RDHU.js';
9
9
  import './index-DMXaEyAB.js';
10
- import { u as useContainerSize, a as useCopy, g as useTransition, d as useKeyDown, e as useOnClickOutside } from './useTransition-n4huKtX2.js';
10
+ import { u as useContainerSize, a as useCopy, g as useTransition, d as useKeyDown, e as useOnClickOutside } from './useTransition-B65KBqdK.js';
11
11
  import { I as ImageErrorIcon } from './index-DGel4E-Z.js';
12
12
  import ReactDOM from 'react-dom';
13
13
  import { I as InfoIcon } from './index-IKusBlIE.js';
package/lib/snippets.js CHANGED
@@ -1,5 +1,5 @@
1
- export { A as AddButton } from './index-qzll74wE.js';
2
- export { E as EditButton, N as NoteBackToSummary } from './index-CnBjimup.js';
1
+ export { A as AddButton } from './index-nltUpkWT.js';
2
+ export { E as EditButton, N as NoteBackToSummary } from './index-B46Mcu9H.js';
3
3
  import 'react';
4
4
  import './theme.js';
5
5
  import './index-DMXaEyAB.js';
@@ -7,11 +7,11 @@ import './types.js';
7
7
  import 'styled-components';
8
8
  import './index-BJxaoI0G.js';
9
9
  import './index-BZS1ijMm.js';
10
- import './index-B7MM_DAw.js';
10
+ import './index-DGuOxbBR.js';
11
11
  import './index-CFnxjzaW.js';
12
12
  import './index-DGel4E-Z.js';
13
13
  import './index-CJs4RDHU.js';
14
14
  import './index-IKusBlIE.js';
15
- import './useTransition-n4huKtX2.js';
15
+ import './useTransition-B65KBqdK.js';
16
16
  import 'react-dom';
17
17
  import './index-CWbxXTof.js';
@@ -3,8 +3,8 @@ import { useState, useEffect, useMemo } from 'react';
3
3
  import { g as useNotificationStore, f as useModalStore, b as useDrawerStore, c as useEntityStore, a as useDataStreamStore, j as useSetupStore } from './index-DMXaEyAB.js';
4
4
  import 'styled-components';
5
5
  import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
6
- import { F as FORM_ALERTS } from './index-B7MM_DAw.js';
7
- import { b as useGenericForm } from './useTransition-n4huKtX2.js';
6
+ import { F as FORM_ALERTS } from './index-DGuOxbBR.js';
7
+ import { b as useGenericForm } from './useTransition-B65KBqdK.js';
8
8
  import { g as getIdFromSseTarget } from './index-7-KCQK-x.js';
9
9
 
10
10
  const INITIAL$2 = {
@@ -203,6 +203,47 @@ const useClickNotification = () => {
203
203
  return { onClickNotification };
204
204
  };
205
205
 
206
+ const useDataStreamFormData = (initialFormData) => {
207
+ const { addNotification } = useNotificationStore();
208
+ const { formData, handleFormChange, formErrors, handleErrorChange, resetFormData } = useGenericForm(initialFormData);
209
+ const validateForm = (params) => {
210
+ const errors = {};
211
+ let isValid = true;
212
+ if (!formData['name']) {
213
+ isValid = false;
214
+ errors['name'] = FORM_ALERTS.FIELD_IS_REQUIRED;
215
+ }
216
+ else {
217
+ errors['name'] = undefined;
218
+ }
219
+ if (!isValid && params?.withAlert) {
220
+ addNotification({
221
+ type: StatusType.Warning,
222
+ title: params.alertTitle,
223
+ message: FORM_ALERTS.REQUIRED_FIELDS,
224
+ hideFromHistory: true,
225
+ });
226
+ }
227
+ handleErrorChange(undefined, undefined, errors);
228
+ return isValid;
229
+ };
230
+ const loadFormWithDrawerItem = ({ name }) => {
231
+ const updatedData = {
232
+ ...initialFormData,
233
+ name,
234
+ };
235
+ handleFormChange(undefined, undefined, updatedData);
236
+ };
237
+ return {
238
+ formData,
239
+ formErrors,
240
+ handleFormChange,
241
+ resetFormData,
242
+ validateForm,
243
+ loadFormWithDrawerItem,
244
+ };
245
+ };
246
+
206
247
  const INITIAL$1 = {
207
248
  // @ts-ignore form should be initialized with empty values
208
249
  type: '',
@@ -541,4 +582,4 @@ const useSourceSelectionFormData = (params) => {
541
582
  };
542
583
  };
543
584
 
544
- export { useClickNode as a, useClickNotification as b, useDestinationFormData as c, useSourceFormData as d, useSourceSelectionFormData as e, useActionFormData as u };
585
+ export { useClickNode as a, useClickNotification as b, useDataStreamFormData as c, useDestinationFormData as d, useSourceFormData as e, useSourceSelectionFormData as f, useActionFormData as u };
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useRef, useEffect, useCallback } from 'react';
2
- import './index-B7MM_DAw.js';
2
+ import './index-DGuOxbBR.js';
3
3
  import { g as useNotificationStore } from './index-DMXaEyAB.js';
4
4
  import { CodeAttributesKeyTypes, PayloadCollectionKeyTypes } from './types.js';
5
5
  import styled from 'styled-components';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "author": "Odigos",
5
5
  "repository": {
6
6
  "type": "git",