Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ exports[`<DdgNodeContent> omits the operation if it is null 1`] = `
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -291,9 +289,7 @@ exports[`<DdgNodeContent> omits the operation if it is null 2`] = `
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -442,9 +438,7 @@ exports[`<DdgNodeContent> renders correctly when decorationValue is a string 1`]
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -593,9 +587,7 @@ exports[`<DdgNodeContent> renders correctly when decorationValue is a string 2`]
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -744,9 +736,7 @@ exports[`<DdgNodeContent> renders correctly when given decorationProgressbar 1`]
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -898,9 +888,7 @@ exports[`<DdgNodeContent> renders correctly when given decorationProgressbar 2`]
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -1049,9 +1037,7 @@ exports[`<DdgNodeContent> renders correctly when isFocalNode = true and focalNod
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -1159,9 +1145,7 @@ exports[`<DdgNodeContent> renders correctly when isFocalNode = true and focalNod
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -1278,9 +1262,7 @@ exports[`<DdgNodeContent> renders the number of operations if there are multiple
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down Expand Up @@ -1446,9 +1428,7 @@ exports[`<DdgNodeContent> renders the number of operations if there are multiple
<span
className="DdgNodeContent--actionsItemIconWrapper"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</span>
<span
className="DdgNodeContent--actionsItemText"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ exports[`<SidePanel> render renders detailLink 1`] = `
rel="noreferrer noopener"
target="_blank"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</a>
</Tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ exports[`MetricCard renders as expected when passCount is zero 1`] = `
rel="noreferrer noopener"
target="_blank"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</a>
</Tooltip>
</span>
Expand Down Expand Up @@ -109,9 +107,7 @@ exports[`MetricCard renders as expected with details 1`] = `
rel="noreferrer noopener"
target="_blank"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</a>
</Tooltip>
</span>
Expand Down Expand Up @@ -228,9 +224,7 @@ exports[`MetricCard renders as expected without details 1`] = `
rel="noreferrer noopener"
target="_blank"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</a>
</Tooltip>
</span>
Expand Down Expand Up @@ -305,9 +299,7 @@ exports[`MetricCard renders as expected without details 2`] = `
rel="noreferrer noopener"
target="_blank"
>
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</a>
</Tooltip>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ exports[`ScoreCard renders as expected when score is below max 1`] = `
target="_blank"
>
How to improve
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</a>
</div>
`;
Expand Down Expand Up @@ -57,9 +55,7 @@ exports[`ScoreCard renders as expected when score is max 1`] = `
target="_blank"
>
Great! What does this mean
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</a>
</div>
`;
Expand Down Expand Up @@ -90,9 +86,7 @@ exports[`ScoreCard renders as expected when score is zero 1`] = `
target="_blank"
>
How to improve
<NewWindowIcon
isLarge={false}
/>
<NewWindowIcon />
</a>
</div>
`;
25 changes: 2 additions & 23 deletions packages/jaeger-ui/src/components/common/ErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ function ErrorAttr({ name, value }: ErrorAttrProps) {
);
}

export function Message(props: SubPartProps) {
const { className, error, wrap, wrapperClassName } = props;
export function Message({ className, error, wrap = false, wrapperClassName }: SubPartProps) {
const cssClass = `ErrorMessage--msg ${className || ''}`;

const msg =
Expand All @@ -66,15 +65,7 @@ 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, error, wrap = false, wrapperClassName }: SubPartProps) {
if (typeof error === 'string') {
return null;
}
Expand Down Expand Up @@ -113,12 +104,6 @@ export function Details(props: SubPartProps) {
return details;
}

Details.defaultProps = {
className: undefined,
wrap: false,
wrapperClassName: undefined,
};

export default function ErrorMessage({
className,
detailClassName,
Expand All @@ -140,9 +125,3 @@ export default function ErrorMessage({
</div>
);
}

ErrorMessage.defaultProps = {
className: undefined,
detailClassName: undefined,
messageClassName: undefined,
};
Original file line number Diff line number Diff line change
Expand Up @@ -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 <IoOpenOutline className={cls} {...rest} data-testid="NewWindowIcon" />;
}

NewWindowIcon.defaultProps = {
isLarge: false,
};
Loading