-
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-961 feat: Add instructor assignment section #31
Conversation
@@ -51,7 +55,30 @@ describe('Common api services', () => { | |||
|
|||
expect(httpClientMock.get).toHaveBeenCalledTimes(1); | |||
expect(httpClientMock.get).toHaveBeenCalledWith( | |||
'http://localhost:18000/pearson_course_operation/api/v2/license-pool/?limit=true&institution_id=1', | |||
'http://localhost:18000/pearson_course_operation/api/v2/license-pool/' |
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.
Could we set 'http://localhost:18000/pearson_course_operation/api/v2/' as a variable? @AuraAlba
@@ -1,4 +1,3 @@ | |||
// eslint-disable-next-line import/no-extraneous-dependencies |
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 this is working now? @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 added this file in the list of eslintignore so this line is not necessary
}, [idInstitution]); // eslint-disable-line react-hooks/exhaustive-deps | ||
|
||
useEffect(() => { | ||
// Show in home only two first classes |
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.
// Show in home only two first classes | |
// Display only the first 'NumberOfClasses' on the homepage. |
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 number of classes? in the home page will display the two first classes without instructor assign
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.
got it, is a variable
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.
Done
|
||
useEffect(() => { | ||
// Show in home only two first classes | ||
if (classesData.length > 2) { |
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 do you think set the number 2 as a variable? @AuraAlba
if (classesData.length > 2) { | |
if (classesData.length > NumberOfClasses) { |
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.
Done
useEffect(() => { | ||
// Show in home only two first classes | ||
if (classesData.length > 2) { | ||
setClassCards(classesData.slice(0, 2)); |
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.
setClassCards(classesData.slice(0, 2)); | |
setClassCards(classesData.slice(0, NumberOfClasses)); |
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.
Done
<Col xs="12"> | ||
<h4 className="title-instr-assign">Instructor assignment</h4> | ||
{classCards.map(classInfo => <ClassCard data={classInfo} />)} | ||
{classesData.length > 2 && ( |
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.
{classesData.length > 2 && ( | |
{classesData.length > NumberOfClasses && ( |
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.
Done
preloadedState = {}, | ||
// Automatically create a store instance if no store was passed in | ||
store = initializeStore(preloadedState), | ||
...renderOptions |
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.
...renderOptions | |
...renderOptions, |
Trailing comma.
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 change makes failed redux test: Unexpected trailing comma after rest element. So I won't add it
b16d982
to
54dad64
Compare
54dad64
to
691b074
Compare
Ticket
https://agile-jira.pearson.com/browse/PADV-961
Description
Add instructor assignment section
Changes made
Add instructor assignment section
Move getClassesByInstitution to common folder
Replace moment for date-fns required for the calendar component
Update tests
Define renderWithProviders for redux test to avoid import of provider in every test
Screenshots
How to test
Clone the Institution Portal MFE
Run npm install.
Run npm run start
Go to http://localhost:1980/dashboard