fix: do not render favorite favStars and filters for anonymous user#14120
Conversation
|
Last commit 43fe481 for lint issue has 2 problems:
Will digg into this later... |
Codecov Report
@@ Coverage Diff @@
## master #14120 +/- ##
=======================================
Coverage 77.40% 77.40%
=======================================
Files 958 958
Lines 48324 48343 +19
Branches 5677 5689 +12
=======================================
+ Hits 37403 37420 +17
- Misses 10721 10723 +2
Partials 200 200
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Thank you for contributing your first PR! |
suddjian
left a comment
There was a problem hiding this comment.
One nit, would be nice if it was addressed but it's non-blocking. This LGTM.
There was a problem hiding this 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.
|
@suddjian, indeed, removing the At this moment I can't figure a way to remove this type casting for this conditional definition... |
495ab63 to
1691b9c
Compare
|
I rebased manually into one commit a fix for hiding favorite's favStars and filters for char and dashbord lists (the flash message issue was fixed in btw into another issue: #14287). Although, I notice a related left over issue; the $ curl "http://localhost:9000/superset/favstar/Dashboard/1/select/"
$ curl "http://localhost:9000/superset/favstar/Dashboard/1/unselect/" |
|
I think I see what's going on with that typing issue. Typescript is inferring a type for the temporary array that is broader than the |
|
Hi @trepmag, I'm wondering if you were interested in trying out my proposed fix for the Filter type. I'm happy to merge this as is if you prefer, just let me know. |
|
Oh you're absolutely right, I missed that somehow. Thanks! No need to squash, commits will be squashed automatically when the PR is merged. |
…pache#14120) * fix: do not render favorite favStar and filter for anonymous user * fix: prevent anonymous user to trigger the favstar view route * fix: lint over previous commit * fix: linter follow-up
…pache#14120) * fix: do not render favorite favStar and filter for anonymous user * fix: prevent anonymous user to trigger the favstar view route * fix: lint over previous commit * fix: linter follow-up
…pache#14120) * fix: do not render favorite favStar and filter for anonymous user * fix: prevent anonymous user to trigger the favstar view route * fix: lint over previous commit * fix: linter follow-up
…pache#14120) * fix: do not render favorite favStar and filter for anonymous user * fix: prevent anonymous user to trigger the favstar view route * fix: lint over previous commit * fix: linter follow-up

Do not render favorite favStars and filters for charts and dashboards lists for anonymous user
When browsing browsing those lists as anonymous user then 2 issues appears:
A flash message popup with the text: "There was an error fetching the favorite status: Internal Server Error"=> fixed in fix: Make g.user attribute access safe for public users #14287Screenshots
Before:
See issue #14070 screenshot.
After:

TEST PLAN
Manually:
Automatic test:
...