-
Notifications
You must be signed in to change notification settings - Fork 39
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
I1529 Frontend Dependancy Update #1555
I1529 Frontend Dependancy Update #1555
Conversation
This Draft PR is branched out of #1554 since that has major Backend updates. So it make sense to this way until that PR get merged |
used CodeMods for updating the MUI to v5. here are the docs what gets updated https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md |
63393a3
to
c72d432
Compare
/> } | ||
/> | ||
</Route> | ||
<Route |
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.
react-router-dom v6 had new approach, nested routes became relative than absolute before.
|
||
export default withRouter |
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.
V6 of the react-router-dom removed withRouter, so I have to write this HOC as per the documentation guide, linked in the page
return ( | ||
<> | ||
<Helmet titleTemplate='%s | My Learning Analytics' title='Courses' /> | ||
<GoogleAnalyticsTracking {...{ gaId, cspNonce }} /> | ||
<Routes> | ||
<Route path='/' element={<CourseList user={user} />} /> | ||
<Route path='/courses' element={ <CourseList user={user} />} /> | ||
<Route path='/courses/:courseId/*' element={courseId ? <Course user={user} courseId={Number(courseId)} {...props} /> : <AlertBanner>Application Launch did not happened properely</AlertBanner>} /> | ||
<Route path='/courses' element={<CourseList user={user} />} /> |
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.
part of react-router-dom v6 change
? [0, 0.1] | ||
: event.selection | ||
? [0, 0.1] | ||
: event.selection | ||
: defaultSelection |
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.
Spacing issue
@@ -35,15 +35,17 @@ const rangeSlider = props => { | |||
range | |||
activeDotStyle={activeDotStyle} | |||
dotStyle={dotStyle} | |||
handleStyle={[activeDotStyle, activeDotStyle]} | |||
railStyle={unselectedStyle} | |||
trackStyle={[selectedStyle]} |
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.
These are deprecated in the new version of rc-slider and includes as part of the styles property.
assets/src/components/RangeSlider.js
Outdated
@@ -1,6 +1,6 @@ | |||
import React from 'react' | |||
import 'rc-slider/assets/index.css' | |||
import Slider, { Range } from 'rc-slider' |
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.
rc-slider package has some solid change, but not breaking. I felt the slider looked ok and functioned as before
<div key={key}> | ||
<Line {...line} barHeight={height} outOf={outOf} /> | ||
</div> | ||
)) | ||
: null |
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.
Spacing change
@@ -1,6 +1,6 @@ | |||
import React, { useState } from 'react' | |||
import { styled } from '@mui/material/styles' | |||
import { useLocation } from 'react-router' | |||
import { useLocation } from 'react-router-dom' | |||
import Button from '@mui/material/Button' |
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.
react-router package is package dependency and we never had in our package.json file. So I changed using the react-router-dom package. properties that are being used here also present in it https://reactrouter.com/en/main/hooks/use-location.
@@ -235,11 +235,11 @@ const SelectCard = props => { | |||
</CardContent> | |||
) | |||
|
|||
return <Root>{cardImage}{cardContent}</Root> | |||
return <>{cardImage}{cardContent}</> | |||
} |
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 is nice and simple fix. I pulled the latest and things are looking good with this commit.
assets/src/components/SurveyModal.js
Outdated
@@ -92,7 +92,7 @@ export default function SurveyModal (props) { | |||
const toggleOpen = () => setOpen(!open) | |||
|
|||
const body = ( | |||
<Root className={`${classes.paper} ${classes.modal}`}> |
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.
@jaydonkrooss I couldn't test this, but I felt this would work. were you able to test this with survey link?
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.
The button looks good, But the modal after clicking is not centered. I added 2 more issue around this.
You can reproduced it locally by going to Admin -> Config -> SURVEY_URL "Give any URL"
1e4e971
to
af36347
Compare
af36347
to
57372e4
Compare
I have built the latest from this repo which is here https://github.com/pushyamig/my-learning-analytics/actions/runs/7413997544 |
This PR is now ready for Review, I have added test plan as well |
I pretty much tested/reviewed it from my lense and things are ok . I have updated things I tested according to test plan |
I can't approve a PR which is opened by me. But I will approve the Jaydon's work as well |
Fixes #1529 and #1525
react-router-dom
has some major changes, the nested router path are relative nowwithRoute
r higher order hook is removed, so need to write a custom functionpackage-lock.json
was just deletenode_module
and update thepackage.json
and generate a new lock file. This was simplest!@apollo/client
, Assignment planning was crashing so added a configuration optionassumeImmutableResults: false,
to enable mutable object of response which was allowed as an configuration option.npm-check-updates
for checking the latest package version in the repo. It is recommended by package dev to install it globally. https://www.npmjs.com/package/npm-check-updatesnpm install -g npm-check-updates
check using the command
npm ls <package-name>
Eg.,npm ls postcss
Todo List:
Reproduce it Admin -> Config -> SURVEY_URL
Listitem
componentbutton
attribute seems deprecated ( it is stricked out in VsCode). Needs an understanding if any impact and any otherway to compensate it. Documentation will helpimport IconButton from '@mui/material/IconButton'
the iconButton Component addedsize='large'
to all filessx
prop. MUI v5 introduced this prop for inline styling for certain component. for older versionstyle
prop was used. I don't feel we need to replacestyle
withsx
but building some understanding will help. https://mui.com/system/getting-started/the-sx-prop/https://stackoverflow.com/questions/72527461/when-should-i-use-style-instead-of-sx-prop-in-material-ui#:~:text=sx%20prop%20works%20only%20on,some%20cases%20as%20explained%20below.
package-lock.json
commit - PushyamiJest testing as things are not working as expected(Fix Jest Frontend tests #1558)Test Plan
https://docs.google.com/spreadsheets/d/18c_VDE7wdme8c36Zo5-pjad77Kit8hFz4ylbmFXmLP8/edit#gid=0
Testing should be done from Student, instructor and MyLa Admin role