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-926 change manage store to reduxin main and instructors pages #26

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

AuraAlba
Copy link
Contributor

@AuraAlba AuraAlba commented Jan 3, 2024

Ticket

https://agile-jira.pearson.com/browse/PADV-926

Description

Manage unique state with redux to shared state between components

Changes made

Define redux actions and reducer for instructors and main
Import redux store in other pages
Add and update tests

How to test

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

@AuraAlba AuraAlba requested a review from anfbermudezme January 3, 2024 15:21
@@ -1,40 +1,20 @@
import React, { useState, useReducer, useEffect } from 'react';
import React, { useState, useEffect } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not using this right now, Am I correct? Please add an inline comment showing that this module will change. @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.

done

@@ -5,7 +5,7 @@ import {
UPDATE_CURRENT_PAGE,
} from 'features/Students/actionTypes';
import { RequestStatus } from 'features/constants';
import reducer from 'features/Instructors/InstructorsPage/reducer';
import reducer from 'features/Students/StudentsPage/reducer';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? @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 was using the incorrect reducer, was the same definition and didn't give error so for the moment I import the correct reducer but that will be removed in the other ticket

@@ -34,7 +34,7 @@ const initialState = {
};

const StudentsFilters = ({ resetPagination, fetchData, setFilters }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we will move this component to redux. Is that correct? @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.

Yes, in the other ticket the student and courses pages will be moved to redux

@@ -0,0 +1,36 @@
/* eslint-disable no-param-reassign */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary? @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.

Eslint give this error because the reducer modify directly the property of the state, the good practice is make copy of the object and modify it but redux improve that so we can use it, only with reducer of redux

@AuraAlba AuraAlba merged commit d5051a9 into master Jan 4, 2024
2 checks passed
@AuraAlba AuraAlba deleted the vue/PADV-805 branch January 4, 2024 15:31
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