Skip to content
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

Merged
merged 1 commit into from
Jan 16, 2024
Merged

PADV-894 Add license table in home page #28

merged 1 commit into from
Jan 16, 2024

Conversation

AuraAlba
Copy link
Contributor

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

Screenshot from 2024-01-11 17-23-43

How to test

Clone the Institution Portal MFE
Run npm install.
Run npm run start
Go to http://localhost:1980/dashboard

@AuraAlba AuraAlba requested a review from Squirrel18 January 11, 2024 22:29
const [dataTableLicense, setDataTableLicense] = useState([]);

let idInstitution = '';
if (stateInstitution.length > 0) { idInstitution = stateInstitution[0].id; }

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

Copy link
Contributor Author

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

Comment on lines 23 to 33
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]);

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

Copy link
Contributor Author

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

@AuraAlba AuraAlba merged commit d708d96 into master Jan 16, 2024
2 checks passed
@AuraAlba AuraAlba deleted the vue/APDV-894 branch January 16, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants