dajr_david_michel_13_13_03_2023's People
dajr_david_michel_13_13_03_2023's Issues
add reset middleware and reducers
refacto profile slice
- move
userStatus
into enum folder - move initial state into initialState file
improve and finish auth persistence
link redux logic with react form, redirect to profile page on success
Add utils file
- remove
getToken
method from User service and make it a function exported from utils file, namedgetStorageToken
- Add
getStorageTokenOrThrow
method - Call it outside services, inside middlewares
- Add
setStorageToken
- Add
deleteStorageToken
refacto Nav into smaller components
display errors
- remove generic error messages in reducers
- custom error should show when failing login
- custom error should display when failing form edit
- remove error message in store when closing edit form
add editing profile react logic, add style to EditProfile
add Profile page with default template
redirect to Login page instead of Home when disconnecting
install prop-types, add PropTypes and jsdoc for Features and Feature
add redux environment and authentification base logic
add font awesome cdn and change page title
add Error middleware
- add an error middleware to handle error type
- add a
MissingTokenError
class to handle missing tokens
add redux environment and logic to get profil
Reinforce fetchOrThrow
Improve error handling inside fetchOrThrow
Rework middlewares and reducers Logic
- use normal Thunks instead of
createAsyncThunk
to have more sequencials actions - convert extraReducers to reducers
- add
authenticated
andhasDisconnected
to initial states
add Remember me functionnality
- If
remember me
is checked, put token in localStorage on login submit succeed - if
remember me is not checked
put token in session storage on login submit succeed - on page load, if we find a token from local storage, check the box
move Routes to Route folder, add PrivateRoute with outlet to protect Profile page
add react-router-dom and Home route
add Login page
install react-redux and redux toolkit packages
add Home page
start to implement User service, with login method
Improve routing and navgation
- When non route is found, redirect to Home page
- when clicking on header user name, redirect to profile page
Add fields validation on Login form
- use native html validation
- use pattern attribute with regex
- show error messages for both
- change text input to email input
implement disconnect when clicking on signount link
add getProfile method to User service, add profile method to UserModeling
add UserModeling class for modeling retrieved data from User service
add nav and footer components ui
prevent authenticated user from showing login page
- Move useEffect from private to app.js, so it can applies for Login page also
- remove login useEffect to disconnect if users got an error
- Add useEffec in login to redirect user to profile page if authenticated
Simplify App.js logic
- Remove
hasDisconnected
from the store - Remove conditions inside
App.js
useEffect
Prefer this:useEffect(() => { dispatch(getProfileMiddleware); }, []);
- Remove
useSelectors
from App.js
refacto Profile and add Accounts and Account components
Make edit form responsive
Refacto App.js
- instead of having navProps variable, directly pass it to
Complete Documentation
- Complete JsDoc
- Complete PropTypes
- Complete Readme
show different navbar menus when authenticated
add fields validation on edit form
- use native html validation
- use pattern attribute with regex
- show error messages for both
- show firstName and lastName as default input value on component render
make Features more reusable, add Feature component
Add Loaders
- Add loaders for all 3 fetch requests
- use svg
- use fake delay for testing, conditionnal method in services
- Disable form buttons when loading, to avoid multiple fetch requests (maybe add an abortController)
- set inititial get status state to pending, to avoid enabling form buttons too early #40
add editing profile redux logic
change input type in Login form
Input type email should be used instead of text
refacto Home into Features, Hero component
add editProfile method on User service and Modeling
improve selectors
- avoid destructuring in selectors : source
rework global state structure
- initial user slice state should have this structure :
const initialState = {
firstName: "",
lastName: "",
email: "",
get: {
status: fetchStatus.PENDING,
error: null
},
edit: {
status: fetchStatus.IDLE,
error: null
},
login: {
status: fetchStatus.IDLE,
error: null
},
authenticated: false
};
- each rejected reducers should have an error message (for now only generic messages)
add SignForm to Login page
Migrate to TypeScript
- make it in a separate branch and start it when you're sure almost everything else is finished
- Make 2 Errors classes
MissingTokenError
andFetchError
(I can't add status to a normal Error instance, typescript complains - Add hooks.ts with
useAppDispatch
anduseAppSelector
recommended by the documentation - Add global.d.ts with
declare module '*.css';
to accept css modules
Merge auth and profile slices into a single slice
- Remove auth slice
- Add logic status in profile reducer
- Only keep loginStatus, remove token
Renamings
- rename
SignForm
toAuthForm
- rename
handler
tologinFormHandler
inLogin
- rename
formEditHandler
toeditFormHandler
inProfile
- rename
handler
tosubmitHandler
inAuthForm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.