Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
9b05c759
Commit
9b05c759
authored
Sep 02, 2019
by
Florent Chehab
Committed by
Florent Chehab
Jan 12, 2020
Browse files
refacto(frontend): finish compliance with new eslint config
parent
754ee880
Changes
78
Hide whitespace changes
Inline
Side-by-side
frontend/.eslintrc.js
View file @
9b05c759
...
...
@@ -26,10 +26,7 @@ module.exports = {
location
:
"
anywhere
"
}
],
// The warn should be turned to error at some point
"
react/require-default-props
"
:
"
warn
"
,
"
react/no-did-update-set-state
"
:
"
warn
"
,
"
import/prefer-default-export
"
:
"
warn
"
,
"
no-console
"
:
"
error
"
,
// Styling choices bellow...
"
react/destructuring-assignment
"
:
"
off
"
,
// might be less readable (and is a pain in the ass to refactor)
"
react/no-unescaped-entities
"
:
"
off
"
,
// that one doesn't improve code readability
...
...
frontend/src/components/app/App.jsx
View file @
9b05c759
...
...
@@ -20,7 +20,7 @@ import PageSettings from "../pages/PageThemeSettings";
import
PageUser
from
"
../pages/PageUser
"
;
import
PageLists
from
"
../pages/PageLists
"
;
import
MainAppFrame
from
"
./MainAppFrame
"
;
import
{
APP_ROUTES
}
from
"
../../config/appRoutes
"
;
import
APP_ROUTES
from
"
../../config/appRoutes
"
;
import
PageAboutProject
from
"
../pages/PageAboutProject
"
;
import
{
PageCgu
,
PageRgpd
}
from
"
../pages/PagesRgpdCgu
"
;
import
PageNotFound
from
"
../pages/PageNotFound
"
;
...
...
frontend/src/components/app/BaseTemplate.jsx
View file @
9b05c759
...
...
@@ -3,7 +3,7 @@ import AppBar from "@material-ui/core/AppBar";
import
Toolbar
from
"
@material-ui/core/Toolbar
"
;
import
PropTypes
from
"
prop-types
"
;
import
{
makeStyles
}
from
"
@material-ui/styles
"
;
import
{
classNames
}
from
"
../../utils/classNames
"
;
import
classNames
from
"
../../utils/classNames
"
;
import
{
appBarHeight
,
siteMaxWidth
}
from
"
../../config/sharedStyles
"
;
const
useStyle
=
makeStyles
(
theme
=>
({
...
...
frontend/src/components/app/ExternalDataUpdateInfo.jsx
View file @
9b05c759
...
...
@@ -7,7 +7,7 @@ import List from "@material-ui/core/List";
import
ListItem
from
"
@material-ui/core/ListItem
"
;
import
ListItemText
from
"
@material-ui/core/ListItemText
"
;
import
Typography
from
"
@material-ui/core/Typography
"
;
import
{
toDateFr
}
from
"
../../utils/dateToFr
"
;
import
toDateFr
from
"
../../utils/dateToFr
"
;
import
getActions
from
"
../../redux/api/getActions
"
;
import
CustomComponentForAPI
from
"
../common/CustomComponentForAPI
"
;
...
...
frontend/src/components/app/FooterImportantInformation.jsx
View file @
9b05c759
...
...
@@ -4,7 +4,7 @@ import { makeStyles } from "@material-ui/styles";
import
PropTypes
from
"
prop-types
"
;
import
{
withRouter
}
from
"
react-router-dom
"
;
import
InformationList
from
"
./InformationList
"
;
import
{
APP_ROUTES
}
from
"
../../config/appRoutes
"
;
import
APP_ROUTES
from
"
../../config/appRoutes
"
;
const
useStyles
=
makeStyles
(
theme
=>
({
divider
:
{
...
...
frontend/src/components/app/InformationList.jsx
View file @
9b05c759
...
...
@@ -13,11 +13,11 @@ import ListItem from "@material-ui/core/ListItem";
import
ListItemIcon
from
"
@material-ui/core/ListItemIcon
"
;
import
ListItemText
from
"
@material-ui/core/ListItemText
"
;
import
PropTypes
from
"
prop-types
"
;
import
{
RequestParams
}
from
"
../../redux/api/RequestParams
"
;
import
RequestParams
from
"
../../redux/api/RequestParams
"
;
import
getActions
from
"
../../redux/api/getActions
"
;
import
{
withErrorBoundary
}
from
"
../common/ErrorBoundary
"
;
import
CustomComponentForAPI
from
"
../common/CustomComponentForAPI
"
;
import
{
toDateFr
}
from
"
../../utils/dateToFr
"
;
import
toDateFr
from
"
../../utils/dateToFr
"
;
const
INFORMATION_ICONS
=
{
success
:
<
StartIcon
/>,
...
...
frontend/src/components/app/Logo.jsx
View file @
9b05c759
...
...
@@ -6,7 +6,7 @@ import React from "react";
import
{
makeStyles
}
from
"
@material-ui/styles
"
;
import
PropTypes
from
"
prop-types
"
;
import
CustomNavLink
from
"
../common/CustomNavLink
"
;
import
{
classNames
}
from
"
../../utils/classNames
"
;
import
classNames
from
"
../../utils/classNames
"
;
const
useStyle
=
makeStyles
(
theme
=>
({
siteName
:
{
...
...
frontend/src/components/app/MainAppFrame.jsx
View file @
9b05c759
...
...
@@ -15,9 +15,9 @@ import {
}
from
"
./menuItems
"
;
import
IconWithMenu
from
"
../common/IconWithMenu
"
;
import
DrawerMenu
from
"
./DrawerMenu
"
;
import
{
APP_ROUTES
}
from
"
../../config/appRoutes
"
;
import
APP_ROUTES
from
"
../../config/appRoutes
"
;
import
CustomNavLink
from
"
../common/CustomNavLink
"
;
import
{
classNames
}
from
"
../../utils/classNames
"
;
import
classNames
from
"
../../utils/classNames
"
;
import
Logo
from
"
./Logo
"
;
import
BaseTemplate
from
"
./BaseTemplate
"
;
...
...
frontend/src/components/app/NotifierImportantInformation.jsx
View file @
9b05c759
...
...
@@ -8,7 +8,7 @@ import { withErrorBoundary } from "../common/ErrorBoundary";
import
getActions
from
"
../../redux/api/getActions
"
;
import
Notifier
from
"
../common/Notifier
"
;
import
{
RequestParams
}
from
"
../../redux/api/RequestParams
"
;
import
RequestParams
from
"
../../redux/api/RequestParams
"
;
/**
* Class to create notifications for important stuff on start up
...
...
frontend/src/components/app/UnlinkedPartners.jsx
View file @
9b05c759
...
...
@@ -8,7 +8,7 @@ import Typography from "@material-ui/core/Typography";
import
List
from
"
@material-ui/core/List
"
;
import
ListItem
from
"
@material-ui/core/ListItem
"
;
import
ListItemText
from
"
@material-ui/core/ListItemText
"
;
import
{
APP_ROUTES
}
from
"
../../config/appRoutes
"
;
import
APP_ROUTES
from
"
../../config/appRoutes
"
;
import
CustomLink
from
"
../common/CustomLink
"
;
import
getActions
from
"
../../redux/api/getActions
"
;
import
CustomComponentForAPI
from
"
../common/CustomComponentForAPI
"
;
...
...
frontend/src/components/app/menuItems.js
View file @
9b05c759
...
...
@@ -3,7 +3,7 @@ import LocationCityIcon from "@material-ui/icons/LocationCity";
import
HomeIcon
from
"
@material-ui/icons/Home
"
;
import
SearchIcon
from
"
@material-ui/icons/Search
"
;
import
AssignmentIcon
from
"
@material-ui/icons/Assignment
"
;
import
{
APP_ROUTES
}
from
"
../../config/appRoutes
"
;
import
APP_ROUTES
from
"
../../config/appRoutes
"
;
function
item
(
label
,
route
,
Icon
,
hardRedirect
=
false
)
{
return
{
...
...
frontend/src/components/common/Alert.jsx
View file @
9b05c759
...
...
@@ -118,12 +118,12 @@ Alert.defaultProps = {
disagreeText
:
"
Annuler
"
,
infoText
:
"
J'ai compris
"
,
multilineButtons
:
false
,
// eslint-disable-next-line no-console
handleClose
:
()
=>
{
// eslint-disable-next-line no-console
console
.
error
(
"
Missing function for closing alert.
"
);
},
// eslint-disable-next-line no-console
handleResponse
:
()
=>
{
// eslint-disable-next-line no-console
console
.
error
(
"
Missing function for handling post performClose.
"
);
}
};
...
...
frontend/src/components/common/CoverGallery/CoverGallery.jsx
View file @
9b05c759
...
...
@@ -56,8 +56,8 @@ CoverGallery.propTypes = {
CoverGallery
.
defaultProps
=
{
picturesSrc
:
[],
// eslint-disable-next-line no-console
onEditButtonClick
:
()
=>
// eslint-disable-next-line no-console
console
.
log
(
"
No function provided to edit cover gallery
"
)
};
...
...
frontend/src/components/common/CustomComponentForAPI.jsx
View file @
9b05c759
...
...
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
import
Loading
from
"
./Loading
"
;
import
{
getLatestRead
,
successActionsWithReads
}
from
"
../../redux/api/utils
"
;
import
Notifier
from
"
./Notifier
"
;
import
{
RequestParams
}
from
"
../../redux/api/RequestParams
"
;
import
RequestParams
from
"
../../redux/api/RequestParams
"
;
/**
* Custom react component to be used when called to the api are required to display data of the component.
...
...
frontend/src/components/common/CustomNavLink.jsx
View file @
9b05c759
...
...
@@ -24,7 +24,7 @@ function CustomNavLink(props) {
CustomNavLink
.
propTypes
=
{
to
:
PropTypes
.
string
.
isRequired
,
children
:
PropTypes
.
node
children
:
PropTypes
.
node
.
isRequired
};
export
default
CustomNavLink
;
frontend/src/components/common/DeleteHandler.jsx
View file @
9b05c759
...
...
@@ -4,7 +4,7 @@ import { compose } from "recompose";
import
{
connect
}
from
"
react-redux
"
;
import
Alert
from
"
./Alert
"
;
import
getActions
from
"
../../redux/api/getActions
"
;
import
{
RequestParams
}
from
"
../../redux/api/RequestParams
"
;
import
RequestParams
from
"
../../redux/api/RequestParams
"
;
class
DeleteHandler
extends
React
.
Component
{
handleDelete
()
{
...
...
frontend/src/components/common/DownshiftMultiple.jsx
View file @
9b05c759
...
...
@@ -53,10 +53,10 @@ function renderSuggestion({
}
renderSuggestion
.
propTypes
=
{
highlightedIndex
:
PropTypes
.
number
,
index
:
PropTypes
.
number
,
itemProps
:
PropTypes
.
object
,
selectedItem
:
PropTypes
.
string
,
highlightedIndex
:
PropTypes
.
number
.
isRequired
,
index
:
PropTypes
.
number
.
isRequired
,
itemProps
:
PropTypes
.
object
.
isRequired
,
selectedItem
:
PropTypes
.
string
.
isRequired
,
suggestion
:
PropTypes
.
shape
({
label
:
PropTypes
.
string
,
value
:
PropTypes
.
number
...
...
frontend/src/components/common/ErrorBoundary.jsx
View file @
9b05c759
...
...
@@ -4,10 +4,10 @@ import { setDisplayName } from "recompose";
import
compose
from
"
recompose/compose
"
;
import
{
connect
}
from
"
react-redux
"
;
import
{
withRouter
}
from
"
react-router-dom
"
;
import
{
RequestParams
}
from
"
../../redux/api/RequestParams
"
;
import
RequestParams
from
"
../../redux/api/RequestParams
"
;
import
getActions
from
"
../../redux/api/getActions
"
;
import
Alert
from
"
./Alert
"
;
import
{
APP_ROUTES
}
from
"
../../config/appRoutes
"
;
import
APP_ROUTES
from
"
../../config/appRoutes
"
;
function
clear
()
{
return
{
...
...
@@ -93,6 +93,7 @@ const ConnectedErrorBoundary = compose(
*
* @returns {function(*): function(*): *}
*/
// eslint-disable-next-line import/prefer-default-export
export
function
withErrorBoundary
()
{
return
Component
=>
setDisplayName
(
"
error-boundary
"
)(
...
...
frontend/src/components/common/LicenseNotice.jsx
View file @
9b05c759
...
...
@@ -2,7 +2,7 @@ import React from "react";
import
PropTypes
from
"
prop-types
"
;
import
Typography
from
"
@material-ui/core/Typography
"
;
import
TextLink
from
"
./TextLink
"
;
import
{
APP_ROUTES
}
from
"
../../config/appRoutes
"
;
import
APP_ROUTES
from
"
../../config/appRoutes
"
;
import
getWindowBase
from
"
../../utils/getWindowBase
"
;
/**
...
...
frontend/src/components/common/LinkToUser.jsx
View file @
9b05c759
import
React
from
"
react
"
;
import
PropTypes
from
"
prop-types
"
;
import
CustomLink
from
"
./CustomLink
"
;
import
{
APP_ROUTES
}
from
"
../../config/appRoutes
"
;
import
APP_ROUTES
from
"
../../config/appRoutes
"
;
export
default
function
LinkToUser
(
props
)
{
if
(
props
.
userId
)
{
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment