-
Notifications
You must be signed in to change notification settings - Fork 0
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
PADV-1007 - Filter License Pool View by Course and name #39
Conversation
6350bc8
to
e1469ee
Compare
const form = e.target; | ||
const formData = new FormData(form); | ||
const formJson = Object.fromEntries(formData.entries()); | ||
const urlParams = Object.entries(formJson) |
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 is this necessary?
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 allows me to capture the select values of the form, then dynamically build the url params to make the request.
dispatch(updateFilters(formJson)); | ||
dispatch(updateCurrentPage(initialPage)); | ||
licenseData.current = licenseOptions; | ||
dispatch(fetchLicensesData(institution.id, initialPage, urlParams)); |
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.
In fact, the url params is required, maybe the thunk params isn't clear, so I'll check it
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.
url params name is too general and I think this url params are only for filters
dispatch(fetchLicensesData(institution.id, initialPage, urlParams)); | |
dispatch(fetchLicensesData(institution.id, initialPage, urlParamsFilters)); |
90fe25c
to
fb90497
Compare
fb90497
to
e0bdc44
Compare
src/features/Licenses/data/thunks.js
Outdated
@@ -8,11 +8,11 @@ import { | |||
fetchLicensesDataFailed, | |||
} from 'features/Licenses/data/slice'; | |||
|
|||
function fetchLicensesData(id, currentPage) { | |||
function fetchLicensesData(id, currentPage, urlParams) { |
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.
Is better to name it filtersData because is the data you are passing in this parameter, the others variables(currentPage, institutionId) are also urlparams so is too general. Instead of changing the name variable, add the docs for the function describing that there are the url params to filter
function fetchLicensesData(id, currentPage, urlParams) { | |
function fetchLicensesData(id, currentPage, filtersData) { |
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.
@01001110J you can name it same as the dispatch part, no problem with that
dispatch(updateFilters(formJson)); | ||
dispatch(updateCurrentPage(initialPage)); | ||
licenseData.current = licenseOptions; | ||
dispatch(fetchLicensesData(institution.id, initialPage, urlParams)); |
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.
url params name is too general and I think this url params are only for filters
dispatch(fetchLicensesData(institution.id, initialPage, urlParams)); | |
dispatch(fetchLicensesData(institution.id, initialPage, urlParamsFilters)); |
e0bdc44
to
00e6c0c
Compare
fix: Bug with missing options fix: Unit test and button validation fix: All broken test fix: src/features/Licenses/LicensesFilters/index.jsx Co-authored-by: Aura Milena Alba <[email protected]> fix: src/features/Licenses/LicensesFilters/__test__/index.test.jsx Co-authored-by: Andrés Felipe Bermúdez Mendoza <[email protected]> fix: src/features/Licenses/data/_test_/redux.test.jsx Co-authored-by: Andrés Felipe Bermúdez Mendoza <[email protected]> fix: Bug on change institution refactor: Request params name
00e6c0c
to
9320ee2
Compare
Description
This PR adds the
LicensesFilters
component, allowing users to filter licenses based on courses. It integrates the selector from React Paragon and Topaz libraries for courses options and utilizes form control from Paragon for license names. This implementation aims to enhance user experience and simplify the filtering process.This PR resolves ticket
Change log
src/features/Licenses/data/_test_/redux.test.jsx
.src/features/Licenses/LicensesPage/index.jsx
.Visual results
Before
After
How to test
Clone the Institution Portal MFE
Install the packages 📦.
Start project.
Finally, go to http://localhost:1980/licenses and see the results.