@odigos/ui-kit 0.0.28 → 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.
Files changed (34) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/components/stepper/index.d.ts +1 -0
  3. package/lib/components.js +5 -5
  4. package/lib/constants/strings/index.d.ts +4 -0
  5. package/lib/constants.js +1 -1
  6. package/lib/containers/data-flow-actions-menu/data-stream-select/index.d.ts +3 -0
  7. package/lib/containers/data-flow-actions-menu/styled.d.ts +2 -0
  8. package/lib/containers/data-stream-drawer/data-stream-drawer.stories.d.ts +9 -0
  9. package/lib/containers/data-stream-drawer/index.d.ts +10 -0
  10. package/lib/containers/data-stream-form/data-stream-form.stories.d.ts +9 -0
  11. package/lib/containers/data-stream-form/index.d.ts +8 -0
  12. package/lib/containers/destination-modal/index.d.ts +1 -0
  13. package/lib/containers/index.d.ts +2 -0
  14. package/lib/containers/overview-drawer/index.d.ts +1 -0
  15. package/lib/containers.js +224 -117
  16. package/lib/functions.js +2 -2
  17. package/lib/hooks/index.d.ts +1 -0
  18. package/lib/hooks/useDataStreamFormData.d.ts +12 -0
  19. package/lib/hooks/useDestinationFormData.d.ts +1 -1
  20. package/lib/hooks.js +3 -3
  21. package/lib/icons.js +1 -1
  22. package/lib/{index-R9xRto5r.js → index-B46Mcu9H.js} +2 -2
  23. package/lib/{index-8BSRffGz.js → index-BGK1nMOD.js} +1 -1
  24. package/lib/{index-BRW_Nl-n.js → index-BbbCCewR.js} +1 -1
  25. package/lib/{index-CTgLYGo-.js → index-DGuOxbBR.js} +5 -1
  26. package/lib/{index-BfatCMWq.js → index-DYNMhZMX.js} +2 -1
  27. package/lib/{index-CX75oR-h.js → index-nltUpkWT.js} +8 -5
  28. package/lib/mock-data/sources/index.d.ts +1 -1
  29. package/lib/snippets.js +4 -4
  30. package/lib/types/destinations/index.d.ts +1 -0
  31. package/lib/types.js +1 -0
  32. package/lib/{useSourceSelectionFormData-CoaXePS_.js → useSourceSelectionFormData-BWz8fTJr.js} +45 -3
  33. package/lib/{useTransition-BSKilkmZ.js → useTransition-B65KBqdK.js} +1 -1
  34. package/package.json +1 -1
package/lib/containers.js CHANGED
@@ -1,25 +1,25 @@
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, M as MONITORS_OPTIONS, B as BUTTON_TEXTS, F as FORM_ALERTS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-CTgLYGo-.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, M as Modal, N as NavigationButtons, a4 as ModalBody, 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, a0 as FlexColumn, 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, J as NotificationNote, U as Stepper, I as IconButton, e as DataCardFields, s as IconsNav, p as IconGroup } from './index-CX75oR-h.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-CoaXePS_.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-BSKilkmZ.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-8BSRffGz.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
- 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-BfatCMWq.js';
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-R9xRto5r.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
- import { a6 as RulesIcon, a7 as SourcesIcon, a3 as ActionsIcon, a4 as DestinationsIcon } from './index-BRW_Nl-n.js';
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';
24
24
  import './index-7-KCQK-x.js';
25
25
 
@@ -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);
@@ -535,6 +537,10 @@ const ActionDrawer = ({ updateAction, deleteAction }) => {
535
537
  React.createElement(DataCard, { title: DISPLAY_TITLES.ACTION_DETAILS, data: !!thisItem ? buildCard$3(thisItem) : [] })))));
536
538
  };
537
539
 
540
+ const GapAndMargin$1 = styled(FlexColumn) `
541
+ margin-top: 24px;
542
+ gap: 12px;
543
+ `;
538
544
  const ActionModal = ({ createAction }) => {
539
545
  const { currentModal, setCurrentModal } = useModalStore();
540
546
  const isOpen = currentModal === EntityTypes.Action;
@@ -568,7 +574,9 @@ const ActionModal = ({ createAction }) => {
568
574
  ] }) },
569
575
  React.createElement(ModalBody, null,
570
576
  React.createElement(SectionTitle, { title: 'Select Action', description: 'Select an action to modify telemetry data before it`s sent to destinations. Choose an action type and configure its details.' }),
571
- React.createElement(AutocompleteInput, { options: ACTION_OPTIONS, selectedOption: selectedItem, onOptionSelect: (opt) => handleSelect(opt), style: { marginTop: '24px' }, autoFocus: !selectedItem?.type }),
577
+ React.createElement(GapAndMargin$1, null,
578
+ React.createElement(NotificationNote, { type: StatusType.Warning, message: FORM_ALERTS.DEFINED_FOR_ALL_STREAMS(DISPLAY_TITLES.ACTIONS) }),
579
+ React.createElement(AutocompleteInput, { options: ACTION_OPTIONS, selectedOption: selectedItem, onOptionSelect: (opt) => handleSelect(opt), autoFocus: !selectedItem?.type })),
572
580
  !!selectedItem?.type ? (React.createElement("div", null,
573
581
  React.createElement(Divider, { margin: '16px 0' }),
574
582
  React.createElement(ActionForm, { action: selectedItem, formData: formData, formErrors: formErrors, handleFormChange: handleFormChange }))) : null)));
