@odigos/ui-kit 0.0.75 → 0.0.77
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 +14 -0
- package/lib/containers.js +41 -20
- package/lib/hooks/useDestinationFormData.d.ts +1 -1
- package/lib/hooks.js +3 -1
- package/lib/types/destinations/index.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.77](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.76...ui-kit-v0.0.77) (2025-08-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* 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))
|
|
9
|
+
|
|
10
|
+
## [0.0.76](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.75...ui-kit-v0.0.76) (2025-08-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* limit source-drawer tabs ([#296](https://github.com/odigos-io/ui-kit/issues/296)) ([7526675](https://github.com/odigos-io/ui-kit/commit/7526675c8de778ecc7e98a3881e9cd185b988077))
|
|
16
|
+
|
|
3
17
|
## [0.0.75](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.74...ui-kit-v0.0.75) (2025-08-06)
|
|
4
18
|
|
|
5
19
|
|
package/lib/containers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, Fragment, useCallback, Children } from 'react';
|
|
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
|
-
import { ActionType, ActionKeyTypes, InputTypes, FieldTypes, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, EdgeTypes, AddNodeTypes, SignalType, HeadersCollectionKeyTypes, CustomInstrumentationsKeyTypes, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType, MountMethod, AgentEnvVarsInjectionMethod, Profile, InstallationMethod } from './types.js';
|
|
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
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-a1b59a38.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';
|
|
@@ -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'] },
|
|
@@ -2398,8 +2398,12 @@ const NotesWrapper = styled.div `
|
|
|
2398
2398
|
const SignalsAndDocsWrapper = styled(FlexRow) `
|
|
2399
2399
|
justify-content: space-between;
|
|
2400
2400
|
`;
|
|
2401
|
+
const FieldTitle$1 = styled(Text) `
|
|
2402
|
+
margin-bottom: 12px;
|
|
2403
|
+
`;
|
|
2401
2404
|
const DestinationForm = ({ isUpdate, categoryItem, formData, formErrors, validateForm, handleFormChange, dynamicFields, setDynamicFields, testConnection }) => {
|
|
2402
2405
|
const { type, displayName, supportedSignals, testConnectionSupported } = categoryItem || {};
|
|
2406
|
+
const theme = Theme.useTheme();
|
|
2403
2407
|
const [autoFilled, setAutoFilled] = useState(false);
|
|
2404
2408
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
2405
2409
|
const [connection, setConnection] = useState(undefined);
|
|
@@ -2484,6 +2488,12 @@ const DestinationForm = ({ isUpdate, categoryItem, formData, formErrors, validat
|
|
|
2484
2488
|
React.createElement(SignalsAndDocsWrapper, null,
|
|
2485
2489
|
React.createElement(MonitorsCheckboxes, { title: isUpdate ? '' : 'This connection will monitor:', required: true, allowedSignals: supportedMonitors, selectedSignals: selectedMonitors, setSelectedSignals: handleSelectedSignals, errorMessage: formErrors['exportedSignals'] }),
|
|
2486
2490
|
!isUpdate && React.createElement(DocsButton, { endpoint: `/backends/${type}` })),
|
|
2491
|
+
isUpdate && (React.createElement("div", null,
|
|
2492
|
+
React.createElement(FieldTitle$1, null, "Status"),
|
|
2493
|
+
React.createElement(Segment, { options: [
|
|
2494
|
+
{ icon: CheckCircledIcon, label: 'active', value: false, selectedBgColor: theme.text.success + Theme.opacity.hex['050'] },
|
|
2495
|
+
{ icon: CrossCircledIcon, label: 'inactive', value: true, selectedBgColor: theme.text.error + Theme.opacity.hex['050'] },
|
|
2496
|
+
], selected: formData.disabled, setSelected: (bool) => handleFormChange('disabled', bool) }))),
|
|
2487
2497
|
!isUpdate && (React.createElement(Input, { title: 'Destination name', placeholder: 'Enter destination name', value: formData['name'], onChange: (e) => {
|
|
2488
2498
|
dirtyForm();
|
|
2489
2499
|
handleFormChange('name', e.target.value);
|
|
@@ -2745,6 +2755,7 @@ const DestinationModal = ({ isOnboarding, categories, potentialDestinations, cre
|
|
|
2745
2755
|
return {
|
|
2746
2756
|
id: alreadyConfigDest?.id || '',
|
|
2747
2757
|
name: alreadyConfigDest?.name || formData.name,
|
|
2758
|
+
disabled: alreadyConfigDest?.disabled || formData.disabled,
|
|
2748
2759
|
dataStreamNames: alreadyConfigDest?.dataStreamNames || [],
|
|
2749
2760
|
conditions: alreadyConfigDest?.conditions || [],
|
|
2750
2761
|
exportedSignals: alreadyConfigDest?.exportedSignals || formData.exportedSignals,
|
|
@@ -4339,6 +4350,8 @@ var Tabs;
|
|
|
4339
4350
|
Tabs["Pods"] = "Pods";
|
|
4340
4351
|
Tabs["Libraries"] = "Libraries";
|
|
4341
4352
|
})(Tabs || (Tabs = {}));
|
|
4353
|
+
const SUPPORTED_KINDS_FOR_DESCRIBE = [K8sResourceKind.Deployment, K8sResourceKind.StatefulSet, K8sResourceKind.DaemonSet];
|
|
4354
|
+
const SUPPORTED_LANGUAGES_FOR_LIBRARIES = [ProgrammingLanguages.Python];
|
|
4342
4355
|
const FormContainer = styled.div `
|
|
4343
4356
|
width: 100%;
|
|
4344
4357
|
height: 100%;
|
|
@@ -4386,6 +4399,30 @@ const SourceDrawer = ({ persistSources, updateSource, restartWorkloads, fetchSou
|
|
|
4386
4399
|
containers: thisItem?.containers || [],
|
|
4387
4400
|
};
|
|
4388
4401
|
}, [thisItem]);
|
|
4402
|
+
const tabs = useMemo(() => {
|
|
4403
|
+
const arr = [
|
|
4404
|
+
{
|
|
4405
|
+
label: Tabs.Overview,
|
|
4406
|
+
onClick: () => setSelectedTab(Tabs.Overview),
|
|
4407
|
+
selected: selectedTab === Tabs.Overview,
|
|
4408
|
+
},
|
|
4409
|
+
];
|
|
4410
|
+
if (SUPPORTED_KINDS_FOR_DESCRIBE.includes(thisItem?.kind)) {
|
|
4411
|
+
arr.push({
|
|
4412
|
+
label: Tabs.Pods,
|
|
4413
|
+
onClick: () => setSelectedTab(Tabs.Pods),
|
|
4414
|
+
selected: selectedTab === Tabs.Pods,
|
|
4415
|
+
});
|
|
4416
|
+
}
|
|
4417
|
+
if (thisItem?.containers?.some(({ language }) => SUPPORTED_LANGUAGES_FOR_LIBRARIES.includes(language))) {
|
|
4418
|
+
arr.push({
|
|
4419
|
+
label: Tabs.Libraries,
|
|
4420
|
+
onClick: () => setSelectedTab(Tabs.Libraries),
|
|
4421
|
+
selected: selectedTab === Tabs.Libraries,
|
|
4422
|
+
});
|
|
4423
|
+
}
|
|
4424
|
+
return arr;
|
|
4425
|
+
}, [selectedTab, thisItem]);
|
|
4389
4426
|
if (!thisItem)
|
|
4390
4427
|
return null;
|
|
4391
4428
|
const handleEdit = (bool) => {
|
|
@@ -4412,23 +4449,7 @@ const SourceDrawer = ({ persistSources, updateSource, restartWorkloads, fetchSou
|
|
|
4412
4449
|
setIsFormDirty(false);
|
|
4413
4450
|
setIsEditing(false);
|
|
4414
4451
|
};
|
|
4415
|
-
return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.otelServiceName || thisItem.name, titleTooltip: 'This attribute is used to identify the name of the service (service.name) that is generating telemetry data.', hideEditTitleFromEdit: true, icons: getContainersIcons(thisItem.containers), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: selectedTab === Tabs.Overview ? handleEdit : undefined, onSave: handleSave, onDelete: selectedTab === Tabs.Overview ? handleDelete : undefined, onCancel: handleCancel, isLastItem: sourcesByStream.length === 1, tabs: [
|
|
4416
|
-
{
|
|
4417
|
-
label: Tabs.Overview,
|
|
4418
|
-
onClick: () => setSelectedTab(Tabs.Overview),
|
|
4419
|
-
selected: selectedTab === Tabs.Overview,
|
|
4420
|
-
},
|
|
4421
|
-
{
|
|
4422
|
-
label: Tabs.Pods,
|
|
4423
|
-
onClick: () => setSelectedTab(Tabs.Pods),
|
|
4424
|
-
selected: selectedTab === Tabs.Pods,
|
|
4425
|
-
},
|
|
4426
|
-
{
|
|
4427
|
-
label: Tabs.Libraries,
|
|
4428
|
-
onClick: () => setSelectedTab(Tabs.Libraries),
|
|
4429
|
-
selected: selectedTab === Tabs.Libraries,
|
|
4430
|
-
},
|
|
4431
|
-
], headerActionButtons: [
|
|
4452
|
+
return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.otelServiceName || thisItem.name, titleTooltip: 'This attribute is used to identify the name of the service (service.name) that is generating telemetry data.', hideEditTitleFromEdit: true, icons: getContainersIcons(thisItem.containers), isEdit: isEditing, isFormDirty: isFormDirty, onEdit: selectedTab === Tabs.Overview ? handleEdit : undefined, onSave: handleSave, onDelete: selectedTab === Tabs.Overview ? handleDelete : undefined, onCancel: handleCancel, isLastItem: sourcesByStream.length === 1, tabs: tabs, headerActionButtons: [
|
|
4432
4453
|
{
|
|
4433
4454
|
'data-id': 'rollout-restart',
|
|
4434
4455
|
variant: 'tertiary',
|
|
@@ -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[];
|
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
|
};
|
|
@@ -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'];
|