-
Notifications
You must be signed in to change notification settings - Fork 14k
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: replace datamask with key from new key value api #17680
fix: replace datamask with key from new key value api #17680
Conversation
/testenv up |
@pkdotson Ephemeral environment spinning up at http://54.191.208.158:8080. Credentials are |
@@ -88,7 +88,6 @@ export const useFilterUpdates = ( | |||
) => { | |||
const filters = useFilters(); | |||
const dataMaskApplied = useNativeFiltersDataMask(); | |||
|
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.
Could we remove the unnecessary change?
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/utils.ts
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx
Outdated
Show resolved
Hide resolved
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 Philip. I have added some comments.If you have any questions, feel free ping me.
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/keyValue.tsx
Outdated
Show resolved
Hide resolved
BTW: We have to fix this issue in separate PR. @michael-s-molina @pkdotson filter_put_method.mov |
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.
A few quick comments. Great work and seems to work nicely, but it's missing one key feature that we discussed with @michael-s-molina that's needed: when a user enters a dashboard with the native filter key, it should initialize a new key-value pair based on the contents of the original one. This is to ensure a user can have multiple tabs open based on the same key; when opening the new tab, the key will change, which will ensure that the state of the original tab is not overwritten. This is mostly an edge case for regular users, but an important one for public dashboards, where circulating the key to others will lead to the original state being overwritten if another anonymous user changes the filters.
…set-io/superset into frontend-dashboard-longurl-2
/testenv up |
@rusackas Ephemeral environment spinning up at http://52.33.231.170:8080. Credentials are |
superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx
Outdated
Show resolved
Hide resolved
/testenv up |
@rusackas Ephemeral environment spinning up at http://35.86.151.100:8080. Credentials are |
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.
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, thanks for the hard work here!
Ephemeral environment shutdown and build artifacts deleted. |
@zhaoyongjie This has been fixed in #17878 |
Thank you for the hard work @pkdotson! |
* afirst stage to ccheck to get initial datamask * clean up code and update typescript * remove consoles * fix ts and update copy dashboard url * use key when one doesn't exists * lint clean up * fix errors * add suggested changes * remove line * add tests and add changes for copydashboard * fix lint * fix lint * fix lint * Update superset-frontend/src/dashboard/components/Header/index.jsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * add timeout * fix test * fix test, add qs to cypress and add suggestions * add suggestions * fix lint * more suggested changes for backwards comapat * fix lint * cleanup naming and add qs parse to tests * Update superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * Update superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * more changes and fix lint * remove nativefiler param * fix path * remove con * simplify logic Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
* afirst stage to ccheck to get initial datamask * clean up code and update typescript * remove consoles * fix ts and update copy dashboard url * use key when one doesn't exists * lint clean up * fix errors * add suggested changes * remove line * add tests and add changes for copydashboard * fix lint * fix lint * fix lint * Update superset-frontend/src/dashboard/components/Header/index.jsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * add timeout * fix test * fix test, add qs to cypress and add suggestions * add suggestions * fix lint * more suggested changes for backwards comapat * fix lint * cleanup naming and add qs parse to tests * Update superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * Update superset-frontend/src/dashboard/components/menu/ShareMenuItems/index.tsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * more changes and fix lint * remove nativefiler param * fix path * remove con * simplify logic Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
SUMMARY
This pr fixes the longurl problem in dashboard when a user has a lot of filters and shares the url with other users. The long copied url had the potential to break loading the dashboard. This pr uses the new keyvalue api for dashboard to replace the datamask content with secure hashed key.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before
Screen.Recording.2021-12-08.at.5.59.57.PM.mov
after
Screen.Recording.2021-12-08.at.6.14.05.PM.mov
TESTING INSTRUCTIONS
Go to a dashboard and create filters. Ensure that the nativefilters param has a hashed key when applying new filters and saving the dashboard url.
ADDITIONAL INFORMATION