@odigos/ui-kit 0.0.76 → 0.0.78
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 +15 -0
- package/lib/components.js +3 -3
- package/lib/containers.js +52 -38
- package/lib/hooks/useDestinationFormData.d.ts +1 -1
- package/lib/hooks/useSourceSelectionFormData.d.ts +2 -0
- package/lib/hooks.js +10 -1
- package/lib/{index-a1b59a38.js → index-0a99fd0b.js} +1 -1
- package/lib/{index-45ee08be.js → index-3a26952d.js} +1 -1
- package/lib/snippets.js +2 -2
- package/lib/types/destinations/index.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.78](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.77...ui-kit-v0.0.78) (2025-08-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* display loaders when namespaces are fetching ([#302](https://github.com/odigos-io/ui-kit/issues/302)) ([9916914](https://github.com/odigos-io/ui-kit/commit/99169143ae04bb479c7837b1f3b40c0af37146c4))
|
|
9
|
+
* show destination boolean in data flow nodes ([#300](https://github.com/odigos-io/ui-kit/issues/300)) ([7bb56be](https://github.com/odigos-io/ui-kit/commit/7bb56bedad94985e1333a980b66bead1e8321e51))
|
|
10
|
+
|
|
11
|
+
## [0.0.77](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.76...ui-kit-v0.0.77) (2025-08-06)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add disabled state to destination form and modal ([#298](https://github.com/odigos-io/ui-kit/issues/298)) ([fa20002](https://github.com/odigos-io/ui-kit/commit/fa2000297df8745415bf6095ec31a18caad60725))
|
|
17
|
+
|
|
3
18
|
## [0.0.76](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.75...ui-kit-v0.0.76) (2025-08-06)
|
|
4
19
|
|
|
5
20
|
|
package/lib/components.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as Button } from './index-
|
|
2
|
-
export { A as AutocompleteInput, a as Badge, a6 as CenterThis, C as Checkbox, b as Code, c as ConditionDetails, D as DataCard, e as DataCardFieldTypes, d as DataCardFields, f as DataFinger, g as DataTab, h as DescribeRow, i as Divider, j as DocsButton, k as Drawer, m as DrawerFooter, l as DrawerHeader, n as Dropdown, E as ExtendArrow, F as FadeLoader, o as FieldError, p as FieldLabel, a5 as FlexColumn, a4 as FlexRow, H as Header, I as IconButton, q as IconGroup, r as IconTitleBadge, s as IconWrapped, t as IconsNav, u as ImageControlled, v as Input, w as InputList, x as InputTable, y as InteractiveTable, K as KeyValueInputsList, M as Modal, a9 as ModalBody, z as MonitorsCheckboxes, G as MonitorsIcons, N as NavigationButtons, J as NoDataFound, L as NotificationNote, a8 as Overlay, P as Popup, O as PopupForm, S as ScrollX, Q as SectionTitle, R as Segment, U as SelectionButton, V as SkeletonLoader, W as Status, X as Stepper, Y as TabList, aa as TableContainer, ab as TableTitleWrap, ac as TableWrap, Z as Tag, _ as Text, $ as TextArea, a0 as Toggle, T as ToggleCodeComponent, a1 as Tooltip, a2 as TraceLoader, a7 as VerticalScroll, a3 as WarningModal } from './index-
|
|
3
|
-
export { C as CancelWarning, D as DeleteWarning } from './index-
|
|
1
|
+
import { B as Button } from './index-0a99fd0b.js';
|
|
2
|
+
export { A as AutocompleteInput, a as Badge, a6 as CenterThis, C as Checkbox, b as Code, c as ConditionDetails, D as DataCard, e as DataCardFieldTypes, d as DataCardFields, f as DataFinger, g as DataTab, h as DescribeRow, i as Divider, j as DocsButton, k as Drawer, m as DrawerFooter, l as DrawerHeader, n as Dropdown, E as ExtendArrow, F as FadeLoader, o as FieldError, p as FieldLabel, a5 as FlexColumn, a4 as FlexRow, H as Header, I as IconButton, q as IconGroup, r as IconTitleBadge, s as IconWrapped, t as IconsNav, u as ImageControlled, v as Input, w as InputList, x as InputTable, y as InteractiveTable, K as KeyValueInputsList, M as Modal, a9 as ModalBody, z as MonitorsCheckboxes, G as MonitorsIcons, N as NavigationButtons, J as NoDataFound, L as NotificationNote, a8 as Overlay, P as Popup, O as PopupForm, S as ScrollX, Q as SectionTitle, R as Segment, U as SelectionButton, V as SkeletonLoader, W as Status, X as Stepper, Y as TabList, aa as TableContainer, ab as TableTitleWrap, ac as TableWrap, Z as Tag, _ as Text, $ as TextArea, a0 as Toggle, T as ToggleCodeComponent, a1 as Tooltip, a2 as TraceLoader, a7 as VerticalScroll, a3 as WarningModal } from './index-0a99fd0b.js';
|
|
3
|
+
export { C as CancelWarning, D as DeleteWarning } from './index-3a26952d.js';
|
|
4
4
|
import React, { createContext, Component, createElement } from 'react';
|
|
5
5
|
import { T as Theme } from './index-fdf3a268.js';
|
|
6
6
|
import 'styled-components';
|
package/lib/containers.js
CHANGED
|
@@ -2,14 +2,14 @@ import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle, us
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { b as DISPLAY_TITLES, T as Theme, U as usePendingStore, V as useNotificationStore, O as useDrawerStore, B as BUTTON_TEXTS, W as useEntityStore, A as ACTION_OPTIONS, g as getActionIcon, z as useModalStore, F as FORM_ALERTS, X as useFilterStore, D as DISPLAY_LANGUAGES, M as MONITORS_OPTIONS, d as getInstrumentationRuleIcon, Y as useDataStreamStore, Z as useInstrumentStore, c as getEntityId, S as STORAGE_KEYS, a as DEFAULT_DATA_STREAM_NAME, _ as useSetupStore, e as getProgrammingLanguageIcon, I as INSTRUMENTATION_RULE_OPTIONS, $ as useSelectedStore, j as ImageErrorIcon, a0 as useDarkMode } from './index-fdf3a268.js';
|
|
4
4
|
import { ActionType, ActionKeyTypes, InputTypes, FieldTypes, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, EdgeTypes, AddNodeTypes, SignalType, HeadersCollectionKeyTypes, CustomInstrumentationsKeyTypes, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType, K8sResourceKind, ProgrammingLanguages, MountMethod, AgentEnvVarsInjectionMethod, Profile, InstallationMethod } from './types.js';
|
|
5
|
-
import { e as DataCardFieldTypes, p as FieldLabel, C as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, _ as Text, R as Segment, Q as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, $ as TextArea, k as Drawer, c as ConditionDetails, D as DataCard, a5 as FlexColumn, M as Modal, N as NavigationButtons, a9 as ModalBody, L as NotificationNote, A as AutocompleteInput, i as Divider, W as Status, a4 as FlexRow, a1 as Tooltip, s as IconWrapped, G as MonitorsIcons, aa as TableContainer, ab as TableTitleWrap, r as IconTitleBadge, ac as TableWrap, y as InteractiveTable, a6 as CenterThis, J as NoDataFound, a2 as TraceLoader, a as Badge, E as ExtendArrow, a7 as VerticalScroll, U as SelectionButton, B as Button, n as Dropdown, ad as nodeConfig, ae as useNodesState, af as useEdgesState, ag as Flow, ah as applyNodeChanges, P as Popup, a0 as Toggle, I as IconButton, ai as AddButton, F as FadeLoader, g as DataTab, X as Stepper, d as DataCardFields, Z as Tag, aj as MarkerType, t as IconsNav, ak as CopyText, h as DescribeRow, al as PodContainer, am as SourceContainer, q as IconGroup, O as PopupForm } from './index-
|
|
5
|
+
import { e as DataCardFieldTypes, p as FieldLabel, C as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, _ as Text, R as Segment, Q as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, $ as TextArea, k as Drawer, c as ConditionDetails, D as DataCard, a5 as FlexColumn, M as Modal, N as NavigationButtons, a9 as ModalBody, L as NotificationNote, A as AutocompleteInput, i as Divider, W as Status, a4 as FlexRow, a1 as Tooltip, s as IconWrapped, G as MonitorsIcons, aa as TableContainer, ab as TableTitleWrap, r as IconTitleBadge, ac as TableWrap, y as InteractiveTable, a6 as CenterThis, J as NoDataFound, a2 as TraceLoader, a as Badge, E as ExtendArrow, a7 as VerticalScroll, U as SelectionButton, B as Button, n as Dropdown, ad as nodeConfig, ae as useNodesState, af as useEdgesState, ag as Flow, ah as applyNodeChanges, P as Popup, a0 as Toggle, I as IconButton, ai as AddButton, F as FadeLoader, g as DataTab, X as Stepper, d as DataCardFields, Z as Tag, aj as MarkerType, t as IconsNav, ak as CopyText, h as DescribeRow, al as PodContainer, am as SourceContainer, q as IconGroup, O as PopupForm } from './index-0a99fd0b.js';
|
|
6
6
|
import { i as isEmpty, s as safeJsonParse, d as deepClone } from './index-5e5f7bda.js';
|
|
7
7
|
import { C as CheckCircledIcon, O as OdigosLogo } from './index-1d5c06a0.js';
|
|
8
8
|
import { C as CrossCircledIcon, O as OdigosLogoText, a as OverviewIcon, F as FilterIcon, D as DataStreamsIcon, A as ArrowIcon, R as RefreshLeftArrowIcon, N as NotificationIcon, U as UserIcon, S as SlackLogo, K as KeyIcon, T as TerminalIcon, G as GearIcon } from './index-b5b322ad.js';
|
|
9
9
|
import { useActionFormData, useSessionStorage, useDataStreamFormData, useDestinationFormData, useClickNotification, useSourceFormData, useSourceSelectionFormData } from './hooks.js';
|
|
10
10
|
import { u as useKeyDown, a as useOnClickOutside, b as useContainerSize, c as useClickNode, d as usePopup, e as useInstrumentationRuleFormData, f as useTransition, g as useTimeAgo, h as useCopy, i as useGenericForm } from './useTransition-ba7b6d8a.js';
|
|
11
11
|
import { E as EditIcon, T as TrashIcon, S as SearchIcon, h as CheckIcon, P as PlusIcon, a as CopyIcon } from './index-ba84d272.js';
|
|
12
|
-
import { D as DeleteWarning, C as CancelWarning } from './index-
|
|
12
|
+
import { D as DeleteWarning, C as CancelWarning } from './index-3a26952d.js';
|
|
13
13
|
import { g as getConditionsBooleans, m as mapConditions, b as getStatusIcon, h as splitCamelString, c as capitalizeFirstLetter, i as isStringABoolean, p as parseBooleanFromString } from './index-0d93b2b4.js';
|
|
14
14
|
import { f as filterActions, l as getEntityLabel, k as getEntityIcon, v as sleep, n as getPlatformIcon, o as getPlatformLabel, g as formatBytes, i as getContainersIcons, p as getValueForRange, j as getDestinationIcon, e as filterSourcesByStream, d as filterSources, b as filterDestinationsByStream, a as filterDestinations, u as mapDestinationFieldsForDisplay, c as compareCondition, r as getYamlFieldsForDestination, m as getMetricForEntity, q as getWorkloadId, s as hasUnhealthyInstances, h as getContainersInstrumentedCount, t as isOverTime } from './index-c51fc6a4.js';
|
|
15
15
|
import { m as mapExportedSignals } from './index-6a6bea6e.js';
|
|
@@ -509,14 +509,14 @@ const Container$i = styled.div `
|
|
|
509
509
|
gap: 24px;
|
|
510
510
|
padding: 4px;
|
|
511
511
|
`;
|
|
512
|
-
const FieldTitle$
|
|
512
|
+
const FieldTitle$2 = styled(Text) `
|
|
513
513
|
margin-bottom: 12px;
|
|
514
514
|
`;
|
|
515
515
|
const ActionForm = ({ isUpdate, action, formData, formErrors, handleFormChange }) => {
|
|
516
516
|
const theme = Theme.useTheme();
|
|
517
517
|
return (React.createElement(Container$i, null,
|
|
518
518
|
isUpdate && (React.createElement("div", null,
|
|
519
|
-
React.createElement(FieldTitle$
|
|
519
|
+
React.createElement(FieldTitle$2, null, "Status"),
|
|
520
520
|
React.createElement(Segment, { options: [
|
|
521
521
|
{ icon: CheckCircledIcon, label: 'active', value: false, selectedBgColor: theme.text.success + Theme.opacity.hex['050'] },
|
|
522
522
|
{ icon: CrossCircledIcon, label: 'inactive', value: true, selectedBgColor: theme.text.error + Theme.opacity.hex['050'] },
|
|
@@ -1707,6 +1707,7 @@ const mapToNodeData$1 = (entity) => {
|
|
|
1707
1707
|
icon,
|
|
1708
1708
|
iconSrc,
|
|
1709
1709
|
monitors: mapExportedSignals(entity.exportedSignals),
|
|
1710
|
+
isActive: !entity.disabled,
|
|
1710
1711
|
raw: entity,
|
|
1711
1712
|
};
|
|
1712
1713
|
};
|
|
@@ -2398,8 +2399,12 @@ const NotesWrapper = styled.div `
|
|
|
2398
2399
|
const SignalsAndDocsWrapper = styled(FlexRow) `
|
|
2399
2400
|
justify-content: space-between;
|
|
2400
2401
|
`;
|
|
2402
|
+
const FieldTitle$1 = styled(Text) `
|
|
2403
|
+
margin-bottom: 12px;
|
|
2404
|
+
`;
|
|
2401
2405
|
const DestinationForm = ({ isUpdate, categoryItem, formData, formErrors, validateForm, handleFormChange, dynamicFields, setDynamicFields, testConnection }) => {
|
|
2402
2406
|
const { type, displayName, supportedSignals, testConnectionSupported } = categoryItem || {};
|
|
2407
|
+
const theme = Theme.useTheme();
|
|
2403
2408
|
const [autoFilled, setAutoFilled] = useState(false);
|
|
2404
2409
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
2405
2410
|
const [connection, setConnection] = useState(undefined);
|
|
@@ -2484,6 +2489,12 @@ const DestinationForm = ({ isUpdate, categoryItem, formData, formErrors, validat
|
|
|
2484
2489
|
React.createElement(SignalsAndDocsWrapper, null,
|
|
2485
2490
|
React.createElement(MonitorsCheckboxes, { title: isUpdate ? '' : 'This connection will monitor:', required: true, allowedSignals: supportedMonitors, selectedSignals: selectedMonitors, setSelectedSignals: handleSelectedSignals, errorMessage: formErrors['exportedSignals'] }),
|
|
2486
2491
|
!isUpdate && React.createElement(DocsButton, { endpoint: `/backends/${type}` })),
|
|
2492
|
+
isUpdate && (React.createElement("div", null,
|
|
2493
|
+
React.createElement(FieldTitle$1, null, "Status"),
|
|
2494
|
+
React.createElement(Segment, { options: [
|
|
2495
|
+
{ icon: CheckCircledIcon, label: 'active', value: false, selectedBgColor: theme.text.success + Theme.opacity.hex['050'] },
|
|
2496
|
+
{ icon: CrossCircledIcon, label: 'inactive', value: true, selectedBgColor: theme.text.error + Theme.opacity.hex['050'] },
|
|
2497
|
+
], selected: formData.disabled, setSelected: (bool) => handleFormChange('disabled', bool) }))),
|
|
2487
2498
|
!isUpdate && (React.createElement(Input, { title: 'Destination name', placeholder: 'Enter destination name', value: formData['name'], onChange: (e) => {
|
|
2488
2499
|
dirtyForm();
|
|
2489
2500
|
handleFormChange('name', e.target.value);
|
|
@@ -2745,6 +2756,7 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
|
|
|
2745
2756
|
return {
|
|
2746
2757
|
id: alreadyConfigDest?.id || '',
|
|
2747
2758
|
name: alreadyConfigDest?.name || formData.name,
|
|
2759
|
+
disabled: alreadyConfigDest?.disabled || formData.disabled,
|
|
2748
2760
|
dataStreamNames: alreadyConfigDest?.dataStreamNames || [],
|
|
2749
2761
|
conditions: alreadyConfigDest?.conditions || [],
|
|
2750
2762
|
exportedSignals: alreadyConfigDest?.exportedSignals || formData.exportedSignals,
|
|
@@ -4032,7 +4044,7 @@ const NotSourcesWrapper = styled(CenterThis) `
|
|
|
4032
4044
|
const SelectionCount = styled(Text) `
|
|
4033
4045
|
width: 18px;
|
|
4034
4046
|
`;
|
|
4035
|
-
const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesAndSources, selectedNamespace, onSelectNamespace, selectedSources, onSelectSource, selectedFutureApps, onSelectFutureApps, }) => {
|
|
4047
|
+
const SourceList = ({ isModal = false, withInstances = true, isFetchingEachNamespace, fetchedNamespaces, filteredNamespacesAndSources, selectedNamespace, onSelectNamespace, selectedSources, onSelectSource, selectedFutureApps, onSelectFutureApps, }) => {
|
|
4036
4048
|
const theme = Theme.useTheme();
|
|
4037
4049
|
const { namespacesLoading } = useEntityStore();
|
|
4038
4050
|
const matrix = Object.entries(filteredNamespacesAndSources || {});
|
|
@@ -4040,39 +4052,41 @@ const SourceList = ({ isModal = false, withInstances = true, filteredNamespacesA
|
|
|
4040
4052
|
return (React.createElement(CenterThis, null, namespacesLoading ? (React.createElement(FadeLoader, null)) : (React.createElement(NoDataFound, { title: DISPLAY_TITLES.NO_SOURCES, subTitle: onSelectNamespace ? DISPLAY_TITLES.PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES : DISPLAY_TITLES.PLEASE_ADD_SOURCE }))));
|
|
4041
4053
|
}
|
|
4042
4054
|
const NamespaceIcon = getEntityIcon(EntityTypes.Namespace);
|
|
4043
|
-
return (React.createElement(Container$4, { "$isModal": isModal },
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
React.createElement(
|
|
4057
|
-
React.createElement(
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
React.createElement(
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
(
|
|
4069
|
-
React.createElement(
|
|
4070
|
-
React.createElement(
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4055
|
+
return (React.createElement(Container$4, { "$isModal": isModal },
|
|
4056
|
+
matrix.map(([namespace, sources]) => {
|
|
4057
|
+
const sourcesForNamespace = selectedSources?.[namespace] || [];
|
|
4058
|
+
const futureAppsForNamespace = selectedFutureApps?.[namespace]?.selected || false;
|
|
4059
|
+
const onlySelectedSources = sourcesForNamespace.filter(({ selected }) => selected);
|
|
4060
|
+
const isNamespaceLoaded = sourcesForNamespace.length > 0;
|
|
4061
|
+
const isNamespaceSelected = selectedNamespace === namespace;
|
|
4062
|
+
const isNamespaceAllSourcesSelected = onlySelectedSources.length > 0 && onlySelectedSources.length === sources.length;
|
|
4063
|
+
const isNamespacePartiallySourcesSelected = onlySelectedSources.length > 0 && onlySelectedSources.length !== sources.length;
|
|
4064
|
+
const hasSources = sources.length > 0;
|
|
4065
|
+
const onlyOneSource = sources.length === 1;
|
|
4066
|
+
if (!onSelectNamespace && !hasSources)
|
|
4067
|
+
return null;
|
|
4068
|
+
return (React.createElement(Group, { key: `namespace-${namespace}`, "data-id": `namespace-${namespace}`, "$selected": isNamespaceAllSourcesSelected, "$isOpen": isNamespaceSelected },
|
|
4069
|
+
React.createElement(NamespaceItem, { "$selected": isNamespaceAllSourcesSelected, "$withClick": !!onSelectNamespace, onClick: () => onSelectNamespace?.(namespace) },
|
|
4070
|
+
React.createElement(FlexRow, { "$gap": 12 },
|
|
4071
|
+
onSelectNamespace && React.createElement(Checkbox, { partiallyChecked: isNamespacePartiallySourcesSelected, value: isNamespaceAllSourcesSelected, onChange: (bool) => onSelectNamespace(namespace, bool) }),
|
|
4072
|
+
React.createElement(NamespaceIcon, null),
|
|
4073
|
+
React.createElement(Text, null, namespace)),
|
|
4074
|
+
React.createElement(FlexRow, { "$gap": 12 },
|
|
4075
|
+
onSelectFutureApps && (React.createElement(React.Fragment, null,
|
|
4076
|
+
React.createElement(Toggle, { title: DISPLAY_TITLES.FUTURE_APPS_TITLE, tooltip: DISPLAY_TITLES.FUTURE_APPS_DESCRIPTION, initialValue: futureAppsForNamespace, onChange: (bool) => onSelectFutureApps(bool, namespace), flipHorizontally: true }),
|
|
4077
|
+
React.createElement(Divider, { orientation: 'vertical', length: '12px', margin: '0' }))),
|
|
4078
|
+
isFetchingEachNamespace && !fetchedNamespaces?.includes(namespace) ? (React.createElement(FadeLoader, { scale: 0.8 })) : (React.createElement(SelectionCount, { size: 10, color: theme.text.grey }, isNamespaceLoaded ? `${onlySelectedSources.length}/${sources.length}` : null)),
|
|
4079
|
+
onSelectNamespace && React.createElement(ExtendArrow, { extend: isNamespaceSelected }))),
|
|
4080
|
+
(isNamespaceSelected || !onSelectNamespace) &&
|
|
4081
|
+
(hasSources ? (React.createElement(RelativeWrapper, { "$addPadding": !onSelectSource },
|
|
4082
|
+
React.createElement(AbsoluteWrapper, null,
|
|
4083
|
+
React.createElement(Divider, { orientation: 'vertical', length: `${onlyOneSource ? 24 : sources.length * 34}px` })),
|
|
4084
|
+
sources.map((source) => {
|
|
4085
|
+
const isSourceSelected = onlySelectedSources.some(({ name }) => name === source.name);
|
|
4086
|
+
return React.createElement(SourceRow, { key: `source-${source.name}`, withInstances: withInstances, source: source, namespace: namespace, isSelected: isSourceSelected, onSelect: onSelectSource });
|
|
4087
|
+
}))) : (React.createElement(NotSourcesWrapper, { "$addPadding": !onSelectSource }, namespacesLoading || (isFetchingEachNamespace && !fetchedNamespaces?.includes(namespace)) ? (React.createElement(FadeLoader, null)) : (React.createElement(NoDataFound, { title: DISPLAY_TITLES.NO_SOURCES_NAMESPACE, subTitle: DISPLAY_TITLES.TRY_SEARCH_OR_OTHER_NAMESPACE })))))));
|
|
4088
|
+
}),
|
|
4089
|
+
isFetchingEachNamespace && React.createElement(FadeLoader, { scale: 1.2 })));
|
|
4076
4090
|
};
|
|
4077
4091
|
const SourceRow = ({ withInstances, source, namespace, isSelected, onSelect, }) => {
|
|
4078
4092
|
return (React.createElement(SourceItem, { "data-id": `source-${source.name}`, "$selected": isSelected, "$withClick": !!onSelect, onClick: () => onSelect?.(source) },
|
|
@@ -12,7 +12,7 @@ export declare const useDestinationFormData: (params?: Params) => {
|
|
|
12
12
|
withAlert?: boolean;
|
|
13
13
|
alertTitle?: string;
|
|
14
14
|
}) => boolean;
|
|
15
|
-
loadFormWithDrawerItem: ({ destinationType: { type }, name, exportedSignals, fields }: Destination) => DestinationFormData;
|
|
15
|
+
loadFormWithDrawerItem: ({ destinationType: { type }, name, disabled, exportedSignals, fields }: Destination) => DestinationFormData;
|
|
16
16
|
yamlFields: DestinationYamlProperties[];
|
|
17
17
|
setYamlFields: import("react").Dispatch<import("react").SetStateAction<DestinationYamlProperties[]>>;
|
|
18
18
|
dynamicFields: DestinationDynamicField[];
|
|
@@ -6,6 +6,8 @@ interface UseSourceFormDataParams {
|
|
|
6
6
|
fetchSingleNamespace: FetchSingleNamespace;
|
|
7
7
|
}
|
|
8
8
|
export interface UseSourceSelectionFormData {
|
|
9
|
+
isFetchingEachNamespace: boolean;
|
|
10
|
+
fetchedNamespaces: string[];
|
|
9
11
|
availableSources: AvailableSourcesByNamespace;
|
|
10
12
|
filteredNamespacesAndSources: AvailableSourcesByNamespace;
|
|
11
13
|
getApiSourcesPayload: () => SourceSelectionFormData;
|
package/lib/hooks.js
CHANGED
|
@@ -243,6 +243,7 @@ const INITIAL$1 = {
|
|
|
243
243
|
traces: false,
|
|
244
244
|
},
|
|
245
245
|
fields: [],
|
|
246
|
+
disabled: false,
|
|
246
247
|
};
|
|
247
248
|
const buildFormDynamicFields = (fields) => {
|
|
248
249
|
return fields
|
|
@@ -347,11 +348,12 @@ const useDestinationFormData = (params) => {
|
|
|
347
348
|
handleErrorChange(undefined, undefined, errors);
|
|
348
349
|
return ok;
|
|
349
350
|
};
|
|
350
|
-
const loadFormWithDrawerItem = ({ destinationType: { type }, name, exportedSignals, fields }) => {
|
|
351
|
+
const loadFormWithDrawerItem = ({ destinationType: { type }, name, disabled, exportedSignals, fields }) => {
|
|
351
352
|
const updatedData = {
|
|
352
353
|
...INITIAL$1,
|
|
353
354
|
type,
|
|
354
355
|
name,
|
|
356
|
+
disabled,
|
|
355
357
|
exportedSignals,
|
|
356
358
|
fields: Object.entries(safeJsonParse(fields, {})).map(([key, value]) => ({ key, value })),
|
|
357
359
|
};
|
|
@@ -470,6 +472,8 @@ const useSourceSelectionFormData = (params) => {
|
|
|
470
472
|
const { configuredSources, configuredFutureApps, availableSources: availableSourcesFromStore } = useSetupStore();
|
|
471
473
|
// Keeps intial values fetched from API, so we can later filter the user-specific-selections, therebey minimizing the amount of data sent to the API on "persist sources".
|
|
472
474
|
const [availableSources, setRecordedInitialSources] = useState(availableSourcesFromStore);
|
|
475
|
+
const [isFetchingEachNamespace, setIsFetchingEachNamespace] = useState(false);
|
|
476
|
+
const [fetchedNamespaces, setFetchedNamespaces] = useState([]);
|
|
473
477
|
const [selectedNamespace, setSelectedNamespace] = useState('');
|
|
474
478
|
const [selectedFutureApps, setSelectedFutureApps] = useState(configuredFutureApps);
|
|
475
479
|
const [selectedSources, setSelectedSources] = useState(mergeAvailableAndSelectedSources(availableSourcesFromStore, configuredSources, selectedStreamName));
|
|
@@ -479,6 +483,7 @@ const useSourceSelectionFormData = (params) => {
|
|
|
479
483
|
const { name, sources = [] } = data?.computePlatform?.k8sActualNamespace || {};
|
|
480
484
|
if (!name)
|
|
481
485
|
return;
|
|
486
|
+
setFetchedNamespaces((prev) => [...prev, name]);
|
|
482
487
|
setRecordedInitialSources((prev) => ({
|
|
483
488
|
...prev,
|
|
484
489
|
[name]: sources.map((s) => mapToAvailableSource(s, selectedStreamName)),
|
|
@@ -508,8 +513,10 @@ const useSourceSelectionFormData = (params) => {
|
|
|
508
513
|
return payload;
|
|
509
514
|
});
|
|
510
515
|
(async () => {
|
|
516
|
+
setIsFetchingEachNamespace(true);
|
|
511
517
|
for await (const ns of namespaces)
|
|
512
518
|
await fetchAndSetThisNamespace(ns);
|
|
519
|
+
setIsFetchingEachNamespace(false);
|
|
513
520
|
})();
|
|
514
521
|
}
|
|
515
522
|
}, [namespaces, selectedStreamName]);
|
|
@@ -589,6 +596,8 @@ const useSourceSelectionFormData = (params) => {
|
|
|
589
596
|
return payload;
|
|
590
597
|
};
|
|
591
598
|
return {
|
|
599
|
+
isFetchingEachNamespace,
|
|
600
|
+
fetchedNamespaces,
|
|
592
601
|
availableSources,
|
|
593
602
|
filteredNamespacesAndSources,
|
|
594
603
|
getApiSourcesPayload,
|
|
@@ -16522,7 +16522,7 @@ const BaseNode = memo(({ id: nodeId, data }) => {
|
|
|
16522
16522
|
const isPending = isThisPending({ entityType, entityId });
|
|
16523
16523
|
const renderActions = () => {
|
|
16524
16524
|
const StatusIcon = hasActiveBoolean ? getStatusIcon(isActive ? StatusType.Success : StatusType.Info, theme) : status && getStatusIcon(status, theme);
|
|
16525
|
-
const statusTooltipText = hasActiveBoolean ? `${entityType} is ${isActive ? '
|
|
16525
|
+
const statusTooltipText = hasActiveBoolean ? `${entityType} is ${isActive ? 'enabled' : 'disabled'}` : undefined;
|
|
16526
16526
|
const sourceIsInstrumenting = isSource && (!raw.conditions?.length || raw.conditions?.some(({ status }) => status === 'loading'));
|
|
16527
16527
|
// TODO: handle action/icon to apply instrumentation-rules for individual sources (@Notion GEN-1650)
|
|
16528
16528
|
return isPending ? (React.createElement(FadeLoader, null)) : StatusIcon ? (React.createElement(Tooltip, { text: statusTooltipText },
|
package/lib/snippets.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as Button, _ as Text, L as NotificationNote } from './index-
|
|
2
|
-
export { ai as AddButton, an as AddNode, ao as BaseNode, ak as CopyText, ap as EdgedNode, ag as Flow, aq as FrameNode, ar as HeaderNode, aw as LabeledEdge, as as MapItemNode, at as NoDataNode, al as PodContainer, au as ScrollNode, av as SkeletonNode, am as SourceContainer, ad as nodeConfig } from './index-
|
|
1
|
+
import { B as Button, _ as Text, L as NotificationNote } from './index-0a99fd0b.js';
|
|
2
|
+
export { ai as AddButton, an as AddNode, ao as BaseNode, ak as CopyText, ap as EdgedNode, ag as Flow, aq as FrameNode, ar as HeaderNode, aw as LabeledEdge, as as MapItemNode, at as NoDataNode, al as PodContainer, au as ScrollNode, av as SkeletonNode, am as SourceContainer, ad as nodeConfig } from './index-0a99fd0b.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { T as Theme, B as BUTTON_TEXTS, b as DISPLAY_TITLES } from './index-fdf3a268.js';
|
|
5
5
|
import { E as EditIcon } from './index-ba84d272.js';
|
|
@@ -70,6 +70,7 @@ export declare enum DestinationTypes {
|
|
|
70
70
|
export interface Destination {
|
|
71
71
|
id: string;
|
|
72
72
|
name: string;
|
|
73
|
+
disabled: boolean;
|
|
73
74
|
dataStreamNames: string[];
|
|
74
75
|
exportedSignals: {
|
|
75
76
|
traces: boolean;
|
|
@@ -134,6 +135,7 @@ export interface DestinationFormData {
|
|
|
134
135
|
key: string;
|
|
135
136
|
value: string;
|
|
136
137
|
}[];
|
|
138
|
+
disabled: Destination['disabled'];
|
|
137
139
|
}
|
|
138
140
|
export interface DestinationDynamicField {
|
|
139
141
|
name: DestinationYamlProperties['name'];
|