@odigos/ui-kit 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/lib/components/data-tab/data-tab.stories.d.ts +8 -2
- package/lib/components/data-tab/index.d.ts +21 -7
- package/lib/components/icon-group/index.d.ts +1 -0
- package/lib/components.js +8 -8
- package/lib/constants.js +3 -3
- package/lib/containers/data-flow-actions-menu/filters/index.d.ts +0 -5
- package/lib/containers/data-flow-actions-menu/index.d.ts +0 -3
- package/lib/containers/data-flow-actions-menu/styled.d.ts +3 -1
- package/lib/containers/dropdowns/namespace-dropdown/index.d.ts +0 -3
- package/lib/containers/overview-drawer/index.d.ts +5 -2
- package/lib/containers/overview-drawer/overview-drawer.stories.d.ts +2 -2
- package/lib/containers/source-modal/index.d.ts +1 -3
- package/lib/containers/source-selection-form/fast/list/index.d.ts +0 -1
- package/lib/containers/source-selection-form/index.d.ts +1 -3
- package/lib/containers/source-selection-form/simple/controls/index.d.ts +0 -2
- package/lib/containers/source-selection-form/simple/list/index.d.ts +0 -1
- package/lib/containers/table-cell-conditions/index.d.ts +1 -0
- package/lib/containers.js +168 -103
- package/lib/data/destinations/index.d.ts +1 -1
- package/lib/functions/get-destination-icon/index.d.ts +5 -1
- package/lib/functions.js +7 -17
- package/lib/hooks/useSourceSelectionFormData.d.ts +1 -2
- package/lib/hooks.js +5 -5
- package/lib/icons/destinations/app-dynamics-logo/index.d.ts +2 -0
- package/lib/icons/destinations/aws-cloudwatch-logo/aws-cloudwatch-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/aws-cloudwatch-logo/index.d.ts +2 -0
- package/lib/icons/destinations/aws-s3-logo/aws-s3-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/aws-s3-logo/index.d.ts +2 -0
- package/lib/icons/destinations/aws-xray-logo/aws-xray-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/aws-xray-logo/index.d.ts +2 -0
- package/lib/icons/destinations/axiom-logo/axiom-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/axiom-logo/index.d.ts +2 -0
- package/lib/icons/destinations/better-stack-logo/better-stack-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/better-stack-logo/index.d.ts +2 -0
- package/lib/icons/destinations/blob-storage-logo/blob-storage-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/blob-storage-logo/index.d.ts +2 -0
- package/lib/icons/destinations/causely-logo/causely-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/causely-logo/index.d.ts +2 -0
- package/lib/icons/destinations/chronosphere-logo/chronosphere-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/chronosphere-logo/index.d.ts +2 -0
- package/lib/icons/destinations/clickhouse-logo/clickhouse-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/clickhouse-logo/index.d.ts +2 -0
- package/lib/icons/destinations/coralogix-logo/coralogix-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/coralogix-logo/index.d.ts +2 -0
- package/lib/icons/destinations/dash0-logo/dash0-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/dash0-logo/index.d.ts +2 -0
- package/lib/icons/destinations/datadog-logo/datadog-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/datadog-logo/index.d.ts +2 -0
- package/lib/icons/destinations/dynatrace-logo/dynatrace-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/dynatrace-logo/index.d.ts +2 -0
- package/lib/icons/destinations/elastic-apm-logo/elastic-apm-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/elastic-apm-logo/index.d.ts +2 -0
- package/lib/icons/destinations/elastic-search-logo/elastic-search-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/elastic-search-logo/index.d.ts +2 -0
- package/lib/icons/destinations/gigapipe-logo/gigapipe-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/gigapipe-logo/index.d.ts +2 -0
- package/lib/icons/destinations/google-cloud-platform-logo/google-cloud-platform-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/google-cloud-platform-logo/index.d.ts +2 -0
- package/lib/icons/destinations/google-cloud-storage-logo/google-cloud-storage-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/google-cloud-storage-logo/index.d.ts +2 -0
- package/lib/icons/destinations/grafana-logo/grafana-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/grafana-logo/index.d.ts +2 -0
- package/lib/icons/destinations/groundcover-logo/groundcover-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/groundcover-logo/index.d.ts +2 -0
- package/lib/icons/destinations/honeycomb-logo/honeycomb-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/honeycomb-logo/index.d.ts +2 -0
- package/lib/icons/destinations/hyperdx-logo/hyperdx-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/hyperdx-logo/index.d.ts +2 -0
- package/lib/icons/destinations/index.d.ts +46 -0
- package/lib/icons/destinations/instana-logo/index.d.ts +2 -0
- package/lib/icons/destinations/instana-logo/instana-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/jaeger-logo/index.d.ts +2 -0
- package/lib/icons/destinations/jaeger-logo/jaeger-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/kafka-logo/kafka-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/kloudmate-logo/index.d.ts +2 -0
- package/lib/icons/destinations/kloudmate-logo/kloudmate-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/last9-logo/index.d.ts +2 -0
- package/lib/icons/destinations/last9-logo/last9-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/lightstep-logo/index.d.ts +2 -0
- package/lib/icons/destinations/lightstep-logo/lightstep-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/logzio-logo/index.d.ts +2 -0
- package/lib/icons/destinations/logzio-logo/logzio-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/loki-logo/index.d.ts +2 -0
- package/lib/icons/destinations/loki-logo/loki-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/lumigo-logo/index.d.ts +2 -0
- package/lib/icons/destinations/lumigo-logo/lumigo-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/middleware-logo/index.d.ts +2 -0
- package/lib/icons/destinations/middleware-logo/middleware-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/new-relic-logo/index.d.ts +2 -0
- package/lib/icons/destinations/new-relic-logo/new-relic-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/open-telemetry-logo/index.d.ts +2 -0
- package/lib/icons/destinations/open-telemetry-logo/open-telemetry-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/ops-verse-logo/index.d.ts +2 -0
- package/lib/icons/destinations/ops-verse-logo/ops-verse-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/prometheus-logo/index.d.ts +2 -0
- package/lib/icons/destinations/prometheus-logo/prometheus-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/qryn-logo/index.d.ts +2 -0
- package/lib/icons/destinations/qryn-logo/qryn-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/quickwit-logo/index.d.ts +2 -0
- package/lib/icons/destinations/quickwit-logo/quickwit-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/sentry-logo/index.d.ts +2 -0
- package/lib/icons/destinations/sentry-logo/sentry-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/signoz-logo/index.d.ts +2 -0
- package/lib/icons/destinations/signoz-logo/signoz-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/splunk-logo/index.d.ts +2 -0
- package/lib/icons/destinations/splunk-logo/splunk-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/sumo-logic-logo/index.d.ts +2 -0
- package/lib/icons/destinations/sumo-logic-logo/sumo-logic-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/tempo-logo/index.d.ts +2 -0
- package/lib/icons/destinations/tempo-logo/tempo-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/traceloop-logo/index.d.ts +2 -0
- package/lib/icons/destinations/traceloop-logo/traceloop-logo.stories.d.ts +8 -0
- package/lib/icons/destinations/uptrace-logo/index.d.ts +2 -0
- package/lib/icons/destinations/uptrace-logo/uptrace-logo.stories.d.ts +8 -0
- package/lib/icons/index.d.ts +1 -0
- package/lib/icons/overview/index.d.ts +1 -0
- package/lib/icons/overview/namespaces-icon/index.d.ts +2 -0
- package/lib/icons/overview/namespaces-icon/namespaces-icon.stories.d.ts +8 -0
- package/lib/icons/programming-languages/index.d.ts +0 -1
- package/lib/icons.js +29 -5
- package/lib/{index-CYn62h8x.js → index-CKtl8KxE.js} +2 -2
- package/lib/{index-Db_ZDrEr.js → index-CLOUNx6Z.js} +1 -1
- package/lib/{index-B5wdZoej.js → index-D6cZdmUs.js} +77 -45
- package/lib/index-DB8Djrsy.js +487 -0
- package/lib/{index-3KUV6Vlt.js → index-DH2zLaey.js} +5 -2
- package/lib/{index-BtuW12KL.js → index-DiEc-llU.js} +68 -5
- package/lib/{index-DYEcdkUF.js → index-IvGLauAo.js} +49 -37
- package/lib/{index-CJKFedQi.js → index-lL1o2K_5.js} +2 -2
- package/lib/store/useEntityStore.d.ts +4 -2
- package/lib/store/useSetupStore.d.ts +2 -3
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +1 -0
- package/lib/types/destinations/index.d.ts +50 -3
- package/lib/types.js +53 -1
- package/lib/{useSourceSelectionFormData-BnlRp8m3.js → useSourceSelectionFormData-R_uK7F7W.js} +6 -4
- package/lib/{useTransition-CFmm4scp.js → useTransition-hWYVBuSi.js} +2 -2
- package/package.json +12 -12
- package/lib/index-BjJpYtF1.js +0 -42
- package/lib/containers/data-flow-actions-menu/{data-flow.stories.d.ts → data-flow-actions-menu.stories.d.ts} +0 -0
- package/lib/icons/{programming-languages/kafka-logo/kafka-logo.stories.d.ts → destinations/app-dynamics-logo/app-dynamics-logo.stories.d.ts} +0 -0
- package/lib/icons/{programming-languages → destinations}/kafka-logo/index.d.ts +0 -0
- package/lib/{index-9ObpINp4.js → index-DM8CZWtL.js} +5 -5
package/lib/containers.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import React, { useState, useEffect, forwardRef,
|
|
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 { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-
|
|
3
|
+
import { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-lL1o2K_5.js';
|
|
4
4
|
import { D as DISPLAY_TITLES, F as FORM_ALERTS } from './index-C_0J5P9M.js';
|
|
5
5
|
import { ActionType, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, AddNodeTypes, EdgeTypes, FieldTypes, SignalType, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType } from './types.js';
|
|
6
|
-
import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, U as Text, O as Segment, S as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, V as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a2 as ModalBody, A as AutocompleteInput, i as Divider, Q as Status, _ as FlexRow, X as Tooltip, s as IconWrapped, G as MonitorsIcons, a3 as TableContainer, a4 as TableTitleWrap, r as IconTitleBadge, a5 as TableWrap, y as InteractiveTable, a0 as CenterThis, J as NoDataFound, $ as FlexColumn, Y as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a6 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, P as SkeletonLoader, W as Toggle, L as NotificationNote, R as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-
|
|
7
|
-
import { g as usePendingStore, f as useNotificationStore, a as useDrawerStore, b as useEntityStore, e as useModalStore, c as useFilterStore, s as styleInject, h as useSelectedStore, d as useInstrumentStore,
|
|
6
|
+
import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, U as Text, O as Segment, S as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, V as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a2 as ModalBody, A as AutocompleteInput, i as Divider, Q as Status, _ as FlexRow, X as Tooltip, s as IconWrapped, G as MonitorsIcons, a3 as TableContainer, a4 as TableTitleWrap, r as IconTitleBadge, a5 as TableWrap, y as InteractiveTable, a0 as CenterThis, J as NoDataFound, $ as FlexColumn, Y as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a6 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, P as SkeletonLoader, W as Toggle, L as NotificationNote, R as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-D6cZdmUs.js';
|
|
7
|
+
import { g as usePendingStore, f as useNotificationStore, a as useDrawerStore, b as useEntityStore, e as useModalStore, c as useFilterStore, s as styleInject, h as useSelectedStore, d as useInstrumentStore, j as getEntityId, i as useSetupStore, u as useDarkMode } from './index-IvGLauAo.js';
|
|
8
8
|
import Theme from './theme.js';
|
|
9
9
|
import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
|
|
10
|
-
import { i as CheckCircledIcon, h as ErrorTriangleIcon, W as WarningTriangleIcon } from './index-
|
|
11
|
-
import { C as CrossCircledIcon, E as EditIcon, O as OdigosLogoText, b as OverviewIcon, F as FilterIcon, N as NotificationIcon, S as SlackLogo, a as FolderIcon, K as KeyIcon, T as TerminalIcon } from './index-
|
|
12
|
-
import { g as getActionIcon, a as getInstrumentationRuleIcon } from './index-
|
|
13
|
-
import { u as useActionFormData, a as useClickNode, c as useDestinationFormData, b as useClickNotification, d as useSourceFormData, e as useSourceSelectionFormData } from './useSourceSelectionFormData-
|
|
14
|
-
import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-
|
|
10
|
+
import { i as CheckCircledIcon, h as ErrorTriangleIcon, W as WarningTriangleIcon } from './index-DM8CZWtL.js';
|
|
11
|
+
import { C as CrossCircledIcon, E as EditIcon, O as OdigosLogoText, b as OverviewIcon, F as FilterIcon, N as NotificationIcon, S as SlackLogo, a as FolderIcon, K as KeyIcon, T as TerminalIcon } from './index-DH2zLaey.js';
|
|
12
|
+
import { g as getActionIcon, a as getInstrumentationRuleIcon } from './index-CLOUNx6Z.js';
|
|
13
|
+
import { u as useActionFormData, a as useClickNode, c as useDestinationFormData, b as useClickNotification, d as useSourceFormData, e as useSourceSelectionFormData } from './useSourceSelectionFormData-R_uK7F7W.js';
|
|
14
|
+
import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-hWYVBuSi.js';
|
|
15
15
|
import { T as TrashIcon, S as SearchIcon, P as PlusIcon$1, A as ArrowIcon, a as CopyIcon, f as CheckIcon, g as CrossIcon } from './index-D_Qn2U89.js';
|
|
16
|
-
import { m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-
|
|
17
|
-
import { f as filterActions, g as getConditionsBooleans,
|
|
16
|
+
import { m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-CKtl8KxE.js';
|
|
17
|
+
import { f as filterActions, g as getConditionsBooleans, k as getEntityLabel, j as getEntityIcon, s as sleep$1, m as getPlatformIcon, n as getPlatformLabel, d as formatBytes, h as getContainersIcons, o as getValueForRange, i as getDestinationIcon, b as filterSources, a as filterDestinations, c as compareCondition, l as getMetricForEntity, p as getWorkloadId, e as getContainersInstrumentedCount, q as isOverTime } from './index-DiEc-llU.js';
|
|
18
18
|
import require$$1 from 'use-sync-external-store/shim';
|
|
19
19
|
import { createPortal } from 'react-dom';
|
|
20
20
|
import { O as OdigosLogo } from './index-BGlk5VhF.js';
|
|
21
|
-
import { R as RulesIcon,
|
|
21
|
+
import { R as RulesIcon, W as SourcesIcon, y as ActionsIcon, z as DestinationsIcon } from './index-DB8Djrsy.js';
|
|
22
22
|
import 'babel-runtime/helpers/extends';
|
|
23
23
|
import 'babel-runtime/core-js/object/get-prototype-of';
|
|
24
24
|
import 'babel-runtime/helpers/classCallCheck';
|
|
@@ -332,7 +332,7 @@ const ActionForm = ({ isUpdate, action, formData, formErrors, handleFormChange }
|
|
|
332
332
|
React.createElement(TextArea, { title: 'Notes', value: formData['notes'], onChange: ({ target: { value } }) => handleFormChange('notes', value), errorMessage: formErrors['notes'] })));
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
-
const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, iconSrc, isEdit = false, isFormDirty = false, isLastItem = false, onEdit, onSave, onDelete, onCancel, tabs,
|
|
335
|
+
const OverviewDrawer = forwardRef(({ children, width = 640, title, titleTooltip, icon, iconSrc, isEdit = false, isFormDirty = false, isLastItem = false, onEdit, onSave, onDelete, onCancel, tabs }, drawerRef) => {
|
|
336
336
|
const theme = Theme.useTheme();
|
|
337
337
|
const { isThisPending } = usePendingStore();
|
|
338
338
|
const { addNotification } = useNotificationStore();
|
|
@@ -342,18 +342,20 @@ const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, icon
|
|
|
342
342
|
const [isCancelModalOpen, setIsCancelModalOpen] = useState(false);
|
|
343
343
|
const titleRef = useRef(null);
|
|
344
344
|
const isSource = drawerType === EntityTypes.Source;
|
|
345
|
-
const closeDrawer = () => {
|
|
346
|
-
setDrawerType(null);
|
|
347
|
-
setDrawerEntityId(null);
|
|
348
|
-
if (onEdit)
|
|
349
|
-
onEdit(false);
|
|
350
|
-
setIsDeleteModalOpen(false);
|
|
351
|
-
setIsCancelModalOpen(false);
|
|
352
|
-
};
|
|
353
345
|
const closeWarningModals = () => {
|
|
354
346
|
setIsDeleteModalOpen(false);
|
|
355
347
|
setIsCancelModalOpen(false);
|
|
356
348
|
};
|
|
349
|
+
const closeDrawer = () => {
|
|
350
|
+
closeWarningModals();
|
|
351
|
+
if (onEdit)
|
|
352
|
+
onEdit(false);
|
|
353
|
+
setDrawerType(null);
|
|
354
|
+
setDrawerEntityId(null);
|
|
355
|
+
};
|
|
356
|
+
useImperativeHandle(drawerRef, () => ({
|
|
357
|
+
closeDrawer,
|
|
358
|
+
}));
|
|
357
359
|
const handleCancel = () => {
|
|
358
360
|
titleRef.current?.clearTitle();
|
|
359
361
|
if (onCancel)
|
|
@@ -402,7 +404,7 @@ const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, icon
|
|
|
402
404
|
actionButtons.push({
|
|
403
405
|
'data-id': 'drawer-edit',
|
|
404
406
|
variant: 'tertiary',
|
|
405
|
-
onClick: isPending ? () => handlePending('edit') :
|
|
407
|
+
onClick: isPending ? () => handlePending('edit') : () => onEdit(true),
|
|
406
408
|
children: (React.createElement(React.Fragment, null,
|
|
407
409
|
React.createElement(EditIcon, null),
|
|
408
410
|
React.createElement(Text, { size: 14, family: 'secondary', decoration: 'underline' }, "Edit"))),
|
|
@@ -411,7 +413,7 @@ const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, icon
|
|
|
411
413
|
actionButtons.push({
|
|
412
414
|
'data-id': 'drawer-delete',
|
|
413
415
|
variant: 'tertiary',
|
|
414
|
-
onClick: isPending ? () => handlePending(isSource ? 'uninstrument' : 'delete') :
|
|
416
|
+
onClick: isPending ? () => handlePending(isSource ? 'uninstrument' : 'delete') : clickDelete,
|
|
415
417
|
children: (React.createElement(React.Fragment, null,
|
|
416
418
|
React.createElement(TrashIcon, null),
|
|
417
419
|
React.createElement(Text, { color: theme.text.error, size: 14, family: 'secondary', decoration: 'underline' }, isSource ? 'Uninstrument' : 'Delete'))),
|
|
@@ -454,7 +456,7 @@ const OverviewDrawer = ({ children, width = 640, title, titleTooltip, icon, icon
|
|
|
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 })));
|
|
457
|
-
};
|
|
459
|
+
});
|
|
458
460
|
const EditTitle = forwardRef(({ title }, ref) => {
|
|
459
461
|
const [inputValue, setInputValue] = useState(title);
|
|
460
462
|
useEffect(() => {
|
|
@@ -482,12 +484,9 @@ const DataContainer$3 = styled.div `
|
|
|
482
484
|
`;
|
|
483
485
|
const ActionDrawer = ({ updateAction, deleteAction }) => {
|
|
484
486
|
const { actions } = useEntityStore();
|
|
485
|
-
const { drawerType, drawerEntityId
|
|
487
|
+
const { drawerType, drawerEntityId } = useDrawerStore();
|
|
488
|
+
const drawerRef = useRef(null);
|
|
486
489
|
const isOpen = drawerType !== EntityTypes.Action;
|
|
487
|
-
const onClose = () => {
|
|
488
|
-
setDrawerType(null);
|
|
489
|
-
setDrawerEntityId(null);
|
|
490
|
-
};
|
|
491
490
|
const [isEditing, setIsEditing] = useState(false);
|
|
492
491
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
493
492
|
const { formData, formErrors, handleFormChange, resetFormData, validateForm, loadFormWithDrawerItem } = useActionFormData();
|
|
@@ -518,7 +517,7 @@ const ActionDrawer = ({ updateAction, deleteAction }) => {
|
|
|
518
517
|
setIsFormDirty(false);
|
|
519
518
|
resetFormData();
|
|
520
519
|
// close drawer, all other cases are handled in OverviewDrawer
|
|
521
|
-
|
|
520
|
+
drawerRef.current?.closeDrawer();
|
|
522
521
|
};
|
|
523
522
|
const handleSave = (newTitle) => {
|
|
524
523
|
if (validateForm({ withAlert: true, alertTitle: Crud.Update })) {
|
|
@@ -529,7 +528,7 @@ const ActionDrawer = ({ updateAction, deleteAction }) => {
|
|
|
529
528
|
setIsFormDirty(false);
|
|
530
529
|
}
|
|
531
530
|
};
|
|
532
|
-
return (React.createElement(OverviewDrawer, { title: thisItem.spec.actionName || thisItem.type, icon: 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, icon: getActionIcon(thisItem.type), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: handleEdit, onSave: handleSave, onDelete: handleDelete, onCancel: handleCancel }, isEditing && thisOptionType ? (React.createElement(FormContainer$3, null,
|
|
533
532
|
React.createElement(ActionForm, { isUpdate: true, action: thisOptionType, formData: formData, formErrors: formErrors, handleFormChange: (...params) => {
|
|
534
533
|
setIsFormDirty(true);
|
|
535
534
|
handleFormChange(...params);
|
|
@@ -644,20 +643,27 @@ const buildSpecCell$1 = (action) => {
|
|
|
644
643
|
return str;
|
|
645
644
|
};
|
|
646
645
|
|
|
647
|
-
const TableCellConditions = ({ conditions }) => {
|
|
646
|
+
const TableCellConditions = ({ conditions, id }) => {
|
|
648
647
|
const errors = useMemo(() => conditions?.filter(({ status }) => status === StatusType.Error) || [], [conditions]);
|
|
649
648
|
const warnings = useMemo(() => conditions?.filter(({ status }) => status === StatusType.Warning) || [], [conditions]);
|
|
650
649
|
const disableds = useMemo(() => conditions?.filter(({ status }) => status === OtherStatus.Disabled) || [], [conditions]);
|
|
651
650
|
const isLoading = useMemo(() => !conditions?.length || !!conditions?.find(({ status }) => status === OtherStatus.Loading), [conditions]);
|
|
652
|
-
|
|
651
|
+
const conditionsToShow = errors.length > 0 ? errors : warnings.length > 0 ? warnings : disableds.length > 0 ? disableds : [];
|
|
652
|
+
if (conditionsToShow.length > 0) {
|
|
653
|
+
return (React.createElement("div", { style: { lineHeight: 1 } },
|
|
654
|
+
React.createElement(ConditionsStatuses, { conditions: conditionsToShow, id: id })));
|
|
655
|
+
}
|
|
656
|
+
const elseStatus = isLoading ? OtherStatus.Loading : StatusType.Success;
|
|
657
|
+
return (React.createElement("div", { style: { lineHeight: 1 } },
|
|
658
|
+
React.createElement(Status, { status: elseStatus, title: elseStatus, withBorder: true, withIcon: true })));
|
|
653
659
|
};
|
|
654
|
-
const ConditionsStatuses = ({ conditions }) => {
|
|
660
|
+
const ConditionsStatuses = ({ conditions, id }) => {
|
|
655
661
|
const theme = Theme.useTheme();
|
|
656
|
-
return (React.createElement(FlexRow, null, mapConditions(conditions).map(({ status, type, reason, message, lastTransitionTime }) => {
|
|
662
|
+
return (React.createElement(FlexRow, null, mapConditions(conditions).map(({ status, type, reason, message, lastTransitionTime }, i) => {
|
|
657
663
|
if (status === 'loading' || status === 'disabled')
|
|
658
664
|
status = StatusType.Info;
|
|
659
665
|
const icon = getStatusIcon(status, theme);
|
|
660
|
-
return (React.createElement(Tooltip, { key:
|
|
666
|
+
return (React.createElement(Tooltip, { key: `condition-${id}-${status}-${type}-${i}`, titleIcon: icon, title: type, text: message || reason || '', timestamp: lastTransitionTime },
|
|
661
667
|
React.createElement(Status, { status: status, title: reason || type, withBorder: true, withIcon: true })));
|
|
662
668
|
})));
|
|
663
669
|
};
|
|
@@ -719,7 +725,7 @@ const ActionTable = ({ maxHeight, maxWidth }) => {
|
|
|
719
725
|
},
|
|
720
726
|
{
|
|
721
727
|
columnKey: 'conditions',
|
|
722
|
-
component: () => React.createElement(TableCellConditions, { conditions: act.conditions || [] }),
|
|
728
|
+
component: () => React.createElement(TableCellConditions, { conditions: act.conditions || [], id: act.id }),
|
|
723
729
|
},
|
|
724
730
|
{
|
|
725
731
|
columnKey: 'active-status',
|
|
@@ -1026,7 +1032,8 @@ const MonitorDropdown = ({ title = 'Monitors', value, onSelect, onDeselect, ...p
|
|
|
1026
1032
|
return React.createElement(Dropdown, { disabled: !options?.length, title: title, placeholder: 'All', options: options, value: value, onSelect: onSelect, onDeselect: onDeselect, ...props });
|
|
1027
1033
|
};
|
|
1028
1034
|
|
|
1029
|
-
const NamespaceDropdown = ({
|
|
1035
|
+
const NamespaceDropdown = ({ title = 'Namespace', value, onSelect, onDeselect, ...props }) => {
|
|
1036
|
+
const { namespaces } = useEntityStore();
|
|
1030
1037
|
const options = useMemo(() => {
|
|
1031
1038
|
const payload = [];
|
|
1032
1039
|
namespaces?.forEach(({ name }) => {
|
|
@@ -12718,7 +12725,22 @@ const BaseNode = memo(({ id: nodeId, data }) => {
|
|
|
12718
12725
|
setSelectedSources(namespaces);
|
|
12719
12726
|
};
|
|
12720
12727
|
return (React.createElement(Container$i, { "data-id": nodeId, "$nodeWidth": nodeWidth, className: 'nowheel nodrag' },
|
|
12721
|
-
React.createElement(DataTab, { title: title, subTitle: subTitle,
|
|
12728
|
+
React.createElement(DataTab, { title: title, subTitle: subTitle, onClick: () => { }, renderActions: renderActions, iconProps: {
|
|
12729
|
+
icon: icon,
|
|
12730
|
+
icons: icons,
|
|
12731
|
+
iconSrc: iconSrc,
|
|
12732
|
+
iconSrcs: iconSrcs,
|
|
12733
|
+
}, visualProps: {
|
|
12734
|
+
status: status,
|
|
12735
|
+
faded: faded,
|
|
12736
|
+
monitors: monitors,
|
|
12737
|
+
isActive: isActive,
|
|
12738
|
+
}, checkboxProps: {
|
|
12739
|
+
withCheckbox: isSource,
|
|
12740
|
+
isChecked: sourceIndex !== -1,
|
|
12741
|
+
onCheckboxChange: onSelectSource,
|
|
12742
|
+
isCheckboxDisabled: isPending,
|
|
12743
|
+
} }),
|
|
12722
12744
|
React.createElement(Handle, { type: 'target', position: Position.Left, style: { visibility: 'hidden' } }),
|
|
12723
12745
|
React.createElement(Handle, { type: 'source', position: Position.Right, style: { visibility: 'hidden' } })));
|
|
12724
12746
|
});
|
|
@@ -13350,6 +13372,10 @@ const getNodePositions = ({ containerWidth }) => {
|
|
|
13350
13372
|
const endX = (containerWidth <= 1500 ? 1500 : containerWidth) - nodeWidth$1 - startX;
|
|
13351
13373
|
const getY = (idx) => nodeHeight * ((idx || 0) + 1);
|
|
13352
13374
|
const positions = {
|
|
13375
|
+
[EntityTypes.Namespace]: {
|
|
13376
|
+
x: 0,
|
|
13377
|
+
y: () => 0,
|
|
13378
|
+
},
|
|
13353
13379
|
[EntityTypes.InstrumentationRule]: {
|
|
13354
13380
|
x: startX,
|
|
13355
13381
|
y: getY,
|
|
@@ -13379,6 +13405,7 @@ const getNodePositions = ({ containerWidth }) => {
|
|
|
13379
13405
|
const { nodeWidth } = nodeConfig;
|
|
13380
13406
|
const mapToNodeData = (entity) => {
|
|
13381
13407
|
const { hasDisableds, priorotizedStatus } = getConditionsBooleans(entity.conditions || []);
|
|
13408
|
+
const { icon, iconSrc } = getDestinationIcon(entity.destinationType.type);
|
|
13382
13409
|
return {
|
|
13383
13410
|
nodeWidth,
|
|
13384
13411
|
id: entity.id,
|
|
@@ -13387,7 +13414,8 @@ const mapToNodeData = (entity) => {
|
|
|
13387
13414
|
faded: hasDisableds,
|
|
13388
13415
|
title: getEntityLabel(entity, EntityTypes.Destination, { prioritizeDisplayName: true }),
|
|
13389
13416
|
subTitle: entity.destinationType.displayName,
|
|
13390
|
-
|
|
13417
|
+
icon,
|
|
13418
|
+
iconSrc,
|
|
13391
13419
|
monitors: Object.keys(entity.exportedSignals).filter((signal) => entity.exportedSignals[signal] === true),
|
|
13392
13420
|
raw: entity,
|
|
13393
13421
|
};
|
|
@@ -13545,6 +13573,7 @@ const AbsoluteContainer$1 = styled.div `
|
|
|
13545
13573
|
border: ${({ theme }) => `1px solid ${theme.colors.border}`};
|
|
13546
13574
|
border-radius: 24px;
|
|
13547
13575
|
width: 420px;
|
|
13576
|
+
display: ${({ $hidden }) => ($hidden ? 'none' : 'block')};
|
|
13548
13577
|
`;
|
|
13549
13578
|
|
|
13550
13579
|
const buildSearchResults = ({ instrumentationRules, sources, actions, destinations, searchText, selectedCategory }) => {
|
|
@@ -13675,6 +13704,13 @@ const Actions = styled.div `
|
|
|
13675
13704
|
padding: 12px;
|
|
13676
13705
|
border-top: ${({ theme }) => `1px solid ${theme.colors.border}`};
|
|
13677
13706
|
`;
|
|
13707
|
+
const ActionButton$1 = styled(Button) `
|
|
13708
|
+
font-size: 14px;
|
|
13709
|
+
${({ $color }) => `color: ${$color};`}
|
|
13710
|
+
`;
|
|
13711
|
+
const PushRight = styled.div `
|
|
13712
|
+
margin-left: auto;
|
|
13713
|
+
`;
|
|
13678
13714
|
const getFilterCount = (params) => {
|
|
13679
13715
|
let count = 0;
|
|
13680
13716
|
count += params.namespaces?.length || 0;
|
|
@@ -13686,9 +13722,8 @@ const getFilterCount = (params) => {
|
|
|
13686
13722
|
count++;
|
|
13687
13723
|
return count;
|
|
13688
13724
|
};
|
|
13689
|
-
const Filters$1 = (
|
|
13725
|
+
const Filters$1 = () => {
|
|
13690
13726
|
const theme = Theme.useTheme();
|
|
13691
|
-
const { sources } = useEntityStore();
|
|
13692
13727
|
const { namespaces, kinds, monitors, languages, errors, onlyErrors, setAll, clearAll, getEmptyState } = useFilterStore();
|
|
13693
13728
|
// We need local state, because we want to keep the filters in the store only when the user clicks on apply
|
|
13694
13729
|
const [filters, setFilters] = useState({ namespaces, kinds, monitors, languages, errors, onlyErrors });
|
|
@@ -13703,9 +13738,15 @@ const Filters$1 = ({ namespaces: namespaceItems }) => {
|
|
|
13703
13738
|
}
|
|
13704
13739
|
}, [focused, namespaces, kinds, monitors, errors, onlyErrors]);
|
|
13705
13740
|
const onApply = () => {
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13741
|
+
// TODO: remove trycatch after debugging
|
|
13742
|
+
try {
|
|
13743
|
+
setAll(filters);
|
|
13744
|
+
setFilterCount(getFilterCount(filters));
|
|
13745
|
+
setFocused(false);
|
|
13746
|
+
}
|
|
13747
|
+
catch (error) {
|
|
13748
|
+
console.error(error);
|
|
13749
|
+
}
|
|
13709
13750
|
};
|
|
13710
13751
|
const onReset = () => {
|
|
13711
13752
|
clearAll();
|
|
@@ -13713,15 +13754,17 @@ const Filters$1 = ({ namespaces: namespaceItems }) => {
|
|
|
13713
13754
|
setFilterCount(0);
|
|
13714
13755
|
setFocused(false);
|
|
13715
13756
|
};
|
|
13716
|
-
const onCancel =
|
|
13757
|
+
const onCancel = () => {
|
|
13758
|
+
setFocused(false);
|
|
13759
|
+
};
|
|
13717
13760
|
const ref = useRef(null);
|
|
13718
13761
|
useOnClickOutside(ref, onCancel);
|
|
13719
13762
|
useKeyDown({ key: 'Escape', active: focused }, onCancel);
|
|
13720
13763
|
return (React.createElement(RelativeContainer$1, { ref: ref },
|
|
13721
13764
|
React.createElement(SelectionButton, { label: 'Filters', icon: FilterIcon, badgeLabel: filterCount, badgeFilled: !!filterCount, withBorder: true, color: 'transparent', onClick: toggleFocused }),
|
|
13722
|
-
|
|
13765
|
+
React.createElement(AbsoluteContainer$1, { "$hidden": !focused },
|
|
13723
13766
|
React.createElement(FormWrapper, null,
|
|
13724
|
-
React.createElement(NamespaceDropdown, {
|
|
13767
|
+
React.createElement(NamespaceDropdown, { value: filters['namespaces'], onSelect: (val) => setFilters((prev) => ({ ...prev, namespaces: [...(prev.namespaces || []), val] })), onDeselect: (val) => setFilters((prev) => ({ ...prev, namespaces: (prev.namespaces || []).filter((opt) => opt.id !== val.id) })), showSearch: true, required: true, isMulti: true }),
|
|
13725
13768
|
React.createElement(KindDropdown, { value: filters['kinds'], onSelect: (val) => setFilters((prev) => ({ ...prev, kinds: [...(prev.kinds || []), val] })), onDeselect: (val) => setFilters((prev) => ({ ...prev, kinds: (prev.kinds || []).filter((opt) => opt.id !== val.id) })), showSearch: true, required: true, isMulti: true }),
|
|
13726
13769
|
React.createElement(LanguageDropdown, { value: filters['languages'], onSelect: (val) => setFilters((prev) => ({ ...prev, languages: [...(prev.languages || []), val] })), onDeselect: (val) => setFilters((prev) => ({ ...prev, languages: (prev.languages || []).filter((opt) => opt.id !== val.id) })), showSearch: true, required: true, isMulti: true }),
|
|
13727
13770
|
React.createElement(MonitorDropdown, { value: filters['monitors'], onSelect: (val) => setFilters((prev) => ({ ...prev, monitors: [...(prev.monitors || []), val] })), onDeselect: (val) => setFilters((prev) => ({ ...prev, monitors: (prev.monitors || []).filter((opt) => opt.id !== val.id) })), showSearch: true, required: true, isMulti: true }),
|
|
@@ -13729,9 +13772,10 @@ const Filters$1 = ({ namespaces: namespaceItems }) => {
|
|
|
13729
13772
|
React.createElement(Toggle, { title: 'Show only sources with errors', initialValue: filters['onlyErrors'], onChange: (bool) => setFilters((prev) => ({ ...prev, errors: [], onlyErrors: bool })) })),
|
|
13730
13773
|
React.createElement(ErrorDropdown, { value: filters['errors'], onSelect: (val) => setFilters((prev) => ({ ...prev, errors: [...(prev.errors || []), val] })), onDeselect: (val) => setFilters((prev) => ({ ...prev, errors: (prev.errors || []).filter((opt) => opt.id !== val.id) })), disabled: !filters['onlyErrors'], showSearch: true, required: true, isMulti: true })),
|
|
13731
13774
|
React.createElement(Actions, null,
|
|
13732
|
-
React.createElement(
|
|
13733
|
-
React.createElement(
|
|
13734
|
-
React.createElement(
|
|
13775
|
+
React.createElement(ActionButton$1, { variant: 'primary', onClick: onApply }, "Apply"),
|
|
13776
|
+
React.createElement(ActionButton$1, { variant: 'secondary', onClick: onCancel }, "Cancel"),
|
|
13777
|
+
React.createElement(PushRight, null,
|
|
13778
|
+
React.createElement(ActionButton$1, { variant: 'tertiary', onClick: onReset, "$color": theme.text.error }, "Reset"))))));
|
|
13735
13779
|
};
|
|
13736
13780
|
|
|
13737
13781
|
const Container$b = styled.div `
|
|
@@ -13753,13 +13797,12 @@ const AddButton = styled(Button) `
|
|
|
13753
13797
|
min-width: 160px;
|
|
13754
13798
|
padding-right: 24px;
|
|
13755
13799
|
`;
|
|
13756
|
-
const DataFlowActionsMenu = ({
|
|
13800
|
+
const DataFlowActionsMenu = ({ addEntity }) => {
|
|
13757
13801
|
const theme = Theme.useTheme();
|
|
13758
13802
|
const { setCurrentModal } = useModalStore();
|
|
13759
|
-
const { sources, destinations, actions, instrumentationRules } = useEntityStore();
|
|
13760
13803
|
return (React.createElement(Container$b, null,
|
|
13761
13804
|
React.createElement(Search, null),
|
|
13762
|
-
React.createElement(Filters$1,
|
|
13805
|
+
React.createElement(Filters$1, null),
|
|
13763
13806
|
addEntity && (React.createElement(PushToEnd, null,
|
|
13764
13807
|
React.createElement(AddButton, { "data-id": `add-${addEntity}`, onClick: () => setCurrentModal(addEntity) },
|
|
13765
13808
|
React.createElement(PlusIcon$1, { fill: theme.colors.primary }),
|
|
@@ -13991,12 +14034,9 @@ const DataContainer$2 = styled.div `
|
|
|
13991
14034
|
`;
|
|
13992
14035
|
const DestinationDrawer = ({ categories, updateDestination, deleteDestination, testConnection, testLoading, testResult }) => {
|
|
13993
14036
|
const { destinations } = useEntityStore();
|
|
13994
|
-
const { drawerType, drawerEntityId
|
|
14037
|
+
const { drawerType, drawerEntityId } = useDrawerStore();
|
|
14038
|
+
const drawerRef = useRef(null);
|
|
13995
14039
|
const isOpen = drawerType !== EntityTypes.Destination;
|
|
13996
|
-
const onClose = () => {
|
|
13997
|
-
setDrawerType(null);
|
|
13998
|
-
setDrawerEntityId(null);
|
|
13999
|
-
};
|
|
14000
14040
|
const [isEditing, setIsEditing] = useState(false);
|
|
14001
14041
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
14002
14042
|
// const [thisItem, setThisItem] = useState<Destination | undefined>(undefined)
|
|
@@ -14030,6 +14070,7 @@ const DestinationDrawer = ({ categories, updateDestination, deleteDestination, t
|
|
|
14030
14070
|
if (!thisItem)
|
|
14031
14071
|
return null;
|
|
14032
14072
|
const thisOptionType = categories.map(({ items }) => items.filter(({ type }) => type === thisItem.destinationType.type)).filter((arr) => !!arr.length)?.[0]?.[0];
|
|
14073
|
+
const { icon, iconSrc } = getDestinationIcon(thisOptionType.type);
|
|
14033
14074
|
const handleEdit = (bool) => {
|
|
14034
14075
|
setIsEditing(typeof bool === 'boolean' ? bool : true);
|
|
14035
14076
|
};
|
|
@@ -14044,7 +14085,7 @@ const DestinationDrawer = ({ categories, updateDestination, deleteDestination, t
|
|
|
14044
14085
|
setIsFormDirty(false);
|
|
14045
14086
|
resetFormData();
|
|
14046
14087
|
// close drawer, all other cases are handled in OverviewDrawer
|
|
14047
|
-
|
|
14088
|
+
drawerRef.current?.closeDrawer();
|
|
14048
14089
|
};
|
|
14049
14090
|
const handleSave = async (newTitle) => {
|
|
14050
14091
|
if (validateForm({ withAlert: true, alertTitle: Crud.Update })) {
|
|
@@ -14055,7 +14096,7 @@ const DestinationDrawer = ({ categories, updateDestination, deleteDestination, t
|
|
|
14055
14096
|
setIsFormDirty(false);
|
|
14056
14097
|
}
|
|
14057
14098
|
};
|
|
14058
|
-
return (React.createElement(OverviewDrawer, { title: thisItem.name || thisItem.destinationType.displayName, iconSrc:
|
|
14099
|
+
return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.name || thisItem.destinationType.displayName, icon: icon, iconSrc: iconSrc, isEdit: isEditing, isFormDirty: isFormDirty, onEdit: handleEdit, onSave: handleSave, onDelete: handleDelete, onCancel: handleCancel, isLastItem: destinations.length === 1 }, isEditing ? (React.createElement(FormContainer$2, null,
|
|
14059
14100
|
React.createElement(DestinationForm, { isUpdate: true, categoryItem: thisOptionType, formData: formData, formErrors: formErrors, handleFormChange: (...params) => {
|
|
14060
14101
|
setIsFormDirty(true);
|
|
14061
14102
|
handleFormChange(...params);
|
|
@@ -14076,7 +14117,16 @@ const DestinationsList = ({ items, setSelectedItem }) => {
|
|
|
14076
14117
|
return items.map((category) => {
|
|
14077
14118
|
return (React.createElement(ListsWrapper$1, { key: `category-${category.name}` },
|
|
14078
14119
|
React.createElement(SectionTitle, { size: 'small', title: capitalizeFirstLetter(category.name), description: category.description }),
|
|
14079
|
-
category.items.map((item, idx) =>
|
|
14120
|
+
category.items.map((item, idx) => {
|
|
14121
|
+
const { icon, iconSrc } = getDestinationIcon(item.type);
|
|
14122
|
+
return (React.createElement(DataTab, { key: `select-destination-${item.type}-${idx}`, "data-id": `select-destination-${item.type}`, title: item.displayName, hoverText: 'Select', onClick: () => setSelectedItem(item), iconProps: {
|
|
14123
|
+
icon,
|
|
14124
|
+
iconSrc,
|
|
14125
|
+
}, visualProps: {
|
|
14126
|
+
monitors: Object.keys(item.supportedSignals).filter((signal) => item.supportedSignals[signal].supported),
|
|
14127
|
+
monitorsWithLabels: true,
|
|
14128
|
+
} }));
|
|
14129
|
+
})));
|
|
14080
14130
|
});
|
|
14081
14131
|
};
|
|
14082
14132
|
|
|
@@ -14090,7 +14140,16 @@ const PotentialDestinationsList = ({ items, setSelectedItem }) => {
|
|
|
14090
14140
|
return null;
|
|
14091
14141
|
return (React.createElement(ListsWrapper, null,
|
|
14092
14142
|
React.createElement(SectionTitle, { size: 'small', icon: OdigosLogo, title: 'Detected by Odigos', description: 'Odigos detects destinations for which automatic connection is available. All data will be filled out automatically.' }),
|
|
14093
|
-
items.map((item, idx) =>
|
|
14143
|
+
items.map((item, idx) => {
|
|
14144
|
+
const { icon, iconSrc } = getDestinationIcon(item.type);
|
|
14145
|
+
return (React.createElement(DataTab, { key: `select-potential-destination-${item.type}-${idx}`, "data-id": `select-potential-destination-${item.type}`, title: item.displayName, hoverText: 'Select', onClick: () => setSelectedItem(item), iconProps: {
|
|
14146
|
+
icon,
|
|
14147
|
+
iconSrc,
|
|
14148
|
+
}, visualProps: {
|
|
14149
|
+
monitors: Object.keys(item.supportedSignals).filter((signal) => item.supportedSignals[signal].supported),
|
|
14150
|
+
monitorsWithLabels: true,
|
|
14151
|
+
} }));
|
|
14152
|
+
})));
|
|
14094
14153
|
};
|
|
14095
14154
|
|
|
14096
14155
|
const Container$9 = styled.div `
|
|
@@ -14212,9 +14271,8 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
|
|
|
14212
14271
|
value: formData.name,
|
|
14213
14272
|
});
|
|
14214
14273
|
const storedDestination = {
|
|
14215
|
-
type: selectedItem
|
|
14216
|
-
displayName: selectedItem
|
|
14217
|
-
imageUrl: selectedItem?.imageUrl || '',
|
|
14274
|
+
type: selectedItem.type,
|
|
14275
|
+
displayName: selectedItem.displayName,
|
|
14218
14276
|
exportedSignals: formData.exportedSignals,
|
|
14219
14277
|
destinationTypeDetails,
|
|
14220
14278
|
category: '', // Could be handled in a more dynamic way if needed
|
|
@@ -14273,12 +14331,22 @@ const ConfiguredList = () => {
|
|
|
14273
14331
|
const { configuredDestinations } = useSetupStore();
|
|
14274
14332
|
return (React.createElement(Container$7, null, configuredDestinations.map(({ stored }, idx) => (React.createElement(ListItem$1, { key: `selected-destination-${stored.type}-${idx}`, "data-id": `selected-destination-${stored.type}`, item: stored, isLastItem: configuredDestinations.length === 1 })))));
|
|
14275
14333
|
};
|
|
14276
|
-
const ListItem$1 = ({ item, isLastItem
|
|
14334
|
+
const ListItem$1 = ({ item, isLastItem }) => {
|
|
14277
14335
|
const { removeConfiguredDestination } = useSetupStore();
|
|
14278
14336
|
const [deleteWarning, setDeleteWarning] = useState(false);
|
|
14337
|
+
const { icon, iconSrc } = getDestinationIcon(item.type);
|
|
14279
14338
|
return (React.createElement(React.Fragment, null,
|
|
14280
|
-
React.createElement(DataTab, { title: item.displayName,
|
|
14281
|
-
|
|
14339
|
+
React.createElement(DataTab, { title: item.displayName, iconProps: {
|
|
14340
|
+
icon,
|
|
14341
|
+
iconSrc,
|
|
14342
|
+
}, visualProps: {
|
|
14343
|
+
monitors: Object.keys(item.exportedSignals).filter((signal) => item.exportedSignals[signal] === true),
|
|
14344
|
+
monitorsWithLabels: true,
|
|
14345
|
+
}, extendableProps: {
|
|
14346
|
+
withExtend: true,
|
|
14347
|
+
renderExtended: () => React.createElement(DataCardFields, { data: item.destinationTypeDetails }),
|
|
14348
|
+
}, renderActions: () => (React.createElement(IconButton, { onClick: () => setDeleteWarning(true) },
|
|
14349
|
+
React.createElement(TrashIcon, null))) }),
|
|
14282
14350
|
React.createElement(DeleteWarning, { isOpen: deleteWarning, name: item.displayName || item.type, type: EntityTypes.Destination, isLastItem: isLastItem, onApprove: () => removeConfiguredDestination(item), onDeny: () => setDeleteWarning(false) })));
|
|
14283
14351
|
};
|
|
14284
14352
|
|
|
@@ -14336,6 +14404,7 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
14336
14404
|
const filtered = useMemo(() => filterDestinations(destinations, filters), [destinations, filters]);
|
|
14337
14405
|
const rows = useMemo(() => filtered.map((dest) => {
|
|
14338
14406
|
const { hasErrors, hasWarnings, hasDisableds } = getConditionsBooleans(dest.conditions || []);
|
|
14407
|
+
const { icon, iconSrc } = getDestinationIcon(dest.destinationType.type);
|
|
14339
14408
|
return {
|
|
14340
14409
|
status: hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : undefined,
|
|
14341
14410
|
faded: hasDisableds,
|
|
@@ -14346,7 +14415,7 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
14346
14415
|
cells: [
|
|
14347
14416
|
{
|
|
14348
14417
|
columnKey: 'icon',
|
|
14349
|
-
component: () => React.createElement(IconWrapped, { src:
|
|
14418
|
+
component: () => React.createElement(IconWrapped, { icon: icon, src: iconSrc }),
|
|
14350
14419
|
},
|
|
14351
14420
|
{
|
|
14352
14421
|
columnKey: 'name',
|
|
@@ -14364,7 +14433,7 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
14364
14433
|
},
|
|
14365
14434
|
{
|
|
14366
14435
|
columnKey: 'conditions',
|
|
14367
|
-
component: () => React.createElement(TableCellConditions, { conditions: dest.conditions || [] }),
|
|
14436
|
+
component: () => React.createElement(TableCellConditions, { conditions: dest.conditions || [], id: dest.id }),
|
|
14368
14437
|
},
|
|
14369
14438
|
{
|
|
14370
14439
|
columnKey: 'signals',
|
|
@@ -14615,12 +14684,9 @@ const FormContainer$1 = styled.div `
|
|
|
14615
14684
|
const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrumentationRule }) => {
|
|
14616
14685
|
const { instrumentationRules } = useEntityStore();
|
|
14617
14686
|
const { addNotification } = useNotificationStore();
|
|
14618
|
-
const { drawerType, drawerEntityId
|
|
14687
|
+
const { drawerType, drawerEntityId } = useDrawerStore();
|
|
14688
|
+
const drawerRef = useRef(null);
|
|
14619
14689
|
const isOpen = drawerType !== EntityTypes.InstrumentationRule;
|
|
14620
|
-
const onClose = () => {
|
|
14621
|
-
setDrawerType(null);
|
|
14622
|
-
setDrawerEntityId(null);
|
|
14623
|
-
};
|
|
14624
14690
|
const [isEditing, setIsEditing] = useState(false);
|
|
14625
14691
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
14626
14692
|
const { formData, formErrors, handleFormChange, resetFormData, validateForm, loadFormWithDrawerItem } = useInstrumentationRuleFormData();
|
|
@@ -14672,7 +14738,7 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14672
14738
|
setIsFormDirty(false);
|
|
14673
14739
|
resetFormData();
|
|
14674
14740
|
// close drawer, all other cases are handled in OverviewDrawer
|
|
14675
|
-
|
|
14741
|
+
drawerRef.current?.closeDrawer();
|
|
14676
14742
|
}
|
|
14677
14743
|
};
|
|
14678
14744
|
const handleSave = (newTitle) => {
|
|
@@ -14684,7 +14750,7 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14684
14750
|
setIsFormDirty(false);
|
|
14685
14751
|
}
|
|
14686
14752
|
};
|
|
14687
|
-
return (React.createElement(OverviewDrawer, { title: thisItem.ruleName || thisItem.type, icon: getInstrumentationRuleIcon(thisItem.type), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: handleEdit, onSave: handleSave, onDelete: handleDelete, onCancel: handleCancel }, isEditing && thisOptionType ? (React.createElement(FormContainer$1, null,
|
|
14753
|
+
return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.ruleName || thisItem.type, icon: getInstrumentationRuleIcon(thisItem.type), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: handleEdit, onSave: handleSave, onDelete: handleDelete, onCancel: handleCancel }, isEditing && thisOptionType ? (React.createElement(FormContainer$1, null,
|
|
14688
14754
|
React.createElement(InstrumentationRuleForm, { isUpdate: true, rule: thisOptionType, formData: formData, formErrors: formErrors, handleFormChange: (...params) => {
|
|
14689
14755
|
setIsFormDirty(true);
|
|
14690
14756
|
handleFormChange(...params);
|
|
@@ -15220,16 +15286,12 @@ const DataContainer$1 = styled.div `
|
|
|
15220
15286
|
`;
|
|
15221
15287
|
const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) => {
|
|
15222
15288
|
const { sources } = useEntityStore();
|
|
15223
|
-
const { drawerType, drawerEntityId
|
|
15224
|
-
const
|
|
15289
|
+
const { drawerType, drawerEntityId } = useDrawerStore();
|
|
15290
|
+
const drawerRef = useRef(null);
|
|
15225
15291
|
const isOpen = drawerType !== EntityTypes.Source;
|
|
15226
|
-
const onClose = () => {
|
|
15227
|
-
setSelectedTab(Tabs.Overview);
|
|
15228
|
-
setDrawerType(null);
|
|
15229
|
-
setDrawerEntityId(null);
|
|
15230
|
-
};
|
|
15231
15292
|
const [isEditing, setIsEditing] = useState(false);
|
|
15232
15293
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
15294
|
+
const [selectedTab, setSelectedTab] = useState(Tabs.Overview);
|
|
15233
15295
|
const { formData, handleFormChange, resetFormData, loadFormWithDrawerItem } = useSourceFormData();
|
|
15234
15296
|
const thisItem = useMemo(() => {
|
|
15235
15297
|
if (isOpen)
|
|
@@ -15249,27 +15311,27 @@ const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) =>
|
|
|
15249
15311
|
setIsEditing(typeof bool === 'boolean' ? bool : true);
|
|
15250
15312
|
};
|
|
15251
15313
|
const handleCancel = () => {
|
|
15252
|
-
setIsEditing(false);
|
|
15253
15314
|
setIsFormDirty(false);
|
|
15315
|
+
setIsEditing(false);
|
|
15254
15316
|
handleFormChange('otelServiceName', thisItem.otelServiceName || thisItem.name || '');
|
|
15255
15317
|
};
|
|
15256
15318
|
const handleDelete = async () => {
|
|
15257
15319
|
const { namespace } = thisItem;
|
|
15258
15320
|
persistSources({ [namespace]: [{ ...thisItem, selected: false }] }, {});
|
|
15259
|
-
setIsEditing(false);
|
|
15260
15321
|
setIsFormDirty(false);
|
|
15322
|
+
setIsEditing(false);
|
|
15261
15323
|
resetFormData();
|
|
15262
15324
|
// close drawer, all other cases are handled in OverviewDrawer
|
|
15263
|
-
|
|
15325
|
+
drawerRef.current?.closeDrawer();
|
|
15264
15326
|
};
|
|
15265
15327
|
const handleSave = async () => {
|
|
15266
15328
|
const title = formData.otelServiceName !== thisItem.name ? formData.otelServiceName : '';
|
|
15267
15329
|
handleFormChange('otelServiceName', title);
|
|
15268
15330
|
await updateSource(drawerEntityId, { ...formData, otelServiceName: title });
|
|
15269
|
-
setIsEditing(false);
|
|
15270
15331
|
setIsFormDirty(false);
|
|
15332
|
+
setIsEditing(false);
|
|
15271
15333
|
};
|
|
15272
|
-
return (React.createElement(OverviewDrawer, { title: thisItem.otelServiceName || thisItem.name, titleTooltip: 'This attribute is used to identify the name of the service (service.name) that is generating telemetry data.', icon: getEntityIcon(EntityTypes.Source), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: selectedTab === Tabs.Overview ? handleEdit : undefined, onSave: handleSave, onDelete: selectedTab === Tabs.Overview ? handleDelete : undefined, onCancel: handleCancel, isLastItem: sources.length === 1, tabs: [
|
|
15334
|
+
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.', icon: getEntityIcon(EntityTypes.Source), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: selectedTab === Tabs.Overview ? handleEdit : undefined, onSave: handleSave, onDelete: selectedTab === Tabs.Overview ? handleDelete : undefined, onCancel: handleCancel, isLastItem: sources.length === 1, tabs: [
|
|
15273
15335
|
{
|
|
15274
15336
|
label: Tabs.Overview,
|
|
15275
15337
|
onClick: () => setSelectedTab(Tabs.Overview),
|
|
@@ -15344,9 +15406,10 @@ const NoDataFoundWrapper$1 = styled.div `
|
|
|
15344
15406
|
max-height: calc(100vh - 360px);
|
|
15345
15407
|
overflow-y: auto;
|
|
15346
15408
|
`;
|
|
15347
|
-
const List$1 = ({ isModal = false, filterNamespaces, filterSources,
|
|
15409
|
+
const List$1 = ({ isModal = false, filterNamespaces, filterSources, selectedNamespace, onSelectNamespace, selectedSources, onSelectSource, selectedFutureApps, onSelectFutureApps, onSelectAll, }) => {
|
|
15348
15410
|
const theme = Theme.useTheme();
|
|
15349
15411
|
const namespaces = filterNamespaces();
|
|
15412
|
+
const { namespacesLoading } = useEntityStore();
|
|
15350
15413
|
if (!namespaces.length) {
|
|
15351
15414
|
return React.createElement(NoDataFoundWrapper$1, null, namespacesLoading ? React.createElement(FadeLoader, { scale: 2 }) : React.createElement(NoDataFound, { title: 'No namespaces found' }));
|
|
15352
15415
|
}
|
|
@@ -15463,7 +15526,8 @@ const NoDataFoundWrapper = styled.div `
|
|
|
15463
15526
|
max-height: calc(100vh - 360px);
|
|
15464
15527
|
overflow-y: auto;
|
|
15465
15528
|
`;
|
|
15466
|
-
const List = ({ isModal = false,
|
|
15529
|
+
const List = ({ isModal = false, selectedNamespace, selectedSources, onSelectSource, filterSources, }) => {
|
|
15530
|
+
const { namespacesLoading } = useEntityStore();
|
|
15467
15531
|
const sources = selectedSources[selectedNamespace] || [];
|
|
15468
15532
|
if (!sources.length) {
|
|
15469
15533
|
return React.createElement(NoDataFoundWrapper, null, namespacesLoading ? React.createElement(FadeLoader, { scale: 2 }) : React.createElement(NoDataFound, { title: 'No sources found' }));
|
|
@@ -15497,7 +15561,7 @@ const ToggleWrapper = styled.div `
|
|
|
15497
15561
|
align-items: center;
|
|
15498
15562
|
gap: 32px;
|
|
15499
15563
|
`;
|
|
15500
|
-
const Controls = ({
|
|
15564
|
+
const Controls = ({ selectedNamespace, onSelectNamespace, selectedSources, onSelectAll, selectedFutureApps, onSelectFutureApps, searchText, setSearchText, showSelectedOnly, setShowSelectedOnly, }) => {
|
|
15501
15565
|
const futureApps = selectedFutureApps[selectedNamespace] || false;
|
|
15502
15566
|
const sources = selectedSources[selectedNamespace] || [];
|
|
15503
15567
|
const selectedAppsCount = sources.filter(({ selected }) => selected).length;
|
|
@@ -15505,7 +15569,7 @@ const Controls = ({ namespaces, selectedNamespace, onSelectNamespace, selectedSo
|
|
|
15505
15569
|
React.createElement(SectionTitle, { title: 'Choose sources', description: "Apps will be automatically instrumented, and data will be sent to the relevant APM's destinations." }),
|
|
15506
15570
|
React.createElement(FlexContainer, { style: { marginTop: 24 } },
|
|
15507
15571
|
React.createElement(Input, { placeholder: 'Search for sources', icon: SearchIcon, value: searchText, onChange: (e) => setSearchText(e.target.value.toLowerCase()) }),
|
|
15508
|
-
React.createElement(NamespaceDropdown, {
|
|
15572
|
+
React.createElement(NamespaceDropdown, { title: '', value: selectedNamespace ? [{ value: selectedNamespace, id: selectedNamespace }] : [], onSelect: ({ id }) => !!id && onSelectNamespace(id), onDeselect: ({ id }) => !!id && onSelectNamespace(id) })),
|
|
15509
15573
|
React.createElement(Divider, { margin: '16px 0' }),
|
|
15510
15574
|
React.createElement(FlexContainer, null,
|
|
15511
15575
|
React.createElement(FlexContainer, null,
|
|
@@ -15524,8 +15588,8 @@ const Simple = (props) => {
|
|
|
15524
15588
|
React.createElement(List, { ...props })));
|
|
15525
15589
|
};
|
|
15526
15590
|
|
|
15527
|
-
const SourceSelectionForm = forwardRef(({ componentType, isModal,
|
|
15528
|
-
const formState = useSourceSelectionFormData({
|
|
15591
|
+
const SourceSelectionForm = forwardRef(({ componentType, isModal, selectedNamespace, onSelectNamespace, namespace }, ref) => {
|
|
15592
|
+
const formState = useSourceSelectionFormData({ selectedNamespace, onSelectNamespace, namespace });
|
|
15529
15593
|
const { recordedInitialSources, getApiSourcesPayload, getApiFutureAppsPayload } = formState;
|
|
15530
15594
|
useImperativeHandle(ref, () => ({
|
|
15531
15595
|
getFormValues: () => ({
|
|
@@ -15536,15 +15600,15 @@ const SourceSelectionForm = forwardRef(({ componentType, isModal, namespaces, na
|
|
|
15536
15600
|
}));
|
|
15537
15601
|
switch (componentType) {
|
|
15538
15602
|
case 'SIMPLE':
|
|
15539
|
-
return React.createElement(Simple, { isModal: isModal,
|
|
15603
|
+
return React.createElement(Simple, { isModal: isModal, selectedNamespace: selectedNamespace, onSelectNamespace: onSelectNamespace, ...formState });
|
|
15540
15604
|
case 'FAST':
|
|
15541
|
-
return React.createElement(Fast, { isModal: isModal,
|
|
15605
|
+
return React.createElement(Fast, { isModal: isModal, selectedNamespace: selectedNamespace, onSelectNamespace: onSelectNamespace, ...formState });
|
|
15542
15606
|
default:
|
|
15543
15607
|
return null;
|
|
15544
15608
|
}
|
|
15545
15609
|
});
|
|
15546
15610
|
|
|
15547
|
-
const SourceModal = ({ componentType = 'FAST',
|
|
15611
|
+
const SourceModal = ({ componentType = 'FAST', selectedNamespace, setSelectedNamespace, namespace, persistSources }) => {
|
|
15548
15612
|
const { currentModal, setCurrentModal } = useModalStore();
|
|
15549
15613
|
const isOpen = currentModal === EntityTypes.Source;
|
|
15550
15614
|
const onSelectNamespace = (ns) => {
|
|
@@ -15570,7 +15634,7 @@ const SourceModal = ({ componentType = 'FAST', namespaces, namespace, namespaces
|
|
|
15570
15634
|
onClick: handleSubmit,
|
|
15571
15635
|
},
|
|
15572
15636
|
] }) },
|
|
15573
|
-
React.createElement(SourceSelectionForm, { ref: formRef, componentType: componentType, isModal: true,
|
|
15637
|
+
React.createElement(SourceSelectionForm, { ref: formRef, componentType: componentType, isModal: true, selectedNamespace: selectedNamespace, onSelectNamespace: onSelectNamespace, namespace: namespace })));
|
|
15574
15638
|
};
|
|
15575
15639
|
|
|
15576
15640
|
const columns = [
|
|
@@ -15642,7 +15706,8 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15642
15706
|
setSelectedSources(payload);
|
|
15643
15707
|
}, [selectedSources]);
|
|
15644
15708
|
const rows = useMemo(() => filtered.map((source) => {
|
|
15645
|
-
const id =
|
|
15709
|
+
const id = getWorkloadId(source);
|
|
15710
|
+
const idString = JSON.stringify(id);
|
|
15646
15711
|
const { hasErrors, hasWarnings, hasDisableds } = getConditionsBooleans(source.conditions || []);
|
|
15647
15712
|
const isPending = isThisPending({ entityType: EntityTypes.Source, entityId: id });
|
|
15648
15713
|
const isChecked = !!selectedSources[id.namespace]?.find((x) => x.namespace === id.namespace && x.name === id.name && x.kind === id.kind);
|
|
@@ -15658,7 +15723,7 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15658
15723
|
columnKey: 'checkbox-and-icon',
|
|
15659
15724
|
component: () => (React.createElement(FlexRow, { "$gap": 16 },
|
|
15660
15725
|
React.createElement(Checkbox, { disabled: isPending, value: isChecked, onChange: () => onSelectOne(source) }),
|
|
15661
|
-
React.createElement(IconGroup, { icons: getContainersIcons(source.containers) }))),
|
|
15726
|
+
React.createElement(IconGroup, { icons: getContainersIcons(source.containers), id: idString }))),
|
|
15662
15727
|
},
|
|
15663
15728
|
{
|
|
15664
15729
|
columnKey: 'name',
|
|
@@ -15681,7 +15746,7 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15681
15746
|
},
|
|
15682
15747
|
{
|
|
15683
15748
|
columnKey: 'conditions',
|
|
15684
|
-
component: () => React.createElement(TableCellConditions, { conditions: source.conditions || [] }),
|
|
15749
|
+
component: () => React.createElement(TableCellConditions, { conditions: source.conditions || [], id: idString }),
|
|
15685
15750
|
},
|
|
15686
15751
|
{
|
|
15687
15752
|
columnKey: 'containers',
|