@odigos/ui-kit 0.0.9 → 0.0.11

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 (90) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/lib/components/badge/index.d.ts +2 -2
  3. package/lib/components/data-card/data-card-fields/index.d.ts +14 -14
  4. package/lib/components/data-card/index.d.ts +2 -2
  5. package/lib/components/data-tab/index.d.ts +3 -3
  6. package/lib/components/delete-warning/index.d.ts +2 -2
  7. package/lib/components/describe-row/index.d.ts +2 -2
  8. package/lib/components/divider/index.d.ts +2 -2
  9. package/lib/components/drawer/drawer-header/index.d.ts +1 -1
  10. package/lib/components/icon-group/index.d.ts +2 -2
  11. package/lib/components/icon-wrapped/index.d.ts +2 -2
  12. package/lib/components/interactive-table/index.d.ts +2 -2
  13. package/lib/components/interactive-table/row.d.ts +2 -2
  14. package/lib/components/monitors-checkboxes/index.d.ts +4 -4
  15. package/lib/components/monitors-icons/index.d.ts +2 -2
  16. package/lib/components/notification-note/index.d.ts +2 -2
  17. package/lib/components/status/index.d.ts +2 -2
  18. package/lib/components/stepper/index.d.ts +1 -1
  19. package/lib/components/styled.d.ts +12 -0
  20. package/lib/components/warning-modal/index.d.ts +2 -2
  21. package/lib/components.js +8 -8
  22. package/lib/constants/strings/index.d.ts +11 -10
  23. package/lib/constants.js +4 -4
  24. package/lib/containers/action-drawer/build-card.d.ts +2 -2
  25. package/lib/containers/action-drawer/index.d.ts +2 -2
  26. package/lib/containers/action-form/custom-fields/index.d.ts +2 -2
  27. package/lib/containers/data-flow/edges/labeled-edge.d.ts +2 -2
  28. package/lib/containers/data-flow/helpers/get-main-container-language.d.ts +2 -2
  29. package/lib/containers/data-flow/helpers/get-node-positions.d.ts +2 -2
  30. package/lib/containers/data-flow/nodes/add-node.d.ts +3 -3
  31. package/lib/containers/data-flow/nodes/base-node.d.ts +5 -5
  32. package/lib/containers/data-flow/nodes/edged-node.d.ts +2 -2
  33. package/lib/containers/data-flow/nodes/frame-node.d.ts +2 -2
  34. package/lib/containers/data-flow/nodes/header-node.d.ts +2 -2
  35. package/lib/containers/data-flow/nodes/scroll-node.d.ts +5 -5
  36. package/lib/containers/data-flow/nodes/skeleton-node.d.ts +2 -2
  37. package/lib/containers/data-flow-actions-menu/index.d.ts +2 -2
  38. package/lib/containers/data-flow-actions-menu/search/search-results/builder.d.ts +2 -2
  39. package/lib/containers/destination-drawer/build-card.d.ts +2 -2
  40. package/lib/containers/destination-form/test-connection/index.d.ts +2 -2
  41. package/lib/containers/instrumentation-rule-drawer/build-card.d.ts +2 -2
  42. package/lib/containers/instrumentation-rule-form/custom-fields/index.d.ts +2 -2
  43. package/lib/containers/side-nav/index.d.ts +8 -8
  44. package/lib/containers/source-drawer/build-card.d.ts +1 -1
  45. package/lib/containers.js +380 -385
  46. package/lib/data/sources/index.d.ts +3 -3
  47. package/lib/functions/get-action-icon/index.d.ts +2 -2
  48. package/lib/functions/get-conditions-booleans/index.d.ts +2 -2
  49. package/lib/functions/get-entity-icon/index.d.ts +2 -2
  50. package/lib/functions/get-entity-label/index.d.ts +2 -2
  51. package/lib/functions/get-id-from-sse-target/index.d.ts +2 -2
  52. package/lib/functions/get-instrumentation-rule-icon/index.d.ts +2 -2
  53. package/lib/functions/get-metric-for-entity/index.d.ts +2 -2
  54. package/lib/functions/get-monitor-icon/index.d.ts +2 -2
  55. package/lib/functions/get-platform-icon/index.d.ts +2 -2
  56. package/lib/functions/get-platform-label/index.d.ts +2 -2
  57. package/lib/functions/get-programming-language-icon/index.d.ts +2 -2
  58. package/lib/functions/get-sse-target-from-id/index.d.ts +2 -2
  59. package/lib/functions/get-status-icon/index.d.ts +2 -2
  60. package/lib/functions/index.d.ts +0 -1
  61. package/lib/functions.js +9 -20
  62. package/lib/hooks.js +7 -7
  63. package/lib/icons.js +2 -2
  64. package/lib/{index-BFct3S32.js → index-7-KCQK-x.js} +2 -2
  65. package/lib/{index-ixs381n-.js → index-9ObpINp4.js} +4 -4
  66. package/lib/{index-m62aT4IR.js → index-B_fzHjxk.js} +111 -93
  67. package/lib/{index-g6Twdelv.js → index-BtuW12KL.js} +22 -22
  68. package/lib/{index-CZe2VX28.js → index-CJKFedQi.js} +31 -31
  69. package/lib/{index-Bc8gi9FH.js → index-CYn62h8x.js} +33 -33
  70. package/lib/{index-Cu2uHOuh.js → index-C_0J5P9M.js} +11 -10
  71. package/lib/{index-DIcomki-.js → index-DYEcdkUF.js} +19 -19
  72. package/lib/{index-BumPE6cF.js → index-Db_ZDrEr.js} +13 -13
  73. package/lib/store/useDrawerStore.d.ts +2 -2
  74. package/lib/store/useEntityStore.d.ts +5 -5
  75. package/lib/store/usePendingStore.d.ts +2 -2
  76. package/lib/store.js +1 -1
  77. package/lib/theme.js +1 -1
  78. package/lib/types/actions/index.d.ts +14 -14
  79. package/lib/types/common/index.d.ts +80 -76
  80. package/lib/types/connection/index.d.ts +3 -3
  81. package/lib/types/data-flow/index.d.ts +15 -15
  82. package/lib/types/destinations/index.d.ts +2 -2
  83. package/lib/types/instrumentation-rules/index.d.ts +28 -28
  84. package/lib/types/signals/index.d.ts +5 -5
  85. package/lib/types/sources/index.d.ts +7 -7
  86. package/lib/types.js +164 -159
  87. package/lib/{useSourceSelectionFormData-BY6B70Kf.js → useSourceSelectionFormData-BnlRp8m3.js} +40 -40
  88. package/lib/{useTransition-Dfxjcy-C.js → useTransition-CFmm4scp.js} +23 -23
  89. package/package.json +10 -10
  90. package/lib/functions/derive-type-from-rule/index.d.ts +0 -2
