pkdotson commented on a change in pull request #16393:
URL: https://github.com/apache/superset/pull/16393#discussion_r707631910
##########
File path: superset-frontend/src/views/CRUD/chart/ChartList.tsx
##########
@@ -417,113 +417,110 @@ function ChartList(props: ChartListProps) {
],
);
- const favoritesFilter: Filter = {
- Header: t('Favorite'),
- id: 'id',
- urlDisplay: 'favorite',
- input: 'select',
- operator: FilterOperator.chartIsFav,
- unfilteredLabel: t('Any'),
- selects: [
- { label: t('Yes'), value: true },
- { label: t('No'), value: false },
- ],
- };
-
- const filters: Filters = [
- {
- Header: t('Owner'),
- id: 'owners',
+ const favoritesFilter: Filter = useMemo(
+ () => ({
+ Header: t('Favorite'),
+ id: 'id',
+ urlDisplay: 'favorite',
input: 'select',
- operator: FilterOperator.relationManyMany,
- unfilteredLabel: t('All'),
- fetchSelects: createFetchRelated(
- 'chart',
- 'owners',
- createErrorHandler(errMsg =>
- addDangerToast(
- t(
- 'An error occurred while fetching chart owners values: %s',
- errMsg,
+ operator: FilterOperator.chartIsFav,
+ unfilteredLabel: t('Any'),
+ selects: [
+ { label: t('Yes'), value: true },
+ { label: t('No'), value: false },
+ ],
+ }),
+ [],
+ );
+
+ const filters: Filters = useMemo(
Review comment:
Nice, I think memoize works here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]