@odigos/ui-kit 0.0.9 → 0.0.10
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 +13 -0
- package/lib/components/badge/index.d.ts +2 -2
- package/lib/components/data-tab/index.d.ts +2 -2
- package/lib/components/describe-row/index.d.ts +2 -2
- package/lib/components/divider/index.d.ts +2 -2
- package/lib/components/drawer/drawer-header/index.d.ts +1 -1
- package/lib/components/icon-group/index.d.ts +2 -2
- package/lib/components/icon-wrapped/index.d.ts +2 -2
- package/lib/components/interactive-table/index.d.ts +2 -2
- package/lib/components/interactive-table/row.d.ts +2 -2
- package/lib/components/notification-note/index.d.ts +2 -2
- package/lib/components/status/index.d.ts +2 -2
- package/lib/components/styled.d.ts +12 -0
- package/lib/components/warning-modal/index.d.ts +2 -2
- package/lib/components.js +3 -3
- package/lib/constants/strings/index.d.ts +1 -0
- package/lib/constants.js +1 -1
- package/lib/containers/data-flow/nodes/base-node.d.ts +2 -2
- package/lib/containers/data-flow/nodes/scroll-node.d.ts +2 -2
- package/lib/containers/destination-form/test-connection/index.d.ts +2 -2
- package/lib/containers.js +87 -93
- package/lib/functions/get-conditions-booleans/index.d.ts +2 -2
- package/lib/functions/get-status-icon/index.d.ts +2 -2
- package/lib/functions.js +2 -2
- package/lib/hooks.js +2 -2
- package/lib/{index-Bc8gi9FH.js → index-DB1gmCsH.js} +6 -6
- package/lib/{index-Cu2uHOuh.js → index-DnmWFsTQ.js} +1 -0
- package/lib/{index-m62aT4IR.js → index-Do8ODRlA.js} +50 -27
- package/lib/{index-g6Twdelv.js → index-eF2JXMVR.js} +6 -6
- package/lib/types/common/index.d.ts +3 -3
- package/lib/types/connection/index.d.ts +2 -2
- package/lib/types.js +9 -9
- package/lib/{useSourceSelectionFormData-BY6B70Kf.js → useSourceSelectionFormData-CxdOP9FT.js} +4 -4
- package/package.json +10 -10
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useRef, forwardRef, useEffect, createElement, useCallback, useMemo, Fragment, useId } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { STATUS_TYPE, OTHER_STATUS, PROGRAMMING_LANGUAGES, ENTITY_TYPES } from './types.js';
|
|
3
3
|
import './index-DIcomki-.js';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import Theme from './theme.js';
|
|
6
|
-
import { b as getStatusIcon, r as removeEmptyValuesFromObject, s as safeJsonStringify, f as flattenObjectKeys, m as mapConditions, c as capitalizeFirstLetter, g as getMonitorIcon, p as parseJsonStringToPrettyString, a as getProgrammingLanguageIcon, d as splitCamelString } from './index-
|
|
6
|
+
import { b as getStatusIcon, r as removeEmptyValuesFromObject, s as safeJsonStringify, f as flattenObjectKeys, m as mapConditions, c as capitalizeFirstLetter, g as getMonitorIcon, p as parseJsonStringToPrettyString, a as getProgrammingLanguageIcon, d as splitCamelString } from './index-DB1gmCsH.js';
|
|
7
7
|
import { s as safeJsonParse, i as isEmpty } from './index-BZS1ijMm.js';
|
|
8
8
|
import { M as MinusIcon, f as CheckIcon, L as ListIcon, C as CodeIcon, E as ExtendArrowIcon, I as ImageErrorIcon, c as SortArrowsIcon, a as CopyIcon, b as NotebookIcon, X as XIcon, d as EyeClosedIcon, e as EyeOpenIcon, N as NoDataIcon, g as CrossIcon, S as SearchIcon, T as TrashIcon, P as PlusIcon, A as ArrowIcon } from './index-D_Qn2U89.js';
|
|
9
9
|
import { M as MONITORS_OPTIONS } from './index-CZe2VX28.js';
|
|
@@ -339,7 +339,7 @@ const Button$4 = ({ children, variant = 'primary', onClick, ...props }) => {
|
|
|
339
339
|
const CancelWarning = ({ isOpen, noOverlay, name, onApprove, onDeny }) => {
|
|
340
340
|
return (React.createElement(WarningModal, { isOpen: isOpen, noOverlay: noOverlay, title: `Cancel${name ? ` ${name}` : ''}`, description: 'Are you sure you want to cancel?', approveButton: {
|
|
341
341
|
text: 'Confirm',
|
|
342
|
-
variant:
|
|
342
|
+
variant: STATUS_TYPE.WARNING,
|
|
343
343
|
onClick: onApprove,
|
|
344
344
|
}, denyButton: {
|
|
345
345
|
text: 'Go Back',
|
|
@@ -381,6 +381,20 @@ const ModalBody = styled.div `
|
|
|
381
381
|
margin: ${({ $isNotModal }) => ($isNotModal ? '64px 0 0 0' : '64px 7vw 32px 7vw')};
|
|
382
382
|
overflow-y: scroll;
|
|
383
383
|
`;
|
|
384
|
+
// common styles for focused-table containers
|
|
385
|
+
const TableContainer = styled(FlexColumn) `
|
|
386
|
+
max-width: ${({ $maxWidth }) => $maxWidth || 'unset'};
|
|
387
|
+
width: 100%;
|
|
388
|
+
`;
|
|
389
|
+
const TableTitleWrap = styled(FlexRow) `
|
|
390
|
+
gap: 16px;
|
|
391
|
+
padding: 16px;
|
|
392
|
+
`;
|
|
393
|
+
const TableWrap = styled.div `
|
|
394
|
+
width: 100%;
|
|
395
|
+
max-height: ${({ $maxHeight }) => $maxHeight || 'unset'};
|
|
396
|
+
overflow-y: auto;
|
|
397
|
+
`;
|
|
384
398
|
|
|
385
399
|
const TooltipContainer = styled.div `
|
|
386
400
|
position: relative;
|
|
@@ -3723,7 +3737,7 @@ const getComponentsFromPropertyString = (propertyString, theme) => {
|
|
|
3723
3737
|
return React.createElement("div", { key: useId(), style: { width: 16, height: 16 } });
|
|
3724
3738
|
let Icon = getStatusIcon(value, theme);
|
|
3725
3739
|
if (!Icon)
|
|
3726
|
-
Icon = getStatusIcon(
|
|
3740
|
+
Icon = getStatusIcon(STATUS_TYPE.WARNING, theme);
|
|
3727
3741
|
return React.createElement(Icon, { key: useId() });
|
|
3728
3742
|
default:
|
|
3729
3743
|
console.warn('unexpected component type!', type);
|
|
@@ -3951,15 +3965,15 @@ const ExtendArrow = ({ extend, size = 14, align = 'center' }) => {
|
|
|
3951
3965
|
|
|
3952
3966
|
const Container$q = styled.div `
|
|
3953
3967
|
border-radius: 24px;
|
|
3954
|
-
background-color: ${({ theme, $status }) => $status ===
|
|
3968
|
+
background-color: ${({ theme, $status }) => $status === STATUS_TYPE.ERROR
|
|
3955
3969
|
? theme.text.error + Theme.opacity.hex['010']
|
|
3956
|
-
: $status ===
|
|
3970
|
+
: $status === STATUS_TYPE.WARNING
|
|
3957
3971
|
? theme.text.warning + Theme.opacity.hex['010']
|
|
3958
3972
|
: theme.colors.secondary + Theme.opacity.hex['005']};
|
|
3959
3973
|
&:hover {
|
|
3960
|
-
background-color: ${({ theme, $status }) => $status ===
|
|
3974
|
+
background-color: ${({ theme, $status }) => $status === STATUS_TYPE.ERROR
|
|
3961
3975
|
? theme.text.error + Theme.opacity.hex['020']
|
|
3962
|
-
: $status ===
|
|
3976
|
+
: $status === STATUS_TYPE.WARNING
|
|
3963
3977
|
? theme.text.warning + Theme.opacity.hex['020']
|
|
3964
3978
|
: theme.colors.secondary + Theme.opacity.hex['010']};
|
|
3965
3979
|
}
|
|
@@ -3990,9 +4004,9 @@ const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed'
|
|
|
3990
4004
|
const theme = Theme.useTheme();
|
|
3991
4005
|
const [extend, setExtend] = useState(false);
|
|
3992
4006
|
const conditions = mapConditions(c);
|
|
3993
|
-
const errors = useMemo(() => conditions.filter(({ status }) => status ===
|
|
4007
|
+
const errors = useMemo(() => conditions.filter(({ status }) => status === STATUS_TYPE.ERROR), [conditions]);
|
|
3994
4008
|
const hasErrors = !!errors.length;
|
|
3995
|
-
const warnings = useMemo(() => conditions.filter(({ status }) => status ===
|
|
4009
|
+
const warnings = useMemo(() => conditions.filter(({ status }) => status === STATUS_TYPE.WARNING), [conditions]);
|
|
3996
4010
|
const hasWarnings = !!warnings.length;
|
|
3997
4011
|
const disableds = useMemo(() => conditions.filter(({ status }) => status === OTHER_STATUS.DISABLED), [conditions]);
|
|
3998
4012
|
const hasDisableds = !!disableds.length;
|
|
@@ -4002,7 +4016,7 @@ const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed'
|
|
|
4002
4016
|
useEffect(() => {
|
|
4003
4017
|
setExtend(hasErrors || hasWarnings || hasDisableds || hasLoadings);
|
|
4004
4018
|
}, [hasErrors, hasWarnings, hasDisableds, hasLoadings]);
|
|
4005
|
-
const overallStatus = hasErrors ?
|
|
4019
|
+
const overallStatus = hasErrors ? STATUS_TYPE.ERROR : hasWarnings ? STATUS_TYPE.WARNING : hasDisableds ? STATUS_TYPE.INFO : STATUS_TYPE.SUCCESS;
|
|
4006
4020
|
const HeaderIcon = getStatusIcon(overallStatus, theme);
|
|
4007
4021
|
const headerText = hasErrors ? headerLabelError : hasWarnings ? headerLabelWarning : hasDisableds ? headerLabelWarning : loading ? 'Loading...' : headerLabelSuccess;
|
|
4008
4022
|
const headerTextColor = hasErrors ? theme.text.error : hasWarnings ? theme.text.warning : theme.text.info;
|
|
@@ -4016,13 +4030,13 @@ const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed'
|
|
|
4016
4030
|
React.createElement(Text, { color: headerSubTextColor, size: 12, family: 'secondary' }, headerSubText),
|
|
4017
4031
|
React.createElement(ExtendArrow, { extend: extend, align: 'right' })),
|
|
4018
4032
|
extend && (React.createElement(Body, null, conditions.map(({ status, type, reason, message, lastTransitionTime }, idx) => {
|
|
4019
|
-
const Icon = status === 'loading' ? () => React.createElement(FadeLoader, { scale: 0.8 }) : status === 'disabled' ? getStatusIcon(
|
|
4020
|
-
const color = status === 'disabled' ? theme.text.info : status ===
|
|
4033
|
+
const Icon = status === 'loading' ? () => React.createElement(FadeLoader, { scale: 0.8 }) : status === 'disabled' ? getStatusIcon(STATUS_TYPE.INFO, theme) : getStatusIcon(status, theme);
|
|
4034
|
+
const color = status === 'disabled' ? theme.text.info : status === STATUS_TYPE.ERROR ? theme.text.error : status === STATUS_TYPE.WARNING ? theme.text.warning : theme.text.info;
|
|
4021
4035
|
const boldColor = status === 'disabled'
|
|
4022
4036
|
? theme.text.info_secondary
|
|
4023
|
-
: status ===
|
|
4037
|
+
: status === STATUS_TYPE.ERROR
|
|
4024
4038
|
? theme.text.error_secondary
|
|
4025
|
-
: status ===
|
|
4039
|
+
: status === STATUS_TYPE.WARNING
|
|
4026
4040
|
? theme.text.warning_secondary
|
|
4027
4041
|
: theme.text.info_secondary;
|
|
4028
4042
|
return (React.createElement(Row$1, { key: `condition-${idx}` },
|
|
@@ -4063,9 +4077,9 @@ const TextWrapper$1 = styled.div `
|
|
|
4063
4077
|
display: flex;
|
|
4064
4078
|
align-items: center;
|
|
4065
4079
|
`;
|
|
4066
|
-
const Status = ({ title, subtitle, size = 12, family = 'secondary', status =
|
|
4080
|
+
const Status = ({ title, subtitle, size = 12, family = 'secondary', status = STATUS_TYPE.DEFAULT, withIcon, withBorder, withBackground }) => {
|
|
4067
4081
|
const theme = Theme.useTheme();
|
|
4068
|
-
const statusType = status === OTHER_STATUS.LOADING ?
|
|
4082
|
+
const statusType = status === OTHER_STATUS.LOADING ? STATUS_TYPE.INFO : status;
|
|
4069
4083
|
const StatusIcon = status === OTHER_STATUS.LOADING ? () => React.createElement(FadeLoader, { scale: 0.8 }) : () => getStatusIcon(statusType, theme)({ size: size + 2 });
|
|
4070
4084
|
return (React.createElement(Container$p, { "$size": size, "$status": statusType, "$withIcon": withIcon, "$withBorder": withBorder, "$withBackground": withBackground },
|
|
4071
4085
|
withIcon && (React.createElement(IconWrapper$4, null,
|
|
@@ -4298,7 +4312,7 @@ const DataTab = ({ title, subTitle, icon, icons, iconSrc, iconSrcs, hoverText, s
|
|
|
4298
4312
|
return null;
|
|
4299
4313
|
return (React.createElement(React.Fragment, null,
|
|
4300
4314
|
withSeperator && React.createElement(SubTitle$2, null, '•'),
|
|
4301
|
-
React.createElement(Status, { status: isActive ?
|
|
4315
|
+
React.createElement(Status, { status: isActive ? STATUS_TYPE.SUCCESS : STATUS_TYPE.ERROR, size: 10 })));
|
|
4302
4316
|
};
|
|
4303
4317
|
return (React.createElement(Container$m, { ref: containerRef, "$status": status, "$faded": faded, "$withClick": !!onClick, onClick: onClick, ...props },
|
|
4304
4318
|
React.createElement(FlexRow, { "$gap": 8 },
|
|
@@ -4607,7 +4621,7 @@ const renderValue = (type, value) => {
|
|
|
4607
4621
|
return React.createElement(InteractiveTable, { ...params });
|
|
4608
4622
|
}
|
|
4609
4623
|
case DATA_CARD_FIELD_TYPES.ACTIVE_STATUS: {
|
|
4610
|
-
return React.createElement(Status, { status: value == 'true' ?
|
|
4624
|
+
return React.createElement(Status, { status: value == 'true' ? STATUS_TYPE.SUCCESS : STATUS_TYPE.ERROR, title: value == 'true' ? 'Active' : 'Inactive', size: 10, withIcon: true, withBorder: true });
|
|
4611
4625
|
}
|
|
4612
4626
|
case DATA_CARD_FIELD_TYPES.COPY_TEXT: {
|
|
4613
4627
|
const str = typeof value === 'string' ? value : JSON.stringify(value);
|
|
@@ -4622,14 +4636,14 @@ const renderValue = (type, value) => {
|
|
|
4622
4636
|
const { containerName, actualDevice, processes } = safeJsonParse(value, {
|
|
4623
4637
|
containerName: '',
|
|
4624
4638
|
actualDevice: { title: '', subTitle: '', tooltip: '' },
|
|
4625
|
-
processes: [{ health:
|
|
4639
|
+
processes: [{ health: STATUS_TYPE.INFO, message: '', identifyingAttributes: [] }],
|
|
4626
4640
|
});
|
|
4627
4641
|
return (React.createElement(DataTab, { title: containerName, subTitle: `${processes.length} Instrumented Processes`, renderActions: () => {
|
|
4628
|
-
return
|
|
4642
|
+
return React.createElement(Status, { status: STATUS_TYPE.INFO, title: 'Instrumentation Device', subtitle: !actualDevice.subTitle || actualDevice.subTitle === '[]' ? 'none' : actualDevice.subTitle, withBorder: true });
|
|
4629
4643
|
}, isExtended: !!processes.length, renderExtended: () => {
|
|
4630
4644
|
return (React.createElement(FlexColStretched, { "$gap": 24 }, processes.map((process, idx) => (React.createElement(FlexColStretched, { key: `process-${idx}`, "$gap": 8 },
|
|
4631
4645
|
React.createElement(DescribeRow, { title: `Instrumented Process #${idx + 1}`, subTitle: process.message || '', value: {
|
|
4632
|
-
text: process.health ===
|
|
4646
|
+
text: process.health === STATUS_TYPE.SUCCESS ? 'healthy' : 'unhealthy',
|
|
4633
4647
|
status: process.health,
|
|
4634
4648
|
} }),
|
|
4635
4649
|
process.identifyingAttributes.map(({ name, value }) => (React.createElement(DescribeRow, { key: useId(), title: name, subTitle: '', value: { text: value, status: undefined } }))))))));
|
|
@@ -4648,11 +4662,11 @@ const renderValue = (type, value) => {
|
|
|
4648
4662
|
return (React.createElement(DataTab, { title: containerName, subTitle: `${language === PROGRAMMING_LANGUAGES.JAVASCRIPT ? 'Node.js' : capitalizeFirstLetter(language)}` + (!!runtimeVersion ? ` • Runtime Version: ${runtimeVersion}` : ''), icon: getProgrammingLanguageIcon(language), isExtended: !!instrumentationMessage, renderExtended: () => {
|
|
4649
4663
|
if (!!instrumentationMessage) {
|
|
4650
4664
|
return (React.createElement(AlignCenter, null,
|
|
4651
|
-
React.createElement(Status, { status:
|
|
4665
|
+
React.createElement(Status, { status: STATUS_TYPE.INFO, title: splitCamelString(instrumentationMessage) })));
|
|
4652
4666
|
}
|
|
4653
4667
|
return null;
|
|
4654
4668
|
}, renderActions: () => {
|
|
4655
|
-
return (React.createElement(Status, { status: instrumented ?
|
|
4669
|
+
return (React.createElement(Status, { status: instrumented ? STATUS_TYPE.SUCCESS : awaitingInstrumentation ? STATUS_TYPE.WARNING : STATUS_TYPE.ERROR, title: instrumented ? 'Instrumented' : awaitingInstrumentation ? 'Instrumenting...' : 'Uninstrumented', subtitle: otelDistroName, withIcon: true, withBorder: true }));
|
|
4656
4670
|
} }));
|
|
4657
4671
|
}
|
|
4658
4672
|
default: {
|
|
@@ -4714,7 +4728,7 @@ const DeleteWarning = ({ isOpen, noOverlay, name, type, isLastItem, onApprove, o
|
|
|
4714
4728
|
const actionText = type === ENTITY_TYPES.SOURCE ? 'uninstrument' : 'delete';
|
|
4715
4729
|
return (React.createElement(WarningModal, { isOpen: isOpen, noOverlay: noOverlay, title: `${actionText.charAt(0).toUpperCase() + actionText.substring(1)}${name ? ` ${name}` : ''}`, description: `Are you sure you want to ${actionText}?`, note: isLastItem
|
|
4716
4730
|
? {
|
|
4717
|
-
type:
|
|
4731
|
+
type: STATUS_TYPE.WARNING,
|
|
4718
4732
|
title: `You're about to ${actionText} the last ${type || name}`,
|
|
4719
4733
|
message: '',
|
|
4720
4734
|
}
|
|
@@ -4783,11 +4797,20 @@ const Tab = styled(Text) `
|
|
|
4783
4797
|
gap: 8px;
|
|
4784
4798
|
`;
|
|
4785
4799
|
const DrawerHeader = ({ onClose, icon, iconSrc, title, titleTooltip, replaceTitleWith: ReplaceTitleWith, actionButtons = [], tabs }) => {
|
|
4800
|
+
const renderReplaceTitleWith = () => {
|
|
4801
|
+
if (typeof ReplaceTitleWith === 'function') {
|
|
4802
|
+
return React.createElement(ReplaceTitleWith, null);
|
|
4803
|
+
}
|
|
4804
|
+
if (ReplaceTitleWith) {
|
|
4805
|
+
return ReplaceTitleWith;
|
|
4806
|
+
}
|
|
4807
|
+
return null;
|
|
4808
|
+
};
|
|
4786
4809
|
return (React.createElement(Container$j, null,
|
|
4787
4810
|
React.createElement(TopRow, null,
|
|
4788
4811
|
React.createElement(SectionItemsWrapper, null,
|
|
4789
4812
|
(!!icon || !!iconSrc) && React.createElement(IconWrapped, { icon: icon, src: iconSrc, alt: 'Drawer Item' }),
|
|
4790
|
-
|
|
4813
|
+
renderReplaceTitleWith() || (React.createElement(Tooltip, { text: titleTooltip, withIcon: true }, title && React.createElement(Title$7, null, title)))),
|
|
4791
4814
|
React.createElement(SectionItemsWrapper, { "$gap": 2 },
|
|
4792
4815
|
actionButtons.map((btn, i) => (React.createElement(ActionButton$1, { key: `header-action-button-${i}`, ...btn }))),
|
|
4793
4816
|
React.createElement(CloseButton, { "data-id": 'drawer-close', variant: 'secondary', onClick: onClose },
|
|
@@ -29571,4 +29594,4 @@ const WarningModal = ({ isOpen, noOverlay, title = '', description = '', note, a
|
|
|
29571
29594
|
React.createElement(FooterButton, { "data-id": 'deny', variant: denyButton.variant || 'secondary', onClick: onDeny }, denyButton.text)))));
|
|
29572
29595
|
};
|
|
29573
29596
|
|
|
29574
|
-
export { FlexColumn as $, AutocompleteInput as A, Button$4 as B, CancelWarning as C, DataCard as D, ExtendArrow as E, FadeLoader as F, MonitorsIcons as G, Header as H, IconButton as I, NoDataFound as J, KeyValueInputsList as K, NotificationNote as L, Modal as M, NavigationButtons as N, Segment as O, SkeletonLoader as P, Status as Q, Stepper as R, SectionTitle as S, ToggleCodeComponent as T, Text as U, TextArea as V, Toggle as W, Tooltip as X, TraceLoader as Y, WarningModal as Z, FlexRow as _, Badge as a, CenterThis as a0, Overlay as a1, ModalBody as a2,
|
|
29597
|
+
export { FlexColumn as $, AutocompleteInput as A, Button$4 as B, CancelWarning as C, DataCard as D, ExtendArrow as E, FadeLoader as F, MonitorsIcons as G, Header as H, IconButton as I, NoDataFound as J, KeyValueInputsList as K, NotificationNote as L, Modal as M, NavigationButtons as N, Segment as O, SkeletonLoader as P, Status as Q, Stepper as R, SectionTitle as S, ToggleCodeComponent as T, Text as U, TextArea as V, Toggle as W, Tooltip as X, TraceLoader as Y, WarningModal as Z, FlexRow as _, Badge as a, CenterThis as a0, Overlay as a1, ModalBody as a2, TableContainer as a3, TableTitleWrap as a4, TableWrap as a5, getDefaultExportFromCjs as a6, Checkbox as b, Code as c, ConditionDetails as d, DataCardFields as e, DATA_CARD_FIELD_TYPES as f, DataTab as g, DeleteWarning as h, Divider as i, DocsButton as j, Drawer as k, DrawerHeader as l, DrawerFooter as m, Dropdown as n, FieldError as o, FieldLabel as p, IconGroup as q, IconTitleBadge as r, IconWrapped as s, IconsNav as t, ImageControlled as u, Input as v, InputList as w, InputTable as x, InteractiveTable as y, MonitorsCheckboxes as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as getProgrammingLanguageIcon } from './index-
|
|
1
|
+
import { STATUS_TYPE, OTHER_STATUS, ENTITY_TYPES, PLATFORM_TYPE } from './types.js';
|
|
2
|
+
import { a as getProgrammingLanguageIcon } from './index-DB1gmCsH.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './index-DIcomki-.js';
|
|
5
5
|
import 'styled-components';
|
|
@@ -61,7 +61,7 @@ const filterSources = (sources, filters) => {
|
|
|
61
61
|
if (!!filters.languages?.length)
|
|
62
62
|
filtered = filtered.filter((source) => !!filters.languages?.find((language) => !!source.containers?.find((cont) => cont.language === language.id)));
|
|
63
63
|
if (!!filters.onlyErrors)
|
|
64
|
-
filtered = filtered.filter((source) => !!source.conditions?.find((cond) => cond.status ===
|
|
64
|
+
filtered = filtered.filter((source) => !!source.conditions?.find((cond) => cond.status === STATUS_TYPE.ERROR));
|
|
65
65
|
if (!!filters.errors?.length)
|
|
66
66
|
filtered = filtered.filter((source) => !!filters.errors?.find((error) => !!source.conditions?.find((cond) => cond.message === error.id)));
|
|
67
67
|
return filtered;
|
|
@@ -77,11 +77,11 @@ const formatBytes = (bytes) => {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
const getConditionsBooleans = (conditions) => {
|
|
80
|
-
const hasErrors = !!conditions?.find(({ status }) => status ===
|
|
81
|
-
const hasWarnings = !!conditions?.find(({ status }) => status ===
|
|
80
|
+
const hasErrors = !!conditions?.find(({ status }) => status === STATUS_TYPE.ERROR);
|
|
81
|
+
const hasWarnings = !!conditions?.find(({ status }) => status === STATUS_TYPE.WARNING);
|
|
82
82
|
const hasDisableds = !!conditions?.find(({ status }) => status === OTHER_STATUS.DISABLED);
|
|
83
83
|
const hasLoadings = !!conditions?.find(({ status }) => status === OTHER_STATUS.LOADING);
|
|
84
|
-
const priorotizedStatus = hasErrors ?
|
|
84
|
+
const priorotizedStatus = hasErrors ? STATUS_TYPE.ERROR : hasWarnings ? STATUS_TYPE.WARNING : hasDisableds ? STATUS_TYPE.INFO : undefined;
|
|
85
85
|
return {
|
|
86
86
|
hasErrors,
|
|
87
87
|
hasWarnings,
|
|
@@ -89,7 +89,7 @@ export declare enum CRD_TYPES {
|
|
|
89
89
|
LATENCY_SAMPLER = "LatencySampler",
|
|
90
90
|
PROBABILISTIC_SAMPLER = "ProbabilisticSampler"
|
|
91
91
|
}
|
|
92
|
-
export declare enum
|
|
92
|
+
export declare enum STATUS_TYPE {
|
|
93
93
|
WARNING = "warning",
|
|
94
94
|
ERROR = "error",
|
|
95
95
|
SUCCESS = "success",
|
|
@@ -101,7 +101,7 @@ export declare enum OTHER_STATUS {
|
|
|
101
101
|
DISABLED = "disabled"
|
|
102
102
|
}
|
|
103
103
|
export interface Condition {
|
|
104
|
-
status:
|
|
104
|
+
status: STATUS_TYPE | OTHER_STATUS;
|
|
105
105
|
type: string;
|
|
106
106
|
reason?: string | null;
|
|
107
107
|
message?: string | null;
|
|
@@ -109,7 +109,7 @@ export interface Condition {
|
|
|
109
109
|
}
|
|
110
110
|
export interface Notification {
|
|
111
111
|
id: string;
|
|
112
|
-
type:
|
|
112
|
+
type: STATUS_TYPE;
|
|
113
113
|
title?: string;
|
|
114
114
|
message?: string;
|
|
115
115
|
crdType?: string;
|
package/lib/types.js
CHANGED
|
@@ -89,14 +89,14 @@ var CRD_TYPES;
|
|
|
89
89
|
CRD_TYPES["LATENCY_SAMPLER"] = "LatencySampler";
|
|
90
90
|
CRD_TYPES["PROBABILISTIC_SAMPLER"] = "ProbabilisticSampler";
|
|
91
91
|
})(CRD_TYPES || (CRD_TYPES = {}));
|
|
92
|
-
var
|
|
93
|
-
(function (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
})(
|
|
92
|
+
var STATUS_TYPE;
|
|
93
|
+
(function (STATUS_TYPE) {
|
|
94
|
+
STATUS_TYPE["WARNING"] = "warning";
|
|
95
|
+
STATUS_TYPE["ERROR"] = "error";
|
|
96
|
+
STATUS_TYPE["SUCCESS"] = "success";
|
|
97
|
+
STATUS_TYPE["INFO"] = "info";
|
|
98
|
+
STATUS_TYPE["DEFAULT"] = "default";
|
|
99
|
+
})(STATUS_TYPE || (STATUS_TYPE = {}));
|
|
100
100
|
var OTHER_STATUS;
|
|
101
101
|
(function (OTHER_STATUS) {
|
|
102
102
|
OTHER_STATUS["LOADING"] = "loading";
|
|
@@ -163,4 +163,4 @@ var K8S_RESOURCE_KIND;
|
|
|
163
163
|
K8S_RESOURCE_KIND["STATEFUL_SET"] = "StatefulSet";
|
|
164
164
|
})(K8S_RESOURCE_KIND || (K8S_RESOURCE_KIND = {}));
|
|
165
165
|
|
|
166
|
-
export { ACTION_TYPE, ADD_NODE_TYPES, CODE_ATTRIBUTES_KEY_TYPES, CRD_TYPES, CRUD, EDGE_TYPES, ENTITY_TYPES, FIELD_TYPES, INSTRUMENTATION_RULE_TYPE, K8S_RESOURCE_KIND, NODE_TYPES,
|
|
166
|
+
export { ACTION_TYPE, ADD_NODE_TYPES, CODE_ATTRIBUTES_KEY_TYPES, CRD_TYPES, CRUD, EDGE_TYPES, ENTITY_TYPES, FIELD_TYPES, INSTRUMENTATION_RULE_TYPE, K8S_RESOURCE_KIND, NODE_TYPES, OTHER_STATUS, PAYLOAD_COLLECTION_KEY_TYPES, PLATFORM_TYPE, PROGRAMMING_LANGUAGES, SIGNAL_TYPE, STATUS_TYPE, TIER };
|
package/lib/{useSourceSelectionFormData-BY6B70Kf.js → useSourceSelectionFormData-CxdOP9FT.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ACTION_TYPE,
|
|
1
|
+
import { ACTION_TYPE, STATUS_TYPE, ADD_NODE_TYPES, ENTITY_TYPES, FIELD_TYPES } from './types.js';
|
|
2
2
|
import { useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { f as useNotificationStore, e as useModalStore, a as useDrawerStore, i as useSetupStore } from './index-DIcomki-.js';
|
|
4
4
|
import 'styled-components';
|
|
5
5
|
import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
|
|
6
6
|
import './index-CZe2VX28.js';
|
|
7
|
-
import { F as FORM_ALERTS } from './index-
|
|
7
|
+
import { F as FORM_ALERTS } from './index-DnmWFsTQ.js';
|
|
8
8
|
import { b as useGenericForm } from './useTransition-Dfxjcy-C.js';
|
|
9
9
|
import { g as getIdFromSseTarget } from './index-BFct3S32.js';
|
|
10
10
|
|
|
@@ -75,7 +75,7 @@ const useActionFormData = () => {
|
|
|
75
75
|
ok = !Object.values(errors).length;
|
|
76
76
|
if (!ok && params?.withAlert) {
|
|
77
77
|
addNotification({
|
|
78
|
-
type:
|
|
78
|
+
type: STATUS_TYPE.WARNING,
|
|
79
79
|
title: params.alertTitle,
|
|
80
80
|
message: FORM_ALERTS.REQUIRED_FIELDS,
|
|
81
81
|
hideFromHistory: true,
|
|
@@ -308,7 +308,7 @@ const useDestinationFormData = (params) => {
|
|
|
308
308
|
});
|
|
309
309
|
if (!ok && params?.withAlert) {
|
|
310
310
|
addNotification({
|
|
311
|
-
type:
|
|
311
|
+
type: STATUS_TYPE.WARNING,
|
|
312
312
|
title: params.alertTitle,
|
|
313
313
|
message: FORM_ALERTS.REQUIRED_FIELDS,
|
|
314
314
|
hideFromHistory: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odigos/ui-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"author": "Odigos",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"react-dom": "^19.0.0",
|
|
75
75
|
"react-error-boundary": "^5.0.0",
|
|
76
76
|
"react-lottie": "^1.2.10",
|
|
77
|
-
"styled-components": "^6.1.
|
|
77
|
+
"styled-components": "^6.1.16",
|
|
78
78
|
"zustand": "^5.0.3"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"react-dom": "^19.0.0",
|
|
86
86
|
"react-error-boundary": "^5.0.0",
|
|
87
87
|
"react-lottie": "^1.2.10",
|
|
88
|
-
"styled-components": "^6.1.
|
|
88
|
+
"styled-components": "^6.1.16",
|
|
89
89
|
"zustand": "^5.0.3"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
97
97
|
"@rollup/plugin-json": "^6.1.0",
|
|
98
98
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
99
|
-
"@storybook/addon-essentials": "^8.6.
|
|
99
|
+
"@storybook/addon-essentials": "^8.6.7",
|
|
100
100
|
"@storybook/addon-webpack5-compiler-babel": "^3.0.5",
|
|
101
|
-
"@storybook/react": "^8.6.
|
|
102
|
-
"@storybook/react-webpack5": "^8.6.
|
|
101
|
+
"@storybook/react": "^8.6.7",
|
|
102
|
+
"@storybook/react-webpack5": "^8.6.7",
|
|
103
103
|
"@types/node": "^22.13.10",
|
|
104
|
-
"@types/react": "^19.0.
|
|
104
|
+
"@types/react": "^19.0.11",
|
|
105
105
|
"@types/react-dom": "^19.0.4",
|
|
106
106
|
"@types/react-lottie": "^1.2.10",
|
|
107
107
|
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
@@ -110,13 +110,13 @@
|
|
|
110
110
|
"babel-plugin-styled-components": "^2.1.4",
|
|
111
111
|
"eslint": "^9.22.0",
|
|
112
112
|
"eslint-plugin-react": "^7.37.4",
|
|
113
|
-
"eslint-plugin-storybook": "^0.11.
|
|
113
|
+
"eslint-plugin-storybook": "^0.11.6",
|
|
114
114
|
"html-webpack-plugin": "^5.6.3",
|
|
115
115
|
"postcss": "^8.5.3",
|
|
116
|
-
"rollup": "^4.
|
|
116
|
+
"rollup": "^4.36.0",
|
|
117
117
|
"rollup-plugin-postcss": "^4.0.2",
|
|
118
118
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
119
|
-
"storybook": "^8.6.
|
|
119
|
+
"storybook": "^8.6.7",
|
|
120
120
|
"typescript": "^5.8.2"
|
|
121
121
|
}
|
|
122
122
|
}
|