@@ -1,13 +1,13 @@
1
1
  import React, { useState, useRef, forwardRef, useEffect, createElement, useCallback, useMemo, Fragment, useId } from 'react';
2
- import { NOTIFICATION_TYPE, OTHER_STATUS, PROGRAMMING_LANGUAGES, ENTITY_TYPES } from './types.js';
3
- import './index-DIcomki-.js';
2
+ import { StatusType, OtherStatus, SortDirection, ProgrammingLanguages, EntityTypes } from './types.js';
3
+ import './index-DYEcdkUF.js';
4
4
  import styled, { css } from 'styled-components';
5
5
  import Theme from './theme.js';
6
- 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-Bc8gi9FH.js';
6
+ 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-CYn62h8x.js';
7
7
  import { s as safeJsonParse, i as isEmpty } from './index-BZS1ijMm.js';
8
8
  import { M as MinusIcon, f as CheckIcon, L as ListIcon, C as CodeIcon, E as ExtendArrowIcon, I as ImageErrorIcon, 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, T as TrashIcon, P as PlusIcon, A as ArrowIcon } from './index-D_Qn2U89.js';
9
- import { M as MONITORS_OPTIONS } from './index-CZe2VX28.js';
10
- import { u as useContainerSize, a as useCopy, g as useTransition, d as useKeyDown, e as useOnClickOutside } from './useTransition-Dfxjcy-C.js';
9
+ import { M as MONITORS_OPTIONS } from './index-CJKFedQi.js';
10
+ import { u as useContainerSize, a as useCopy, g as useTransition, d as useKeyDown, e as useOnClickOutside } from './useTransition-CFmm4scp.js';
11
11
  import ReactDOM from 'react-dom';
12
12
  import require$$0 from 'babel-runtime/helpers/extends';
13
13
  import require$$1$1 from 'babel-runtime/core-js/object/get-prototype-of';
@@ -16,7 +16,7 @@ import require$$3 from 'babel-runtime/helpers/createClass';
16
16
  import require$$4 from 'babel-runtime/helpers/possibleConstructorReturn';
17
17
  import require$$5 from 'babel-runtime/helpers/inherits';
18
18
  import require$$1 from 'object-assign';
19
- import { I as InfoIcon } from './index-ixs381n-.js';
19
+ import { I as InfoIcon } from './index-9ObpINp4.js';
20
20
 
21
21
  const TextWrapper$2 = styled.div `
22
22
  color: ${({ $color, theme }) => $color || theme.text.secondary};
@@ -339,7 +339,7 @@ const Button$4 = ({ children, variant = 'primary', onClick, ...props }) => {
339
339
  const CancelWarning = ({ isOpen, noOverlay, name, onApprove, onDeny }) => {
340
340
  return (React.createElement(WarningModal, { isOpen: isOpen, noOverlay: noOverlay, title: `Cancel${name ? ` ${name}` : ''}`, description: 'Are you sure you want to cancel?', approveButton: {
341
341
  text: 'Confirm',
342
- variant: NOTIFICATION_TYPE.WARNING,
342
+ variant: StatusType.Warning,
343
343
  onClick: onApprove,
344
344
  }, denyButton: {
345
345
  text: 'Go Back',
@@ -381,6 +381,20 @@ const ModalBody = styled.div `
381
381
  margin: ${({ $isNotModal }) => ($isNotModal ? '64px 0 0 0' : '64px 7vw 32px 7vw')};
382
382
  overflow-y: scroll;
383
383
  `;
384
+ // common styles for focused-table containers
385
+ const TableContainer = styled(FlexColumn) `
386
+ max-width: ${({ $maxWidth }) => $maxWidth || 'unset'};
387
+ width: 100%;
388
+ `;
389
+ const TableTitleWrap = styled(FlexRow) `
390
+ gap: 16px;
391
+ padding: 16px;
392
+ `;
393
+ const TableWrap = styled.div `
394
+ width: 100%;
395
+ max-height: ${({ $maxHeight }) => $maxHeight || 'unset'};
396
+ overflow-y: auto;
397
+ `;
384
398
 
385
399
  const TooltipContainer = styled.div `
386
400
  position: relative;
