suddjian commented on a change in pull request #14120:
URL: https://github.com/apache/superset/pull/14120#discussion_r622481056



##########
File path: superset-frontend/src/views/CRUD/dashboard/DashboardList.tsx
##########
@@ -410,18 +420,22 @@ function DashboardList(props: DashboardListProps) {
         { label: t('Unpublished'), value: false },
       ],
     },
-    {
-      Header: t('Favorite'),
-      id: 'id',
-      urlDisplay: 'favorite',
-      input: 'select',
-      operator: FilterOperators.dashboardIsFav,
-      unfilteredLabel: t('Any'),
-      selects: [
-        { label: t('Yes'), value: true },
-        { label: t('No'), value: false },
-      ],
-    },
+    ...(props.user.userId
+      ? [
+          {
+            Header: t('Favorite'),
+            id: 'id',
+            urlDisplay: 'favorite',
+            input: 'select',
+            operator: FilterOperators.dashboardIsFav,
+            unfilteredLabel: t('Any'),
+            selects: [
+              { label: t('Yes'), value: true },
+              { label: t('No'), value: false },
+            ],
+          } as Filter,

Review comment:
       Is there any way we can cleanly avoid using `as Filter` here? Ideally 
the type system would know that this object is compatible without a type 
assertion.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to