Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
004cab75
Commit
004cab75
authored
Jan 29, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CodeEditor] fix CodeType changing triggers
parent
bc9246a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
CodeEditor.purs
src/Gargantext/Components/CodeEditor.purs
+2
-9
Corpus.purs
src/Gargantext/Components/Nodes/Corpus.purs
+1
-1
No files found.
src/Gargantext/Components/CodeEditor.purs
View file @
004cab75
...
@@ -192,23 +192,16 @@ toolbar p = R.createElement toolbarCpt p []
...
@@ -192,23 +192,16 @@ toolbar p = R.createElement toolbarCpt p []
toolbarCpt :: R.Component ToolbarProps
toolbarCpt :: R.Component ToolbarProps
toolbarCpt = R.hooksComponent "G.C.CE.toolbar" cpt
toolbarCpt = R.hooksComponent "G.C.CE.toolbar" cpt
where
where
cpt
props@{controls: {codeType, error, viewType}
} _ = do
cpt
{controls: {codeS, codeType, error, viewType}, onChange
} _ = do
pure $
pure $
H.div { className: "row toolbar" } [
H.div { className: "row toolbar" } [
codeTypeSelector {
codeTypeSelector {
codeType
codeType
, onChange:
onChangeCodeType props
, onChange:
\newCodeType -> onChange newCodeType (fst codeS)
}
}
, viewTypeSelector {state: viewType}
, viewTypeSelector {state: viewType}
]
]
-- Handle rerendering of preview when viewType changed
onChangeCodeType :: forall e. Record ToolbarProps -> e -> Effect Unit
onChangeCodeType {controls, onChange} _ = do
onChange (fst controls.codeType) code
where
code = fst controls.codeS
type ErrorComponentProps =
type ErrorComponentProps =
(
(
...
...
src/Gargantext/Components/Nodes/Corpus.purs
View file @
004cab75
...
@@ -78,7 +78,7 @@ corpusLayoutViewCpt = R.hooksComponent "G.C.N.C.corpusLayoutView" cpt
...
@@ -78,7 +78,7 @@ corpusLayoutViewCpt = R.hooksComponent "G.C.N.C.corpusLayoutView" cpt
fieldsS <- R.useState' fieldsWithIndex
fieldsS <- R.useState' fieldsWithIndex
fieldsRef <- R.useRef fields
fieldsRef <- R.useRef fields
-- handle
props change of fields
-- handle
change of props-derived state
R.useEffect1' fields $ do
R.useEffect1' fields $ do
if R.readRef fieldsRef == fields then
if R.readRef fieldsRef == fields then
pure unit
pure unit
...
...
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