@@ -3723,7 +3737,7 @@ const getComponentsFromPropertyString = (propertyString, theme) => {
3723
3737
  return React.createElement("div", { key: useId(), style: { width: 16, height: 16 } });
3724
3738
  let Icon = getStatusIcon(value, theme);
3725
3739
  if (!Icon)
3726
- Icon = getStatusIcon(NOTIFICATION_TYPE.WARNING, theme);
3740
+ Icon = getStatusIcon(StatusType.Warning, theme);
3727
3741
  return React.createElement(Icon, { key: useId() });
3728
3742
  default:
3729
3743
  console.warn('unexpected component type!', type);
@@ -3951,15 +3965,15 @@ const ExtendArrow = ({ extend, size = 14, align = 'center' }) => {
3951
3965
 
3952
3966
  const Container$q = styled.div `
3953
3967
  border-radius: 24px;
3954
- background-color: ${({ theme, $status }) => $status === NOTIFICATION_TYPE.ERROR
3968
+ background-color: ${({ theme, $status }) => $status === StatusType.Error
3955
3969
  ? theme.text.error + Theme.opacity.hex['010']
3956
- : $status === NOTIFICATION_TYPE.WARNING
3970
+ : $status === StatusType.Warning
3957
3971
  ? theme.text.warning + Theme.opacity.hex['010']
3958
3972
  : theme.colors.secondary + Theme.opacity.hex['005']};
3959
3973
  &:hover {
3960
- background-color: ${({ theme, $status }) => $status === NOTIFICATION_TYPE.ERROR
3974
+ background-color: ${({ theme, $status }) => $status === StatusType.Error
3961
3975
  ? theme.text.error + Theme.opacity.hex['020']
3962
- : $status === NOTIFICATION_TYPE.WARNING
3976
+ : $status === StatusType.Warning
3963
3977
  ? theme.text.warning + Theme.opacity.hex['020']
3964
3978
  : theme.colors.secondary + Theme.opacity.hex['010']};
3965
3979
  }
@@ -3990,19 +4004,19 @@ const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed'
3990
4004
  const theme = Theme.useTheme();
3991
4005
  const [extend, setExtend] = useState(false);
3992
4006
  const conditions = mapConditions(c);
3993
- const errors = useMemo(() => conditions.filter(({ status }) => status === NOTIFICATION_TYPE.ERROR), [conditions]);
4007
+ const errors = useMemo(() => conditions.filter(({ status }) => status === StatusType.Error), [conditions]);
3994
4008
  const hasErrors = !!errors.length;
3995
- const warnings = useMemo(() => conditions.filter(({ status }) => status === NOTIFICATION_TYPE.WARNING), [conditions]);
4009
+ const warnings = useMemo(() => conditions.filter(({ status }) => status === StatusType.Warning), [conditions]);
3996
4010
  const hasWarnings = !!warnings.length;
3997
- const disableds = useMemo(() => conditions.filter(({ status }) => status === OTHER_STATUS.DISABLED), [conditions]);
4011
+ const disableds = useMemo(() => conditions.filter(({ status }) => status === OtherStatus.Disabled), [conditions]);
3998
4012
  const hasDisableds = !!disableds.length;
3999
- const loadings = useMemo(() => conditions.filter(({ status }) => status === OTHER_STATUS.LOADING), [conditions]);
4013
+ const loadings = useMemo(() => conditions.filter(({ status }) => status === OtherStatus.Loading), [conditions]);
4000
4014
  const hasLoadings = !!loadings.length;
4001
4015
  const loading = (!conditions.length || hasLoadings) && !hasErrors && !hasWarnings && !hasDisableds;
4002
4016
  useEffect(() => {
4003
4017
  setExtend(hasErrors || hasWarnings || hasDisableds || hasLoadings);
4004
4018
  }, [hasErrors, hasWarnings, hasDisableds, hasLoadings]);
4005
- const overallStatus = hasErrors ? NOTIFICATION_TYPE.ERROR : hasWarnings ? NOTIFICATION_TYPE.WARNING : hasDisableds ? NOTIFICATION_TYPE.INFO : NOTIFICATION_TYPE.SUCCESS;
4019
+ const overallStatus = hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : hasDisableds ? StatusType.Info : StatusType.Success;
4006
4020
  const HeaderIcon = getStatusIcon(overallStatus, theme);
4007
4021
  const headerText = hasErrors ? headerLabelError : hasWarnings ? headerLabelWarning : hasDisableds ? headerLabelWarning : loading ? 'Loading...' : headerLabelSuccess;
4008
4022
  const headerTextColor = hasErrors ? theme.text.error : hasWarnings ? theme.text.warning : theme.text.info;
@@ -4016,13 +4030,13 @@ const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed'
4016
4030
  React.createElement(Text, { color: headerSubTextColor, size: 12, family: 'secondary' }, headerSubText),
4017
4031
  React.createElement(ExtendArrow, { extend: extend, align: 'right' })),
4018
4032
  extend && (React.createElement(Body, null, conditions.map(({ status, type, reason, message, lastTransitionTime }, idx) => {
4019
- const Icon = status === 'loading' ? () => React.createElement(FadeLoader, { scale: 0.8 }) : status === 'disabled' ? getStatusIcon(NOTIFICATION_TYPE.INFO, theme) : getStatusIcon(status, theme);
4020
- const color = status === 'disabled' ? theme.text.info : status === NOTIFICATION_TYPE.ERROR ? theme.text.error : status === NOTIFICATION_TYPE.WARNING ? theme.text.warning : theme.text.info;
4033
+ const Icon = status === 'loading' ? () => React.createElement(FadeLoader, { scale: 0.8 }) : status === 'disabled' ? getStatusIcon(StatusType.Info, theme) : getStatusIcon(status, theme);
4034
+ const color = status === 'disabled' ? theme.text.info : status === StatusType.Error ? theme.text.error : status === StatusType.Warning ? theme.text.warning : theme.text.info;
4021
4035
  const boldColor = status === 'disabled'
4022
4036
  ? theme.text.info_secondary
4023
- : status === NOTIFICATION_TYPE.ERROR
4037
+ : status === StatusType.Error
4024
4038
  ? theme.text.error_secondary
4025
- : status === NOTIFICATION_TYPE.WARNING
4039
+ : status === StatusType.Warning
4026
4040
  ? theme.text.warning_secondary
4027
4041
  : theme.text.info_secondary;
4028
4042
  return (React.createElement(Row$1, { key: `condition-${idx}` },
@@ -4063,10 +4077,10 @@ const TextWrapper$1 = styled.div `
4063
4077
  display: flex;
4064
4078
  align-items: center;
4065
4079
  `;
4066
- const Status = ({ title, subtitle, size = 12, family = 'secondary', status = NOTIFICATION_TYPE.DEFAULT, withIcon, withBorder, withBackground }) => {
4080
+ const Status = ({ title, subtitle, size = 12, family = 'secondary', status = StatusType.Default, withIcon, withBorder, withBackground }) => {
4067
4081
  const theme = Theme.useTheme();
4068
- const statusType = status === OTHER_STATUS.LOADING ? NOTIFICATION_TYPE.INFO : status;
4069
- const StatusIcon = status === OTHER_STATUS.LOADING ? () => React.createElement(FadeLoader, { scale: 0.8 }) : () => getStatusIcon(statusType, theme)({ size: size + 2 });
4082
+ const statusType = status === OtherStatus.Loading ? StatusType.Info : status;
4083
+ const StatusIcon = status === OtherStatus.Loading ? () => React.createElement(FadeLoader, { scale: 0.8 }) : () => getStatusIcon(statusType, theme)({ size: size + 2 });
4070
4084
  return (React.createElement(Container$p, { "$size": size, "$status": statusType, "$withIcon": withIcon, "$withBorder": withBorder, "$withBackground": withBackground },
4071
4085
  withIcon && (React.createElement(IconWrapper$4, null,
4072
4086
  React.createElement(StatusIcon, null))),
@@ -4298,7 +4312,7 @@ const DataTab = ({ title, subTitle, icon, icons, iconSrc, iconSrcs, hoverText, s
4298
4312
  return null;
4299
4313
  return (React.createElement(React.Fragment, null,
4300
4314
  withSeperator && React.createElement(SubTitle$2, null, '•'),
4301
- React.createElement(Status, { status: isActive ? NOTIFICATION_TYPE.SUCCESS : NOTIFICATION_TYPE.ERROR, size: 10 })));
4315
+ React.createElement(Status, { status: isActive ? StatusType.Success : StatusType.Error, size: 10 })));
4302
4316
  };
4303
4317
  return (React.createElement(Container$m, { ref: containerRef, "$status": status, "$faded": faded, "$withClick": !!onClick, onClick: onClick, ...props },
4304
4318
  React.createElement(FlexRow, { "$gap": 8 },
@@ -4353,7 +4367,7 @@ const DescribeRow = ({ title, subTitle, tooltip, value }) => {
4353
4367
  React.createElement(Tooltip, { text: tooltip || '' },
4354
4368
  title && React.createElement(Title$a, null, title),
4355
4369
  subTitle && React.createElement(SubTitle$1, null, subTitle))),
4356
- React.createElement(ValueWrapper, null, !!value?.status ? (React.createElement(Status, { status: value.status === 'transitioning' ? OTHER_STATUS.LOADING : value.status, title: value.text || value.status, withBorder: true, withIcon: true })) : (React.createElement(ValueText, null, value?.text || '-')))));
4370
+ React.createElement(ValueWrapper, null, !!value?.status ? (React.createElement(Status, { status: value.status === 'transitioning' ? OtherStatus.Loading : value.status, title: value.text || value.status, withBorder: true, withIcon: true })) : (React.createElement(ValueText, null, value?.text || '-')))));
4357
4371
  };
4358
4372
 
4359
4373
  const TableRow = styled.tr `
@@ -4454,21 +4468,16 @@ const Title$9 = styled(Text) `
4454
4468
  text-wrap: nowrap;
4455
4469
  `;
4456
4470
  const TableBody = styled.tbody ``;
4457
- var SORT_DIRECTION;
4458
- (function (SORT_DIRECTION) {
4459
- SORT_DIRECTION["ASC"] = "asc";
4460
- SORT_DIRECTION["DESC"] = "desc";
4461
- })(SORT_DIRECTION || (SORT_DIRECTION = {}));
4462
4471
  const InteractiveTable = ({ columns, rows, onRowClick }) => {
4463
- const [sortDirection, setSortDirection] = useState(SORT_DIRECTION.ASC);
4472
+ const [sortDirection, setSortDirection] = useState(SortDirection.Ascending);
4464
4473
  const [sortBy, setSortBy] = useState('name');
4465
4474
  const onSort = useCallback((key) => {
4466
4475
  if (sortBy === key) {
4467
- setSortDirection((prev) => (prev === SORT_DIRECTION.ASC ? SORT_DIRECTION.DESC : SORT_DIRECTION.ASC));
4476
+ setSortDirection((prev) => (prev === SortDirection.Ascending ? SortDirection.Descending : SortDirection.Ascending));
4468
4477
  }
4469
4478
  else {
4470
4479
  setSortBy(key);
4471
- setSortDirection(SORT_DIRECTION.ASC);
4480
+ setSortDirection(SortDirection.Ascending);
4472
4481
  }
4473
4482
  }, [sortBy]);
4474
4483
  const sorted = useMemo(() => {
@@ -4489,7 +4498,7 @@ const InteractiveTable = ({ columns, rows, onRowClick }) => {
4489
4498
  ? [...rows].sort((a, b) => {
4490
4499
  const valueA = getCellValue(a, sortBy);
4491
4500
  const valueB = getCellValue(b, sortBy);
4492
- const direction = sortDirection === SORT_DIRECTION.ASC ? 1 : -1;
4501
+ const direction = sortDirection === SortDirection.Ascending ? 1 : -1;
4493
4502
  return direction * compareValues(valueA, valueB);
4494
4503
  })
4495
4504
  : rows;
@@ -4503,20 +4512,20 @@ const InteractiveTable = ({ columns, rows, onRowClick }) => {
4503
4512
  React.createElement(TableBody, null, sorted.map(({ status, faded, cells }, i) => (React.createElement(Row, { key: `row-${i}`, index: i, columns: columns, cells: cells, onClick: !!onRowClick ? () => onRowClick(i) : undefined, status: status, faded: faded })))))));
4504
4513
  };
4505
4514
 
4506
- var DATA_CARD_FIELD_TYPES;
4507
- (function (DATA_CARD_FIELD_TYPES) {
4508
- DATA_CARD_FIELD_TYPES["CODE"] = "code";
4509
- DATA_CARD_FIELD_TYPES["TABLE"] = "table";
4510
- DATA_CARD_FIELD_TYPES["BADGE"] = "badge";
4511
- DATA_CARD_FIELD_TYPES["LOADER"] = "loader";
4512
- DATA_CARD_FIELD_TYPES["DIVIDER"] = "divider";
4513
- DATA_CARD_FIELD_TYPES["MONITORS"] = "monitors";
4514
- DATA_CARD_FIELD_TYPES["COPY_TEXT"] = "copy-text";
4515
- DATA_CARD_FIELD_TYPES["DESCRIBE_ROW"] = "describe-row";
4516
- DATA_CARD_FIELD_TYPES["ACTIVE_STATUS"] = "active-status";
4517
- DATA_CARD_FIELD_TYPES["POD_CONTAINER"] = "pod-container";
4518
- DATA_CARD_FIELD_TYPES["SOURCE_CONTAINER"] = "source-container";
4519
- })(DATA_CARD_FIELD_TYPES || (DATA_CARD_FIELD_TYPES = {}));
4515
+ var DataCardFieldTypes;
4516
+ (function (DataCardFieldTypes) {
4517
+ DataCardFieldTypes["Code"] = "code";
4518
+ DataCardFieldTypes["Table"] = "table";
4519
+ DataCardFieldTypes["Badge"] = "badge";
4520
+ DataCardFieldTypes["Loader"] = "loader";
4521
+ DataCardFieldTypes["Divider"] = "divider";
4522
+ DataCardFieldTypes["Monitors"] = "monitors";
4523
+ DataCardFieldTypes["CopyText"] = "copy-text";
4524
+ DataCardFieldTypes["DescribeRow"] = "describe-row";
4525
+ DataCardFieldTypes["ActiveStatus"] = "active-status";
4526
+ DataCardFieldTypes["PodContainer"] = "pod-container";
4527
+ DataCardFieldTypes["SourceContainer"] = "source-container";
4528
+ })(DataCardFieldTypes || (DataCardFieldTypes = {}));
4520
4529
  const ListContainer$3 = styled.div `
4521
4530
  display: flex;
4522
4531
  flex-wrap: wrap;
@@ -4556,60 +4565,60 @@ const CopyWrapper = styled(FlexRow) `
4556
4565
  }
4557
4566
  `;
4558
4567
  const DataCardFields = ({ data }) => {
4559
- return (React.createElement(ListContainer$3, null, data.map(({ type, title, tooltip, value }, idx) => (React.createElement(ListItem, { key: `data-field-${title || (!!value ? JSON.stringify(value) : idx)}`, "$width": !!type && [DATA_CARD_FIELD_TYPES.CODE, DATA_CARD_FIELD_TYPES.TABLE].includes(type)
4568
+ return (React.createElement(ListContainer$3, null, data.map(({ type, title, tooltip, value }, idx) => (React.createElement(ListItem, { key: `data-field-${title || (!!value ? JSON.stringify(value) : idx)}`, "$width": !!type && [DataCardFieldTypes.Code, DataCardFieldTypes.Table].includes(type)
4560
4569
  ? 'inherit'
4561
4570
  : !!type &&
4562
4571
  [
4563
- DATA_CARD_FIELD_TYPES.LOADER,
4564
- DATA_CARD_FIELD_TYPES.DIVIDER,
4565
- DATA_CARD_FIELD_TYPES.COPY_TEXT,
4566
- DATA_CARD_FIELD_TYPES.DESCRIBE_ROW,
4567
- DATA_CARD_FIELD_TYPES.POD_CONTAINER,
4568
- DATA_CARD_FIELD_TYPES.SOURCE_CONTAINER,
4572
+ DataCardFieldTypes.Loader,
4573
+ DataCardFieldTypes.Divider,
4574
+ DataCardFieldTypes.CopyText,
4575
+ DataCardFieldTypes.DescribeRow,
4576
+ DataCardFieldTypes.PodContainer,
4577
+ DataCardFieldTypes.SourceContainer,
4569
4578
  ].includes(type)
4570
4579
  ? '100%'
4571
4580
  : 'unset' },
4572
4581
  React.createElement(Tooltip, { text: tooltip, withIcon: true }, !!title && React.createElement(ItemTitle, null, title)),
4573
4582
  renderValue(type, value))))));
4574
4583
  };
4575
- // We need to maintain this with new components every time we add a new type to "DATA_CARD_FIELD_TYPES"
4584
+ // We need to maintain this with new components every time we add a new type to "DataCardFieldTypes"
4576
4585
  const renderValue = (type, value) => {
4577
4586
  const theme = Theme.useTheme();
4578
4587
  const { clickCopy, isCopied } = useCopy();
4579
4588
  switch (type) {
4580
- case DATA_CARD_FIELD_TYPES.DIVIDER: {
4589
+ case DataCardFieldTypes.Divider: {
4581
4590
  return React.createElement(Divider, { length: '100%', margin: '0' });
4582
4591
  }
4583
- case DATA_CARD_FIELD_TYPES.LOADER: {
4592
+ case DataCardFieldTypes.Loader: {
4584
4593
  return (React.createElement(CenterThis, null,
4585
4594
  React.createElement(FadeLoader, { scale: 1.2 })));
4586
4595
  }
4587
- case DATA_CARD_FIELD_TYPES.MONITORS: {
4596
+ case DataCardFieldTypes.Monitors: {
4588
4597
  return React.createElement(MonitorsIcons, { monitors: value?.split(', ') || [], withLabels: true, color: theme.colors.secondary });
4589
4598
  }
4590
- case DATA_CARD_FIELD_TYPES.BADGE: {
4599
+ case DataCardFieldTypes.Badge: {
4591
4600
  const params = safeJsonParse(value, { label: '-', filled: false });
4592
4601
  return React.createElement(Badge, { ...params });
4593
4602
  }
4594
- case DATA_CARD_FIELD_TYPES.CODE: {
4603
+ case DataCardFieldTypes.Code: {
4595
4604
  const params = safeJsonParse(value, { language: '', code: '' });
4596
4605
  return React.createElement(Code, { ...params });
4597
4606
  }
4598
- case DATA_CARD_FIELD_TYPES.DESCRIBE_ROW: {
4607
+ case DataCardFieldTypes.DescribeRow: {
4599
4608
  const params = safeJsonParse(value, { title: '', subTitle: '', tooltip: '', value: { text: undefined, status: undefined } });
4600
4609
  return React.createElement(DescribeRow, { ...params });
4601
4610
  }
4602
- case DATA_CARD_FIELD_TYPES.TABLE: {
4611
+ case DataCardFieldTypes.Table: {
4603
4612
  const params = safeJsonParse(value, {
4604
4613
  columns: [],
4605
4614
  rows: [{ status: undefined, cells: [] }],
4606
4615
  });
4607
4616
  return React.createElement(InteractiveTable, { ...params });
4608
4617
  }
4609
- case DATA_CARD_FIELD_TYPES.ACTIVE_STATUS: {
4610
- return React.createElement(Status, { status: value == 'true' ? NOTIFICATION_TYPE.SUCCESS : NOTIFICATION_TYPE.ERROR, title: value == 'true' ? 'Active' : 'Inactive', size: 10, withIcon: true, withBorder: true });
4618
+ case DataCardFieldTypes.ActiveStatus: {
4619
+ return React.createElement(Status, { status: value == 'true' ? StatusType.Success : StatusType.Error, title: value == 'true' ? 'Active' : 'Inactive', size: 10, withIcon: true, withBorder: true });
4611
4620
  }
4612
- case DATA_CARD_FIELD_TYPES.COPY_TEXT: {
4621
+ case DataCardFieldTypes.CopyText: {
4613
4622
  const str = typeof value === 'string' ? value : JSON.stringify(value);
4614
4623
  return (React.createElement(CopyWrapper, null,
4615
4624
  React.createElement(IconButton, { onClick: (e) => {
@@ -4618,41 +4627,41 @@ const renderValue = (type, value) => {
4618
4627
  }, tooltip: isCopied ? 'Copied!' : 'Copy' }, isCopied ? React.createElement(CheckIcon, null) : React.createElement(CopyIcon, null)),
4619
4628
  React.createElement("pre", null, str)));
4620
4629
  }
4621
- case DATA_CARD_FIELD_TYPES.POD_CONTAINER: {
4630
+ case DataCardFieldTypes.PodContainer: {
4622
4631
  const { containerName, actualDevice, processes } = safeJsonParse(value, {
4623
4632
  containerName: '',
4624
4633
  actualDevice: { title: '', subTitle: '', tooltip: '' },
4625
- processes: [{ health: NOTIFICATION_TYPE.INFO, message: '', identifyingAttributes: [] }],
4634
+ processes: [{ health: StatusType.Info, message: '', identifyingAttributes: [] }],
4626
4635
  });
4627
4636
  return (React.createElement(DataTab, { title: containerName, subTitle: `${processes.length} Instrumented Processes`, renderActions: () => {
4628
- return (React.createElement(Status, { status: NOTIFICATION_TYPE.INFO, title: 'Instrumentation Device', subtitle: !actualDevice.subTitle || actualDevice.subTitle === '[]' ? 'none' : actualDevice.subTitle, withBorder: true }));
4637
+ return React.createElement(Status, { status: StatusType.Info, title: 'Instrumentation Device', subtitle: !actualDevice.subTitle || actualDevice.subTitle === '[]' ? 'none' : actualDevice.subTitle, withBorder: true });
4629
4638
  }, isExtended: !!processes.length, renderExtended: () => {
4630
4639
  return (React.createElement(FlexColStretched, { "$gap": 24 }, processes.map((process, idx) => (React.createElement(FlexColStretched, { key: `process-${idx}`, "$gap": 8 },
4631
4640
  React.createElement(DescribeRow, { title: `Instrumented Process #${idx + 1}`, subTitle: process.message || '', value: {
4632
- text: process.health === NOTIFICATION_TYPE.SUCCESS ? 'healthy' : 'unhealthy',
4641
+ text: process.health === StatusType.Success ? 'healthy' : 'unhealthy',
4633
4642
  status: process.health,
4634
4643
  } }),
