Skip to content
Snippets Groups Projects
Commit 0a1e089b authored by sixertoy's avatar sixertoy
Browse files

:blowfish: linting input/output fields

- move des inputs de base pour les calculs + eslint
- remove autoloading data from fields
- restore du timer sur les champs input fields
parent dcdd0fee
Branches
Tags
No related merge requests found
Showing
with 40 additions and 33 deletions
import PropTypes from "prop-types";
import { Fragment } from "react";
import InputField from "../fields/input-field";
import OutputField from "../fields/output-field";
import InputField from "../input-field";
import OutputField from "../output-field";
const BaseInputOutputComponent = ({
baseValue,
......@@ -11,8 +11,8 @@ const BaseInputOutputComponent = ({
name,
newValue,
outputFieldStyle,
plfValue,
plfFieldStyle,
plfValue,
}) => (
<Fragment>
<OutputField style={outputFieldStyle} value={baseValue} />
......@@ -33,6 +33,8 @@ BaseInputOutputComponent.propTypes = {
name: PropTypes.string.isRequired,
newValue: PropTypes.string.isRequired,
outputFieldStyle: PropTypes.shape().isRequired,
plfFieldStyle: PropTypes.shape().isRequired,
plfValue: PropTypes.string.isRequired,
};
export default BaseInputOutputComponent;
import { get } from "lodash";
import { connect } from "react-redux";
import {
fetchCalculateCompare,
updateReformeByName,
} from "../../../redux/actions";
import { updateReformeByName } from "../../../redux/actions";
import makeNumberGoodLooking from "../../articles/utils/make-number-good-looking";
import BaseInputOutputComponent from "./base-input-output-component";
......@@ -37,18 +34,15 @@ const mapStateToProps = (state, props) => {
baseValue,
inputFieldStyle,
newValue,
plfValue,
outputFieldStyle,
plfFieldStyle,
plfValue,
};
};
const mapDispatchToProps = dispatch => ({
handleInputChange: (value, name) => {
let action = updateReformeByName(name, value);
dispatch(action);
action = fetchCalculateCompare();
dispatch(action);
dispatch(updateReformeByName(name, value));
},
});
......
import PropTypes from "prop-types";
import { Fragment } from "react";
import OutputField from "../fields/output-field";
import OutputField from "../output-field";
const BaseOutputComponent = ({ baseValue, plfValue, style }) => (
<Fragment>
......@@ -11,6 +12,7 @@ const BaseOutputComponent = ({ baseValue, plfValue, style }) => (
BaseOutputComponent.propTypes = {
baseValue: PropTypes.string.isRequired,
plfValue: PropTypes.string.isRequired,
style: PropTypes.shape().isRequired,
};
......
......@@ -23,8 +23,8 @@ const mapStateToProps = (state, props) => {
return {
baseValue,
style,
plfValue,
style,
};
};
......
import PropTypes from "prop-types";
import { Fragment } from "react";
import OutputField from "../fields/output-field";
import OutputField from "../output-field";
const FormulaOutputCombiLin = ({ baseValue, newValue, plfValue, style }) => (
const FormulaOutputCombiLin = ({
baseValue, newValue, plfValue, style,
}) => (
<Fragment>
<OutputField style={style.VarCodeexistant} value={baseValue} />
<OutputField style={style.VarPLF} value={plfValue} />
......@@ -14,6 +16,7 @@ const FormulaOutputCombiLin = ({ baseValue, newValue, plfValue, style }) => (
FormulaOutputCombiLin.propTypes = {
baseValue: PropTypes.string.isRequired,
newValue: PropTypes.string.isRequired,
plfValue: PropTypes.string.isRequired,
style: PropTypes.shape().isRequired,
};
......
......@@ -34,7 +34,7 @@ const mapStateToProps = (state, props) => {
return {
baseValue,
newValue,
plfValue
plfValue,
};
};
......
import PropTypes from "prop-types";
import { Fragment } from "react";
import OutputField from "../fields/output-field";
import OutputField from "../output-field";
const FormulaOutputComponent = ({ baseValue, newValue, plfValue, style }) => (
const FormulaOutputComponent = ({
baseValue, newValue, plfValue, style,
}) => (
<Fragment>
<OutputField style={style.VarCodeexistant} value={baseValue} />
<OutputField style={style.VarPLF} value={plfValue} />
......@@ -14,6 +16,7 @@ const FormulaOutputComponent = ({ baseValue, newValue, plfValue, style }) => (
FormulaOutputComponent.propTypes = {
baseValue: PropTypes.string.isRequired,
newValue: PropTypes.string.isRequired,
plfValue: PropTypes.string.isRequired,
style: PropTypes.shape().isRequired,
};
......
......@@ -6,7 +6,7 @@ import { ExpandMore as ExpandMoreIcon } from "@material-ui/icons";
import PropTypes from "prop-types";
import { PureComponent } from "react";
import OutputField from "../../articles-inputs/fields/output-field";
import OutputField from "../../articles-inputs/output-field";
import LexExpansionPanel from "../expandable-panels/expansion-panel";
import LexExpansionPanelDetails from "../expandable-panels/expansion-panel-details";
import LexExpansionPanelSummary from "../expandable-panels/expansion-panel-summary";
......
......@@ -10,8 +10,8 @@ import {
FormulaOutput,
FormulaOutputCombilin,
} from "../articles-inputs";
import InputField from "../articles-inputs/fields/input-field";
import OutputField from "../articles-inputs/fields/output-field";
import InputField from "../articles-inputs/input-field";
import OutputField from "../articles-inputs/output-field";
import fillArrayWith from "../utils/array/fillArrayWith";
import Alinea0 from "./article-alinea-0";
import Alinea2 from "./article-alinea-2";
......
import PropTypes from "prop-types";
import { Typography } from "@material-ui/core";
import { withStyles } from "@material-ui/core/styles";
import { OpenInNew as OpenInNewIcon } from "@material-ui/icons";
import PropTypes from "prop-types";
const stylesTheme = theme => ({
alink: {
......@@ -83,7 +83,10 @@ function LegendeArticle({ classes }) {
Droit existant
</Typography>
<Typography inline className={classes.styleAvantPLF}>
<a className={classes.alink} href="https://www.impots.gouv.fr/portail/simulateur-de-la-baisse-dimpot-sur-le-revenu-annoncee-pour-2020" target="blank">
<a
className={classes.alink}
href="https://www.impots.gouv.fr/portail/simulateur-de-la-baisse-dimpot-sur-le-revenu-annoncee-pour-2020"
target="blank">
Baisse d&apos;impôt prévue en 2020
<OpenInNewIcon className={classes.styleOpenInNewIcon} />
</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment