-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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(dashboard list): do not show favorite star for anonymous users #18210 #19409
fix(dashboard list): do not show favorite star for anonymous users #18210 #19409
Conversation
eb597e6
to
34820b4
Compare
Codecov Report
@@ Coverage Diff @@
## master #19409 +/- ##
==========================================
+ Coverage 66.48% 66.59% +0.10%
==========================================
Files 1670 1677 +7
Lines 63965 64237 +272
Branches 6512 6538 +26
==========================================
+ Hits 42528 42778 +250
- Misses 19748 19764 +16
- Partials 1689 1695 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -44,7 +44,7 @@ interface DashboardCardProps { | |||
saveFavoriteStatus: (id: number, isStarred: boolean) => void; | |||
favoriteStatus: boolean; | |||
dashboardFilter?: string; | |||
userId?: number; | |||
userId?: string | number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! I don't think that this should ever be a string? Could you give me more context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found it strange too, but it comes from already existing code: DashboardList.tsx:73
and I didn't want to dig deep into this for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be number. You can take note of it for a follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be number. You can take note of it for a follow up.
original: { id }, | ||
}, | ||
}: any) => | ||
userId ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this over userId &&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, I'll change it
5254a95
to
2fc450c
Compare
2fc450c
to
ced4cea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -44,7 +44,7 @@ interface DashboardCardProps { | |||
saveFavoriteStatus: (id: number, isStarred: boolean) => void; | |||
favoriteStatus: boolean; | |||
dashboardFilter?: string; | |||
userId?: number; | |||
userId?: string | number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be number. You can take note of it for a follow up.
@@ -44,7 +44,7 @@ interface DashboardCardProps { | |||
saveFavoriteStatus: (id: number, isStarred: boolean) => void; | |||
favoriteStatus: boolean; | |||
dashboardFilter?: string; | |||
userId?: number; | |||
userId?: string | number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be number. You can take note of it for a follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work @dudasaron ! Thanks not only for fixing this, but also cleaning up the code + adding tests ❤️
Hey I am facing same error....please let me know how to fix that issue....i read the whole conversation but did not understand what changes to be done in config.py file.....I wrote PUBLIC_ROLE_LIKE = "Gamma" in config.py file then relaunched it through superset init but still i face the same unexpected error..ListViewError: Invalid filter config, id is not present in columns...pls Help me out @dudasaron or @villebro or anyone who knows how to fix this issue. |
Hi @crazamahdi, I think you were referring to the reproduction steps of the bug. What version are you using? This fix is only merged into master, but it's not yet part of any released version. If you don't have the time to wait until it makes into the official release, you can create a fork of the latest release of superset (1.4.2 as of now) and cherry pick the merge commit on top of that. |
Hey thanks for your reply …I am using version 1.4.1…but I have superset version 1.4.1 on my local machine which works fine (running on http)…now when I installed the same version on my work machine(Aws instance Ubuntu 20) it throws me this unexpected error ListViewError….(while running on HTTPS)…I don’t understand how same version of superset is working on my local machine and not on my work machine….is it something related to HTTP and HTTPS? If so what changes should I do in config file to run it on https. For me I am not even able to login through admin…after entering credentials this unexpected error screen shows up I tried installing, deleting and reinstalling various versions of superset on my work machine but everytime it throws some unexpected error….please help me out with this issue I tried resolving it for more than 4 days but no success yet@dudasaron |
Hello, I took the liberty of disturbing, I am using the same version of the program, but I use centos, and now I am encountering the same problem as you, do you have a solution now? I found myself that even if I logged in, I would always stay on the first page of the previous page described by the author, similar to the refresh operation, but I myself used wechat to browse the web page, although there would be an operation described by the author, I could still log in and show two or three pictures of the previous page. Thank you very much. |
Hey @chenshaojie I am still stuck at the same issue…hoping they release the fixed version soon. Got to know that issue is from their end and the fix is not yet officially released but committed to master branch. U can wait for release or u can try from GitHub directly. (If GitHub one works pls let me know too) |
Hey @chenshaojie I finally managed to solved that error. Solve the login error by commenting the following lines in config.py file Comment settings as below:#SESSION_COOKIE_SAMESITE = "None" someone helped me with the solution on stack overflow. |
thank you very much !૧(●´৺`●)૭ I will try it 😘
…---Original---
From: "Raza Mahdi ***@***.***>
Date: Sun, Apr 24, 2022 11:05 AM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [apache/superset] fix(dashboard list): do not show favorite starfor anonymous users #18210 (PR #19409)
Hey @chenshaojie I finally managed to solved that error. Solve the login error by commenting the following lines in config.py file
Comment settings as below:
#SESSION_COOKIE_SAMESITE = "None"
#SESSION_COOKIE_SECURE = True
someone helped me with the solution on stack overflow.
and it worked well for me.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
…ache#18210 (apache#19409) * fix: Only show favorite star on dashboard list if user is logged in apache#18210 * Fix linter errors
…ache#18210 (apache#19409) * fix: Only show favorite star on dashboard list if user is logged in apache#18210 * Fix linter errors
SUMMARY
A previous commit removed the
FaveStar
component and theid
column with it from the dashboards list view for anonymous users. This broke theCERTIFIED
filter because it also depends on theid
column.This PR re-adds the id column, but removes the favorite star and hides the column if the user is not logged in. Also removing the stars from the
DashboardCard
component if not applicable.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
Anonymous user, list/card view:
Logged in user, dashboard (for reference, not supposed to change):
Logged in user, list view (for reference, not supposed to change):
Logged in user, card view (for reference, not supposed to change):
After
Anonymous user, list view:
Anonymous user, card view:
Logged in user, dashboard (not supposed to change visually, but screenshot is included because some components are modified):
Logged in user, list view (not supposed to change visually, but screenshot is included because some components are modified):
Logged in user, card view (not supposed to change visually, but screenshot is included because some components are modified):
TESTING INSTRUCTIONS
Automated tests added for both logged in/anonymous cases for table and card view.
For manual testing add
to
docker/pythonpath_dev/superset_config.py
and rundocker compose up
.Log in as admin and add the
all datasource access on all_datasource_access
andall database access on all_database_access
permissions to the public role.After logging out, navigate to http://localhost:3000/superset/dashboards/list and the dashboard list should open without an error and the CERTIFIED filter should work and the favorite star should not be present on the list view nor the table view. When logging in, the favorite star should be there.
ADDITIONAL INFORMATION