diff --git a/src/Gargantext/Components/CodeEditor.purs b/src/Gargantext/Components/CodeEditor.purs index 1af2dd0cf715d315f9ec11e1fa50d270465af29f..64e4c21868cb9920a40215fdd4b603723a170ab3 100644 --- a/src/Gargantext/Components/CodeEditor.purs +++ b/src/Gargantext/Components/CodeEditor.purs @@ -111,7 +111,6 @@ renderPython s = s -- | I took the idea from: https://github.com/satya164/react-simple-code-editor codeEditor :: R2.Leaf Props codeEditor = R2.leaf codeEditorCpt - codeEditorCpt :: R.Component Props codeEditorCpt = here.component "codeEditor" cpt where cpt {code, defaultCodeType, onChange} _ = do @@ -245,7 +244,6 @@ type ToolbarProps = toolbar :: R2.Leaf ToolbarProps toolbar = R2.leaf toolbarCpt - toolbarCpt :: R.Component ToolbarProps toolbarCpt = here.component "toolbar" cpt where cpt { controls: { codeS, codeType, viewType } @@ -294,7 +292,6 @@ type ErrorComponentProps = errorComponent :: Record ErrorComponentProps -> R.Element errorComponent p = R.createElement errorComponentCpt p [] - errorComponentCpt :: R.Component ErrorComponentProps errorComponentCpt = here.component "errorComponent" cpt where @@ -313,7 +310,6 @@ type CodeTypeSelectorProps = codeTypeSelector :: R2.Leaf CodeTypeSelectorProps codeTypeSelector = R2.leaf codeTypeSelectorCpt - codeTypeSelectorCpt :: R.Component CodeTypeSelectorProps codeTypeSelectorCpt = here.component "codeTypeSelector" cpt where cpt { codeType, onChange } _ = do diff --git a/src/Gargantext/Components/Corpus/CodeSection.purs b/src/Gargantext/Components/Corpus/CodeSection.purs index 734353e20e81ae96ec4b405ff0b67b78577b9683..a342470dad201b86f7e95956a338e631857720cb 100644 --- a/src/Gargantext/Components/Corpus/CodeSection.purs +++ b/src/Gargantext/Components/Corpus/CodeSection.purs @@ -82,9 +82,11 @@ fieldsCodeEditorCpt = here.component "fieldsCodeEditorCpt" cpt where onChange :: Index -> FieldType -> Effect Unit onChange idx typ = do - T.modify_ (\(FTFieldsWithIndex fs) -> - FTFieldsWithIndex $ fromMaybe fs $ - List.modifyAt idx (\{ ftField: Field f} -> { idx, ftField: Field $ f { typ = typ } }) fs) fields + T.modify_ ( + (\(FTFieldsWithIndex fs) -> + FTFieldsWithIndex $ fromMaybe fs $ + List.modifyAt idx (\{ ftField: Field f} -> { idx, ftField: Field $ f { typ = typ } }) fs)) + fields onMoveDown :: T2.ReloadS -> Index -> Unit -> Effect Unit onMoveDown masterKey idx _ = do @@ -352,7 +354,7 @@ changeCode onc (Python {python}) CE.Markdown _ = onc $ Markdown $ defaultMarkdow changeCode onc (Markdown _) CE.Haskell c = onc $ Haskell $ defaultHaskell' { haskell = c } changeCode onc (Markdown _) CE.Python c = onc $ Python $ defaultPython' { python = c } -changeCode onc (Markdown _) CE.JSON c = onc $ Markdown $ defaultMarkdown' { text = c } +changeCode onc (Markdown _) CE.JSON c = onc $ JSON $ defaultJSON' { desc = c } changeCode onc (Markdown md) CE.Markdown c = onc $ Markdown $ md { text = c } changeCode onc (JSON j) CE.Haskell _ = onc $ Haskell $ defaultHaskell' { haskell = haskell }