diff --git a/.gitignore b/.gitignore index 84e4b17534..3f4fa67b15 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ node_modules # production build - # reports coverage .nyc_output diff --git a/package-lock.json b/package-lock.json index 5678a24a4c..ebb80df9d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,7 +60,6 @@ "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-7.1.0.tgz", "integrity": "sha512-MMoDGWn1y9LdQJQSHiCC20x3uZ3CwQnv9QMz6pCmJOrqdgM9YxsoVVY0wtrdXbmfSgnV0KNk6zi09NAhMR2jvg==", "license": "MIT", - "peer": true, "dependencies": { "@ctrl/tinycolor": "^3.6.1" } @@ -96,7 +95,6 @@ "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.21.1.tgz", "integrity": "sha512-tyWnlK+XH7Bumd0byfbCiZNK43HEubMoCcu9VxwsAwiHdHTgWa+tMN0/yvxa+e8EzuFP1WdUNNPclRpVtD33lg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.11.1", "@emotion/hash": "^0.8.0", @@ -116,7 +114,6 @@ "resolved": "https://registry.npmjs.org/@ant-design/cssinjs-utils/-/cssinjs-utils-1.1.0.tgz", "integrity": "sha512-E9nOWObXx7Dy7hdyuYlOFaer/LtPO7oyZVxZphh0CYEslr5EmhJPM3WI0Q2RBHRtYg6dSNqeSK73kvZjPN3IMQ==", "license": "MIT", - "peer": true, "dependencies": { "@ant-design/cssinjs": "^1.21.0", "@babel/runtime": "^7.23.2", @@ -144,7 +141,6 @@ "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-5.5.1.tgz", "integrity": "sha512-0UrM02MA2iDIgvLatWrj6YTCYe0F/cwXvVE0E2SqGrL7PZireQwgEKTKBisWpZyal5eXZLvuM98kju6YtYne8w==", "license": "MIT", - "peer": true, "dependencies": { "@ant-design/colors": "^7.0.0", "@ant-design/icons-svg": "^4.4.0", @@ -2208,7 +2204,6 @@ "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==", "license": "MIT", - "peer": true, "engines": { "node": ">=10" } @@ -5713,7 +5708,6 @@ "resolved": "https://registry.npmjs.org/antd/-/antd-5.21.3.tgz", "integrity": "sha512-Yby3gU6jfuvhNFRPsrHB4Yc/G3LHLNHHy0kShwNmmZf1QTCiW5TmqP3DT5m/NHbJsTgEwJpwo3AaOWo+KQyEjw==", "license": "MIT", - "peer": true, "dependencies": { "@ant-design/colors": "^7.1.0", "@ant-design/cssinjs": "^1.21.1", @@ -5867,8 +5861,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-tree-filter/-/array-tree-filter-2.1.0.tgz", "integrity": "sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/array-union": { "version": "2.1.0", @@ -15601,7 +15594,6 @@ "resolved": "https://registry.npmjs.org/rc-cascader/-/rc-cascader-3.28.1.tgz", "integrity": "sha512-9+8oHIMWVLHxuaapDiqFNmD9KSyKN/P4bo9x/MBuDbyTqP8f2/POmmZxdXWBO3yq/uE3pKyQCXYNUxrNfHRv2A==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.12.5", "array-tree-filter": "^2.1.0", @@ -15620,7 +15612,6 @@ "resolved": "https://registry.npmjs.org/rc-checkbox/-/rc-checkbox-3.3.0.tgz", "integrity": "sha512-Ih3ZaAcoAiFKJjifzwsGiT/f/quIkxJoklW4yKGho14Olulwn8gN7hOBve0/WGDg5o/l/5mL0w7ff7/YGvefVw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.3.2", @@ -15636,7 +15627,6 @@ "resolved": "https://registry.npmjs.org/rc-collapse/-/rc-collapse-3.8.0.tgz", "integrity": "sha512-YVBkssrKPBG09TGfcWWGj8zJBYD9G3XuTy89t5iUmSXrIXEAnO1M+qjUxRW6b4Qi0+wNWG6MHJF/+US+nmIlzA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "2.x", @@ -15687,7 +15677,6 @@ "resolved": "https://registry.npmjs.org/rc-dropdown/-/rc-dropdown-4.2.0.tgz", "integrity": "sha512-odM8Ove+gSh0zU27DUj5cG1gNKg7mLWBYzB5E4nNLrLwBmYEgYP43vHKDGOVZcJSVElQBI0+jTQgjnq0NfLjng==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.3", "@rc-component/trigger": "^2.0.0", @@ -15704,7 +15693,6 @@ "resolved": "https://registry.npmjs.org/rc-field-form/-/rc-field-form-2.4.0.tgz", "integrity": "sha512-XZ/lF9iqf9HXApIHQHqzJK5v2w4mkUMsVqAzOyWVzoiwwXEavY6Tpuw7HavgzIoD+huVff4JghSGcgEfX6eycg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.0", "@rc-component/async-validator": "^5.0.3", @@ -15780,7 +15768,6 @@ "resolved": "https://registry.npmjs.org/rc-input/-/rc-input-1.6.3.tgz", "integrity": "sha512-wI4NzuqBS8vvKr8cljsvnTUqItMfG1QbJoxovCgL+DX4eVUcHIjVwharwevIxyy7H/jbLryh+K7ysnJr23aWIA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", @@ -15796,7 +15783,6 @@ "resolved": "https://registry.npmjs.org/rc-input-number/-/rc-input-number-9.2.0.tgz", "integrity": "sha512-5XZFhBCV5f9UQ62AZ2hFbEY8iZT/dm23Q1kAg0H8EvOgD3UDbYYJAayoVIkM3lQaCqYAW5gV0yV3vjw1XtzWHg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/mini-decimal": "^1.0.1", @@ -15814,7 +15800,6 @@ "resolved": "https://registry.npmjs.org/rc-mentions/-/rc-mentions-2.16.1.tgz", "integrity": "sha512-GnhSTGP9Mtv6pqFFGQze44LlrtWOjHNrUUAcsdo9DnNAhN4pwVPEWy4z+2jpjkiGlJ3VoXdvMHcNDQdfI9fEaw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.22.5", "@rc-component/trigger": "^2.0.0", @@ -15834,7 +15819,6 @@ "resolved": "https://registry.npmjs.org/rc-menu/-/rc-menu-9.15.1.tgz", "integrity": "sha512-UKporqU6LPfHnpPmtP6hdEK4iO5Q+b7BRv/uRpxdIyDGplZy9jwUjsnpev5bs3PQKB0H0n34WAPDfjAfn3kAPA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/trigger": "^2.0.0", @@ -15903,7 +15887,6 @@ "resolved": "https://registry.npmjs.org/rc-pagination/-/rc-pagination-4.3.0.tgz", "integrity": "sha512-UubEWA0ShnroQ1tDa291Fzw6kj0iOeF26IsUObxYTpimgj4/qPCWVFl18RLZE+0Up1IZg0IK4pMn6nB3mjvB7g==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.3.2", @@ -15919,7 +15902,6 @@ "resolved": "https://registry.npmjs.org/rc-picker/-/rc-picker-4.6.15.tgz", "integrity": "sha512-OWZ1yrMie+KN2uEUfYCfS4b2Vu6RC1FWwNI0s+qypsc3wRt7g+peuZKVIzXCTaJwyyZruo80+akPg2+GmyiJjw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.24.7", "@rc-component/trigger": "^2.0.0", @@ -16008,7 +15990,6 @@ "resolved": "https://registry.npmjs.org/rc-segmented/-/rc-segmented-2.5.0.tgz", "integrity": "sha512-B28Fe3J9iUFOhFJET3RoXAPFJ2u47QvLSYcZWC4tFYNGPEjug5LAxEasZlA/PpAxhdOPqGWsGbSj7ftneukJnw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", @@ -16025,7 +16006,6 @@ "resolved": "https://registry.npmjs.org/rc-select/-/rc-select-14.15.2.tgz", "integrity": "sha512-oNoXlaFmpqXYcQDzcPVLrEqS2J9c+/+oJuGrlXeVVX/gVgrbHa5YcyiRUXRydFjyuA7GP3elRuLF7Y3Tfwltlw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/trigger": "^2.1.1", @@ -16048,7 +16028,6 @@ "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-11.1.7.tgz", "integrity": "sha512-ytYbZei81TX7otdC0QvoYD72XSlxvTihNth5OeZ6PMXyEDq/vHdWFulQmfDGyXK1NwKwSlKgpvINOa88uT5g2A==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.5", @@ -16100,7 +16079,6 @@ "resolved": "https://registry.npmjs.org/rc-table/-/rc-table-7.47.5.tgz", "integrity": "sha512-fzq+V9j/atbPIcvs3emuclaEoXulwQpIiJA6/7ey52j8+9cJ4P8DGmp4YzfUVDrb3qhgedcVeD6eRgUrokwVEQ==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "@rc-component/context": "^1.4.0", @@ -16122,7 +16100,6 @@ "resolved": "https://registry.npmjs.org/rc-tabs/-/rc-tabs-15.3.0.tgz", "integrity": "sha512-lzE18r+zppT/jZWOAWS6ntdkDUKHOLJzqMi5UAij1LeKwOaQaupupAoI9Srn73GRzVpmGznkECMRrzkRusC40A==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.11.2", "classnames": "2.x", @@ -16145,7 +16122,6 @@ "resolved": "https://registry.npmjs.org/rc-textarea/-/rc-textarea-1.8.2.tgz", "integrity": "sha512-UFAezAqltyR00a8Lf0IPAyTd29Jj9ee8wt8DqXyDMal7r/Cg/nDt3e1OOv3Th4W6mKaZijjgwuPXhAfVNTN8sw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.1", @@ -16163,7 +16139,6 @@ "resolved": "https://registry.npmjs.org/rc-tooltip/-/rc-tooltip-6.2.1.tgz", "integrity": "sha512-rws0duD/3sHHsD905Nex7FvoUGy2UBQRhTkKxeEvr2FB+r21HsOxcDJI0TzyO8NHhnAA8ILr8pfbSBg5Jj5KBg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.11.2", "@rc-component/trigger": "^2.0.0", @@ -16179,7 +16154,6 @@ "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-5.9.0.tgz", "integrity": "sha512-CPrgOvm9d/9E+izTONKSngNzQdIEjMox2PBufWjS1wf7vxtvmCWzK1SlpHbRY6IaBfJIeZ+88RkcIevf729cRg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "2.x", @@ -16200,7 +16174,6 @@ "resolved": "https://registry.npmjs.org/rc-tree-select/-/rc-tree-select-5.23.0.tgz", "integrity": "sha512-aQGi2tFSRw1WbXv0UVXPzHm09E0cSvUVZMLxQtMv3rnZZpNmdRXWrnd9QkLNlVH31F+X5rgghmdSFF3yZW0N9A==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.1", "classnames": "2.x", @@ -20103,7 +20076,7 @@ "@ant-design/compatible": "^5.1.3", "@jaegertracing/plexus": "0.2.0", "@pyroscope/flamegraph": "0.21.4", - "@sentry/browser": "^8.48.0", + "@sentry/browser": "^8.18.0", "antd": "^5.21.3", "chance": "^1.0.10", "classnames": "^2.5.1", diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchForm.jsx b/packages/jaeger-ui/src/components/SearchTracePage/SearchForm.jsx index fc5353635b..eb7799859d 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/SearchForm.jsx +++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchForm.jsx @@ -262,12 +262,12 @@ export class SearchFormImpl extends React.PureComponent { render() { const { handleSubmit, - invalid, + invalid = false, searchMaxLookback, - selectedLookback, - selectedService = '-', - services, - submitting: disabled, + selectedLookback = null, + selectedService = null, + services = [], + submitting = false, } = this.props; const selectedServicePayload = services.find(s => s.name === selectedService); const opsForSvc = (selectedServicePayload && selectedServicePayload.operations) || []; @@ -555,14 +555,6 @@ SearchFormImpl.propTypes = { selectedLookback: PropTypes.string, }; -SearchFormImpl.defaultProps = { - invalid: false, - services: [], - submitting: false, - selectedService: null, - selectedLookback: null, -}; - export const searchSideBarFormSelector = formValueSelector('searchSideBar'); export function mapStateToProps(state) { diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx index a28e6453d5..214c49e422 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx +++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ScatterPlot.jsx @@ -23,9 +23,11 @@ import { ONE_MILLISECOND, formatDuration } from '../../../utils/date'; import 'react-vis/dist/style.css'; import './ScatterPlot.css'; -export default function ScatterPlot(props) { - const { data, onValueClick, calculateContainerWidth } = props; - +export default function ScatterPlot({ + data, + onValueClick, + calculateContainerWidth = container => container.clientWidth, +}) { const containerRef = useRef(null); const [containerWidth, setContainerWidth] = useState(0); @@ -103,8 +105,3 @@ ScatterPlot.propTypes = { onValueClick: PropTypes.func.isRequired, calculateContainerWidth: PropTypes.func, }; - -ScatterPlot.defaultProps = { - // JSDOM does not, as of 2023, have a layout engine, so allow tests to supply a mock width as a workaround. - calculateContainerWidth: container => container.clientWidth, -}; diff --git a/packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/TraceHeader.tsx b/packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/TraceHeader.tsx index 5baba664bb..5efeac5604 100644 --- a/packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/TraceHeader.tsx +++ b/packages/jaeger-ui/src/components/TraceDiff/TraceDiffHeader/TraceHeader.tsx @@ -75,8 +75,15 @@ export function Attrs(props: AttrsProps) { ); } -export default function TraceHeader(props: Props) { - const { duration, error, startTime, state, traceID, totalSpans, traceName } = props; +export default function TraceHeader({ + duration, + error = undefined, + startTime, + state, + traceID, + totalSpans, + traceName, +}: Props) { const AttrsComponent = state === fetchedState.DONE ? Attrs : EmptyAttrs; return ( @@ -101,7 +108,3 @@ export default function TraceHeader(props: Props) { ); } - -TraceHeader.defaultProps = { - error: undefined, -}; diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.tsx index d099fcaaed..66924258ed 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.tsx @@ -35,8 +35,7 @@ type AccordianKeyValuesProps = { }; // export for tests -export function KeyValuesSummary(props: { data?: KeyValuePair[] }) { - const { data } = props; +export function KeyValuesSummary({ data = null }: { data?: KeyValuePair[] | null }) { if (!Array.isArray(data) || !data.length) { return null; } @@ -55,12 +54,16 @@ export function KeyValuesSummary(props: { data?: KeyValuePair[] }) { ); } -KeyValuesSummary.defaultProps = { - data: null, -}; - -export default function AccordianKeyValues(props: AccordianKeyValuesProps) { - const { className, data, highContrast, interactive, isOpen, label, linksGetter, onToggle } = props; +export default function AccordianKeyValues({ + className = null, + data, + highContrast = false, + interactive = true, + isOpen, + label, + linksGetter, + onToggle = null, +}: AccordianKeyValuesProps) { const isEmpty = !Array.isArray(data) || !data.length; const iconCls = cx('u-align-icon', { 'AccordianKeyValues--emptyIcon': isEmpty }); let arrow: React.ReactNode | null = null; @@ -94,10 +97,3 @@ export default function AccordianKeyValues(props: AccordianKeyValuesProps) { ); } - -AccordianKeyValues.defaultProps = { - className: null, - highContrast: false, - interactive: true, - onToggle: null, -}; diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianLogs.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianLogs.tsx index 86b0833193..9fd756a7f5 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianLogs.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianLogs.tsx @@ -27,7 +27,7 @@ import './AccordianLogs.css'; type AccordianLogsProps = { interactive?: boolean; isOpen: boolean; - linksGetter: ((pairs: KeyValuePair[], index: number) => Link[]) | TNil; + linksGetter?: ((pairs: KeyValuePair[], index: number) => Link[]) | TNil; // Optional logs: Log[]; onItemToggle?: (log: Log) => void; onToggle?: () => void; @@ -35,8 +35,16 @@ type AccordianLogsProps = { timestamp: number; }; -export default function AccordianLogs(props: AccordianLogsProps) { - const { interactive, isOpen, linksGetter, logs, openedItems, onItemToggle, onToggle, timestamp } = props; +export default function AccordianLogs({ + interactive = true, + isOpen, + linksGetter, + logs, + openedItems = undefined, + onItemToggle = undefined, + onToggle = undefined, + timestamp, +}: AccordianLogsProps) { let arrow: React.ReactNode | null = null; let HeaderComponent: 'span' | 'a' = 'span'; let headerProps: object | null = null; @@ -84,11 +92,3 @@ export default function AccordianLogs(props: AccordianLogsProps) { ); } - -AccordianLogs.defaultProps = { - interactive: true, - linksGetter: undefined, - onItemToggle: undefined, - onToggle: undefined, - openedItems: undefined, -}; diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianText.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianText.tsx index ba21141524..34f2edd60a 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianText.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianText.tsx @@ -31,8 +31,16 @@ type AccordianTextProps = { onToggle?: null | (() => void); }; -export default function AccordianText(props: AccordianTextProps) { - const { className, data, headerClassName, highContrast, interactive, isOpen, label, onToggle } = props; +export default function AccordianText({ + className = null, + data, + headerClassName, + highContrast = false, + interactive = true, + isOpen, + label, + onToggle = null, +}: AccordianTextProps) { const isEmpty = !Array.isArray(data) || !data.length; const iconCls = cx('u-align-icon', { 'AccordianKeyValues--emptyIcon': isEmpty }); @@ -64,10 +72,3 @@ export default function AccordianText(props: AccordianTextProps) { ); } - -AccordianText.defaultProps = { - className: null, - highContrast: false, - interactive: true, - onToggle: null, -}; diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx index a1df1628bc..503a2f43cb 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx @@ -116,16 +116,20 @@ function formatValue(key: string, value: any) { return