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
143
Issues
143
List
Board
Labels
Milestones
Merge Requests
8
Merge Requests
8
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
71638695
Commit
71638695
authored
Oct 13, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[reactix] upgraded reactix to 0.4.6
parent
475a69dc
Changes
73
Hide whitespace changes
Inline
Side-by-side
Showing
73 changed files
with
212 additions
and
233 deletions
+212
-233
packages.json
.psc-package/local/.set/packages.json
+1
-1
purs-packages.nix
nix/purs-packages.nix
+3
-3
packages.dhall
packages.dhall
+1
-1
AnnotatedField.purs
src/Gargantext/Components/Annotation/AnnotatedField.purs
+3
-3
Menu.purs
src/Gargantext/Components/Annotation/Menu.purs
+2
-2
App.purs
src/Gargantext/Components/App.purs
+7
-7
AutoUpdate.purs
src/Gargantext/Components/AutoUpdate.purs
+1
-1
CodeEditor.purs
src/Gargantext/Components/CodeEditor.purs
+7
-7
ContextMenu.purs
src/Gargantext/Components/ContextMenu/ContextMenu.purs
+6
-6
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+7
-7
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+4
-4
Forest.purs
src/Gargantext/Components/Forest.purs
+3
-3
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+4
-4
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+2
-2
Add.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
+1
-1
Contact.purs
...argantext/Components/Forest/Tree/Node/Action/Contact.purs
+3
-3
Link.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs
+1
-1
Merge.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
+1
-1
Move.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
+1
-1
Frame.purs
...text/Components/Forest/Tree/Node/Action/Search/Frame.purs
+3
-3
SearchBar.purs
.../Components/Forest/Tree/Node/Action/Search/SearchBar.purs
+1
-1
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+8
-8
Share.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
+1
-1
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+7
-7
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+4
-4
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+7
-7
ProgressBar.purs
...antext/Components/Forest/Tree/Node/Tools/ProgressBar.purs
+2
-2
SubTree.purs
...Gargantext/Components/Forest/Tree/Node/Tools/SubTree.purs
+3
-3
Sync.purs
src/Gargantext/Components/Forest/Tree/Node/Tools/Sync.purs
+4
-4
Graph.purs
src/Gargantext/Components/Graph.purs
+1
-1
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+5
-5
Button.purs
src/Gargantext/Components/GraphExplorer/Button.purs
+1
-1
Controls.purs
src/Gargantext/Components/GraphExplorer/Controls.purs
+1
-1
ControlsToggleButton.purs
...antext/Components/GraphExplorer/ControlsToggleButton.purs
+1
-1
Legend.purs
src/Gargantext/Components/GraphExplorer/Legend.purs
+1
-1
RangeControl.purs
src/Gargantext/Components/GraphExplorer/RangeControl.purs
+1
-1
Search.purs
src/Gargantext/Components/GraphExplorer/Search.purs
+1
-1
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+1
-1
SlideButton.purs
src/Gargantext/Components/GraphExplorer/SlideButton.purs
+3
-3
ToggleButton.purs
src/Gargantext/Components/GraphExplorer/ToggleButton.purs
+4
-4
InputWithAutocomplete.purs
src/Gargantext/Components/InputWithAutocomplete.purs
+3
-3
InputWithEnter.purs
src/Gargantext/Components/InputWithEnter.purs
+2
-2
Loader.purs
src/Gargantext/Components/Loader.purs
+1
-1
LoadingSpinner.purs
src/Gargantext/Components/LoadingSpinner.purs
+1
-3
Login.purs
src/Gargantext/Components/Login.purs
+7
-7
Modal.purs
src/Gargantext/Components/Modal.purs
+3
-3
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+7
-7
Components.purs
src/Gargantext/Components/NgramsTable/Components.purs
+6
-6
Annuaire.purs
src/Gargantext/Components/Nodes/Annuaire.purs
+6
-6
Contacts.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
+4
-4
Tabs.purs
...gantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
+1
-1
Corpus.purs
src/Gargantext/Components/Nodes/Corpus.purs
+8
-8
Common.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Common.purs
+2
-2
Histo.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Histo.purs
+1
-1
Metrics.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Metrics.purs
+1
-1
Pie.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Pie.purs
+2
-2
Tree.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Tree.purs
+1
-1
Utils.purs
src/Gargantext/Components/Nodes/Corpus/Chart/Utils.purs
+1
-1
Dashboard.purs
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
+5
-5
Document.purs
src/Gargantext/Components/Nodes/Corpus/Document.purs
+4
-4
Tabs.purs
src/Gargantext/Components/Nodes/Corpus/Graph/Tabs.purs
+1
-1
File.purs
src/Gargantext/Components/Nodes/File.purs
+2
-2
Frame.purs
src/Gargantext/Components/Nodes/Frame.purs
+3
-3
Home.purs
src/Gargantext/Components/Nodes/Home.purs
+1
-1
Public.purs
src/Gargantext/Components/Nodes/Home/Public.purs
+2
-2
Lists.purs
src/Gargantext/Components/Nodes/Lists.purs
+2
-2
Tabs.purs
src/Gargantext/Components/Nodes/Lists/Tabs.purs
+3
-3
Texts.purs
src/Gargantext/Components/Nodes/Texts.purs
+4
-4
RangeSlider.purs
src/Gargantext/Components/RangeSlider.purs
+3
-3
Tab.purs
src/Gargantext/Components/Tab.purs
+1
-1
Table.purs
src/Gargantext/Components/Table.purs
+4
-4
Reactix.purs
src/Gargantext/Utils/Reactix.purs
+0
-19
Version.purs
src/Gargantext/Version.purs
+2
-2
No files found.
.psc-package/local/.set/packages.json
View file @
71638695
...
...
@@ -3144,7 +3144,7 @@
"unsafe-coerce"
],
"repo"
:
"https://github.com/irresponsible/purescript-reactix"
,
"version"
:
"v0.4.
5
"
"version"
:
"v0.4.
6
"
},
"read"
:
{
"dependencies"
:
[
...
...
nix/purs-packages.nix
View file @
71638695
...
...
@@ -768,11 +768,11 @@
};
"reactix"
=
{
name
=
"reactix"
;
version
=
"v0.4.
5
"
;
version
=
"v0.4.
6
"
;
src
=
pkgs
.
fetchgit
{
url
=
"https://github.com/irresponsible/purescript-reactix"
;
rev
=
"v0.4.
5
"
;
sha256
=
"0
nzings4ygsrl4ak8x87sns7lgv6fljzhw69l0gk1iihhhazkhan
"
;
rev
=
"v0.4.
6
"
;
sha256
=
"0
q3cq3d9385jq9dlpjhfqdc4b4nvxxlmjncs3fr4xk8vv24j3kns
"
;
};
};
"read"
=
{
...
...
packages.dhall
View file @
71638695
...
...
@@ -109,7 +109,7 @@ let additions =
, "unsafe-coerce"
]
"https://github.com/irresponsible/purescript-reactix"
"v0.4.
5
"
"v0.4.
6
"
, tuples-native =
mkPackage
[ "generics-rep", "prelude", "typelevel", "unsafe-coerce" ]
...
...
src/Gargantext/Components/Annotation/AnnotatedField.purs
View file @
71638695
...
...
@@ -47,7 +47,7 @@ annotatedField :: Record Props -> R.Element
annotatedField p = R.createElement annotatedFieldComponent p []
annotatedFieldComponent :: R.Component Props
annotatedFieldComponent = R
2.hooksComponent
thisModule "annotatedField" cpt
annotatedFieldComponent = R
.hooksComponentWithModule
thisModule "annotatedField" cpt
where
cpt {ngrams,setTermList,text} _ = do
mMenu@(_ /\ setMenu) <- R.useState' Nothing
...
...
@@ -98,7 +98,7 @@ addMenu :: Record AddMenuProps -> R.Element
addMenu p = R.createElement addMenuCpt p []
addMenuCpt :: R.Component AddMenuProps
addMenuCpt = R
2.hooksComponent
thisModule "addMenu" cpt
addMenuCpt = R
.hooksComponentWithModule
thisModule "addMenu" cpt
where
cpt { menuRef } _ = do
(mMenu /\ setmMenu) <- R.useState' (Nothing :: Maybe AnnotationMenu)
...
...
@@ -113,7 +113,7 @@ addMenuCpt = R2.hooksComponent thisModule "addMenu" cpt
Nothing -> HTML.div {} []
Just menu -> annotationMenu setmMenu menu
-- forall e. IsMouseEvent e => R
2.Setter (Maybe AnnotationMenu) -> R2
.Setter ? -> ? -> e -> Effect Unit
-- forall e. IsMouseEvent e => R
.Setter (Maybe AnnotationMenu) -> R
.Setter ? -> ? -> e -> Effect Unit
maybeShowMenu setMenu menuRef setTermList ngrams event = do
s <- Sel.getSelection
log2 "[maybeShowMenu] s" s
...
...
src/Gargantext/Components/Annotation/Menu.purs
View file @
71638695
...
...
@@ -36,14 +36,14 @@ type AnnotationMenu = {
-- | An Annotation Menu is parameterised by a Maybe Termlist of the
-- | TermList the currently selected text belongs to
annotationMenu :: R
2
.Setter (Maybe AnnotationMenu) -> AnnotationMenu -> R.Element
annotationMenu :: R.Setter (Maybe AnnotationMenu) -> AnnotationMenu -> R.Element
annotationMenu setMenu { x,y,list,menuType, onClose,setList } =
CM.contextMenu { x,y, onClose, setMenu } [
R.createElement annotationMenuCpt {list,menuType,setList} []
]
annotationMenuCpt :: R.Component Props
annotationMenuCpt = R
2.hooksComponent
thisModule "annotationMenu" cpt
annotationMenuCpt = R
.hooksComponentWithModule
thisModule "annotationMenu" cpt
where
cpt props _ = pure $ R.fragment $ children props
children props = A.mapMaybe (addToList props) [ MapTerm, CandidateTerm, StopTerm ]
...
...
src/Gargantext/Components/App.purs
View file @
71638695
...
...
@@ -45,7 +45,7 @@ app :: {} -> R.Element
app props = R.createElement appCpt props []
appCpt :: R.Component ()
appCpt = R
2.hooksComponent
thisModule "app" cpt where
appCpt = R
.hooksComponentWithModule
thisModule "app" cpt where
frontends = defaultFrontends
cpt _ _ = do
sessions <- useSessions
...
...
@@ -130,7 +130,7 @@ type ForestLayoutProps =
, reload :: R.State Int
, route :: AppRoute
, sessions :: Sessions
, showLogin :: R
2
.Setter Boolean
, showLogin :: R.Setter Boolean
, backend :: R.State (Maybe Backend)
)
...
...
@@ -138,7 +138,7 @@ forestLayout :: Record ForestLayoutProps -> R.Element
forestLayout props = R.createElement forestLayoutCpt props []
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R
2.hooksComponent
thisModule "forestLayout" cpt
forestLayoutCpt = R
.hooksComponentWithModule
thisModule "forestLayout" cpt
where
cpt props@{ handed } _ = do
pure $ R.fragment [ topBar { handed }, forestLayoutMain props ]
...
...
@@ -147,7 +147,7 @@ forestLayoutMain :: Record ForestLayoutProps -> R.Element
forestLayoutMain props = R.createElement forestLayoutMainCpt props []
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R
2.hooksComponent
thisModule "forestLayoutMain" cpt
forestLayoutMainCpt = R
.hooksComponentWithModule
thisModule "forestLayoutMain" cpt
where
cpt { child, frontends, handed, reload, route, sessions, showLogin, backend} _ = do
let ordering =
...
...
@@ -183,7 +183,7 @@ topBar :: Record TopBarProps -> R.Element
topBar props = R.createElement topBarCpt props []
topBarCpt :: R.Component TopBarProps
topBarCpt = R
2.hooksComponent
thisModule "topBar" cpt
topBarCpt = R
.hooksComponentWithModule
thisModule "topBar" cpt
where
cpt { handed } _ = do
pure $ H.div { id: "dafixedtop"
...
...
@@ -225,7 +225,7 @@ handedChooser :: Record HandedChooserProps -> R.Element
handedChooser props = R.createElement handedChooserCpt props []
handedChooserCpt :: R.Component HandedChooserProps
handedChooserCpt = R
2.hooksComponent
thisModule "handedChooser" cpt
handedChooserCpt = R
.hooksComponentWithModule
thisModule "handedChooser" cpt
where
cpt { handed } _ = do
pure $ H.li {} [
...
...
@@ -376,7 +376,7 @@ footer :: Record FooterProps -> R.Element
footer props = R.createElement footerCpt props []
footerCpt :: R.Component FooterProps
footerCpt = R
2.hooksComponent
thisModule "footer" cpt
footerCpt = R
.hooksComponentWithModule
thisModule "footer" cpt
where
cpt { session } _ = do
pure $ H.div
...
...
src/Gargantext/Components/AutoUpdate.purs
View file @
71638695
...
...
@@ -49,7 +49,7 @@ autoUpdate :: Record PropsRow -> R.Element
autoUpdate props = R.createElement autoUpdateCpt props []
autoUpdateCpt :: R.Component PropsRow
autoUpdateCpt = R
2.hooksComponent
thisModule "autoUpdate" cpt
autoUpdateCpt = R
.hooksComponentWithModule
thisModule "autoUpdate" cpt
where
cpt { duration, effect } _ = do
intervalRef <- R.useRef Nothing
...
...
src/Gargantext/Components/CodeEditor.purs
View file @
71638695
...
...
@@ -107,7 +107,7 @@ codeEditor p = R.createElement codeEditorCpt p []
-- The overlay is to provide seamless syntax highlighting on top of the textarea.
-- I took the idea from: https://github.com/satya164/react-simple-code-editor
codeEditorCpt :: R.Component Props
codeEditorCpt = R
2.hooksComponent
thisModule "codeEditor" cpt
codeEditorCpt = R
.hooksComponentWithModule
thisModule "codeEditor" cpt
where
cpt {code, defaultCodeType, onChange} _ = do
controls <- initControls code defaultCodeType
...
...
@@ -166,7 +166,7 @@ codeEditorCpt = R2.hooksComponent thisModule "codeEditor" cpt
onEditChange :: forall e. Record Controls -> (CodeType -> Code -> Effect Unit) -> e -> Effect Unit
onEditChange controls@{codeElRef, codeOverlayElRef, codeType: (codeType /\ _), codeS} onChange e = do
let code = R
2
.unsafeEventValue e
let code = R.unsafeEventValue e
snd codeS $ const code
onChange codeType code
...
...
@@ -204,7 +204,7 @@ toolbar :: Record ToolbarProps -> R.Element
toolbar p = R.createElement toolbarCpt p []
toolbarCpt :: R.Component ToolbarProps
toolbarCpt = R
2.hooksComponent
thisModule "toolbar" cpt
toolbarCpt = R
.hooksComponentWithModule
thisModule "toolbar" cpt
where
cpt props@{controls: {codeType, error, viewType}} _ = do
pure $
...
...
@@ -233,7 +233,7 @@ errorComponent :: Record ErrorComponentProps -> R.Element
errorComponent p = R.createElement errorComponentCpt p []
errorComponentCpt :: R.Component ErrorComponentProps
errorComponentCpt = R
2.hooksComponent
thisModule "errorComponent" cpt
errorComponentCpt = R
.hooksComponentWithModule
thisModule "errorComponent" cpt
where
cpt {error: (Nothing /\ _)} _ = pure $ H.div {} []
cpt {error: ((Just error) /\ _)} _ = do
...
...
@@ -250,7 +250,7 @@ codeTypeSelector :: Record CodeTypeSelectorProps -> R.Element
codeTypeSelector p = R.createElement codeTypeSelectorCpt p []
codeTypeSelectorCpt :: R.Component CodeTypeSelectorProps
codeTypeSelectorCpt = R
2.hooksComponent
thisModule "codeTypeSelector" cpt
codeTypeSelectorCpt = R
.hooksComponentWithModule
thisModule "codeTypeSelector" cpt
where
cpt {codeType, onChange} _ = do
pure $ R2.select { className: "form-control"
...
...
@@ -274,7 +274,7 @@ codeTypeSelectorCpt = R2.hooksComponent thisModule "codeTypeSelector" cpt
setCodeType $ const codeType
onChange codeType
where
value = R
2
.unsafeEventValue e
value = R.unsafeEventValue e
type ViewTypeSelectorProps =
...
...
@@ -286,7 +286,7 @@ viewTypeSelector :: Record ViewTypeSelectorProps -> R.Element
viewTypeSelector p = R.createElement viewTypeSelectorCpt p []
viewTypeSelectorCpt :: R.Component ViewTypeSelectorProps
viewTypeSelectorCpt = R
2.hooksComponent
thisModule "viewTypeSelector" cpt
viewTypeSelectorCpt = R
.hooksComponentWithModule
thisModule "viewTypeSelector" cpt
where
cpt {state} _ =
pure $ H.div { className: "btn-group" } [
...
...
src/Gargantext/Components/ContextMenu/ContextMenu.purs
View file @
71638695
...
...
@@ -27,14 +27,14 @@ type Props t = (
x :: Number
, y :: Number
, onClose :: Unit -> Effect Unit
, setMenu :: R
2
.Setter (Maybe t)
, setMenu :: R.Setter (Maybe t)
)
contextMenu :: forall t. Record (Props t) -> Array R.Element -> R.Element
contextMenu = R.createElement contextMenuCpt
contextMenuCpt :: forall t. R.Component (Props t)
contextMenuCpt = R
2.hooksComponent
thisModule "contextMenu" cpt
contextMenuCpt = R
.hooksComponentWithModule
thisModule "contextMenu" cpt
where
cpt menu@{ x, y, onClose, setMenu } children = do
host <- R2.getPortalHost
...
...
@@ -70,7 +70,7 @@ contextMenuCpt = R2.hooksComponent thisModule "contextMenu" cpt
contextMenuEffect
:: forall t.
(Unit -> Effect Unit)
-> R
2
.Setter (Maybe t)
-> R.Setter (Maybe t)
-> R.Ref (Nullable DOM.Element)
-> Effect (Effect Unit)
contextMenuEffect onClose setMenu rootRef =
...
...
@@ -85,7 +85,7 @@ contextMenuEffect onClose setMenu rootRef =
DOM.removeEventListener document "scroll" onScroll
Nothing -> pure R.nothing
documentClickHandler :: forall t. (Unit -> Effect Unit) -> R
2
.Setter (Maybe t) -> DOM.Element -> Callback DE.MouseEvent
documentClickHandler :: forall t. (Unit -> Effect Unit) -> R.Setter (Maybe t) -> DOM.Element -> Callback DE.MouseEvent
documentClickHandler onClose hide menu =
R2.named "hideMenuOnClickOutside" $ callback $ \e ->
if Element.contains menu (DE.target e)
...
...
@@ -94,7 +94,7 @@ documentClickHandler onClose hide menu =
hide (const Nothing)
onClose unit
documentScrollHandler :: forall t. R
2
.Setter (Maybe t) -> Callback DE.MouseEvent
documentScrollHandler :: forall t. R.Setter (Maybe t) -> Callback DE.MouseEvent
documentScrollHandler hide =
R2.named "hideMenuOnScroll" $ callback $ \e -> hide (const Nothing)
...
...
@@ -111,7 +111,7 @@ contextMenuItem :: Array R.Element -> R.Element
contextMenuItem = R.createElement contextMenuItemCpt {}
contextMenuItemCpt :: R.Component ()
contextMenuItemCpt = R
2.hooksComponent
thisModule "contextMenuItem" cpt
contextMenuItemCpt = R
.hooksComponentWithModule
thisModule "contextMenuItem" cpt
where
cpt _props children = pure $ HTML.li { className: "context-menu-item" } children
...
...
src/Gargantext/Components/DocsTable.purs
View file @
71638695
...
...
@@ -162,7 +162,7 @@ docViewLayout :: Record LayoutProps -> R.Element
docViewLayout props = R.createElement docViewLayoutCpt props []
docViewLayoutCpt :: R.Component LayoutProps
docViewLayoutCpt = R
2.hooksComponent
thisModule "docViewLayout" cpt
docViewLayoutCpt = R
.hooksComponentWithModule
thisModule "docViewLayout" cpt
where
cpt layout _children = do
query <- R.useState' ""
...
...
@@ -179,7 +179,7 @@ docView :: Record Props -> R.Element
docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component Props
docViewCpt = R
2.hooksComponent
thisModule "docView" cpt where
docViewCpt = R
.hooksComponentWithModule
thisModule "docView" cpt where
cpt { query, params
, layout: { frontends, session, nodeId, tabType, listId
, corpusId, totalRecords, chart, showSearch } } _ = do
...
...
@@ -216,7 +216,7 @@ docViewCpt = R2.hooksComponent thisModule "docView" cpt where
searchBar :: R.State Query -> R.Element
searchBar (query /\ setQuery) = R.createElement el {} []
where
el = R
2.hooksComponent
thisModule "SearchBar" cpt
el = R
.hooksComponentWithModule
thisModule "SearchBar" cpt
cpt {} _children = do
queryText <- R.useState' query
...
...
@@ -235,7 +235,7 @@ searchBar (query /\ setQuery) = R.createElement el {} []
onSearchChange :: forall e. R.State Query -> e -> Effect Unit
onSearchChange (_ /\ setQueryText) = \e ->
setQueryText $ const $ R
2
.unsafeEventValue e
setQueryText $ const $ R.unsafeEventValue e
onSearchKeyup :: R.State Query -> DE.KeyboardEvent -> Effect Unit
onSearchKeyup (queryText /\ _) = \e ->
...
...
@@ -301,7 +301,7 @@ pageLayout :: Record PageLayoutProps -> R.Element
pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R
2.hooksComponent
thisModule "pageLayout" cpt where
pageLayoutCpt = R
.hooksComponentWithModule
thisModule "pageLayout" cpt where
cpt props@{ corpusId, frontends, listId, nodeId, params, query, session, tabType } _ =
useLoaderWithCacheAPI {
cacheEndpoint: getPageHash session
...
...
@@ -337,7 +337,7 @@ page :: T.Params -> Record PageLayoutProps -> Array DocumentsView -> R.Element
page params layout documents = R.createElement pageCpt { documents, layout, params } []
pageCpt :: R.Component PageProps
pageCpt = R
2.hooksComponent
thisModule "pageCpt" cpt where
pageCpt = R
.hooksComponentWithModule
thisModule "pageCpt" cpt where
cpt { documents, layout, params } _ = do
paramsS <- R.useState' params
pure $ pagePaint { documents, layout, params: paramsS }
...
...
@@ -352,7 +352,7 @@ pagePaint :: Record PagePaintProps -> R.Element
pagePaint props = R.createElement pagePaintCpt props []
pagePaintCpt :: R.Component PagePaintProps
pagePaintCpt = R
2.hooksComponent
thisModule "pagePaintCpt" cpt where
pagePaintCpt = R
.hooksComponentWithModule
thisModule "pagePaintCpt" cpt where
cpt { layout: { corpusId, frontends, listId, nodeId, session, totalRecords }, documents, params } _ = do
localCategories <- R.useState' (mempty :: LocalCategories)
pure $ T.table
...
...
src/Gargantext/Components/FacetsTable.purs
View file @
71638695
...
...
@@ -94,7 +94,7 @@ docView :: Record Props -> R.Element
docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component Props
docViewCpt = R
2.hooksComponent
thisModule "docView" cpt
docViewCpt = R
.hooksComponentWithModule
thisModule "docView" cpt
where
cpt {frontends, session, nodeId, listId, query, totalRecords, chart, container} _ = do
deletions <- R.useState' initialDeletions
...
...
@@ -145,7 +145,7 @@ docViewGraph :: Record Props -> R.Element
docViewGraph props = R.createElement docViewCpt props []
docViewGraphCpt :: R.Component Props
docViewGraphCpt = R
2.hooksComponent
thisModule "docViewGraph" cpt
docViewGraphCpt = R
.hooksComponentWithModule
thisModule "docViewGraph" cpt
where
cpt {frontends, session, nodeId, listId, query, totalRecords, chart, container} _ = do
deletions <- R.useState' initialDeletions
...
...
@@ -292,7 +292,7 @@ pageLayout :: Record PageLayoutProps -> R.Element
pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R
2.hooksComponent
thisModule "pageLayout" cpt
pageLayoutCpt = R
.hooksComponentWithModule
thisModule "pageLayout" cpt
where
cpt {frontends, totalRecords, deletions, container, session, path} _ = do
useLoader (fst path) loadPage $ \documents ->
...
...
@@ -302,7 +302,7 @@ page :: Record PageProps -> R.Element
page props = R.createElement pageCpt props []
pageCpt :: R.Component PageProps
pageCpt = R
2.hooksComponent
thisModule "page" cpt
pageCpt = R
.hooksComponentWithModule
thisModule "page" cpt
where
cpt {frontends, totalRecords, container, deletions, documents, session, path: path@({nodeId, listId, query} /\ setPath)} _ = do
pure $ T.table { rows, container, colNames, totalRecords, params, wrapColElts }
...
...
src/Gargantext/Components/Forest.purs
View file @
71638695
...
...
@@ -25,7 +25,7 @@ type Props =
, reload :: R.State Int
, route :: AppRoute
, sessions :: Sessions
, showLogin :: R
2
.Setter Boolean
, showLogin :: R.Setter Boolean
, backend :: R.State (Maybe Backend)
)
...
...
@@ -33,7 +33,7 @@ forest :: Record Props -> R.Element
forest props = R.createElement forestCpt props []
forestCpt :: R.Component Props
forestCpt = R
2.hooksComponent
thisModule "forest" cpt where
forestCpt = R
.hooksComponentWithModule
thisModule "forest" cpt where
cpt { frontends, handed, reload: extReload, route, sessions, showLogin, backend} _ = do
-- NOTE: this is a hack to reload the tree view on demand
reload <- R.useState' (0 :: Reload)
...
...
@@ -65,7 +65,7 @@ forestCpt = R2.hooksComponent thisModule "forest" cpt where
, session: s
}
plus :: Handed -> R
2
.Setter Boolean -> R.State (Maybe Backend) -> R.Element
plus :: Handed -> R.Setter Boolean -> R.State (Maybe Backend) -> R.Element
plus handed showLogin backend = H.div {className: if handed == RightHanded
then "flex-start" -- TODO we should use lefthanded SASS class here
else "flex-end"
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
71638695
...
...
@@ -61,7 +61,7 @@ treeView :: Record Props -> R.Element
treeView props = R.createElement treeViewCpt props []
where
treeViewCpt :: R.Component Props
treeViewCpt = R
2.hooksComponent
thisModule "treeView" cpt
treeViewCpt = R
.hooksComponentWithModule
thisModule "treeView" cpt
where
cpt { root
, asyncTasks
...
...
@@ -86,7 +86,7 @@ treeLoadView :: Record Props -> R.Element
treeLoadView p = R.createElement treeLoadViewCpt p []
where
treeLoadViewCpt :: R.Component Props
treeLoadViewCpt = R
2.hooksComponent
thisModule "treeLoadView" cpt
treeLoadViewCpt = R
.hooksComponentWithModule
thisModule "treeLoadView" cpt
where
cpt { root
, asyncTasks
...
...
@@ -125,7 +125,7 @@ loadedTreeView :: Record TreeViewProps -> R.Element
loadedTreeView p = R.createElement loadedTreeViewCpt p []
where
loadedTreeViewCpt :: R.Component TreeViewProps
loadedTreeViewCpt = R
2.hooksComponent
thisModule "loadedTreeView" cpt
loadedTreeViewCpt = R
.hooksComponentWithModule
thisModule "loadedTreeView" cpt
where
cpt { asyncTasks
, frontends
...
...
@@ -186,7 +186,7 @@ toHtml p@{ asyncTasks
} =
R.createElement el {} []
where
el = R
2.hooksComponent
thisModule "nodeView" cpt
el = R
.hooksComponentWithModule
thisModule "nodeView" cpt
commonProps = RecordE.pick p :: Record CommonProps
pAction a = performAction a (RecordE.pick p :: Record PerformActionProps)
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
71638695
...
...
@@ -56,7 +56,7 @@ nodeMainSpan :: IsLeaf
-> R.Element
nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.createElement el p []
where
el = R
2.hooksComponent
thisModule "nodeMainSpan" cpt
el = R
.hooksComponentWithModule
thisModule "nodeMainSpan" cpt
cpt props@{id, mCurrentRoute, name, nodeType, tasks: { onTaskFinish, tasks }} _ = do
-- only 1 popup at a time is allowed to be opened
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
...
...
@@ -222,7 +222,7 @@ nodeActions :: Record NodeActionsProps -> R.Element
nodeActions p = R.createElement nodeActionsCpt p []
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R
2.hooksComponent
thisModule "nodeActions" cpt
nodeActionsCpt = R
.hooksComponentWithModule
thisModule "nodeActions" cpt
where
cpt { id
, nodeType: GT.Graph
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
View file @
71638695
...
...
@@ -64,7 +64,7 @@ addNodeView :: Record CreateNodeProps
-> R.Element
addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
where
el = R
2.hooksComponent
thisModule "addNodeView" cpt
el = R
.hooksComponentWithModule
thisModule "addNodeView" cpt
cpt {id, name} _ = do
nodeName@(name' /\ setNodeName) <- R.useState' "Name"
nodeType'@(nt /\ setNodeType) <- R.useState' $ fromMaybe Folder $ head nodeTypes
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Contact.purs
View file @
71638695
...
...
@@ -41,7 +41,7 @@ textInputBox :: Record TextInputBoxProps -> R.Element
textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), params } = R.createElement el p []
where
{firstname, lastname} = params
el = R
2.hooksComponent
thisModule (boxName <> "Box") cpt
el = R
.hooksComponentWithModule
thisModule (boxName <> "Box") cpt
cpt {id, params:params'} _ = do
let {firstname, lastname} = params'
stateFirstname <- R.useState' firstname
...
...
@@ -59,7 +59,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), para
, defaultValue: default
, on: { input: set
<<< const
<<< R
2
.unsafeEventValue }
<<< R.unsafeEventValue }
, placeholder: (boxName <> " Node")
, type: "text"
}
...
...
@@ -81,7 +81,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), para
} []
textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
where
el = R
2.hooksComponent
thisModule (boxName <> "Box") cpt
el = R
.hooksComponentWithModule
thisModule (boxName <> "Box") cpt
cpt {} _ = pure $ H.div {} []
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Link.purs
View file @
71638695
...
...
@@ -59,7 +59,7 @@ linkNode :: Record SubTreeParamsIn -> R.Element
linkNode p = R.createElement linkNodeCpt p []
linkNodeCpt :: R.Component SubTreeParamsIn
linkNodeCpt = R
2.hooksComponent
thisModule "linkNode" cpt
linkNodeCpt = R
.hooksComponentWithModule
thisModule "linkNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
View file @
71638695
...
...
@@ -26,7 +26,7 @@ mergeNode :: Record SubTreeParamsIn -> R.Element
mergeNode p = R.createElement mergeNodeCpt p []
mergeNodeCpt :: R.Component SubTreeParamsIn
mergeNodeCpt = R
2.hooksComponent
thisModule "mergeNode" cpt
mergeNodeCpt = R
.hooksComponentWithModule
thisModule "mergeNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing})
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Move.purs
View file @
71638695
...
...
@@ -25,7 +25,7 @@ moveNode :: Record SubTreeParamsIn -> R.Element
moveNode p = R.createElement moveNodeCpt p []
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R
2.hooksComponent
thisModule "moveNode" cpt
moveNodeCpt = R
.hooksComponentWithModule
thisModule "moveNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing})
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/Frame.purs
View file @
71638695
...
...
@@ -43,7 +43,7 @@ searchIframes :: Record SearchIFramesProps -> R.Element
searchIframes props = R.createElement searchIframesCpt props []
searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt = R
2.hooksComponent
thisModule "searchIframes" cpt
searchIframesCpt = R
.hooksComponentWithModule
thisModule "searchIframes" cpt
where
cpt { iframeRef, search: search@(search' /\ _) } _ = do
pure $ if isIsTex_Advanced search'.datafield
...
...
@@ -64,7 +64,7 @@ divIframe :: Record IFrameProps -> R.Element
divIframe props = R.createElement divIframeCpt props []
divIframeCpt :: R.Component IFrameProps
divIframeCpt = R
2.hooksComponent
thisModule "divIframe" cpt
divIframeCpt = R
.hooksComponentWithModule
thisModule "divIframe" cpt
where
cpt { frameSource, iframeRef, search: search@(search' /\ _) } _ = do
pure $ H.div { className: "frame-search panel panel-default" }
...
...
@@ -79,7 +79,7 @@ iframeWith :: Record IFrameProps -> R.Element
iframeWith props = R.createElement iframeWithCpt props []
iframeWithCpt :: R.Component IFrameProps
iframeWithCpt = R
2.hooksComponent
thisModule "iframeWith" cpt
iframeWithCpt = R
.hooksComponentWithModule
thisModule "iframeWith" cpt
where
cpt { frameSource, iframeRef, search: (search /\ setSearch) } _ =
pure $ H.iframe { src: src frameSource search.term
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchBar.purs
View file @
71638695
...
...
@@ -27,7 +27,7 @@ searchBar :: Record Props -> R.Element
searchBar props = R.createElement searchBarCpt props []
searchBarCpt :: R.Component Props
searchBarCpt = R
2.hooksComponent
thisModule "searchBar" cpt
searchBarCpt = R
.hooksComponentWithModule
thisModule "searchBar" cpt
where
cpt {langs, onSearch, search: search@(s /\ _), session} _ = do
--onSearchChange session s
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
71638695
...
...
@@ -47,9 +47,9 @@ searchField :: Record Props -> R.Element
searchField p = R.createElement searchFieldComponent p []
--searchFieldComponent :: R.Memo Props
--searchFieldComponent = R.memo (R
2.hooksComponent
thisModule "searchField" cpt) eqProps
--searchFieldComponent = R.memo (R
.hooksComponentWithModule
thisModule "searchField" cpt) eqProps
searchFieldComponent :: R.Component Props
searchFieldComponent = R
2.hooksComponent
thisModule "searchField" cpt
searchFieldComponent = R
.hooksComponentWithModule
thisModule "searchField" cpt
where
cpt props@{onSearch, search: search@(s /\ _)} _ = do
iframeRef <- R.useRef null
...
...
@@ -290,7 +290,7 @@ databaseInput (search /\ setSearch) dbs =
liItem db' = H.option {className : "text-primary center"} [ H.text (show db') ]
onChange e = do
let value = read $ R
2
.unsafeEventValue e
let value = read $ R.unsafeEventValue e
setSearch $ _ { datafield = Just $ External value
, databases = fromMaybe Empty value
}
...
...
@@ -308,7 +308,7 @@ orgInput ({datafield} /\ setSearch) orgs =
liItem :: Org -> R.Element
liItem org = H.option {className : "text-primary center"} [ H.text (show org) ]
onChange e = do
let value = R
2
.unsafeEventValue e
let value = R.unsafeEventValue e
setSearch $ _ { datafield = Just $ External $ Just $ HAL $ read value }
{-
...
...
@@ -318,7 +318,7 @@ filterInput (term /\ setTerm) =
[ H.input { defaultValue: term
, className: "form-control"
, type: "text"
, on: { change: setTerm <<< const <<< R
2
.unsafeEventValue }
, on: { change: setTerm <<< const <<< R.unsafeEventValue }
, "required pattern": "[[0-9]+[ ]+]*"
-- TODO ^FIXME not sure about the regex comprehension: that should match "123 2334 44545" only (Integers separated by one space)
-- form validation with CSS
...
...
@@ -337,7 +337,7 @@ searchInput :: Record SearchInputProps -> R.Element
searchInput p = R.createElement searchInputComponent p []
searchInputComponent :: R.Component SearchInputProps
searchInputComponent = R
2.hooksComponent
thisModule "searchInput" cpt
searchInputComponent = R
.hooksComponentWithModule
thisModule "searchInput" cpt
where
cpt {search: (search /\ setSearch)} _ = do
pure $
...
...
@@ -350,7 +350,7 @@ searchInputComponent = R2.hooksComponent thisModule "searchInput" cpt
}
]
onChange setSearch e = do
let value = R
2
.unsafeEventValue e
let value = R.unsafeEventValue e
setSearch $ _ { term = value }
type SubmitButtonProps =
...
...
@@ -363,7 +363,7 @@ submitButton :: Record SubmitButtonProps -> R.Element
submitButton p = R.createElement submitButtonComponent p []
submitButtonComponent :: R.Component SubmitButtonProps
submitButtonComponent = R
2.hooksComponent
thisModule "submitButton" cpt
submitButtonComponent = R
.hooksComponentWithModule
thisModule "submitButton" cpt
where
cpt {onSearch, search: (mySearch /\ _), session} _ =
pure $
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
View file @
71638695
...
...
@@ -59,7 +59,7 @@ shareNode :: Record SubTreeParamsIn -> R.Element
shareNode p = R.createElement shareNodeCpt p []
shareNodeCpt :: R.Component SubTreeParamsIn
shareNodeCpt = R
2.hooksComponent
thisModule "shareNode" cpt
shareNodeCpt = R
.hooksComponentWithModule
thisModule "shareNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing})
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
71638695
...
...
@@ -73,7 +73,7 @@ uploadFileView :: Record Props -> R.Element
uploadFileView props = R.createElement uploadFileViewCpt props []
uploadFileViewCpt :: R.Component Props
uploadFileViewCpt = R
2.hooksComponent
thisModule "uploadFileView" cpt
uploadFileViewCpt = R
.hooksComponentWithModule
thisModule "uploadFileView" cpt
where
cpt {dispatch, id, nodeType} _ = do
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
...
...
@@ -142,7 +142,7 @@ uploadButton :: Record UploadButtonProps -> R.Element
uploadButton props = R.createElement uploadButtonCpt props []
uploadButtonCpt :: R.Component UploadButtonProps
uploadButtonCpt = R
2.hooksComponent
thisModule "uploadButton" cpt
uploadButtonCpt = R
.hooksComponentWithModule
thisModule "uploadButton" cpt
where
cpt { dispatch
, fileType: (fileType /\ setFileType)
...
...
@@ -189,7 +189,7 @@ fileTypeView :: Record FileTypeProps -> R.Element
fileTypeView p = R.createElement fileTypeViewCpt p []
fileTypeViewCpt :: R.Component FileTypeProps
fileTypeViewCpt = R
2.hooksComponent
thisModule "fileTypeView" cpt
fileTypeViewCpt = R
.hooksComponentWithModule
thisModule "fileTypeView" cpt
where
cpt { dispatch
, droppedFile: Just (DroppedFile {blob, fileType}) /\ setDroppedFile
...
...
@@ -236,8 +236,8 @@ fileTypeViewCpt = R2.hooksComponent thisModule "fileTypeView" cpt
where
onChange e l =
setDroppedFile $ const $ Just $ DroppedFile $ { blob
, fileType: read $ R
2
.unsafeEventValue e
, lang : fromMaybe EN $ read $ R
2
.unsafeEventValue l
, fileType: read $ R.unsafeEventValue e
, lang : fromMaybe EN $ read $ R.unsafeEventValue l
}
renderOption opt = H.option {} [ H.text $ show opt ]
...
...
@@ -328,7 +328,7 @@ uploadTermListView :: Record Props -> R.Element
uploadTermListView props = R.createElement uploadTermListViewCpt props []
uploadTermListViewCpt :: R.Component Props
uploadTermListViewCpt = R
2.hooksComponent
thisModule "uploadTermListView" cpt
uploadTermListViewCpt = R
.hooksComponentWithModule
thisModule "uploadTermListView" cpt
where
cpt {dispatch, id, nodeType} _ = do
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
...
...
@@ -374,7 +374,7 @@ uploadTermButton :: Record UploadTermButtonProps -> R.Element
uploadTermButton props = R.createElement uploadTermButtonCpt props []
uploadTermButtonCpt :: R.Component UploadTermButtonProps
uploadTermButtonCpt = R
2.hooksComponent
thisModule "uploadTermButton" cpt
uploadTermButtonCpt = R
.hooksComponentWithModule
thisModule "uploadTermButton" cpt
where
cpt {dispatch, id, mFile: (mFile /\ setMFile), nodeType} _ = do
pure $ H.button {className: "btn btn-primary", disabled, on: {click: onClick}} [ H.text "Upload" ]
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
71638695
...
...
@@ -50,7 +50,7 @@ nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView p = R.createElement nodePopupCpt p []
nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R
2.hooksComponent
thisModule "nodePopupView" cpt
nodePopupCpt = R
.hooksComponentWithModule
thisModule "nodePopupView" cpt
where
cpt p _ = do
isOpen <- R.useState' false
...
...
@@ -114,7 +114,7 @@ nodePopupCpt = R2.hooksComponent thisModule "nodePopupView" cpt
[ H.a { "type" : "button"
, className: glyphicon "window-close"
, on : { click: \e -> p.onPopoverClose
$ R
2
.unsafeEventTarget e
$ R.unsafeEventTarget e
}
, title : "Close"
} []
...
...
@@ -202,7 +202,7 @@ buttonClick :: Record ButtonClickProps -> R.Element
buttonClick p = R.createElement buttonClickCpt p []
buttonClickCpt :: R.Component ButtonClickProps
buttonClickCpt = R
2.hooksComponent
thisModule "buttonClick" cpt
buttonClickCpt = R
.hooksComponentWithModule
thisModule "buttonClick" cpt
where
cpt {action: todo, state: (node@{action} /\ setNodePopup), nodeType} _ = do
pure $ H.div {className: "col-md-1"}
...
...
@@ -262,7 +262,7 @@ panelAction :: Record PanelActionProps -> R.Element
panelAction p = R.createElement panelActionCpt p []
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = R
2.hooksComponent
thisModule "panelAction" cpt
panelActionCpt = R
.hooksComponentWithModule
thisModule "panelAction" cpt
where
cpt {action: Documentation nodeType} _ = actionDoc nodeType
cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
71638695
...
...
@@ -64,7 +64,7 @@ type TextInputBoxProps =
textInputBox :: Record TextInputBoxProps -> R.Element
textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R.createElement el p []
where
el = R
2.hooksComponent
thisModule (boxName <> "Box") cpt
el = R
.hooksComponentWithModule
thisModule (boxName <> "Box") cpt
cpt {id, text} _ = do
renameNodeName <- R.useState' text
pure $ H.div {className: "from-group row-no-padding"}
...
...
@@ -91,7 +91,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R
-- , className: "form-control"
-- , on: { input: setRenameNodeName
-- <<< const
-- <<< R
2
.unsafeEventValue }
-- <<< R.unsafeEventValue }
-- }
]
submitBtn (newName /\ _) =
...
...
@@ -111,7 +111,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R
launchAff_ $ dispatch ( boxAction newName )
textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
where
el = R
2.hooksComponent
thisModule (boxName <> "Box") cpt
el = R
.hooksComponentWithModule
thisModule (boxName <> "Box") cpt
cpt {text} _ = pure $ H.div {} []