-
Notifications
You must be signed in to change notification settings - Fork 3
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
Upgrade to react-scripts v5 #695
Changes from all commits
7f9ceba
1ddb802
8fe5070
64abe5b
459b8ae
68192bc
80960d2
04ea033
fb5a453
0927c5b
3b7b07c
b9c6baa
7eb9963
6d63a94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"extends": ["plugin:prettier/recommended"], | ||
"parser": "babel-eslint" | ||
"extends": ["react-app"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": false | ||
} | ||
} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,6 @@ | |
"test": "react-scripts test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Docs:
|
||
"browserslist": { | ||
"production": [ | ||
">0.3%", | ||
|
@@ -87,24 +84,15 @@ | |
"react-quill": "^2.0.0-beta.4", | ||
"react-router": "^6.3.0", | ||
"react-router-dom": "^6.3.0", | ||
"react-scripts": "^3.4.1", | ||
"react-scripts": "^5.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎊 |
||
"styled-components": "^5.3.0", | ||
"uuid": "^8.3.2", | ||
"yup": "^0.29.3" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "^10.1.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb": "^18.2.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-jsx-a11y": "^6.3.1", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-react": "^7.20.3", | ||
"eslint-plugin-react-hooks": "^2.5.1", | ||
"prettier": "^1.19.1" | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see my comment in the PR description about eslint |
||
"engines": { | ||
"npm": ">=6.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-plugin-import": "^1.13.5" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,9 @@ import config from "../../config"; | |
import { useUser, getJwt } from "../../auth/user"; | ||
|
||
// File Pond Library | ||
import { FilePond, File, registerPlugin } from "react-filepond"; | ||
import { FilePond, registerPlugin } from "react-filepond"; | ||
// `File` imported from filepond to workaround react-scripts 5 import error | ||
import { File } from "filepond" | ||
Comment on lines
+8
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File uploads still work great in the deploy preview 👍 |
||
import FilePondPluginImageExifOrientation from "filepond-plugin-image-exif-orientation"; | ||
import FilePondPluginImagePreview from "filepond-plugin-image-preview"; | ||
import FilePondPluginFileValidateSize from "filepond-plugin-file-validate-size"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,23 +7,27 @@ | |
* | ||
* @return {string} - Formatted string. | ||
*/ | ||
export default (bytes, si=false, dp=1) => { | ||
const thresh = si ? 1000 : 1024; | ||
const humanReadableFileSize = (bytes, si = false, dp = 1) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the change that fixed the ESLint warning - the rest is prettification |
||
const thresh = si ? 1000 : 1024; | ||
|
||
if (Math.abs(bytes) < thresh) { | ||
return bytes + ' B'; | ||
} | ||
if (Math.abs(bytes) < thresh) { | ||
return bytes + " B"; | ||
} | ||
|
||
const units = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; | ||
const units = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; | ||
|
||
let u = -1; | ||
const r = 10 ** dp; | ||
let u = -1; | ||
const r = 10 ** dp; | ||
|
||
do { | ||
bytes /= thresh; | ||
++u; | ||
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1); | ||
do { | ||
bytes /= thresh; | ||
++u; | ||
} while ( | ||
Math.round(Math.abs(bytes) * r) / r >= thresh && | ||
u < units.length - 1 | ||
); | ||
|
||
return Math.round(bytes.toFixed(dp)) + " " + units[u]; | ||
}; | ||
|
||
return Math.round(bytes.toFixed(dp)) + ' ' + units[u]; | ||
} | ||
export default humanReadableFileSize; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,16 +18,6 @@ | |
height: 4rem !important; | ||
} | ||
|
||
.MuiFab-sizeSmall:nth-of-type(1) { | ||
background-image: url(/moped/static/images/mapStreets.jpg) !important; | ||
color: black; | ||
} | ||
|
||
.MuiFab-sizeSmall:nth-of-type(2) { | ||
background-image: url(/moped/static/images/mapAerial.jpg) !important; | ||
color: white; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's now impossible to reference files in |
||
.MuiFab-label { | ||
font-size: 0.8rem !important; | ||
font-weight: bold !important; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,38 +5,38 @@ | |
* @default | ||
*/ | ||
export const StaffListViewExportConf = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. linting |
||
user_id: { | ||
label: "user_id", | ||
}, | ||
first_name: { | ||
label: "first_name", | ||
}, | ||
last_name: { | ||
label: "last_name", | ||
}, | ||
email: { | ||
label: "email", | ||
}, | ||
date_added: { | ||
label: "date_added", | ||
}, | ||
staff_uuid: { | ||
label: "staff_uuid", | ||
}, | ||
title: { | ||
label: "title", | ||
}, | ||
workgroup: { | ||
label: "workgroup", | ||
}, | ||
cognito_user_id: { | ||
label: "cognito_user_id", | ||
}, | ||
is_coa_staff: { | ||
label: "is_coa_staff", | ||
filter: value => value === true ? "True" : "False", | ||
}, | ||
status_id: { | ||
label: "status_id", | ||
}, | ||
} | ||
user_id: { | ||
label: "user_id", | ||
}, | ||
first_name: { | ||
label: "first_name", | ||
}, | ||
last_name: { | ||
label: "last_name", | ||
}, | ||
email: { | ||
label: "email", | ||
}, | ||
date_added: { | ||
label: "date_added", | ||
}, | ||
staff_uuid: { | ||
label: "staff_uuid", | ||
}, | ||
title: { | ||
label: "title", | ||
}, | ||
workgroup: { | ||
label: "workgroup", | ||
}, | ||
cognito_user_id: { | ||
label: "cognito_user_id", | ||
}, | ||
is_coa_staff: { | ||
label: "is_coa_staff", | ||
filter: (value) => (value === true ? "True" : "False"), | ||
}, | ||
status_id: { | ||
label: "status_id", | ||
}, | ||
}; |
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.
see my comment in the PR description