@odigos/ui-kit 0.0.14 → 0.0.15
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 +7 -0
- package/lib/components/data-tab/data-tab.stories.d.ts +8 -2
- package/lib/components/data-tab/index.d.ts +3 -1
- package/lib/components.js +2 -2
- package/lib/containers/data-flow-actions-menu/filters/index.d.ts +0 -2
- package/lib/containers/data-flow-actions-menu/styled.d.ts +3 -1
- 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.js +64 -60
- package/lib/{index-B5wdZoej.js → index-zMKRaKMY.js} +46 -22
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.15](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.14...ui-kit-v0.0.15) (2025-03-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* :bug: react minified 310 error ([#40](https://github.com/odigos-io/ui-kit/issues/40)) ([eb1fa39](https://github.com/odigos-io/ui-kit/commit/eb1fa399a9244f95223b307fc0a2506845283043))
|
|
9
|
+
|
|
3
10
|
## [0.0.14](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.13...ui-kit-v0.0.14) (2025-03-20)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type DataTabProps } from '.';
|
|
3
|
-
import type {
|
|
3
|
+
import type { StoryObj } from '@storybook/react';
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
6
|
component: React.FC<DataTabProps>;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const NoStatus: StoryObj<DataTabProps>;
|
|
10
|
+
export declare const ForcedBgColor: StoryObj<DataTabProps>;
|
|
11
|
+
export declare const InfoStatus: StoryObj<DataTabProps>;
|
|
12
|
+
export declare const DefaultStatus: StoryObj<DataTabProps>;
|
|
13
|
+
export declare const ErrorStatus: StoryObj<DataTabProps>;
|
|
14
|
+
export declare const WarningStatus: StoryObj<DataTabProps>;
|
|
15
|
+
export declare const SuccessStatus: StoryObj<DataTabProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FC, type ReactNode } from 'react';
|
|
1
|
+
import { type CSSProperties, type FC, type ReactNode } from 'react';
|
|
2
2
|
import type { SVG } from '@/types';
|
|
3
3
|
import { StatusType, SignalType } from '@/types';
|
|
4
4
|
interface DataTabProps {
|
|
@@ -11,6 +11,8 @@ interface DataTabProps {
|
|
|
11
11
|
hoverText?: string;
|
|
12
12
|
status?: StatusType;
|
|
13
13
|
faded?: boolean;
|
|
14
|
+
bgColor?: CSSProperties['backgroundColor'];
|
|
15
|
+
bgColorHover?: CSSProperties['backgroundColor'];
|
|
14
16
|
monitors?: SignalType[];
|
|
15
17
|
monitorsWithLabels?: boolean;
|
|
16
18
|
isActive?: boolean;
|
package/lib/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as Button } from './index-
|
|
2
|
-
export { A as AutocompleteInput, a as Badge, C as CancelWarning, a0 as CenterThis, b as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as DeleteWarning, 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, $ as FlexColumn, _ 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, a2 as ModalBody, z as MonitorsCheckboxes, G as MonitorsIcons, N as NavigationButtons, J as NoDataFound, L as NotificationNote, a1 as Overlay, S as SectionTitle, O as Segment, P as SkeletonLoader, Q as Status, R as Stepper, a3 as TableContainer, a4 as TableTitleWrap, a5 as TableWrap, U as Text, V as TextArea, W as Toggle, T as ToggleCodeComponent, X as Tooltip, Y as TraceLoader, Z as WarningModal } from './index-
|
|
1
|
+
import { B as Button } from './index-zMKRaKMY.js';
|
|
2
|
+
export { A as AutocompleteInput, a as Badge, C as CancelWarning, a0 as CenterThis, b as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as DeleteWarning, 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, $ as FlexColumn, _ 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, a2 as ModalBody, z as MonitorsCheckboxes, G as MonitorsIcons, N as NavigationButtons, J as NoDataFound, L as NotificationNote, a1 as Overlay, S as SectionTitle, O as Segment, P as SkeletonLoader, Q as Status, R as Stepper, a3 as TableContainer, a4 as TableTitleWrap, a5 as TableWrap, U as Text, V as TextArea, W as Toggle, T as ToggleCodeComponent, X as Tooltip, Y as TraceLoader, Z as WarningModal } from './index-zMKRaKMY.js';
|
|
3
3
|
import React, { Component, createElement, createContext } from 'react';
|
|
4
4
|
import Theme from './theme.js';
|
|
5
5
|
import './types.js';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const RelativeContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
-
export declare const AbsoluteContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
2
|
+
export declare const AbsoluteContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$hidden?: boolean;
|
|
4
|
+
}>> & string;
|
|
@@ -16,5 +16,8 @@ interface OverviewDrawerProps extends PropsWithChildren {
|
|
|
16
16
|
onCancel?: () => void;
|
|
17
17
|
tabs?: DrawerProps['header']['tabs'];
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
interface OverviewDrawerRef {
|
|
20
|
+
closeDrawer: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare const OverviewDrawer: React.ForwardRefExoticComponent<OverviewDrawerProps & React.RefAttributes<OverviewDrawerRef>>;
|
|
23
|
+
export { OverviewDrawer, type OverviewDrawerProps, type OverviewDrawerRef };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StoryFn } from '@storybook/react';
|
|
3
|
-
import { type OverviewDrawerProps } from '.';
|
|
3
|
+
import { type OverviewDrawerRef, type OverviewDrawerProps } from '.';
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: React.
|
|
6
|
+
component: React.ForwardRefExoticComponent<OverviewDrawerProps & React.RefAttributes<OverviewDrawerRef>>;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
9
9
|
export declare const Default: StoryFn<OverviewDrawerProps>;
|
package/lib/containers.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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
3
|
import { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-CJKFedQi.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-
|
|
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-zMKRaKMY.js';
|
|
7
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, k as getEntityId, i as useSetupStore, u as useDarkMode } from './index-DYEcdkUF.js';
|
|
8
8
|
import Theme from './theme.js';
|
|
9
9
|
import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
|
|
@@ -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);
|
|
@@ -657,7 +656,7 @@ const ConditionsStatuses = ({ conditions }) => {
|
|
|
657
656
|
if (status === 'loading' || status === 'disabled')
|
|
658
657
|
status = StatusType.Info;
|
|
659
658
|
const icon = getStatusIcon(status, theme);
|
|
660
|
-
return (React.createElement(Tooltip, { key:
|
|
659
|
+
return (React.createElement(Tooltip, { key: crypto.randomUUID(), titleIcon: icon, title: type, text: message || reason || '', timestamp: lastTransitionTime },
|
|
661
660
|
React.createElement(Status, { status: status, title: reason || type, withBorder: true, withIcon: true })));
|
|
662
661
|
})));
|
|
663
662
|
};
|
|
@@ -13545,6 +13544,7 @@ const AbsoluteContainer$1 = styled.div `
|
|
|
13545
13544
|
border: ${({ theme }) => `1px solid ${theme.colors.border}`};
|
|
13546
13545
|
border-radius: 24px;
|
|
13547
13546
|
width: 420px;
|
|
13547
|
+
display: ${({ $hidden }) => ($hidden ? 'none' : 'block')};
|
|
13548
13548
|
`;
|
|
13549
13549
|
|
|
13550
13550
|
const buildSearchResults = ({ instrumentationRules, sources, actions, destinations, searchText, selectedCategory }) => {
|
|
@@ -13675,6 +13675,13 @@ const Actions = styled.div `
|
|
|
13675
13675
|
padding: 12px;
|
|
13676
13676
|
border-top: ${({ theme }) => `1px solid ${theme.colors.border}`};
|
|
13677
13677
|
`;
|
|
13678
|
+
const ActionButton$1 = styled(Button) `
|
|
13679
|
+
font-size: 14px;
|
|
13680
|
+
${({ $color }) => `color: ${$color};`}
|
|
13681
|
+
`;
|
|
13682
|
+
const PushRight = styled.div `
|
|
13683
|
+
margin-left: auto;
|
|
13684
|
+
`;
|
|
13678
13685
|
const getFilterCount = (params) => {
|
|
13679
13686
|
let count = 0;
|
|
13680
13687
|
count += params.namespaces?.length || 0;
|
|
@@ -13688,7 +13695,6 @@ const getFilterCount = (params) => {
|
|
|
13688
13695
|
};
|
|
13689
13696
|
const Filters$1 = ({ namespaces: namespaceItems }) => {
|
|
13690
13697
|
const theme = Theme.useTheme();
|
|
13691
|
-
const { sources } = useEntityStore();
|
|
13692
13698
|
const { namespaces, kinds, monitors, languages, errors, onlyErrors, setAll, clearAll, getEmptyState } = useFilterStore();
|
|
13693
13699
|
// We need local state, because we want to keep the filters in the store only when the user clicks on apply
|
|
13694
13700
|
const [filters, setFilters] = useState({ namespaces, kinds, monitors, languages, errors, onlyErrors });
|
|
@@ -13703,9 +13709,15 @@ const Filters$1 = ({ namespaces: namespaceItems }) => {
|
|
|
13703
13709
|
}
|
|
13704
13710
|
}, [focused, namespaces, kinds, monitors, errors, onlyErrors]);
|
|
13705
13711
|
const onApply = () => {
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13712
|
+
// TODO: remove trycatch after debugging
|
|
13713
|
+
try {
|
|
13714
|
+
setAll(filters);
|
|
13715
|
+
setFilterCount(getFilterCount(filters));
|
|
13716
|
+
setFocused(false);
|
|
13717
|
+
}
|
|
13718
|
+
catch (error) {
|
|
13719
|
+
console.error(error);
|
|
13720
|
+
}
|
|
13709
13721
|
};
|
|
13710
13722
|
const onReset = () => {
|
|
13711
13723
|
clearAll();
|
|
@@ -13713,15 +13725,17 @@ const Filters$1 = ({ namespaces: namespaceItems }) => {
|
|
|
13713
13725
|
setFilterCount(0);
|
|
13714
13726
|
setFocused(false);
|
|
13715
13727
|
};
|
|
13716
|
-
const onCancel =
|
|
13728
|
+
const onCancel = () => {
|
|
13729
|
+
setFocused(false);
|
|
13730
|
+
};
|
|
13717
13731
|
const ref = useRef(null);
|
|
13718
13732
|
useOnClickOutside(ref, onCancel);
|
|
13719
13733
|
useKeyDown({ key: 'Escape', active: focused }, onCancel);
|
|
13720
13734
|
return (React.createElement(RelativeContainer$1, { ref: ref },
|
|
13721
13735
|
React.createElement(SelectionButton, { label: 'Filters', icon: FilterIcon, badgeLabel: filterCount, badgeFilled: !!filterCount, withBorder: true, color: 'transparent', onClick: toggleFocused }),
|
|
13722
|
-
|
|
13736
|
+
React.createElement(AbsoluteContainer$1, { "$hidden": !focused },
|
|
13723
13737
|
React.createElement(FormWrapper, null,
|
|
13724
|
-
React.createElement(NamespaceDropdown, { namespaces:
|
|
13738
|
+
React.createElement(NamespaceDropdown, { namespaces: namespaceItems, 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
13739
|
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
13740
|
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
13741
|
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 +13743,10 @@ const Filters$1 = ({ namespaces: namespaceItems }) => {
|
|
|
13729
13743
|
React.createElement(Toggle, { title: 'Show only sources with errors', initialValue: filters['onlyErrors'], onChange: (bool) => setFilters((prev) => ({ ...prev, errors: [], onlyErrors: bool })) })),
|
|
13730
13744
|
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
13745
|
React.createElement(Actions, null,
|
|
13732
|
-
React.createElement(
|
|
13733
|
-
React.createElement(
|
|
13734
|
-
React.createElement(
|
|
13746
|
+
React.createElement(ActionButton$1, { variant: 'primary', onClick: onApply }, "Apply"),
|
|
13747
|
+
React.createElement(ActionButton$1, { variant: 'secondary', onClick: onCancel }, "Cancel"),
|
|
13748
|
+
React.createElement(PushRight, null,
|
|
13749
|
+
React.createElement(ActionButton$1, { variant: 'tertiary', onClick: onReset, "$color": theme.text.error }, "Reset"))))));
|
|
13735
13750
|
};
|
|
13736
13751
|
|
|
13737
13752
|
const Container$b = styled.div `
|
|
@@ -13756,10 +13771,9 @@ const AddButton = styled(Button) `
|
|
|
13756
13771
|
const DataFlowActionsMenu = ({ namespaces, addEntity }) => {
|
|
13757
13772
|
const theme = Theme.useTheme();
|
|
13758
13773
|
const { setCurrentModal } = useModalStore();
|
|
13759
|
-
const { sources, destinations, actions, instrumentationRules } = useEntityStore();
|
|
13760
13774
|
return (React.createElement(Container$b, null,
|
|
13761
13775
|
React.createElement(Search, null),
|
|
13762
|
-
React.createElement(Filters$1, { namespaces: namespaces
|
|
13776
|
+
React.createElement(Filters$1, { namespaces: namespaces }),
|
|
13763
13777
|
addEntity && (React.createElement(PushToEnd, null,
|
|
13764
13778
|
React.createElement(AddButton, { "data-id": `add-${addEntity}`, onClick: () => setCurrentModal(addEntity) },
|
|
13765
13779
|
React.createElement(PlusIcon$1, { fill: theme.colors.primary }),
|
|
@@ -13991,12 +14005,9 @@ const DataContainer$2 = styled.div `
|
|
|
13991
14005
|
`;
|
|
13992
14006
|
const DestinationDrawer = ({ categories, updateDestination, deleteDestination, testConnection, testLoading, testResult }) => {
|
|
13993
14007
|
const { destinations } = useEntityStore();
|
|
13994
|
-
const { drawerType, drawerEntityId
|
|
14008
|
+
const { drawerType, drawerEntityId } = useDrawerStore();
|
|
14009
|
+
const drawerRef = useRef(null);
|
|
13995
14010
|
const isOpen = drawerType !== EntityTypes.Destination;
|
|
13996
|
-
const onClose = () => {
|
|
13997
|
-
setDrawerType(null);
|
|
13998
|
-
setDrawerEntityId(null);
|
|
13999
|
-
};
|
|
14000
14011
|
const [isEditing, setIsEditing] = useState(false);
|
|
14001
14012
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
14002
14013
|
// const [thisItem, setThisItem] = useState<Destination | undefined>(undefined)
|
|
@@ -14044,7 +14055,7 @@ const DestinationDrawer = ({ categories, updateDestination, deleteDestination, t
|
|
|
14044
14055
|
setIsFormDirty(false);
|
|
14045
14056
|
resetFormData();
|
|
14046
14057
|
// close drawer, all other cases are handled in OverviewDrawer
|
|
14047
|
-
|
|
14058
|
+
drawerRef.current?.closeDrawer();
|
|
14048
14059
|
};
|
|
14049
14060
|
const handleSave = async (newTitle) => {
|
|
14050
14061
|
if (validateForm({ withAlert: true, alertTitle: Crud.Update })) {
|
|
@@ -14055,7 +14066,7 @@ const DestinationDrawer = ({ categories, updateDestination, deleteDestination, t
|
|
|
14055
14066
|
setIsFormDirty(false);
|
|
14056
14067
|
}
|
|
14057
14068
|
};
|
|
14058
|
-
return (React.createElement(OverviewDrawer, { title: thisItem.name || thisItem.destinationType.displayName, iconSrc: thisItem.destinationType.imageUrl, isEdit: isEditing, isFormDirty: isFormDirty, onEdit: handleEdit, onSave: handleSave, onDelete: handleDelete, onCancel: handleCancel, isLastItem: destinations.length === 1 }, isEditing ? (React.createElement(FormContainer$2, null,
|
|
14069
|
+
return (React.createElement(OverviewDrawer, { ref: drawerRef, title: thisItem.name || thisItem.destinationType.displayName, iconSrc: thisItem.destinationType.imageUrl, isEdit: isEditing, isFormDirty: isFormDirty, onEdit: handleEdit, onSave: handleSave, onDelete: handleDelete, onCancel: handleCancel, isLastItem: destinations.length === 1 }, isEditing ? (React.createElement(FormContainer$2, null,
|
|
14059
14070
|
React.createElement(DestinationForm, { isUpdate: true, categoryItem: thisOptionType, formData: formData, formErrors: formErrors, handleFormChange: (...params) => {
|
|
14060
14071
|
setIsFormDirty(true);
|
|
14061
14072
|
handleFormChange(...params);
|
|
@@ -14615,12 +14626,9 @@ const FormContainer$1 = styled.div `
|
|
|
14615
14626
|
const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrumentationRule }) => {
|
|
14616
14627
|
const { instrumentationRules } = useEntityStore();
|
|
14617
14628
|
const { addNotification } = useNotificationStore();
|
|
14618
|
-
const { drawerType, drawerEntityId
|
|
14629
|
+
const { drawerType, drawerEntityId } = useDrawerStore();
|
|
14630
|
+
const drawerRef = useRef(null);
|
|
14619
14631
|
const isOpen = drawerType !== EntityTypes.InstrumentationRule;
|
|
14620
|
-
const onClose = () => {
|
|
14621
|
-
setDrawerType(null);
|
|
14622
|
-
setDrawerEntityId(null);
|
|
14623
|
-
};
|
|
14624
14632
|
const [isEditing, setIsEditing] = useState(false);
|
|
14625
14633
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
14626
14634
|
const { formData, formErrors, handleFormChange, resetFormData, validateForm, loadFormWithDrawerItem } = useInstrumentationRuleFormData();
|
|
@@ -14672,7 +14680,7 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14672
14680
|
setIsFormDirty(false);
|
|
14673
14681
|
resetFormData();
|
|
14674
14682
|
// close drawer, all other cases are handled in OverviewDrawer
|
|
14675
|
-
|
|
14683
|
+
drawerRef.current?.closeDrawer();
|
|
14676
14684
|
}
|
|
14677
14685
|
};
|
|
14678
14686
|
const handleSave = (newTitle) => {
|
|
@@ -14684,7 +14692,7 @@ const InstrumentationRuleDrawer = ({ updateInstrumentationRule, deleteInstrument
|
|
|
14684
14692
|
setIsFormDirty(false);
|
|
14685
14693
|
}
|
|
14686
14694
|
};
|
|
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,
|
|
14695
|
+
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
14696
|
React.createElement(InstrumentationRuleForm, { isUpdate: true, rule: thisOptionType, formData: formData, formErrors: formErrors, handleFormChange: (...params) => {
|
|
14689
14697
|
setIsFormDirty(true);
|
|
14690
14698
|
handleFormChange(...params);
|
|
@@ -15220,16 +15228,12 @@ const DataContainer$1 = styled.div `
|
|
|
15220
15228
|
`;
|
|
15221
15229
|
const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) => {
|
|
15222
15230
|
const { sources } = useEntityStore();
|
|
15223
|
-
const { drawerType, drawerEntityId
|
|
15224
|
-
const
|
|
15231
|
+
const { drawerType, drawerEntityId } = useDrawerStore();
|
|
15232
|
+
const drawerRef = useRef(null);
|
|
15225
15233
|
const isOpen = drawerType !== EntityTypes.Source;
|
|
15226
|
-
const onClose = () => {
|
|
15227
|
-
setSelectedTab(Tabs.Overview);
|
|
15228
|
-
setDrawerType(null);
|
|
15229
|
-
setDrawerEntityId(null);
|
|
15230
|
-
};
|
|
15231
15234
|
const [isEditing, setIsEditing] = useState(false);
|
|
15232
15235
|
const [isFormDirty, setIsFormDirty] = useState(false);
|
|
15236
|
+
const [selectedTab, setSelectedTab] = useState(Tabs.Overview);
|
|
15233
15237
|
const { formData, handleFormChange, resetFormData, loadFormWithDrawerItem } = useSourceFormData();
|
|
15234
15238
|
const thisItem = useMemo(() => {
|
|
15235
15239
|
if (isOpen)
|
|
@@ -15249,27 +15253,27 @@ const SourceDrawer = ({ persistSources, updateSource, fetchDescribeSource }) =>
|
|
|
15249
15253
|
setIsEditing(typeof bool === 'boolean' ? bool : true);
|
|
15250
15254
|
};
|
|
15251
15255
|
const handleCancel = () => {
|
|
15252
|
-
setIsEditing(false);
|
|
15253
15256
|
setIsFormDirty(false);
|
|
15257
|
+
setIsEditing(false);
|
|
15254
15258
|
handleFormChange('otelServiceName', thisItem.otelServiceName || thisItem.name || '');
|
|
15255
15259
|
};
|
|
15256
15260
|
const handleDelete = async () => {
|
|
15257
15261
|
const { namespace } = thisItem;
|
|
15258
15262
|
persistSources({ [namespace]: [{ ...thisItem, selected: false }] }, {});
|
|
15259
|
-
setIsEditing(false);
|
|
15260
15263
|
setIsFormDirty(false);
|
|
15264
|
+
setIsEditing(false);
|
|
15261
15265
|
resetFormData();
|
|
15262
15266
|
// close drawer, all other cases are handled in OverviewDrawer
|
|
15263
|
-
|
|
15267
|
+
drawerRef.current?.closeDrawer();
|
|
15264
15268
|
};
|
|
15265
15269
|
const handleSave = async () => {
|
|
15266
15270
|
const title = formData.otelServiceName !== thisItem.name ? formData.otelServiceName : '';
|
|
15267
15271
|
handleFormChange('otelServiceName', title);
|
|
15268
15272
|
await updateSource(drawerEntityId, { ...formData, otelServiceName: title });
|
|
15269
|
-
setIsEditing(false);
|
|
15270
15273
|
setIsFormDirty(false);
|
|
15274
|
+
setIsEditing(false);
|
|
15271
15275
|
};
|
|
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: [
|
|
15276
|
+
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
15277
|
{
|
|
15274
15278
|
label: Tabs.Overview,
|
|
15275
15279
|
onClick: () => setSelectedTab(Tabs.Overview),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useRef, forwardRef, useEffect, createElement, useCallback, useMemo, Fragment
|
|
1
|
+
import React, { useState, useRef, forwardRef, useEffect, createElement, useCallback, useMemo, Fragment } from 'react';
|
|
2
2
|
import { StatusType, OtherStatus, SortDirection, ProgrammingLanguages, EntityTypes } from './types.js';
|
|
3
3
|
import './index-DYEcdkUF.js';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
@@ -3731,14 +3731,14 @@ const getComponentsFromPropertyString = (propertyString, theme) => {
|
|
|
3731
3731
|
const [type, value] = c.split('=');
|
|
3732
3732
|
switch (type) {
|
|
3733
3733
|
case 'tooltip':
|
|
3734
|
-
return React.createElement(Tooltip, { key:
|
|
3734
|
+
return React.createElement(Tooltip, { key: crypto.randomUUID(), withIcon: true, text: value });
|
|
3735
3735
|
case 'status':
|
|
3736
3736
|
if (value === 'none')
|
|
3737
|
-
return React.createElement("div", { key:
|
|
3737
|
+
return React.createElement("div", { key: crypto.randomUUID(), style: { width: 16, height: 16 } });
|
|
3738
3738
|
let Icon = getStatusIcon(value, theme);
|
|
3739
3739
|
if (!Icon)
|
|
3740
3740
|
Icon = getStatusIcon(StatusType.Warning, theme);
|
|
3741
|
-
return React.createElement(Icon, { key:
|
|
3741
|
+
return React.createElement(Icon, { key: crypto.randomUUID() });
|
|
3742
3742
|
default:
|
|
3743
3743
|
console.warn('unexpected component type!', type);
|
|
3744
3744
|
return null;
|
|
@@ -3753,7 +3753,7 @@ const PrettyJsonCode = ({ darkMode, str }) => {
|
|
|
3753
3753
|
const rows = new Array(count).fill((props) => (React.createElement(TableRow$1, { ...props },
|
|
3754
3754
|
React.createElement(TableData, null),
|
|
3755
3755
|
React.createElement(TableData, null))));
|
|
3756
|
-
return (React.createElement(Fragment, null, rows.map((R, i) => (React.createElement(R, { key:
|
|
3756
|
+
return (React.createElement(Fragment, null, rows.map((R, i) => (React.createElement(R, { key: crypto.randomUUID(), style: i === 0 ? { borderBottom: `1px solid ${theme.colors.border}` } : {} })))));
|
|
3757
3757
|
};
|
|
3758
3758
|
return (React.createElement(Highlight2, { theme: darkMode ? themes_exports.palenight : themes_exports.vsLight, language: 'json', code: str }, ({ getLineProps, getTokenProps, tokens }) => (React.createElement(Table$1, null,
|
|
3759
3759
|
React.createElement(TableBody$1, null, tokens.map((line, i) => {
|
|
@@ -4122,6 +4122,11 @@ const Container$n = styled.div `
|
|
|
4122
4122
|
justify-content: center;
|
|
4123
4123
|
width: ${({ $size }) => $size}px;
|
|
4124
4124
|
height: ${({ $size }) => $size}px;
|
|
4125
|
+
border-radius: 8px;
|
|
4126
|
+
background: ${({ $status, theme }) => {
|
|
4127
|
+
const clr = $status ? theme.text[$status] : theme.text.secondary;
|
|
4128
|
+
return `linear-gradient(180deg, ${clr + Theme.opacity.hex['020']} 0%, ${clr + Theme.opacity.hex['005']} 100%)`;
|
|
4129
|
+
}};
|
|
4125
4130
|
`;
|
|
4126
4131
|
const IconWrapper$3 = styled.div `
|
|
4127
4132
|
position: absolute;
|
|
@@ -4134,22 +4139,35 @@ const IconWrapper$3 = styled.div `
|
|
|
4134
4139
|
width: ${({ $size }) => $size}px;
|
|
4135
4140
|
height: ${({ $size }) => $size}px;
|
|
4136
4141
|
border-radius: 100%;
|
|
4137
|
-
border: 1px solid ${({ theme }) => theme.colors.primary};
|
|
4138
|
-
background: ${({ $status, theme }) => ($status ? theme.colors[$status] : theme.colors.info)};
|
|
4139
4142
|
`;
|
|
4140
4143
|
const IconGroup = ({ icons = [], iconSrcs = [], status, size = 36 }) => {
|
|
4141
4144
|
const theme = Theme.useTheme();
|
|
4142
4145
|
const imgSize = icons.length === 1 || iconSrcs.length === 1 ? size - 16 : size / 3;
|
|
4143
|
-
if (
|
|
4146
|
+
if (iconSrcs.length > 0) {
|
|
4144
4147
|
return React.createElement(IconGroup, { icons: iconSrcs.map((src) => (() => React.createElement(ImageControlled, { src: src, size: imgSize }))), status: status, size: size });
|
|
4145
4148
|
}
|
|
4146
4149
|
if (icons.length === 1) {
|
|
4147
4150
|
return React.createElement(IconWrapped, { icon: icons[0], status: status, size: size });
|
|
4148
4151
|
}
|
|
4149
|
-
|
|
4152
|
+
const getTopPosition = (idx) => {
|
|
4153
|
+
if (icons.length > 2) {
|
|
4154
|
+
return idx === 0 || idx === 1 ? imgSize * 0.2 : imgSize * 1.4;
|
|
4155
|
+
}
|
|
4156
|
+
return imgSize * 0.7;
|
|
4157
|
+
};
|
|
4158
|
+
const getLeftPosition = (idx) => {
|
|
4159
|
+
if (idx >= 2) {
|
|
4160
|
+
return imgSize * 0.7;
|
|
4161
|
+
}
|
|
4162
|
+
else if (idx % 2 === 0) {
|
|
4163
|
+
return imgSize * 0.05;
|
|
4164
|
+
}
|
|
4165
|
+
return imgSize * 1.4;
|
|
4166
|
+
};
|
|
4167
|
+
return (React.createElement(Container$n, { "$status": status, "$size": size }, icons.map((Icon, idx) => {
|
|
4150
4168
|
if (idx > 2)
|
|
4151
4169
|
return null;
|
|
4152
|
-
return (React.createElement(IconWrapper$3, { key:
|
|
4170
|
+
return (React.createElement(IconWrapper$3, { key: crypto.randomUUID(), "$size": imgSize * 1.5, "$top": getTopPosition(idx), "$left": getLeftPosition(idx), "$zIndex": idx + 1 }, idx === 2 && icons.length > 3 ? (React.createElement(Text, { family: 'secondary', color: theme.text.dark_grey, size: imgSize * 0.8 },
|
|
4153
4171
|
"+",
|
|
4154
4172
|
icons.length - 2)) : (React.createElement(Icon, { size: imgSize }))));
|
|
4155
4173
|
})));
|
|
@@ -4224,14 +4242,14 @@ const Container$m = styled.div `
|
|
|
4224
4242
|
padding: 16px;
|
|
4225
4243
|
width: calc(100% - 32px);
|
|
4226
4244
|
border-radius: 16px;
|
|
4227
|
-
background-color: ${({ $status,
|
|
4245
|
+
background-color: ${({ theme, $status, $bgColor }) => $bgColor || ($status ? theme.text[$status] + Theme.opacity.hex['010'] : theme.colors.secondary + Theme.opacity.hex['005'])};
|
|
4228
4246
|
opacity: ${({ $faded }) => ($faded ? 0.5 : 1)};
|
|
4229
4247
|
|
|
4230
|
-
${({
|
|
4248
|
+
${({ theme, $status, $bgColorHover, $withClick }) => $withClick
|
|
4231
4249
|
? css `
|
|
4232
4250
|
&:hover {
|
|
4233
4251
|
cursor: pointer;
|
|
4234
|
-
background-color: ${
|
|
4252
|
+
background-color: ${$bgColorHover || ($status ? theme.text[$status] + Theme.opacity.hex['020'] : theme.colors.secondary + Theme.opacity.hex['010'])};
|
|
4235
4253
|
${ControlledVisibility} {
|
|
4236
4254
|
visibility: visible;
|
|
4237
4255
|
}
|
|
@@ -4250,6 +4268,7 @@ const Title$b = styled(Text) `
|
|
|
4250
4268
|
overflow: hidden;
|
|
4251
4269
|
white-space: nowrap;
|
|
4252
4270
|
text-overflow: ellipsis;
|
|
4271
|
+
|
|
4253
4272
|
font-size: 14px;
|
|
4254
4273
|
&::after {
|
|
4255
4274
|
// This is to prevent the browser "default tooltip" from appearing when the title is too long
|
|
@@ -4258,6 +4277,10 @@ const Title$b = styled(Text) `
|
|
|
4258
4277
|
}
|
|
4259
4278
|
`;
|
|
4260
4279
|
const SubTitleWrapper = styled.div `
|
|
4280
|
+
max-width: ${({ $maxWidth }) => $maxWidth}px;
|
|
4281
|
+
overflow: hidden;
|
|
4282
|
+
white-space: nowrap;
|
|
4283
|
+
|
|
4261
4284
|
display: flex;
|
|
4262
4285
|
align-items: center;
|
|
4263
4286
|
gap: 8px;
|
|
@@ -4275,7 +4298,7 @@ const ActionsWrapper = styled.div `
|
|
|
4275
4298
|
const HoverText = styled(Text) `
|
|
4276
4299
|
margin-right: 16px;
|
|
4277
4300
|
`;
|
|
4278
|
-
const DataTab = ({ title, subTitle, icon, icons, iconSrc, iconSrcs, hoverText, status, faded, monitors, monitorsWithLabels, isActive, withCheckbox, isCheckboxDisabled, isChecked, onCheckboxChange, withExtend, isExtended, renderExtended, renderActions, onClick, ...props }) => {
|
|
4301
|
+
const DataTab = ({ title, subTitle, icon, icons, iconSrc, iconSrcs, hoverText, status, faded, bgColor, bgColorHover, monitors, monitorsWithLabels, isActive, withCheckbox, isCheckboxDisabled, isChecked, onCheckboxChange, withExtend, isExtended, renderExtended, renderActions, onClick, ...props }) => {
|
|
4279
4302
|
const [extend, setExtend] = useState(isExtended || false);
|
|
4280
4303
|
const [maxWidth, setMaxWidth] = useState(0);
|
|
4281
4304
|
const [isTitleOverflowed, setIsTitleOverflowed] = useState(false);
|
|
@@ -4286,9 +4309,10 @@ const DataTab = ({ title, subTitle, icon, icons, iconSrc, iconSrcs, hoverText, s
|
|
|
4286
4309
|
if (containerRef.current && actionsRef.current) {
|
|
4287
4310
|
const containerWidth = containerRef.current.clientWidth;
|
|
4288
4311
|
const actionsWidth = actionsRef.current.clientWidth;
|
|
4289
|
-
// 85 is the sum of the container-padding, icon width, and flex-row-gap
|
|
4290
|
-
// we round to
|
|
4291
|
-
|
|
4312
|
+
// 85 is the sum of the container-padding, icon width, and flex-row-gap.
|
|
4313
|
+
// we round it to 120, to consider cases with actions.
|
|
4314
|
+
const widthOfInnerContents = 120;
|
|
4315
|
+
setMaxWidth(containerWidth - actionsWidth - widthOfInnerContents);
|
|
4292
4316
|
}
|
|
4293
4317
|
}, []);
|
|
4294
4318
|
useEffect(() => {
|
|
@@ -4314,7 +4338,7 @@ const DataTab = ({ title, subTitle, icon, icons, iconSrc, iconSrcs, hoverText, s
|
|
|
4314
4338
|
withSeperator && React.createElement(SubTitle$2, null, '•'),
|
|
4315
4339
|
React.createElement(Status, { status: isActive ? StatusType.Success : StatusType.Error, size: 10 })));
|
|
4316
4340
|
};
|
|
4317
|
-
return (React.createElement(Container$m, { ref: containerRef, "$status": status, "$faded": faded, "$withClick": !!onClick, onClick: onClick, ...props },
|
|
4341
|
+
return (React.createElement(Container$m, { ref: containerRef, "$status": status, "$faded": faded, "$bgColor": bgColor, "$bgColorHover": bgColorHover, "$withClick": !!onClick, onClick: onClick, ...props },
|
|
4318
4342
|
React.createElement(FlexRow, { "$gap": 8 },
|
|
4319
4343
|
React.createElement(FlexRow, { "$gap": 16 },
|
|
4320
4344
|
withCheckbox && React.createElement(Checkbox, { value: isChecked, onChange: onCheckboxChange, disabled: isCheckboxDisabled }),
|
|
@@ -4322,7 +4346,7 @@ const DataTab = ({ title, subTitle, icon, icons, iconSrc, iconSrcs, hoverText, s
|
|
|
4322
4346
|
React.createElement(FlexColumn, { "$gap": 4 },
|
|
4323
4347
|
React.createElement(Tooltip, { text: isTitleOverflowed ? title : undefined, withIcon: false },
|
|
4324
4348
|
React.createElement(Title$b, { ref: titleRef, "$maxWidth": maxWidth }, title)),
|
|
4325
|
-
React.createElement(SubTitleWrapper,
|
|
4349
|
+
React.createElement(SubTitleWrapper, { "$maxWidth": maxWidth },
|
|
4326
4350
|
subTitle && React.createElement(SubTitle$2, null, subTitle),
|
|
4327
4351
|
renderMonitors(!!subTitle),
|
|
4328
4352
|
renderActiveStatus(!!monitors?.length))),
|
|
@@ -4422,7 +4446,7 @@ const TableRow = ({ index, columns, cells, onClick, status, faded }) => {
|
|
|
4422
4446
|
if (!rowCell)
|
|
4423
4447
|
return null;
|
|
4424
4448
|
const { value, textColor, withTooltip, icon, component: Component } = rowCell;
|
|
4425
|
-
return (React.createElement(Td, { key:
|
|
4449
|
+
return (React.createElement(Td, { key: crypto.randomUUID(), "$isFirst": i === 0 },
|
|
4426
4450
|
!!icon ? (React.createElement(IconWrapped, { icon: icon })) : !!Component ? (React.createElement(Component, null)) : (React.createElement(Tooltip, { text: withTooltip && !!value ? String(value) : '' },
|
|
4427
4451
|
React.createElement(RowText, { "$color": textColor }, !isEmpty(value) ? value : '-'))),
|
|
4428
4452
|
i === 0 && React.createElement(RowBackground, { "$height": containerHeight, "$width": containerWidth, "$top": containerHeight * index, "$hovered": isHovered, "$status": status })));
|
|
@@ -4641,7 +4665,7 @@ const renderValue = (type, value) => {
|
|
|
4641
4665
|
text: process.health === StatusType.Success ? 'healthy' : 'unhealthy',
|
|
4642
4666
|
status: process.health,
|
|
4643
4667
|
} }),
|
|
4644
|
-
process.identifyingAttributes.map(({ name, value }) => (React.createElement(DescribeRow, { key:
|
|
4668
|
+
process.identifyingAttributes.map(({ name, value }) => (React.createElement(DescribeRow, { key: crypto.randomUUID(), title: name, subTitle: '', value: { text: value, status: undefined } }))))))));
|
|
4645
4669
|
} }));
|
|
4646
4670
|
}
|
|
4647
4671
|
case DataCardFieldTypes.SourceContainer: {
|
|
@@ -5978,7 +6002,7 @@ const Segment = ({ options = [], selected, setSelected }) => {
|
|
|
5978
6002
|
return (React.createElement(Container$6, null,
|
|
5979
6003
|
options.map(({ icon: Icon, label, value, selectedBgColor }, idx) => {
|
|
5980
6004
|
const isSelected = selected === value;
|
|
5981
|
-
return (React.createElement(Button, { key:
|
|
6005
|
+
return (React.createElement(Button, { key: crypto.randomUUID(), ref: isSelected ? selectedRef : undefined, "$isFirstItem": idx === 0, "$isLastItem": idx === options.length - 1, onClick: () => {
|
|
5982
6006
|
setSelected(value);
|
|
5983
6007
|
setBgColor(selectedBgColor || '');
|
|
5984
6008
|
} },
|