4635
4644
  process.identifyingAttributes.map(({ name, value }) => (React.createElement(DescribeRow, { key: useId(), title: name, subTitle: '', value: { text: value, status: undefined } }))))))));
4636
4645
  } }));
4637
4646
  }
4638
- case DATA_CARD_FIELD_TYPES.SOURCE_CONTAINER: {
4647
+ case DataCardFieldTypes.SourceContainer: {
4639
4648
  const { containerName, language, runtimeVersion, instrumented, instrumentationMessage, otelDistroName } = safeJsonParse(value, {
4640
4649
  containerName: '',
4641
- language: PROGRAMMING_LANGUAGES.UNKNOWN,
4650
+ language: ProgrammingLanguages.Unknown,
4642
4651
  runtimeVersion: '',
4643
4652
  instrumented: false,
4644
4653
  instrumentationMessage: '',
4645
4654
  otelDistroName: '',
4646
4655
  });
4647
4656
  const awaitingInstrumentation = !instrumented && !instrumentationMessage;
4648
- return (React.createElement(DataTab, { title: containerName, subTitle: `${language === PROGRAMMING_LANGUAGES.JAVASCRIPT ? 'Node.js' : capitalizeFirstLetter(language)}` + (!!runtimeVersion ? ` • Runtime Version: ${runtimeVersion}` : ''), icon: getProgrammingLanguageIcon(language), isExtended: !!instrumentationMessage, renderExtended: () => {
4657
+ return (React.createElement(DataTab, { title: containerName, subTitle: `${language === ProgrammingLanguages.JavaScript ? 'Node.js' : capitalizeFirstLetter(language)}` + (!!runtimeVersion ? ` • Runtime Version: ${runtimeVersion}` : ''), icon: getProgrammingLanguageIcon(language), isExtended: !!instrumentationMessage, renderExtended: () => {
4649
4658
  if (!!instrumentationMessage) {
4650
4659
  return (React.createElement(AlignCenter, null,
4651
- React.createElement(Status, { status: NOTIFICATION_TYPE.INFO, title: splitCamelString(instrumentationMessage) })));
4660
+ React.createElement(Status, { status: StatusType.Info, title: splitCamelString(instrumentationMessage) })));
4652
4661
  }
4653
4662
  return null;
4654
4663
  }, renderActions: () => {
4655
- return (React.createElement(Status, { status: instrumented ? NOTIFICATION_TYPE.SUCCESS : awaitingInstrumentation ? NOTIFICATION_TYPE.WARNING : NOTIFICATION_TYPE.ERROR, title: instrumented ? 'Instrumented' : awaitingInstrumentation ? 'Instrumenting...' : 'Uninstrumented', subtitle: otelDistroName, withIcon: true, withBorder: true }));
4664
+ return (React.createElement(Status, { status: instrumented ? StatusType.Success : awaitingInstrumentation ? StatusType.Warning : StatusType.Error, title: instrumented ? 'Instrumented' : awaitingInstrumentation ? 'Instrumenting...' : 'Uninstrumented', subtitle: otelDistroName, withIcon: true, withBorder: true }));
4656
4665
  } }));
4657
4666
  }
4658
4667
  default: {
@@ -4711,10 +4720,10 @@ const DataCard = ({ title = 'Details', titleBadge, description, action: Action,
4711
4720
  };
4712
4721
 
4713
4722
  const DeleteWarning = ({ isOpen, noOverlay, name, type, isLastItem, onApprove, onDeny }) => {
4714
- const actionText = type === ENTITY_TYPES.SOURCE ? 'uninstrument' : 'delete';
4723
+ const actionText = type === EntityTypes.Source ? 'uninstrument' : 'delete';
4715
4724
  return (React.createElement(WarningModal, { isOpen: isOpen, noOverlay: noOverlay, title: `${actionText.charAt(0).toUpperCase() + actionText.substring(1)}${name ? ` ${name}` : ''}`, description: `Are you sure you want to ${actionText}?`, note: isLastItem
4716
4725
  ? {
4717
- type: NOTIFICATION_TYPE.WARNING,
4726
+ type: StatusType.Warning,
4718
4727
  title: `You're about to ${actionText} the last ${type || name}`,
4719
4728
  message: '',
4720
4729
  }
@@ -4783,11 +4792,20 @@ const Tab = styled(Text) `
4783
4792
  gap: 8px;
4784
4793
  `;
4785
4794
  const DrawerHeader = ({ onClose, icon, iconSrc, title, titleTooltip, replaceTitleWith: ReplaceTitleWith, actionButtons = [], tabs }) => {
4795
+ const renderReplaceTitleWith = () => {
4796
+ if (typeof ReplaceTitleWith === 'function') {
4797
+ return React.createElement(ReplaceTitleWith, null);
4798
+ }
4799
+ if (ReplaceTitleWith) {
4800
+ return ReplaceTitleWith;
4801
+ }
4802
+ return null;
4803
+ };
4786
4804
  return (React.createElement(Container$j, null,
4787
4805
  React.createElement(TopRow, null,
4788
4806
  React.createElement(SectionItemsWrapper, null,
4789
4807
  (!!icon || !!iconSrc) && React.createElement(IconWrapped, { icon: icon, src: iconSrc, alt: 'Drawer Item' }),
4790
- !!ReplaceTitleWith ? (React.createElement(ReplaceTitleWith, null)) : (React.createElement(Tooltip, { text: titleTooltip, withIcon: true }, title && React.createElement(Title$7, null, title)))),
4808
+ renderReplaceTitleWith() || (React.createElement(Tooltip, { text: titleTooltip, withIcon: true }, title && React.createElement(Title$7, null, title)))),
4791
4809
  React.createElement(SectionItemsWrapper, { "$gap": 2 },
4792
4810
  actionButtons.map((btn, i) => (React.createElement(ActionButton$1, { key: `header-action-button-${i}`, ...btn }))),
4793
4811
  React.createElement(CloseButton, { "data-id": 'drawer-close', variant: 'secondary', onClick: onClose },
@@ -6009,12 +6027,12 @@ const SkeletonLoader = ({ size = 5, maxWidth }) => {
6009
6027
  React.createElement(Line, { "$width": '100%' })))))));
6010
6028
  };
6011
6029
 
6012
- var STEP_STATE;
6013
- (function (STEP_STATE) {
6014
- STEP_STATE["ACTIVE"] = "active";
6015
- STEP_STATE["DISABLED"] = "disabled";
6016
- STEP_STATE["FINISH"] = "finish";
6017
- })(STEP_STATE || (STEP_STATE = {}));
6030
+ var StepState;
6031
+ (function (StepState) {
6032
+ StepState["Active"] = "active";
6033
+ StepState["Disabled"] = "disabled";
6034
+ StepState["Finished"] = "finish";
6035
+ })(StepState || (StepState = {}));
6018
6036
  const Container$4 = styled.div `
6019
6037
  display: flex;
6020
6038
  flex-direction: column;
@@ -6024,7 +6042,7 @@ const Step = styled.div `
6024
6042
  display: flex;
6025
6043
  gap: 16px;
6026
6044
  padding: 8px;
6027
- opacity: ${({ $state }) => ($state === STEP_STATE.ACTIVE ? 1 : $state === STEP_STATE.DISABLED ? 0.5 : 0.8)};
6045
+ opacity: ${({ $state }) => ($state === StepState.Active ? 1 : $state === StepState.Disabled ? 0.5 : 0.8)};
6028
6046
  transition: all 0.3s;
6029
6047
  `;
6030
6048
  const IconWrapper = styled(FlexRow) `
@@ -6032,8 +6050,8 @@ const IconWrapper = styled(FlexRow) `
6032
6050
  width: 24px;
6033
6051
  height: 24px;
6034
6052
  border-radius: 32px;
6035
- border: ${({ theme, $state }) => ($state === STEP_STATE.DISABLED ? `1px dashed ${theme.text.dark_grey}` : `1px solid ${theme.colors.secondary}`)};
6036
- opacity: ${({ $state }) => ($state === STEP_STATE.FINISH ? 0.8 : 1)};
6053
+ border: ${({ theme, $state }) => ($state === StepState.Disabled ? `1px dashed ${theme.text.dark_grey}` : `1px solid ${theme.colors.secondary}`)};
6054
+ opacity: ${({ $state }) => ($state === StepState.Finished ? 0.8 : 1)};
6037
6055
  `;
6038
6056
  const Content$1 = styled(FlexColumn) `
6039
6057
  justify-content: center;
@@ -6046,18 +6064,18 @@ const Stepper = ({ data, currentStep = 0 }) => {
6046
6064
  useEffect(() => {
6047
6065
  setStepsList(data.map((step, i) => {
6048
6066
  if (i < currentStep - 1) {
6049
- return { ...step, state: STEP_STATE.FINISH, subtitle: 'Success' };
6067
+ return { ...step, state: StepState.Finished, subtitle: 'Success' };
6050
6068
  }
6051
6069
  else if (i === currentStep - 1) {
6052
- return { ...step, state: STEP_STATE.ACTIVE };
6070
+ return { ...step, state: StepState.Active };
6053
6071
  }
6054
6072
  else {
6055
- return { ...step, state: STEP_STATE.DISABLED };
6073
+ return { ...step, state: StepState.Disabled };
6056
6074
  }
6057
6075
  }));
6058
6076
  }, [currentStep, data]);
6059
6077
  return (React.createElement(Container$4, null, stepsList.map((step, index) => (React.createElement(Step, { key: index, "$state": step.state },
6060
- React.createElement(IconWrapper, { "$state": step.state }, [STEP_STATE.ACTIVE, STEP_STATE.DISABLED].includes(step.state) ? React.createElement(Text, { size: 12 }, step.stepNumber) : step.state === STEP_STATE.FINISH ? React.createElement(CheckIcon, { size: 20 }) : null),
6078
+ React.createElement(IconWrapper, { "$state": step.state }, [StepState.Active, StepState.Disabled].includes(step.state) ? React.createElement(Text, { size: 12 }, step.stepNumber) : step.state === StepState.Finished ? React.createElement(CheckIcon, { size: 20 }) : null),
6061
6079
  React.createElement(Content$1, null,
6062
6080
  React.createElement(Title$1, { family: 'secondary' }, step.title),
6063
6081
  step.subtitle && (React.createElement(Subtitle, { size: 10, weight: 300 }, step.subtitle))))))));
@@ -29571,4 +29589,4 @@ const WarningModal = ({ isOpen, noOverlay, title = '', description = '', note, a
29571
29589
  React.createElement(FooterButton, { "data-id": 'deny', variant: denyButton.variant || 'secondary', onClick: onDeny }, denyButton.text)))));
29572
29590
  };
29573
29591
 
29574
- export { FlexColumn as $, AutocompleteInput as A, Button$4 as B, CancelWarning as C, DataCard as D, ExtendArrow as E, FadeLoader as F, MonitorsIcons as G, Header as H, IconButton as I, NoDataFound as J, KeyValueInputsList as K, NotificationNote as L, Modal as M, NavigationButtons as N, Segment as O, SkeletonLoader as P, Status as Q, Stepper as R, SectionTitle as S, ToggleCodeComponent as T, Text as U, TextArea as V, Toggle as W, Tooltip as X, TraceLoader as Y, WarningModal as Z, FlexRow as _, Badge as a, CenterThis as a0, Overlay as a1, ModalBody as a2, getDefaultExportFromCjs as a3, Checkbox as b, Code as c, ConditionDetails as d, DataCardFields as e, DATA_CARD_FIELD_TYPES as f, DataTab as g, DeleteWarning as h, Divider as i, DocsButton as j, Drawer as k, DrawerHeader as l, DrawerFooter as m, Dropdown as n, FieldError as o, FieldLabel as p, IconGroup as q, IconTitleBadge as r, IconWrapped as s, IconsNav as t, ImageControlled as u, Input as v, InputList as w, InputTable as x, InteractiveTable as y, MonitorsCheckboxes as z };
29592
+ export { FlexColumn as $, AutocompleteInput as A, Button$4 as B, CancelWarning as C, DataCard as D, ExtendArrow as E, FadeLoader as F, MonitorsIcons as G, Header as H, IconButton as I, NoDataFound as J, KeyValueInputsList as K, NotificationNote as L, Modal as M, NavigationButtons as N, Segment as O, SkeletonLoader as P, Status as Q, Stepper as R, SectionTitle as S, ToggleCodeComponent as T, Text as U, TextArea as V, Toggle as W, Tooltip as X, TraceLoader as Y, WarningModal as Z, FlexRow as _, Badge as a, CenterThis as a0, Overlay as a1, ModalBody as a2, TableContainer as a3, TableTitleWrap as a4, TableWrap as a5, getDefaultExportFromCjs as a6, Checkbox as b, Code as c, ConditionDetails as d, DataCardFields as e, DataCardFieldTypes as f, DataTab as g, DeleteWarning as h, Divider as i, DocsButton as j, Drawer as k, DrawerHeader as l, DrawerFooter as m, Dropdown as n, FieldError as o, FieldLabel as p, IconGroup as q, IconTitleBadge as r, IconWrapped as s, IconsNav as t, ImageControlled as u, Input as v, InputList as w, InputTable as x, InteractiveTable as y, MonitorsCheckboxes as z };
@@ -1,7 +1,7 @@
1
- import { NOTIFICATION_TYPE, OTHER_STATUS, ENTITY_TYPES, PLATFORM_TYPE } from './types.js';
2
- import { a as getProgrammingLanguageIcon } from './index-Bc8gi9FH.js';
1
+ import { StatusType, OtherStatus, EntityTypes, PlatformType } from './types.js';
2
+ import { a as getProgrammingLanguageIcon } from './index-CYn62h8x.js';
3
3
  import 'react';
4
- import './index-DIcomki-.js';
4
+ import './index-DYEcdkUF.js';
5
5
  import 'styled-components';
6
6
  import { R as RulesIcon, A as ActionsIcon, D as DestinationsIcon, S as SourcesIcon, V as VmLogo } from './index-BjJpYtF1.js';
7
7
  import { O as OdigosLogo, K as K8sLogo } from './index-BGlk5VhF.js';
@@ -61,7 +61,7 @@ const filterSources = (sources, filters) => {
61
61
  if (!!filters.languages?.length)
62
62
  filtered = filtered.filter((source) => !!filters.languages?.find((language) => !!source.containers?.find((cont) => cont.language === language.id)));
63
63
  if (!!filters.onlyErrors)
64
- filtered = filtered.filter((source) => !!source.conditions?.find((cond) => cond.status === NOTIFICATION_TYPE.ERROR));
64
+ filtered = filtered.filter((source) => !!source.conditions?.find((cond) => cond.status === StatusType.Error));
65
65
  if (!!filters.errors?.length)
66
66
  filtered = filtered.filter((source) => !!filters.errors?.find((error) => !!source.conditions?.find((cond) => cond.message === error.id)));
67
67
  return filtered;
@@ -77,11 +77,11 @@ const formatBytes = (bytes) => {
77
77
  };
78
78
 
79
79
  const getConditionsBooleans = (conditions) => {
80
- const hasErrors = !!conditions?.find(({ status }) => status === NOTIFICATION_TYPE.ERROR);
81
- const hasWarnings = !!conditions?.find(({ status }) => status === NOTIFICATION_TYPE.WARNING);
82
- const hasDisableds = !!conditions?.find(({ status }) => status === OTHER_STATUS.DISABLED);
83
- const hasLoadings = !!conditions?.find(({ status }) => status === OTHER_STATUS.LOADING);
84
- const priorotizedStatus = hasErrors ? NOTIFICATION_TYPE.ERROR : hasWarnings ? NOTIFICATION_TYPE.WARNING : hasDisableds ? NOTIFICATION_TYPE.INFO : undefined;
80
+ const hasErrors = !!conditions?.find(({ status }) => status === StatusType.Error);
81
+ const hasWarnings = !!conditions?.find(({ status }) => status === StatusType.Warning);
82
+ const hasDisableds = !!conditions?.find(({ status }) => status === OtherStatus.Disabled);
83
+ const hasLoadings = !!conditions?.find(({ status }) => status === OtherStatus.Loading);
84
+ const priorotizedStatus = hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : hasDisableds ? StatusType.Info : undefined;
85
85
  return {
86
86
  hasErrors,
87
87
  hasWarnings,
@@ -104,10 +104,10 @@ const getContainersIcons = (containers) => {
104
104
 
105
105
  const getEntityIcon = (type) => {
106
106
  const LOGOS = {
107
- [ENTITY_TYPES.SOURCE]: SourcesIcon,
108
- [ENTITY_TYPES.DESTINATION]: DestinationsIcon,
109
- [ENTITY_TYPES.ACTION]: ActionsIcon,
110
- [ENTITY_TYPES.INSTRUMENTATION_RULE]: RulesIcon,
107
+ [EntityTypes.Source]: SourcesIcon,
108
+ [EntityTypes.Destination]: DestinationsIcon,
109
+ [EntityTypes.Action]: ActionsIcon,
110
+ [EntityTypes.InstrumentationRule]: RulesIcon,
111
111
  };
112
112
  return LOGOS[type];
113
113
  };
@@ -117,22 +117,22 @@ const getEntityLabel = (entity, entityType, options) => {
117
117
  let type = '';
118
118
  let name = '';
119
119
  switch (entityType) {
120
- case ENTITY_TYPES.INSTRUMENTATION_RULE:
120
+ case EntityTypes.InstrumentationRule:
121
121
  const rule = entity;
122
122
  type = rule.type;
123
123
  name = rule.ruleName;
124
124
  break;
125
- case ENTITY_TYPES.SOURCE:
125
+ case EntityTypes.Source:
126
126
  const source = entity;
127
127
  type = source.name;
128
128
  name = source.otelServiceName;
129
129
  break;
130
- case ENTITY_TYPES.ACTION:
130
+ case EntityTypes.Action:
131
131
  const action = entity;
132
132
  type = action.type;
133
133
  name = action.spec.actionName;
134
134
  break;
135
- case ENTITY_TYPES.DESTINATION:
135
+ case EntityTypes.Destination:
136
136
  const destination = entity;
137
137
  type = destination.destinationType.displayName;
138
138
  name = destination.name;
@@ -147,7 +147,7 @@ const getEntityLabel = (entity, entityType, options) => {
147
147
  };
148
148
 
149
149
  const getMetricForEntity = (metrics, entityType, entityId) => {
150
- const metric = entityType === ENTITY_TYPES.SOURCE
150
+ const metric = entityType === EntityTypes.Source
151
151
  ? metrics?.sources.find((m) => m.kind === entityId.kind && m.name === entityId.name && m.namespace === entityId.namespace)
152
152
  : metrics?.destinations.find((m) => m.id === entityId);
153
153
  return metric || { throughput: 0 };
@@ -157,8 +157,8 @@ const getPlatformIcon = (type) => {
157
157
  if (!type)
158
158
  return OdigosLogo;
159
159
  const LOGOS = {
160
- [PLATFORM_TYPE.K8S]: K8sLogo,
161
- [PLATFORM_TYPE.VM]: VmLogo,
160
+ [PlatformType.K8s]: K8sLogo,
161
+ [PlatformType.Vm]: VmLogo,
162
162
  };
163
163
  return LOGOS[type];
164
164
  };
@@ -167,8 +167,8 @@ const getPlatformLabel = (type) => {
167
167
  if (!type)
168
168
  return 'Unknown';
169
169
  const LABELS = {
170
- [PLATFORM_TYPE.K8S]: 'Kubernetes Cluster',
171
- [PLATFORM_TYPE.VM]: 'Virtual Machine',
170
+ [PlatformType.K8s]: 'Kubernetes Cluster',
171
+ [PlatformType.Vm]: 'Virtual Machine',
172
172
  };
173
173
  return LABELS[type];
174
174
  };