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
{content}
; } -export const LinkValue = (props: { href: string; title?: string; children: React.ReactNode }) => ( - - {props.children} +export const LinkValue = ({ + href, + title = '', + children, +}: { + href: string; + title?: string; + children: React.ReactNode; +}) => ( + + {children} ); -LinkValue.defaultProps = { - title: '', -}; - const linkValueList = (links: Link[]) => { const dropdownItems = links.map(({ text, url }, index) => ({ label: {text}, diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/Ticks.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/Ticks.tsx index d6893be477..28eacbee5e 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/Ticks.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/Ticks.tsx @@ -26,9 +26,7 @@ type TicksProps = { startTime?: number | TNil; }; -export default function Ticks(props: TicksProps) { - const { endTime, numTicks, showLabels, startTime } = props; - +export default function Ticks({ endTime = null, numTicks, showLabels = null, startTime = null }: TicksProps) { let labels: undefined | string[]; if (showLabels) { labels = []; @@ -57,9 +55,3 @@ export default function Ticks(props: TicksProps) { } return
{ticks}
; } - -Ticks.defaultProps = { - endTime: null, - showLabels: null, - startTime: null, -}; diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineRow.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineRow.tsx index a041119396..d72ba3a3e6 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineRow.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/TimelineRow.tsx @@ -28,8 +28,7 @@ interface ITimelineRowCellProps extends React.HTMLAttributes { style?: object; } -export default function TimelineRow(props: TTimelineRowProps) { - const { children, className = '', ...rest } = props; +export default function TimelineRow({ children, className = '', ...rest }: TTimelineRowProps) { return (
{children} @@ -37,12 +36,7 @@ export default function TimelineRow(props: TTimelineRowProps) { ); } -TimelineRow.defaultProps = { - className: '', -}; - -function TimelineRowCell(props: ITimelineRowCellProps) { - const { children, className = '', width, style, ...rest } = props; +function TimelineRowCell({ children, className = '', width, style = {}, ...rest }: ITimelineRowCellProps) { const widthPercent = `${width * 100}%`; const mergedStyle = { ...style, flexBasis: widthPercent, maxWidth: widthPercent }; return ( @@ -52,6 +46,4 @@ function TimelineRowCell(props: ITimelineRowCellProps) { ); } -TimelineRowCell.defaultProps = { className: '', style: {} }; - TimelineRow.Cell = TimelineRowCell; diff --git a/packages/jaeger-ui/src/components/common/BreakableText.tsx b/packages/jaeger-ui/src/components/common/BreakableText.tsx index a9090e5a63..eb98dc5cd6 100644 --- a/packages/jaeger-ui/src/components/common/BreakableText.tsx +++ b/packages/jaeger-ui/src/components/common/BreakableText.tsx @@ -24,8 +24,7 @@ type Props = { wordRegexp?: RegExp; }; -export default function BreakableText(props: Props) { - const { className, text, wordRegexp = WORD_RX } = props; +export default function BreakableText({ className, text = 'BreakableText', wordRegexp = WORD_RX }: Props) { if (!text) { return typeof text === 'string' ? text : null; } @@ -43,8 +42,3 @@ export default function BreakableText(props: Props) { } return spans; } - -BreakableText.defaultProps = { - className: 'BreakableText', - wordRegexp: WORD_RX, -}; diff --git a/packages/jaeger-ui/src/components/common/ErrorMessage.tsx b/packages/jaeger-ui/src/components/common/ErrorMessage.tsx index cfa7d1dd81..ad5a7ca279 100644 --- a/packages/jaeger-ui/src/components/common/ErrorMessage.tsx +++ b/packages/jaeger-ui/src/components/common/ErrorMessage.tsx @@ -48,8 +48,12 @@ function ErrorAttr({ name, value }: ErrorAttrProps) { ); } -export function Message(props: SubPartProps) { - const { className, error, wrap, wrapperClassName } = props; +export function Message({ + className = undefined, + error, + wrap = false, + wrapperClassName = undefined, +}: SubPartProps) { const cssClass = `ErrorMessage--msg ${className || ''}`; const msg = @@ -66,15 +70,12 @@ export function Message(props: SubPartProps) { return msg; } -Message.defaultProps = { - className: undefined, - wrap: false, - wrapperClassName: undefined, -}; - -export function Details(props: SubPartProps) { - const { className, error, wrap, wrapperClassName } = props; - +export function Details({ + className = undefined, + error, + wrap = false, + wrapperClassName = undefined, +}: SubPartProps) { if (typeof error === 'string') { return null; } @@ -113,17 +114,11 @@ export function Details(props: SubPartProps) { return details; } -Details.defaultProps = { - className: undefined, - wrap: false, - wrapperClassName: undefined, -}; - export default function ErrorMessage({ - className, - detailClassName, + className = undefined, + detailClassName = undefined, error, - messageClassName, + messageClassName = undefined, }: ErrorMessageProps) { if (!error) { return null; @@ -140,9 +135,3 @@ export default function ErrorMessage({
); } - -ErrorMessage.defaultProps = { - className: undefined, - detailClassName: undefined, - messageClassName: undefined, -}; diff --git a/packages/jaeger-ui/src/components/common/LoadingIndicator.tsx b/packages/jaeger-ui/src/components/common/LoadingIndicator.tsx index 282e1188e3..9527edd882 100644 --- a/packages/jaeger-ui/src/components/common/LoadingIndicator.tsx +++ b/packages/jaeger-ui/src/components/common/LoadingIndicator.tsx @@ -25,8 +25,13 @@ type LoadingIndicatorProps = { style?: React.CSSProperties; }; -export default function LoadingIndicator(props: LoadingIndicatorProps) { - const { centered, vcentered, className, small, ...rest } = props; +export default function LoadingIndicator({ + centered = false, + vcentered = false, + className = undefined, + small = false, + ...rest +}: LoadingIndicatorProps) { const cls = ` LoadingIndicator ${centered ? 'is-centered' : ''} @@ -36,9 +41,3 @@ export default function LoadingIndicator(props: LoadingIndicatorProps) { `; return ; } - -LoadingIndicator.defaultProps = { - centered: false, - className: undefined, - small: false, -}; diff --git a/packages/jaeger-ui/src/components/common/NewWindowIcon.tsx b/packages/jaeger-ui/src/components/common/NewWindowIcon.tsx index bbe48f2c7f..4a5dd7037a 100644 --- a/packages/jaeger-ui/src/components/common/NewWindowIcon.tsx +++ b/packages/jaeger-ui/src/components/common/NewWindowIcon.tsx @@ -22,12 +22,7 @@ type Props = { isLarge?: boolean; }; -export default function NewWindowIcon(props: Props) { - const { isLarge, ...rest } = props; +export default function NewWindowIcon({ isLarge = false, ...rest }: Props) { const cls = cx('NewWindowIcon', { 'is-large': isLarge }); return ; } - -NewWindowIcon.defaultProps = { - isLarge: false, -}; diff --git a/packages/plexus/src/zoom/MiniMap.tsx b/packages/plexus/src/zoom/MiniMap.tsx index 4bc76104fe..09bc3706fb 100644 --- a/packages/plexus/src/zoom/MiniMap.tsx +++ b/packages/plexus/src/zoom/MiniMap.tsx @@ -81,8 +81,8 @@ function getClassNames(props: TProps) { }; } -export function MiniMap(props: TProps) { - const css = getClassNames(props); +export function MiniMap({ className = '', classNamePrefix = 'plexus', ...props }: TProps) { + const css = getClassNames({ className, classNamePrefix, ...props }); const mapSize = getMapSize(props); const activeXform = getViewTransform(props, mapSize); return ( @@ -103,9 +103,4 @@ export function MiniMap(props: TProps) { ); } -MiniMap.defaultProps = { - className: '', - classNamePrefix: 'plexus', -}; - export default React.memo(MiniMap);