@@ -746,7 +754,7 @@ const ActionTable = ({ maxHeight, maxWidth }) => {
746
754
  React.createElement(NoDataFound, null)))));
747
755
  };
748
756
 
749
- const Container$m = styled(FlexColumn) `
757
+ const Container$n = styled(FlexColumn) `
750
758
  // width: 100vw;
751
759
  // height: 100vh;
752
760
  gap: 64px;
@@ -759,7 +767,7 @@ const TextWrap = styled(FlexColumn) `
759
767
  align-items: center;
760
768
  justify-content: center;
761
769
  `;
762
- const Title$3 = styled(Text) `
770
+ const Title$4 = styled(Text) `
763
771
  text-align: center;
764
772
  font-size: 24px;
765
773
  `;
@@ -780,12 +788,12 @@ const AwaitPipeline = () => {
780
788
  useEffect(() => {
781
789
  awaitPipeline();
782
790
  }, []);
783
- return (React.createElement(Container$m, null,
791
+ return (React.createElement(Container$n, null,
784
792
  React.createElement(OdigosLogoText, { size: 100 }),
785
793
  React.createElement(TraceLoader, { width: 400 }),
786
794
  React.createElement(TextWrap, null,
787
795
  React.createElement(FlexRow, { "$gap": 16 },
788
- React.createElement(Title$3, null, "Preparing your workspace..."),
796
+ React.createElement(Title$4, null, "Preparing your workspace..."),
789
797
  React.createElement(Badge, { label: `${progress}%` })),
790
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!"))));
791
799
  };
@@ -805,7 +813,7 @@ const Tab = styled(FlexRow) `
805
813
  }
806
814
  `}
807
815
  `;
808
- const Title$2 = styled(Text) `
816
+ const Title$3 = styled(Text) `
809
817
  font-size: 14px;
810
818
  margin-right: 10px;
811
819
  color: ${({ theme }) => theme.text.secondary};
