From b5c5aa2c55c6fa8391805589c4c4de8521a20122 Mon Sep 17 00:00:00 2001 From: Mael Date: Wed, 20 Nov 2019 15:02:13 +0100 Subject: [PATCH] Choix contraint de l'objectif de calcul --- source/sites/publi.codes/Landing.js | 4 +-- source/sites/publi.codes/{Yo.js => Studio.js} | 30 +++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) rename source/sites/publi.codes/{Yo.js => Studio.js} (80%) diff --git a/source/sites/publi.codes/Landing.js b/source/sites/publi.codes/Landing.js index 2c2630bf1..8521063fd 100644 --- a/source/sites/publi.codes/Landing.js +++ b/source/sites/publi.codes/Landing.js @@ -4,7 +4,7 @@ import ColoredYaml from 'Components/rule/ColoredYaml' import React, { useEffect } from 'react' import emoji from 'react-easy-emoji' import { Header } from './Header' -import Yo from './Yo' +import Studio from './Studio' export default function Landing() { useEffect(() => { @@ -24,7 +24,7 @@ export default function Landing() {
- +

Pourquoi ?

Certains algorithmes sont bien trop importants pour ĂȘtre maintenus diff --git a/source/sites/publi.codes/Yo.js b/source/sites/publi.codes/Studio.js similarity index 80% rename from source/sites/publi.codes/Yo.js rename to source/sites/publi.codes/Studio.js index aa348244b..8d6f6f994 100644 --- a/source/sites/publi.codes/Yo.js +++ b/source/sites/publi.codes/Studio.js @@ -3,9 +3,11 @@ import { buildFlatRules } from 'Engine/rules' import { safeLoad } from 'js-yaml' import React, { useEffect, useRef, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' -import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors' +import { + analysisWithDefaultsSelector, + flatRulesSelector +} from 'Selectors/analyseSelectors' import { setSimulationConfig } from '../../actions/actions' - let initialInput = ` a: @@ -36,7 +38,7 @@ export function Studio() { const [target, setTarget] = useState(defaultTarget) const dispatch = useDispatch() - const stateConfig = useSelector(state => state.simulation?.config) + const flatRules = useSelector(state => flatRulesSelector(state)) const [isEditorReady, setIsEditorReady] = useState(false) const valueGetter = useRef() @@ -73,10 +75,26 @@ export function Studio() { value={initialInput} editorDidMount={handleEditorDidMount} /> -

Que voulez-vous calculer ?

- setTarget(e.target.value)} /> +
- {ready && }