-
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-894 Add license table in home page #28
Conversation
const [dataTableLicense, setDataTableLicense] = useState([]); | ||
|
||
let idInstitution = ''; | ||
if (stateInstitution.length > 0) { idInstitution = stateInstitution[0].id; } |
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 you can use ternary operator to avoid the if statement. @AuraAlba
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 changed it. This is a temporary implementation, when the institution selector is implemented this will be removed
if (licenseData.length > 5) { | ||
const arraySorted = licenseData.slice().sort((license1, license2) => { | ||
if (license1.numberOfPendingStudents > license2.numberOfPendingStudents) { return 1; } | ||
if (license1.numberOfPendingStudents < license2.numberOfPendingStudents) { return -1; } | ||
return 0; | ||
}); | ||
setDataTableLicense(arraySorted.slice(0, 5)); | ||
} else { setDataTableLicense(licenseData); } | ||
}, [licenseData]); |
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's the purpose of this? @AuraAlba
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.
It return 5 licenses with fewest remaining seats, in home it's only necessary to show these licenses. In the license page will be shown all
1e31ef9
to
9641c5c
Compare
Ticket
https://agile-jira.pearson.com/browse/PADV-894
Description
Add license table in home page
Changes made
Add license table component
Add data to store redux
Update tests
Screenshots
How to test
Clone the Institution Portal MFE
Run npm install.
Run npm run start
Go to http://localhost:1980/dashboard