@@ -860,7 +868,7 @@ const ComputePlatformSelect = ({ connections, selected, onSelect, onViewAll }) =
860
868
  return (React.createElement(RelativeContainer$3, { ref: containerRef },
861
869
  React.createElement(Tab, { "$withSelect": withSelect, onClick: () => setIsOpen((prev) => !prev) },
862
870
  React.createElement(LogoWrap, null, !!Icon ? React.createElement(Icon, { size: 20, fill: theme.text.info }) : React.createElement(OverviewIcon, { fill: theme.text.info })),
863
- React.createElement(Title$2, null, selected?.name || selected?.id || 'no platform'),
871
+ React.createElement(Title$3, null, selected?.name || selected?.id || 'no platform'),
864
872
  withSelect && (React.createElement(PushToEnd$1, null,
865
873
  React.createElement(ExtendArrow, { extend: isOpen, align: 'right' })))),
866
874
  isOpen && withSelect && (React.createElement(AbsoluteContainer$3, null,
@@ -1019,14 +1027,14 @@ const KindDropdown = ({ sources, title = 'Kind', value, onSelect, onDeselect, ..
1019
1027
  return React.createElement(Dropdown, { disabled: !options?.length, title: title, placeholder: 'All', options: options, value: value, onSelect: onSelect, onDeselect: onDeselect, ...props });
1020
1028
  };
1021
1029
 
1022
- const Container$l = styled.div `
1030
+ const Container$m = styled.div `
1023
1031
  display: flex;
1024
1032
  align-items: center;
1025
1033
  margin: 20px 0;
1026
1034
  padding: 0 16px;
1027
1035
  gap: 8px;
1028
1036
  `;
1029
- const Title$1 = styled(Text) `
1037
+ const Title$2 = styled(Text) `
1030
1038
  font-size: 24px;
1031
1039
  white-space: nowrap;
1032
1040
  `;
@@ -1039,10 +1047,10 @@ const ComputePlatformsActionsMenu = ({ connections }) => {
1039
1047
  useEffect(() => {
1040
1048
  return () => clearAll();
1041
1049
  }, [clearAll]);
1042
- return (React.createElement(Container$l, null,
1050
+ return (React.createElement(Container$m, null,
1043
1051
  React.createElement(FlexRow, { "$gap": 16 },
1044
1052
  React.createElement(FlexRow, { "$gap": 12 },
1045
- React.createElement(Title$1, null, "Compute platforms"),
1053
+ React.createElement(Title$2, null, "Compute platforms"),
1046
1054
  React.createElement(Badge, { label: connections.length, filled: !!connections.length })),
1047
1055
  React.createElement(Divider, { orientation: 'vertical', length: '20px', margin: '0' }),
1048
1056
  React.createElement(SearchAndFilterWrapper, null,
@@ -12796,7 +12804,7 @@ function ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle
12796
12804
  */
12797
12805
  memo(ResizeControl);
12798
12806
 
12799
- const Container$k = styled(FlexColumn) `
12807
+ const Container$l = styled(FlexColumn) `
12800
12808
  align-items: center !important;
12801
12809
  justify-content: center;
12802
12810
  align-self: stretch;
@@ -12819,7 +12827,7 @@ const Container$k = styled(FlexColumn) `
12819
12827
  const TitleWrapper = styled(FlexRow) `
12820
12828
  gap: 4px;
12821
12829
  `;
12822
- const Title = styled(Text) `
12830
+ const Title$1 = styled(Text) `
12823
12831
  font-size: 14px;
12824
12832
  font-weight: 600;
12825
12833
  `;
@@ -12833,24 +12841,24 @@ const AddNode = memo(({ id: nodeId, data }) => {
12833
12841
  const { isThisPending } = usePendingStore();
12834
12842
  const entity = nodeId.split('-')[0];
12835
12843
  const isPending = isThisPending({ entityType: entity });
12836
- return (React.createElement(Container$k, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
12844
+ return (React.createElement(Container$l, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
12837
12845
  isPending ? (React.createElement(Fragment, null,
12838
12846
  React.createElement(TitleWrapper, null,
12839
12847
  React.createElement(FadeLoader, null),
12840
- React.createElement(Title, { family: 'secondary' },
12848
+ React.createElement(Title$1, { family: 'secondary' },
12841
12849
  "adding ",
12842
12850
  entity,
12843
12851
  "s")),
12844
12852
  React.createElement(SubTitle, null, "Just a few more seconds..."))) : (React.createElement(Fragment, null,
12845
12853
  React.createElement(TitleWrapper, null,
12846
12854
  React.createElement(PlusIcon$1, null),
12847
- React.createElement(Title, { family: 'secondary', decoration: 'underline' }, title)),
12855
+ React.createElement(Title$1, { family: 'secondary', decoration: 'underline' }, title)),
12848
12856
  React.createElement(SubTitle, null, subTitle))),
12849
12857
  React.createElement(Handle, { type: 'target', position: Position.Left, style: { visibility: 'hidden' } }),
12850
12858
  React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } })));
12851
12859
  });
12852
12860
 
12853
- const Container$j = styled.div `
12861
+ const Container$k = styled.div `
12854
12862
  width: ${({ $nodeWidth }) => `${$nodeWidth}px`};
12855
12863
  `;
12856
12864
  const BaseNode = memo(({ id: nodeId, data }) => {
@@ -12883,7 +12891,7 @@ const BaseNode = memo(({ id: nodeId, data }) => {
12883
12891
  }
12884
12892
  setSelectedSources(namespaces);
12885
12893
  };
12886
- 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' },
12887
12895
  React.createElement(DataTab, { title: title, subTitle: subTitle, onClick: () => { }, renderActions: renderActions, iconProps: {
12888
12896
  icon: icon,
12889
12897
  icons: icons,
@@ -12903,19 +12911,19 @@ const BaseNode = memo(({ id: nodeId, data }) => {
12903
12911
  React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } })));
12904
12912
  });
12905
12913
 
12906
- const Container$i = styled.div `
12914
+ const Container$j = styled.div `
12907
12915
  width: ${({ $nodeWidth }) => `${$nodeWidth}px`};
12908
12916
  height: ${({ $nodeHeight }) => `${$nodeHeight}px`};
12909
12917
  opacity: 0;
12910
12918
  `;
12911
12919
  const EdgedNode = memo(({ data }) => {
12912
12920
  const { nodeWidth, nodeHeight } = data;
12913
- 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' },
12914
12922
  React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } }),
12915
12923
  React.createElement(Handle, { type: 'target', position: Position.Left, style: { visibility: 'hidden' } })));
12916
12924
  });
12917
12925
 
12918
- const Container$h = styled.div `
12926
+ const Container$i = styled.div `
12919
12927
  width: ${({ $nodeWidth }) => $nodeWidth}px;
12920
12928
  height: ${({ $nodeHeight }) => $nodeHeight}px;
12921
12929
  background: transparent;
@@ -12924,7 +12932,7 @@ const Container$h = styled.div `
12924
12932
  `;
12925
12933
  const FrameNode = memo(({ data }) => {
12926
12934
  const { nodeWidth, nodeHeight } = data;
12927
- 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' },
12928
12936
  React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } }),
12929
12937
  React.createElement(Handle, { type: 'target', position: Position.Left, style: { visibility: 'hidden' } })));
12930
12938
  });
@@ -12939,7 +12947,7 @@ const nodeConfig = {
12939
12947
  };
12940
12948
 
12941
12949
  const { framePadding: framePadding$3 } = nodeConfig;
12942
- const Container$g = styled.div `
12950
+ const Container$h = styled.div `
12943
12951
  position: relative;
12944
12952
  z-index: 1;
12945
12953
  width: fit-content;
@@ -12987,7 +12995,7 @@ const ScrollNode = memo(({ data, ...rest }) => {
12987
12995
  current?.addEventListener('scroll', handleScroll);
12988
12996
  return () => current?.removeEventListener('scroll', handleScroll);
12989
12997
  }, [onScroll]);
12990
- 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' },
12991
12999
  items.map((item) => (React.createElement(BaseNodeWrapper, { key: item.id, onClick: (e) => {
12992
13000
  e.stopPropagation();
12993
13001
  // @ts-ignore
@@ -12997,7 +13005,7 @@ const ScrollNode = memo(({ data, ...rest }) => {
12997
13005
  React.createElement(BottomOverlay, { "$hide": isBottomOfList })));
12998
13006
  });
12999
13007
 
13000
- const Container$f = styled.div `
13008
+ const Container$g = styled.div `
13001
13009
  position: relative;
13002
13010
  width: ${({ $nodeWidth }) => `${$nodeWidth}px`};
13003
13011
  padding: 12px 0px 16px 0px;
@@ -13066,7 +13074,7 @@ const HeaderNode = memo(({ id: nodeId, data }) => {
13066
13074
  setSelectedSources({});
13067
13075
  }
13068
13076
  };
13069
- return (React.createElement(Container$f, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
13077
+ return (React.createElement(Container$g, { "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
13070
13078
  entityType === EntityTypes.Source && (React.createElement(SelectorWrapper, null,
13071
13079
  React.createElement(Checkbox, { partiallyChecked: hasSelected && sources?.length !== totalSelectedSources, value: hasSelected && sources?.length === totalSelectedSources, onChange: onSelect, disabled: !sources?.length }))),
13072
13080
  React.createElement(IconTitleBadge, { icon: Icon, title: title, badge: isSourceAwaitingInstrumentation ? `${instrumentingPercent}%` : badge, badgeTooltip: badgeTooltip, loading: isFetching && !isSourceAwaitingInstrumentation }),
@@ -13128,12 +13136,12 @@ const LabeledEdge = memo(({ id, sourceX, sourceY, targetX, targetY, sourcePositi
13128
13136
  React.createElement(Tooltip, { text: 'Heads up! The data-flow metrics you see are calculated over 10-second intervals.' }, data?.label)))));
13129
13137
  });
13130
13138
 
13131
- const Container$e = styled.div `
13139
+ const Container$f = styled.div `
13132
13140
  width: ${({ $nodeWidth }) => `${$nodeWidth}px`};
13133
13141
  `;
13134
13142
  const SkeletonNode = memo(({ id: nodeId, data }) => {
13135
13143
  const { nodeWidth } = data;
13136
- 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' },
13137
13145
  React.createElement(SkeletonLoader, { size: 3 })));
13138
13146
  });
13139
13147
 
@@ -13628,7 +13636,7 @@ const buildDestinationNodes = ({ loading, entities, positions, unfilteredCount }
13628
13636
  return nodes;
13629
13637
  };
13630
13638
 
13631
- const Container$d = styled.div `
13639
+ const Container$e = styled.div `
13632
13640
  width: 100%;
13633
13641
  height: ${({ $heightToRemove }) => `calc(100vh - ${$heightToRemove})`};
13634
13642
  position: relative;
@@ -13704,7 +13712,7 @@ const DataFlow = ({ heightToRemove, metrics }) => {
13704
13712
  });
13705
13713
  handleNodesChanged(ruleNodes, EntityTypes.InstrumentationRule);
13706
13714
  }, [instrumentationRules, instrumentationRulesLoading, positions[EntityTypes.InstrumentationRule]]);
13707
- return (React.createElement(Container$d, { ref: containerRef, "$heightToRemove": heightToRemove },
13715
+ return (React.createElement(Container$e, { ref: containerRef, "$heightToRemove": heightToRemove },
13708
13716
  React.createElement(Flow, { nodes: nodes, edges: edges, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange })));
13709
13717
  };
13710
13718
 
@@ -13717,11 +13725,12 @@ const AbsoluteContainer$2 = styled.div `
13717
13725
  top: calc(100% + 8px);
13718
13726
  left: 0;
13719
13727
  z-index: 1;
13728
+ width: 420px;
13729
+ padding: ${({ $padding }) => $padding || 'unset'};
13730
+ display: ${({ $hidden }) => ($hidden ? 'none' : 'block')};
13720
13731
  background-color: ${({ theme }) => theme.colors.dropdown_bg};
13721
13732
  border: ${({ theme }) => `1px solid ${theme.colors.border}`};
13722
13733
  border-radius: 24px;
13723
- width: 420px;
13724
- display: ${({ $hidden }) => ($hidden ? 'none' : 'block')};
13725
13734
  `;
13726
13735
 
13727
13736
  const buildSearchResults = ({ instrumentationRules, sources, actions, destinations, searchText, selectedCategory }) => {
@@ -13803,6 +13812,10 @@ const SearchResults = ({ searchText, onClose }) => {
13803
13812
  searchText,
13804
13813
  selectedCategory,
13805
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
+ }
13806
13819
  return (React.createElement(AbsoluteContainer$2, null,
13807
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) })))),
13808
13821
  searchResults.map(({ category, label, entities }, catIdx) => !!entities.length && (React.createElement(Fragment, { key: `category-list-${category}` },
@@ -13924,6 +13937,58 @@ const Filters$1 = () => {
13924
13937
  React.createElement(ActionButton$1, { variant: 'tertiary', onClick: onReset, "$color": theme.text.error }, "Reset"))))));
13925
13938
  };
13926
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
+
13927
13992
  const RelativeContainer$1 = styled.div `
13928
13993
  position: relative;
13929
13994
  `;
@@ -13935,6 +14000,9 @@ const Container$c = styled(FlexRow) `
13935
14000
  max-height: 28px;
13936
14001
  }
13937
14002
  `;
14003
+ const Title = styled(Text) `
14004
+ text-wrap: nowrap;
14005
+ `;
13938
14006
  const AbsoluteContainer$1 = styled.div `
13939
14007
  position: absolute;
13940
14008
  top: calc(100% + 8px);
@@ -13945,36 +14013,64 @@ const AbsoluteContainer$1 = styled.div `
13945
14013
  border-radius: 24px;
13946
14014
  width: 420px;
13947
14015
  `;
13948
- const SelectionMenuHeadWrap = styled.div `
14016
+ const SelectionMenuHeader = styled.div `
13949
14017
  border-bottom: ${({ theme }) => `1px solid ${theme.colors.border}`};
13950
14018
  padding: 12px;
13951
14019
  `;
13952
- const SelectionWrap = styled(VerticalScroll) `
14020
+ const SelectionContent = styled(VerticalScroll) `
13953
14021
  max-height: 240px;
13954
14022
  `;
13955
- 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 }) => {
13956
14030
  const theme = Theme.useTheme();
13957
14031
  const { dataStreams, selectedStreamName, setSelectedStreamName } = useDataStreamStore();
13958
- const containerRef = useRef(null);
13959
14032
  const [popupOpen, setPopupOpen] = useState(false);
14033
+ const containerRef = useRef(null);
13960
14034
  useOnClickOutside(containerRef, () => setPopupOpen(false));
14035
+ const [editOpenForDataStreamName, setEditOpenForDataStreamName] = useState('');
14036
+ const [deleteOpenForDataStreamName, setDeleteOpenForDataStreamName] = useState('');
13961
14037
  const [searchText, setSearchText] = useState('');
13962
14038
  const filteredDataStreams = useMemo(() => dataStreams.filter(({ name }) => !searchText || name.toLowerCase().includes(searchText.toLowerCase())), [dataStreams, searchText]);
13963
- return (React.createElement(RelativeContainer$1, null,
13964
- React.createElement(Container$c, { "$gap": 0 },
13965
- React.createElement(Button, { variant: 'tertiary', onClick: () => setPopupOpen((prev) => !prev) },
13966
- React.createElement(DataStreamsIcon, { fill: theme.text.info }),
13967
- React.createElement(Text, null, selectedStreamName),
13968
- React.createElement(ExtendArrow, { extend: popupOpen })),
13969
- React.createElement(Divider, { orientation: 'vertical', length: '32px', thickness: 2, margin: '0' }),
13970
- React.createElement(AddButton$1, { onClick: onClickNewDataStream, label: BUTTON_TEXTS.NEW })),
13971
- popupOpen && (React.createElement(AbsoluteContainer$1, { ref: containerRef },
13972
- React.createElement(SelectionMenuHeadWrap, null,
13973
- React.createElement(Input, { placeholder: 'Search...', icon: SearchIcon, value: searchText, onChange: (e) => setSearchText(e.target.value) })),
13974
- 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: () => {
13975
14042
  setSelectedStreamName(name);
13976
14043
  setPopupOpen(false);
13977
- }, 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 })));
13978
14074
  };
13979
14075
 
13980
14076
  const Container$b = styled.div `
@@ -13988,10 +14084,10 @@ const Container$b = styled.div `
13988
14084
  const PushToEnd = styled.div `
13989
14085
  margin-left: auto;
13990
14086
  `;
13991
- const DataFlowActionsMenu = ({ addEntity, onClickNewDataStream }) => {
14087
+ const DataFlowActionsMenu = ({ addEntity, onClickNewDataStream, updateDataStream, deleteDataStream }) => {
13992
14088
  const { setCurrentModal } = useModalStore();
13993
14089
  return (React.createElement(Container$b, null,
13994
- onClickNewDataStream && React.createElement(DataStreamSelect, { onClickNewDataStream: onClickNewDataStream }),
14090
+ React.createElement(DataStreamSelect, { onClickNewDataStream: onClickNewDataStream, updateDataStream: updateDataStream, deleteDataStream: deleteDataStream }),
13995
14091
  React.createElement(Search, null),
13996
14092
  React.createElement(Filters$1, null),
13997
14093
  addEntity && (React.createElement(PushToEnd, null,
@@ -13999,25 +14095,13 @@ const DataFlowActionsMenu = ({ addEntity, onClickNewDataStream }) => {
13999
14095
  };
14000
14096
 
14001
14097
  const DataStreamSelectionForm = forwardRef(({ isModal, onClickSummary }, ref) => {
14002
- const { selectedStreamName, dataStreams } = useDataStreamStore();
14003
- const { formData, handleFormChange, formErrors, handleErrorChange } = useGenericForm({
14004
- name: selectedStreamName,
14005
- });
14098
+ const { dataStreams, selectedStreamName } = useDataStreamStore();
14099
+ const dataStreamOptions = useMemo(() => dataStreams.map(({ name }) => ({ label: name })), [dataStreams]);
14100
+ const { formData, handleFormChange, formErrors, validateForm } = useDataStreamFormData({ name: selectedStreamName });
14006
14101
  useImperativeHandle(ref, () => ({
14007
- validateForm: () => {
14008
- let isValid = true;
14009
- if (!formData['name']) {
14010
- isValid = false;
14011
- handleErrorChange('name', FORM_ALERTS.FIELD_IS_REQUIRED);
14012
- }
14013
- else {
14014
- handleErrorChange('name', undefined);
14015
- }
14016
- return isValid;
14017
- },
14102
+ validateForm,
14018
14103
  getFormValues: () => formData,
14019
14104
  }));
14020
- const dataStreamOptions = useMemo(() => dataStreams.map(({ name }) => ({ label: name })), [dataStreams]);
14021
14105
  return (React.createElement(ModalBody, { "$isNotModal": !isModal, "$minHeight": '70vh' },
14022
14106
  React.createElement(FlexColumn, { "$gap": 24 },
14023
14107
  onClickSummary && React.createElement(NoteBackToSummary, { onClick: onClickSummary }),
@@ -14475,19 +14559,19 @@ const SideMenuWrapper = styled.div `
14475
14559
  display: none;
14476
14560
  }
14477
14561
  `;
14478
- const DestinationModal = ({ isOnboarding, categories, potentialDestinations, createDestination, testConnection }) => {
14562
+ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, createDestination, updateDestination, testConnection }) => {
14479
14563
  const { destinations } = useEntityStore();
14480
14564
  const { selectedStreamName } = useDataStreamStore();
14481
14565
  const { currentModal, setCurrentModal } = useModalStore();
14482
14566
  const { addConfiguredDestination, addConfiguredDestinationUpdateOnly } = useSetupStore();
14483
14567
  const isOpen = currentModal === EntityTypes.Destination;
14484
14568
  const [selectedItem, setSelectedItem] = useState(undefined);
14485
- const { formData, formErrors, handleFormChange, resetFormData, validateForm, setYamlFields, dynamicFields, setDynamicFields } = useDestinationFormData({
14569
+ const { formData, formErrors, handleFormChange, resetFormData, validateForm, setYamlFields, dynamicFields, setDynamicFields, loadFormWithDrawerItem } = useDestinationFormData({
14486
14570
  supportedSignals: selectedItem?.supportedSignals,
14487
14571
  preLoadedFields: selectedItem?.fields,
14488
14572
  });
14489
14573
  const getDestPayload = (alreadyConfigDest) => {
14490
- const fields = alreadyConfigDest ? safeJsonParse(alreadyConfigDest.fields, {}) : {};
14574
+ const fields = {};
14491
14575
  if (!alreadyConfigDest) {
14492
14576
  dynamicFields.forEach((f) => {
14493
14577
  fields[f.name] = (f.componentType === FieldTypes.Dropdown ? f.value?.value || '' : f.value);
@@ -14499,7 +14583,7 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
14499
14583
  dataStreamNames: alreadyConfigDest?.dataStreamNames || [],
14500
14584
  conditions: alreadyConfigDest?.conditions || [],
14501
14585
  exportedSignals: alreadyConfigDest?.exportedSignals || formData.exportedSignals,
14502
- fields: JSON.stringify(fields),
14586
+ fields: alreadyConfigDest?.fields || JSON.stringify(fields),
14503
14587
  destinationType: alreadyConfigDest?.destinationType || {
14504
14588
  type: selectedItem.type,
14505
14589
  displayName: selectedItem.displayName,
@@ -14512,15 +14596,29 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
14512
14596
  };
14513
14597
  };
14514
14598
  const handleAdd = (alreadyConfigDest) => {
14515
- // Handle case from already configured
14516
- if (alreadyConfigDest)
14517
- return addConfiguredDestinationUpdateOnly(getDestPayload(alreadyConfigDest));
14518
14599
  // Handle new cases from onboarding
14519
- if (isOnboarding)
14520
- return addConfiguredDestination(getDestPayload());
14600
+ if (isOnboarding && !alreadyConfigDest) {
14601
+ const payload = getDestPayload();
14602
+ addConfiguredDestination(payload);
14603
+ }
14604
+ // Handle already configured cases from onboarding
14605
+ else if (isOnboarding && alreadyConfigDest) {
14606
+ const payload = getDestPayload(alreadyConfigDest);
14607
+ addConfiguredDestinationUpdateOnly(payload);
14608
+ }
14521
14609
  // Handle new cases from overview
14522
- else
14523
- return createDestination(formData);
14610
+ else if (!isOnboarding && !alreadyConfigDest) {
14611
+ createDestination(formData);
14612
+ }
14613
+ // Handle already configured cases from overview
14614
+ else if (!isOnboarding && alreadyConfigDest) {
14615
+ const payload = getDestPayload(alreadyConfigDest);
14616
+ const payloadForm = loadFormWithDrawerItem(payload);
14617
+ updateDestination(alreadyConfigDest.id, payloadForm);
14618
+ }
14619
+ else {
14620
+ console.warn('DestinationModal: handleAdd: No action taken, no destination or already configured destination found');
14621
+ }
14524
14622
  };
14525
14623
  const handleClose = () => {
14526
14624
  resetFormData();
@@ -14657,7 +14755,7 @@ const DestinationSelectionForm = ({ isSourcesListEmpty, goToSources, categories,
14657
14755
  React.createElement(PlusIcon$1, null),
14658
14756
  React.createElement(Text, { color: theme.colors.secondary, size: 14, decoration: 'underline', family: 'secondary' }, DISPLAY_TITLES.ADD_DESTINATION))),
14659
14757
  React.createElement(DestinationList, { withDelete: true }))),
14660
- React.createElement(DestinationModal, { isOnboarding: true, categories: categories, potentialDestinations: potentialDestinations, createDestination: () => { }, testConnection: testConnection })));
14758
+ React.createElement(DestinationModal, { isOnboarding: true, categories: categories, potentialDestinations: potentialDestinations, updateDestination: () => { }, createDestination: () => { }, testConnection: testConnection })));
14661
14759
  };
14662
14760
 
14663
14761
  const columns$2 = [
@@ -15041,6 +15139,10 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
15041
15139
  } }))) : (React.createElement(DataCard, { title: 'Instrumentation Rule Details', data: !!thisItem ? buildCard$1(thisItem) : [] }))));
15042
15140
  };
15043
15141
 
15142
+ const GapAndMargin = styled(FlexColumn) `
15143
+ margin-top: 24px;
15144
+ gap: 12px;
15145
+ `;
15044
15146
  const InstrumentationRuleModal = ({ isEnterprise, createInstrumentationRule }) => {
15045
15147
  const { currentModal, setCurrentModal } = useModalStore();
15046
15148
  const isOpen = currentModal === EntityTypes.InstrumentationRule;
@@ -15074,8 +15176,9 @@ const InstrumentationRuleModal = ({ isEnterprise, createInstrumentationRule }) =
15074
15176
  ] }) },
15075
15177
  React.createElement(ModalBody, null,
15076
15178
  React.createElement(SectionTitle, { title: 'Select Instrumentation Rule', description: 'Define how telemetry is recorded from your application. Choose a rule type and configure the details.' }),
15077
- !isEnterprise && React.createElement(NotificationNote, { type: StatusType.Default, message: FORM_ALERTS.ENTERPRISE_ONLY('Instrumentation Rules'), style: { marginTop: '24px' } }),
15078
- React.createElement(AutocompleteInput, { options: INSTRUMENTATION_RULE_OPTIONS, selectedOption: selectedItem, onOptionSelect: (opt) => handleSelect(opt), style: { marginTop: isEnterprise ? '24px' : '12px' }, autoFocus: !selectedItem?.type }),
15179
+ React.createElement(GapAndMargin, null,
15180
+ !isEnterprise ? (React.createElement(NotificationNote, { type: StatusType.Default, message: FORM_ALERTS.ENTERPRISE_ONLY(DISPLAY_TITLES.INSTRUMENTATION_RULES) })) : (React.createElement(NotificationNote, { type: StatusType.Warning, message: FORM_ALERTS.DEFINED_FOR_ALL_STREAMS(DISPLAY_TITLES.INSTRUMENTATION_RULES) })),
15181
+ React.createElement(AutocompleteInput, { options: INSTRUMENTATION_RULE_OPTIONS, selectedOption: selectedItem, onOptionSelect: (opt) => handleSelect(opt), autoFocus: !selectedItem?.type })),
15079
15182
  !!selectedItem?.type ? (React.createElement("div", null,
15080
15183
  React.createElement(Divider, { margin: '16px 0' }),
15081
15184
  React.createElement(InstrumentationRuleForm, { rule: selectedItem, formData: formData, formErrors: formErrors, handleFormChange: handleFormChange }))) : null)));
@@ -15408,8 +15511,8 @@ const NamespaceItem = styled.div `
15408
15511
  }
15409
15512
  `;
15410
15513
  const SourceItem = styled(NamespaceItem) `
15411
- width: calc(100% - 50px);
15412
- margin-left: auto;
15514
+ width: calc(100% - 100px);
15515
+ margin: 0 auto;
15413
15516
  padding: 8px;
15414
15517
  `;
15415
15518
  const RelativeWrapper = styled.div `
@@ -15434,6 +15537,7 @@ const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesA
15434
15537
  if (!matrix?.length) {
15435
15538
  return (React.createElement(CenterThis, null, namespacesLoading ? (React.createElement(FadeLoader, null)) : (React.createElement(NoDataFound, { title: DISPLAY_TITLES.NO_SOURCES, subTitle: onSelectNamespace ? DISPLAY_TITLES.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES : DISPLAY_TITLES.PLEASE_ADD_SOURCE }))));
15436
15539
  }
15540
+ const NamespaceIcon = getEntityIcon(EntityTypes.Namespace);
15437
15541
  return (React.createElement(Container$4, { "$isModal": isModal }, matrix.map(([namespace, sources]) => {
15438
15542
  const sourcesForNamespace = selectedSources?.[namespace] || [];
15439
15543
  const onlySelectedSources = sourcesForNamespace.filter(({ selected }) => selected);
@@ -15442,12 +15546,14 @@ const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesA
15442
15546
  const isNamespaceAllSourcesSelected = onlySelectedSources.length > 0 && onlySelectedSources.length === sources.length;
15443
15547
  const isNamespacePartiallySourcesSelected = onlySelectedSources.length > 0 && onlySelectedSources.length !== sources.length;
15444
15548
  const hasSources = sources.length > 0;
15549
+ const onlyOneSource = sources.length === 1;
15445
15550
  if (!onSelectNamespace && !hasSources)
15446
15551
  return null;
15447
15552
  return (React.createElement(Group, { key: `namespace-${namespace}`, "data-id": `namespace-${namespace}`, "$selected": isNamespaceAllSourcesSelected, "$isOpen": isNamespaceSelected },
15448
15553
  React.createElement(NamespaceItem, { "$selected": isNamespaceAllSourcesSelected, "$withClick": !!onSelectNamespace, onClick: () => onSelectNamespace?.(namespace) },
15449
15554
  React.createElement(FlexRow, { "$gap": 12 },
15450
15555
  onSelectNamespace && React.createElement(Checkbox, { partiallyChecked: isNamespacePartiallySourcesSelected, value: isNamespaceAllSourcesSelected, onChange: (bool) => onSelectNamespace(namespace, bool) }),
15556
+ React.createElement(NamespaceIcon, null),
15451
15557
  React.createElement(Text, null, namespace)),
15452
15558
  React.createElement(FlexRow, { "$gap": 12 },
15453
15559
  React.createElement(SelectionCount, { size: 10, color: theme.text.grey }, isNamespaceLoaded ? `${onlySelectedSources.length}/${sources.length}` : null),
@@ -15455,7 +15561,7 @@ const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesA
15455
15561
  (isNamespaceSelected || !onSelectNamespace) &&
15456
15562
  (hasSources ? (React.createElement(RelativeWrapper, { "$addPadding": !onSelectSource },
15457
15563
  React.createElement(AbsoluteWrapper, null,
15458
- React.createElement(Divider, { orientation: 'vertical', length: `${(sources.length || 0) * 36}px` })),
15564
+ React.createElement(Divider, { orientation: 'vertical', length: `${onlyOneSource ? 24 : (sources.length) * 34}px` })),
15459
15565
  sources.map((source) => {
15460
15566
  const isSourceSelected = onlySelectedSources.some(({ name }) => name === source.name);
15461
15567
  return React.createElement(SourceRow, { key: `source-${source.name}`, withInstances: withInstances, source: source, namespace: namespace, isSelected: isSourceSelected, onSelect: onSelectSource });
@@ -15466,10 +15572,11 @@ const SourceRow = ({ withInstances, source, namespace, isSelected, onSelect, })
15466
15572
  return (React.createElement(SourceItem, { "data-id": `source-${source.name}`, "$selected": isSelected, "$withClick": !!onSelect, onClick: () => onSelect?.(source) },
15467
15573
  React.createElement(FlexRow, { "$gap": 12 },
15468
15574
  onSelect && React.createElement(Checkbox, { value: isSelected, onChange: () => onSelect(source, namespace) }),
15469
- React.createElement(Text, null, source.name),
15470
- React.createElement(Text, { opacity: 0.8, size: 10 },
15471
- withInstances ? `${source.numberOfInstances || 0} running instance${source.numberOfInstances !== 1 ? 's' : ''} • ` : '',
15472
- source.kind))));
15575
+ React.createElement(FlexRow, { "$gap": 4 },
15576
+ React.createElement(Text, null, source.name),
15577
+ React.createElement(Text, { opacity: 0.8, size: 10 },
15578
+ withInstances ? ` • ${source.numberOfInstances || 0} running instance${source.numberOfInstances !== 1 ? 's' : ''}` : '',
15579
+ ` • ${source.kind}`)))));
15473
15580
  };
15474
15581
 
15475
15582
  const Container$3 = styled.div `
@@ -15744,7 +15851,7 @@ const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) =>
15744
15851
  setIsFormDirty(false);
15745
15852
  setIsEditing(false);
15746
15853
  };
15747
- 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: [
15748
15855
  {
15749
15856
  label: Tabs.Overview,
15750
15857
  onClick: () => setSelectedTab(Tabs.Overview),
@@ -16218,4 +16325,4 @@ const ToggleDarkMode = () => {
16218
16325
  React.createElement(Background, { "$darkMode": darkMode })));
16219
16326
  };
16220
16327
 
16221
- 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 };