-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat(ocpadvisor-123): functional filters with mockdata #629
feat(ocpadvisor-123): functional filters with mockdata #629
Conversation
1eff54e
to
0bd5112
Compare
Codecov ReportAttention:
📢 Thoughts on this report? Let us know! |
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.
Amazing job @Fewwy! 😄 Filters work as expected, tested with multiple filters at once.
Just a question, what about the filter params in 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.
Good idea with the json!
src/Components/Common/Tables.js
Outdated
const mapping = { | ||
1: 'low', | ||
2: 'moderate', | ||
3: 'important', | ||
4: 'critical', | ||
}; |
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.
Really like this mapping, will propably refactor the severityTypeTotext
to use this mapping and just uppercase the first letter.
b53ded6
to
236eb4c
Compare
9d33bb9
to
395a0e1
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.
Well done, filters work as expected! 😄
delete cleanedUpParams.sortDirection; | ||
delete cleanedUpParams.offset; | ||
delete cleanedUpParams.limit; | ||
return Object.values(cleanedUpParams).filter((value) => !isEmpty(value)); |
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.
You could return this instead
return Object.values(cleanedUpParams).filter((value) => !isEmpty(value)); | |
return ( | |
Object.values(cleanedUpParams).filter((value) => !isEmpty(value)).length > 0 | |
); |
and then remove the filtersApplied
state, since it's not used in any effect.
Used like this: showDeleteButton: noFiltersApplied(filters)
/retest |
🎉 This PR is included in version 1.25.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Working filters for the workloads table
No URL PARAMS YET! Gonna work on them in a separate PR
How to setup mock api:
Clone insights-results-aggregator-mock
make build (takes a few minutes for me, coffee time ☕)
2.1. can speed it up with make build -j 4 to run multiple jobs at once
make run
Test the mocked api curl localhost:8080/api/insights-results-aggregator/v2/namespaces/dvo
Run the app MOCK=true npm run start:proxy:beta
Workloads should load mocked data
How to test with local data:
You can use the mock data provided from the json file - for that you need comment out data from props and use json