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 when searching for a dashboard in the chart list #24546

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
8 changes: 3 additions & 5 deletions superset-frontend/src/pages/ChartList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ function ChartList(props: ChartListProps) {
? {
filters: [
{
col: 'dashboards',
opr: FilterOperator.relationManyMany,
col: 'dashboard_title',
opr: FilterOperator.startsWith,
Copy link
Member Author

Choose a reason for hiding this comment

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

It's using startsWith which is the same operator used by the Datasets filter.

value: filterValue,
},
],
Expand All @@ -287,9 +287,7 @@ function ChartList(props: ChartListProps) {
...filters,
});
const response: void | JsonResponse = await SupersetClient.get({
endpoint: !filterValue
? `/api/v1/dashboard/?q=${queryParams}`
: `/api/v1/chart/?q=${queryParams}`,
endpoint: `/api/v1/dashboard/?q=${queryParams}`,
Copy link
Member

Choose a reason for hiding this comment

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

@michael-s-molina I briefly looked into this logic previously. Could you confirm that your logic also works when you include a filterValue. i.e., text in the SEARCH box?

Copy link
Member Author

Choose a reason for hiding this comment

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

If you use the search input (not the dashboard select) to look for a dashboard name, it won't work. That would require creating a search filter but that's out of the scope of this PR.

}).catch(() =>
addDangerToast(t('An error occurred while fetching dashboards')),
);
Expand Down