-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
support direct table filter link #146
Conversation
ui/src/utils/History.js
Outdated
* @returns {string} Param value from url | ||
*/ | ||
export const getHistory = (query) => { | ||
export const getHistory = (query, defaultReturn = null) => { |
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.
Please chagne to defaultValue
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.
changed
const classes = useStyles(); | ||
// eslint-disable-next-line |
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.
do we need it ?
@@ -150,7 +150,7 @@ const FilterBar = ({ | |||
} | |||
}); | |||
|
|||
updateFilters(filters); | |||
setFilters(filters); |
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.
update filters updates the history as well incase of bad filter passed at the url.
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.
what is a bad filter? this code removes the table filters.
If we have a "bad" filter the code will not use them
const classes = useStyles(); | ||
// eslint-disable-next-line | ||
const [tableFilters, setTableFilters] = useTableFilters({}); |
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.
Where do you use tableFilters ? (I only see you use setTableFilters)
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.
fixed
What type of PR is this?
/UI Feature
What this PR does / why we need it:
support direct table filter link
for example, when the user goes to: /?filters=resource:aws_apigateway&executionId=general_1598464963&sortColumn=Name&direction=asc&search=test&rows=100&page=1
the resource table component will set the get parameters:
sortColumn
direction
search
rows
with the URL values