Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Error Message is cut off in alerts & reports log page #19444

Merged
merged 1 commit into from
Apr 6, 2022
Merged
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
10 changes: 10 additions & 0 deletions superset-frontend/src/views/CRUD/alert/ExecutionLog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import moment from 'moment';
import React, { useEffect, useMemo } from 'react';
import { Link, useParams } from 'react-router-dom';
import ListView from 'src/components/ListView';
import { Tooltip } from 'src/components/Tooltip';
import SubMenu from 'src/views/components/SubMenu';
import withToasts from 'src/components/MessageToasts/withToasts';
import { fDuration } from 'src/modules/dates';
Expand Down Expand Up @@ -144,6 +145,15 @@ function ExecutionLog({ addDangerToast, isReportEnabled }: ExecutionLogProps) {
{
accessor: 'error_message',
Header: t('Error message'),
Cell: ({
row: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure all rows are objects that have an original nested object?
If not, this could fail, and maybe we need to use optional chaining instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @diegomedina248 , all rows have the nested object which contains original.
We can confirm this from line# 133. (https://github.com/apache/superset/pull/19444/files#diff-b0502ccd40e521f12fa41224e8486ad60145cbccb955f2122c1a4da6f5904081R133)

original: { error_message = '' },
},
}: any) => (
<Tooltip title={error_message} placement="topLeft">
<span>{error_message}</span>
</Tooltip>
),
},
],
[isReportEnabled],
Expand Down