Fix bugs caused by dependencies update

* Replace es2015 babel preset with env preset
* Fix ModalPanel transition
* Simplify redux-logger configuration
* remove deprecated 'ecmaFeatures' property from .eslintrc

Partial-Bug: 1743722
Change-Id: I2d9ffb9207574e1c8959b7372de1a273d7e31274
This commit is contained in:
Jiri Tomasek 2017-12-18 21:54:37 +01:00
parent 744fdebcd7
commit 2c20fdbba6
4 changed files with 31 additions and 43 deletions

View File

@ -1,5 +1,5 @@
{
"presets": ["es2015", "stage-0", "react"],
"presets": ["env", "stage-0", "react"],
"plugins": [
[
"react-intl",

View File

@ -37,10 +37,6 @@
"jest": true
},
"extends": ["prettier", "prettier/react"],
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
},
"plugins": ["prettier", "react"],
"parser": "babel-eslint"
}

View File

@ -18,37 +18,35 @@ import cx from 'classnames';
import { Modal } from 'react-overlays';
import PropTypes from 'prop-types';
import React from 'react';
import { Fade } from 'react-bootstrap';
// import { Fade } from 'react-bootstrap';
// TODO(jtomasek): use this as transition and backdropTransition props once react-bootstrap is
// updated to version which uses react-overlays ^0.8.3
// We could use latest react-overlays for ModalPanel now but that causes ModalPanel and Modal
// nesting issues as Modal is not correctly registered by ModalManager
//
// import Transition, {
// ENTERED,
// ENTERING
// } from 'react-transition-group/Transition';
//
// const Fade = ({ children, ...props }) => {
// const fadeStyles = {
// [ENTERING]: 'in',
// [ENTERED]: 'in'
// };
//
// return (
// <Transition {...props} timeout={400}>
// {(status, innerProps) =>
// React.cloneElement(children, {
// ...innerProps,
// className: `fade ${fadeStyles[status]} ${children.props.className}`
// })}
// </Transition>
// );
// };
// Fade.propTypes = {
// children: PropTypes.node
// };
// TODO(jtomasek): use Fade transition from react-bootstrap once it is updated
// to work correctly
import Transition, {
ENTERED,
ENTERING
} from 'react-transition-group/Transition';
const Fade = ({ children, ...props }) => {
const fadeStyles = {
[ENTERING]: 'in',
[ENTERED]: 'in'
};
return (
<Transition {...props} timeout={400}>
{(status, innerProps) =>
React.cloneElement(children, {
...innerProps,
className: `fade ${fadeStyles[status]} ${children.props.className}`
})
}
</Transition>
);
};
Fade.propTypes = {
children: PropTypes.node
};
class ModalPanel extends React.Component {
// provide onHide via context, so child buttons (close/cancel) can access it
@ -69,7 +67,7 @@ class ModalPanel extends React.Component {
backdropClassName="modal-panel-backdrop modal-backdrop"
backdropStyle={style}
containerClassName="modal-open"
// backdropTransition={Fade}
backdropTransition={Fade}
transition={Fade}
className="fixed-container"
style={style}

View File

@ -51,13 +51,7 @@ const loggerMiddleware = createLogger({
logger: logger,
// We're turning off all colors here because the formatting chars obscure the
// content server-side.
colors: {
title: false,
prevState: false,
action: false,
nextState: false,
error: false
}
colors: false
});
const store = createStore(