Commit 92c4b9d5 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[refactor] refactor react component names

Use thisModule everywhere.
parent 02b6488b
...@@ -28,6 +28,9 @@ import Gargantext.Components.Annotation.Utils ( termBootstrapClass ) ...@@ -28,6 +28,9 @@ import Gargantext.Components.Annotation.Utils ( termBootstrapClass )
import Gargantext.Components.NgramsTable.Core (NgramsTable, NgramsTerm, findNgramTermList, highlightNgrams, normNgram) import Gargantext.Components.NgramsTable.Core (NgramsTable, NgramsTerm, findNgramTermList, highlightNgrams, normNgram)
import Gargantext.Components.Annotation.Menu ( AnnotationMenu, annotationMenu, MenuType(..) ) import Gargantext.Components.Annotation.Menu ( AnnotationMenu, annotationMenu, MenuType(..) )
import Gargantext.Utils.Selection as Sel import Gargantext.Utils.Selection as Sel
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Annotation.AnnotatedField"
type Props = type Props =
( ngrams :: NgramsTable ( ngrams :: NgramsTable
...@@ -44,7 +47,7 @@ annotatedField :: Record Props -> R.Element ...@@ -44,7 +47,7 @@ annotatedField :: Record Props -> R.Element
annotatedField p = R.createElement annotatedFieldComponent p [] annotatedField p = R.createElement annotatedFieldComponent p []
annotatedFieldComponent :: R.Component Props annotatedFieldComponent :: R.Component Props
annotatedFieldComponent = R.hooksComponent "AnnotatedField" cpt annotatedFieldComponent = R2.hooksComponent thisModule "annotatedField" cpt
where where
cpt {ngrams,setTermList,text} _ = do cpt {ngrams,setTermList,text} _ = do
mMenu@(_ /\ setMenu) <- R.useState $ const Nothing mMenu@(_ /\ setMenu) <- R.useState $ const Nothing
......
...@@ -16,6 +16,8 @@ import Gargantext.Components.Annotation.Utils (termBootstrapClass) ...@@ -16,6 +16,8 @@ import Gargantext.Components.Annotation.Utils (termBootstrapClass)
import Gargantext.Components.ContextMenu.ContextMenu as CM import Gargantext.Components.ContextMenu.ContextMenu as CM
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Annotation.Menu"
data MenuType = NewNgram | SetTermListItem data MenuType = NewNgram | SetTermListItem
type Props = type Props =
...@@ -35,7 +37,7 @@ annotationMenu setMenu { x,y,list,menuType,setList } = ...@@ -35,7 +37,7 @@ annotationMenu setMenu { x,y,list,menuType,setList } =
] ]
annotationMenuCpt :: R.Component Props annotationMenuCpt :: R.Component Props
annotationMenuCpt = R.hooksComponent "Annotation.Menu" cpt annotationMenuCpt = R2.hooksComponent thisModule "annotationMenu" cpt
where where
cpt props _ = pure $ R.fragment $ children props cpt props _ = pure $ R.fragment $ children props
children props = A.mapMaybe (addToList props) [ MapTerm, CandidateTerm, StopTerm ] children props = A.mapMaybe (addToList props) [ MapTerm, CandidateTerm, StopTerm ]
......
...@@ -35,6 +35,8 @@ import Gargantext.Sessions as Sessions ...@@ -35,6 +35,8 @@ import Gargantext.Sessions as Sessions
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.App"
-- TODO (what does this mean?) -- TODO (what does this mean?)
-- tree changes endConfig state => trigger endConfig change in outerLayout, layoutFooter etc -- tree changes endConfig state => trigger endConfig change in outerLayout, layoutFooter etc
...@@ -42,7 +44,7 @@ app :: {} -> R.Element ...@@ -42,7 +44,7 @@ app :: {} -> R.Element
app props = R.createElement appCpt props [] app props = R.createElement appCpt props []
appCpt :: R.Component () appCpt :: R.Component ()
appCpt = R.hooksComponent "G.C.App.app" cpt where appCpt = R2.hooksComponent thisModule "app" cpt where
frontends = defaultFrontends frontends = defaultFrontends
cpt _ _ = do cpt _ _ = do
sessions <- useSessions sessions <- useSessions
...@@ -121,7 +123,7 @@ forestLayout :: Record ForestLayoutProps -> R.Element ...@@ -121,7 +123,7 @@ forestLayout :: Record ForestLayoutProps -> R.Element
forestLayout props = R.createElement forestLayoutCpt props [] forestLayout props = R.createElement forestLayoutCpt props []
forestLayoutCpt :: R.Component ForestLayoutProps forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponent "G.C.A.forestLayout" cpt forestLayoutCpt = R2.hooksComponent thisModule "forestLayout" cpt
where where
cpt props@{ handed } _ = do cpt props@{ handed } _ = do
pure $ R.fragment [ topBar { handed }, forestLayoutMain props ] pure $ R.fragment [ topBar { handed }, forestLayoutMain props ]
...@@ -130,7 +132,7 @@ forestLayoutMain :: Record ForestLayoutProps -> R.Element ...@@ -130,7 +132,7 @@ forestLayoutMain :: Record ForestLayoutProps -> R.Element
forestLayoutMain props = R.createElement forestLayoutMainCpt props [] forestLayoutMain props = R.createElement forestLayoutMainCpt props []
forestLayoutMainCpt :: R.Component ForestLayoutProps forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponent "G.C.A.forestLayoutMain" cpt forestLayoutMainCpt = R2.hooksComponent thisModule "forestLayoutMain" cpt
where where
cpt { child, frontends, handed, reload, route, sessions, showLogin } _ = do cpt { child, frontends, handed, reload, route, sessions, showLogin } _ = do
let ordering = let ordering =
...@@ -162,7 +164,7 @@ topBar :: Record TopBarProps -> R.Element ...@@ -162,7 +164,7 @@ topBar :: Record TopBarProps -> R.Element
topBar props = R.createElement topBarCpt props [] topBar props = R.createElement topBarCpt props []
topBarCpt :: R.Component TopBarProps topBarCpt :: R.Component TopBarProps
topBarCpt = R.hooksComponent "G.C.A.topBar" cpt topBarCpt = R2.hooksComponent thisModule "topBar" cpt
where where
cpt { handed } _ = do cpt { handed } _ = do
pure $ H.div { id: "dafixedtop" pure $ H.div { id: "dafixedtop"
...@@ -204,7 +206,7 @@ handedChooser :: Record HandedChooserProps -> R.Element ...@@ -204,7 +206,7 @@ handedChooser :: Record HandedChooserProps -> R.Element
handedChooser props = R.createElement handedChooserCpt props [] handedChooser props = R.createElement handedChooserCpt props []
handedChooserCpt :: R.Component HandedChooserProps handedChooserCpt :: R.Component HandedChooserProps
handedChooserCpt = R.hooksComponent "G.C.A.handedChooser" cpt handedChooserCpt = R2.hooksComponent thisModule "handedChooser" cpt
where where
cpt { handed } _ = do cpt { handed } _ = do
pure $ H.li {} [ pure $ H.li {} [
...@@ -337,7 +339,7 @@ footer :: Record FooterProps -> R.Element ...@@ -337,7 +339,7 @@ footer :: Record FooterProps -> R.Element
footer props = R.createElement footerCpt props [] footer props = R.createElement footerCpt props []
footerCpt :: R.Component FooterProps footerCpt :: R.Component FooterProps
footerCpt = R.hooksComponent "G.C.A.footer" cpt footerCpt = R2.hooksComponent thisModule "footer" cpt
where where
cpt { session } _ = do cpt { session } _ = do
pure $ H.div pure $ H.div
......
...@@ -11,6 +11,9 @@ import Reactix as R ...@@ -11,6 +11,9 @@ import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.AutoUpdate"
data Action = Update data Action = Update
...@@ -46,7 +49,7 @@ autoUpdate :: Record PropsRow -> R.Element ...@@ -46,7 +49,7 @@ autoUpdate :: Record PropsRow -> R.Element
autoUpdate props = R.createElement autoUpdateCpt props [] autoUpdate props = R.createElement autoUpdateCpt props []
autoUpdateCpt :: R.Component PropsRow autoUpdateCpt :: R.Component PropsRow
autoUpdateCpt = R.hooksComponent "G.C.AU.autoUpdate" cpt autoUpdateCpt = R2.hooksComponent thisModule "autoUpdate" cpt
where where
cpt { duration, effect } _ = do cpt { duration, effect } _ = do
intervalRef <- R.useRef Nothing intervalRef <- R.useRef Nothing
......
...@@ -24,6 +24,8 @@ import Gargantext.Prelude ...@@ -24,6 +24,8 @@ import Gargantext.Prelude
import Gargantext.Utils.HighlightJS as HLJS import Gargantext.Utils.HighlightJS as HLJS
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.CodeEditor"
type Code = String type Code = String
type Html = String type Html = String
type Error = String type Error = String
...@@ -105,7 +107,7 @@ codeEditor p = R.createElement codeEditorCpt p [] ...@@ -105,7 +107,7 @@ codeEditor p = R.createElement codeEditorCpt p []
-- The overlay is to provide seamless syntax highlighting on top of the textarea. -- 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 -- I took the idea from: https://github.com/satya164/react-simple-code-editor
codeEditorCpt :: R.Component Props codeEditorCpt :: R.Component Props
codeEditorCpt = R.hooksComponent "G.C.CE.CodeEditor" cpt codeEditorCpt = R2.hooksComponent thisModule "codeEditor" cpt
where where
cpt {code, defaultCodeType, onChange} _ = do cpt {code, defaultCodeType, onChange} _ = do
controls <- initControls code defaultCodeType controls <- initControls code defaultCodeType
...@@ -202,7 +204,7 @@ toolbar :: Record ToolbarProps -> R.Element ...@@ -202,7 +204,7 @@ toolbar :: Record ToolbarProps -> R.Element
toolbar p = R.createElement toolbarCpt p [] toolbar p = R.createElement toolbarCpt p []
toolbarCpt :: R.Component ToolbarProps toolbarCpt :: R.Component ToolbarProps
toolbarCpt = R.hooksComponent "G.C.CE.toolbar" cpt toolbarCpt = R2.hooksComponent thisModule "toolbar" cpt
where where
cpt props@{controls: {codeType, error, viewType}} _ = do cpt props@{controls: {codeType, error, viewType}} _ = do
pure $ pure $
...@@ -231,7 +233,7 @@ errorComponent :: Record ErrorComponentProps -> R.Element ...@@ -231,7 +233,7 @@ errorComponent :: Record ErrorComponentProps -> R.Element
errorComponent p = R.createElement errorComponentCpt p [] errorComponent p = R.createElement errorComponentCpt p []
errorComponentCpt :: R.Component ErrorComponentProps errorComponentCpt :: R.Component ErrorComponentProps
errorComponentCpt = R.hooksComponent "G.C.CE.ErrorComponent" cpt errorComponentCpt = R2.hooksComponent thisModule "errorComponent" cpt
where where
cpt {error: (Nothing /\ _)} _ = pure $ H.div {} [] cpt {error: (Nothing /\ _)} _ = pure $ H.div {} []
cpt {error: ((Just error) /\ _)} _ = do cpt {error: ((Just error) /\ _)} _ = do
...@@ -248,7 +250,7 @@ codeTypeSelector :: Record CodeTypeSelectorProps -> R.Element ...@@ -248,7 +250,7 @@ codeTypeSelector :: Record CodeTypeSelectorProps -> R.Element
codeTypeSelector p = R.createElement codeTypeSelectorCpt p [] codeTypeSelector p = R.createElement codeTypeSelectorCpt p []
codeTypeSelectorCpt :: R.Component CodeTypeSelectorProps codeTypeSelectorCpt :: R.Component CodeTypeSelectorProps
codeTypeSelectorCpt = R.hooksComponent "G.C.CE.CodeTypeSelector" cpt codeTypeSelectorCpt = R2.hooksComponent thisModule "codeTypeSelector" cpt
where where
cpt {codeType, onChange} _ = do cpt {codeType, onChange} _ = do
pure $ R2.select { className: "form-control" pure $ R2.select { className: "form-control"
...@@ -284,7 +286,7 @@ viewTypeSelector :: Record ViewTypeSelectorProps -> R.Element ...@@ -284,7 +286,7 @@ viewTypeSelector :: Record ViewTypeSelectorProps -> R.Element
viewTypeSelector p = R.createElement viewTypeSelectorCpt p [] viewTypeSelector p = R.createElement viewTypeSelectorCpt p []
viewTypeSelectorCpt :: R.Component ViewTypeSelectorProps viewTypeSelectorCpt :: R.Component ViewTypeSelectorProps
viewTypeSelectorCpt = R.hooksComponent "G.C.CE.ViewTypeSelector" cpt viewTypeSelectorCpt = R2.hooksComponent thisModule "viewTypeSelector" cpt
where where
cpt {state} _ = cpt {state} _ =
pure $ H.div { className: "btn-group" } [ pure $ H.div { className: "btn-group" } [
......
...@@ -21,13 +21,15 @@ import Reactix.DOM.HTML as HTML ...@@ -21,13 +21,15 @@ import Reactix.DOM.HTML as HTML
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.ContextMenu.ContextMenu"
type Props t = ( x :: Number, y :: Number, setMenu :: R2.Setter (Maybe t) ) type Props t = ( x :: Number, y :: Number, setMenu :: R2.Setter (Maybe t) )
contextMenu :: forall t. Record (Props t) -> Array R.Element -> R.Element contextMenu :: forall t. Record (Props t) -> Array R.Element -> R.Element
contextMenu = R.createElement contextMenuCpt contextMenu = R.createElement contextMenuCpt
contextMenuCpt :: forall t. R.Component (Props t) contextMenuCpt :: forall t. R.Component (Props t)
contextMenuCpt = R.hooksComponent "ContextMenu" cpt contextMenuCpt = R2.hooksComponent thisModule "contextMenu" cpt
where where
cpt menu children = do cpt menu children = do
host <- R2.getPortalHost host <- R2.getPortalHost
...@@ -101,7 +103,7 @@ contextMenuItem :: Array R.Element -> R.Element ...@@ -101,7 +103,7 @@ contextMenuItem :: Array R.Element -> R.Element
contextMenuItem = R.createElement contextMenuItemCpt {} contextMenuItem = R.createElement contextMenuItemCpt {}
contextMenuItemCpt :: R.Component () contextMenuItemCpt :: R.Component ()
contextMenuItemCpt = R.hooksComponent "ContextMenuItem" cpt contextMenuItemCpt = R2.hooksComponent thisModule "contextMenuItem" cpt
where where
cpt _props children = pure $ HTML.li { className: "context-menu-item" } children cpt _props children = pure $ HTML.li { className: "context-menu-item" } children
......
...@@ -39,6 +39,9 @@ import Gargantext.Routes (SessionRoute(NodeAPI)) ...@@ -39,6 +39,9 @@ import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, sessionId, get, delete, put) import Gargantext.Sessions (Session, sessionId, get, delete, put)
import Gargantext.Types (NodeType(..), OrderBy(..), TableResult, TabType, showTabType') import Gargantext.Types (NodeType(..), OrderBy(..), TableResult, TabType, showTabType')
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.DocsTable"
------------------------------------------------------------------------ ------------------------------------------------------------------------
type TotalRecords = Int type TotalRecords = Int
...@@ -159,7 +162,7 @@ docViewLayout :: Record LayoutProps -> R.Element ...@@ -159,7 +162,7 @@ docViewLayout :: Record LayoutProps -> R.Element
docViewLayout props = R.createElement docViewLayoutCpt props [] docViewLayout props = R.createElement docViewLayoutCpt props []
docViewLayoutCpt :: R.Component LayoutProps docViewLayoutCpt :: R.Component LayoutProps
docViewLayoutCpt = R.hooksComponent "G.C.DocsTable.docViewLayout" cpt docViewLayoutCpt = R2.hooksComponent thisModule "docViewLayout" cpt
where where
cpt layout _children = do cpt layout _children = do
query <- R.useState' "" query <- R.useState' ""
...@@ -176,7 +179,7 @@ docView :: Record Props -> R.Element ...@@ -176,7 +179,7 @@ docView :: Record Props -> R.Element
docView props = R.createElement docViewCpt props [] docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component Props docViewCpt :: R.Component Props
docViewCpt = R.hooksComponent "G.C.DocsTable.docView" cpt where docViewCpt = R2.hooksComponent thisModule "docView" cpt where
cpt { query, params cpt { query, params
, layout: { frontends, session, nodeId, tabType, listId , layout: { frontends, session, nodeId, tabType, listId
, corpusId, totalRecords, chart, showSearch } } _ = do , corpusId, totalRecords, chart, showSearch } } _ = do
...@@ -213,7 +216,7 @@ docViewCpt = R.hooksComponent "G.C.DocsTable.docView" cpt where ...@@ -213,7 +216,7 @@ docViewCpt = R.hooksComponent "G.C.DocsTable.docView" cpt where
searchBar :: R.State Query -> R.Element searchBar :: R.State Query -> R.Element
searchBar (query /\ setQuery) = R.createElement el {} [] searchBar (query /\ setQuery) = R.createElement el {} []
where where
el = R.hooksComponent "SearchBar" cpt el = R2.hooksComponent thisModule "SearchBar" cpt
cpt {} _children = do cpt {} _children = do
queryText <- R.useState' query queryText <- R.useState' query
...@@ -298,7 +301,7 @@ pageLayout :: Record PageLayoutProps -> R.Element ...@@ -298,7 +301,7 @@ pageLayout :: Record PageLayoutProps -> R.Element
pageLayout props = R.createElement pageLayoutCpt props [] pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R.hooksComponent "G.C.DocsTable.pageLayout" cpt where pageLayoutCpt = R2.hooksComponent thisModule "pageLayout" cpt where
cpt props@{ corpusId, frontends, listId, nodeId, params, query, session, tabType } _ = cpt props@{ corpusId, frontends, listId, nodeId, params, query, session, tabType } _ =
useLoaderWithCacheAPI { useLoaderWithCacheAPI {
cacheEndpoint: getPageHash session cacheEndpoint: getPageHash session
...@@ -334,7 +337,7 @@ page :: T.Params -> Record PageLayoutProps -> Array DocumentsView -> R.Element ...@@ -334,7 +337,7 @@ page :: T.Params -> Record PageLayoutProps -> Array DocumentsView -> R.Element
page params layout documents = R.createElement pageCpt { documents, layout, params } [] page params layout documents = R.createElement pageCpt { documents, layout, params } []
pageCpt :: R.Component PageProps pageCpt :: R.Component PageProps
pageCpt = R.hooksComponent "G.C.DocsTable.pageCpt" cpt where pageCpt = R2.hooksComponent thisModule "pageCpt" cpt where
cpt { documents, layout, params } _ = do cpt { documents, layout, params } _ = do
paramsS <- R.useState' params paramsS <- R.useState' params
pure $ pagePaint { documents, layout, params: paramsS } pure $ pagePaint { documents, layout, params: paramsS }
...@@ -349,7 +352,7 @@ pagePaint :: Record PagePaintProps -> R.Element ...@@ -349,7 +352,7 @@ pagePaint :: Record PagePaintProps -> R.Element
pagePaint props = R.createElement pagePaintCpt props [] pagePaint props = R.createElement pagePaintCpt props []
pagePaintCpt :: R.Component PagePaintProps pagePaintCpt :: R.Component PagePaintProps
pagePaintCpt = R.hooksComponent "G.C.DocsTable.pagePaintCpt" cpt where pagePaintCpt = R2.hooksComponent thisModule "pagePaintCpt" cpt where
cpt { layout: { corpusId, frontends, listId, nodeId, session, totalRecords }, documents, params } _ = do cpt { layout: { corpusId, frontends, listId, nodeId, session, totalRecords }, documents, params } _ = do
localCategories <- R.useState' (mempty :: LocalCategories) localCategories <- R.useState' (mempty :: LocalCategories)
pure $ T.table pure $ T.table
......
...@@ -17,6 +17,10 @@ import Data.Tuple (fst, snd) ...@@ -17,6 +17,10 @@ import Data.Tuple (fst, snd)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect (Effect) import Effect (Effect)
import Effect.Aff (Aff, launchAff_) import Effect.Aff (Aff, launchAff_)
import Prelude
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Category (Category(..), CategoryQuery(..), favCategory, decodeCategory, putCategories) import Gargantext.Components.Category (Category(..), CategoryQuery(..), favCategory, decodeCategory, putCategories)
import Gargantext.Components.Search import Gargantext.Components.Search
import Gargantext.Components.Table as T import Gargantext.Components.Table as T
...@@ -29,9 +33,8 @@ import Gargantext.Types (NodeType(..), OrderBy(..), NodePath(..), NodeID) ...@@ -29,9 +33,8 @@ import Gargantext.Types (NodeType(..), OrderBy(..), NodePath(..), NodeID)
import Gargantext.Utils (toggleSet, zeroPad) import Gargantext.Utils (toggleSet, zeroPad)
import Gargantext.Utils.DecodeMaybe ((.|)) import Gargantext.Utils.DecodeMaybe ((.|))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Prelude
import Reactix as R thisModule = "Gargantext.Components.FacetsTable"
import Reactix.DOM.HTML as H
------------------------------------------------------------------------ ------------------------------------------------------------------------
type Props = type Props =
...@@ -91,7 +94,7 @@ docView :: Record Props -> R.Element ...@@ -91,7 +94,7 @@ docView :: Record Props -> R.Element
docView props = R.createElement docViewCpt props [] docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component Props docViewCpt :: R.Component Props
docViewCpt = R.hooksComponent "G.C.FacetsTable.DocView" cpt docViewCpt = R2.hooksComponent thisModule "docView" cpt
where where
cpt {frontends, session, nodeId, listId, query, totalRecords, chart, container} _ = do cpt {frontends, session, nodeId, listId, query, totalRecords, chart, container} _ = do
deletions <- R.useState' initialDeletions deletions <- R.useState' initialDeletions
...@@ -142,7 +145,7 @@ docViewGraph :: Record Props -> R.Element ...@@ -142,7 +145,7 @@ docViewGraph :: Record Props -> R.Element
docViewGraph props = R.createElement docViewCpt props [] docViewGraph props = R.createElement docViewCpt props []
docViewGraphCpt :: R.Component Props docViewGraphCpt :: R.Component Props
docViewGraphCpt = R.hooksComponent "FacetsDocViewGraph" cpt docViewGraphCpt = R2.hooksComponent thisModule "docViewGraph" cpt
where where
cpt {frontends, session, nodeId, listId, query, totalRecords, chart, container} _ = do cpt {frontends, session, nodeId, listId, query, totalRecords, chart, container} _ = do
deletions <- R.useState' initialDeletions deletions <- R.useState' initialDeletions
...@@ -289,7 +292,7 @@ pageLayout :: Record PageLayoutProps -> R.Element ...@@ -289,7 +292,7 @@ pageLayout :: Record PageLayoutProps -> R.Element
pageLayout props = R.createElement pageLayoutCpt props [] pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R.hooksComponent "G.C.FacetsTable.PageLayout" cpt pageLayoutCpt = R2.hooksComponent thisModule "pageLayout" cpt
where where
cpt {frontends, totalRecords, deletions, container, session, path} _ = do cpt {frontends, totalRecords, deletions, container, session, path} _ = do
useLoader (fst path) loadPage $ \documents -> useLoader (fst path) loadPage $ \documents ->
...@@ -299,7 +302,7 @@ page :: Record PageProps -> R.Element ...@@ -299,7 +302,7 @@ page :: Record PageProps -> R.Element
page props = R.createElement pageCpt props [] page props = R.createElement pageCpt props []
pageCpt :: R.Component PageProps pageCpt :: R.Component PageProps
pageCpt = R.hooksComponent "G.C.FacetsTable.Page" cpt pageCpt = R2.hooksComponent thisModule "page" cpt
where where
cpt {frontends, totalRecords, container, deletions, documents, session, path: path@({nodeId, listId, query} /\ setPath)} _ = do cpt {frontends, totalRecords, container, deletions, documents, session, path: path@({nodeId, listId, query} /\ setPath)} _ = do
pure $ T.table { rows, container, colNames, totalRecords, params, wrapColElts } pure $ T.table { rows, container, colNames, totalRecords, params, wrapColElts }
......
...@@ -17,6 +17,8 @@ import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions) ...@@ -17,6 +17,8 @@ import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions)
import Gargantext.Types (Reload, Handed(..)) import Gargantext.Types (Reload, Handed(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest"
type Props = type Props =
( frontends :: Frontends ( frontends :: Frontends
, handed :: Handed , handed :: Handed
...@@ -30,7 +32,7 @@ forest :: Record Props -> R.Element ...@@ -30,7 +32,7 @@ forest :: Record Props -> R.Element
forest props = R.createElement forestCpt props [] forest props = R.createElement forestCpt props []
forestCpt :: R.Component Props forestCpt :: R.Component Props
forestCpt = R.hooksComponent "G.C.Forest.forest" cpt where forestCpt = R2.hooksComponent thisModule "forest" cpt where
cpt { frontends, handed, reload: extReload, route, sessions, showLogin } _ = do cpt { frontends, handed, reload: extReload, route, sessions, showLogin } _ = do
-- NOTE: this is a hack to reload the tree view on demand -- NOTE: this is a hack to reload the tree view on demand
reload <- R.useState' (0 :: Reload) reload <- R.useState' (0 :: Reload)
......
...@@ -33,10 +33,13 @@ import Gargantext.Ends (Frontends) ...@@ -33,10 +33,13 @@ import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (Unit, bind, discard, map, pure, void, ($), (+), (<>), (==)) import Gargantext.Prelude (Unit, bind, discard, map, pure, void, ($), (+), (<>), (==))
import Gargantext.Routes (AppRoute) import Gargantext.Routes (AppRoute)
import Gargantext.Routes as GR
import Gargantext.Sessions (OpenNodes, Session, mkNodeId, get) import Gargantext.Sessions (OpenNodes, Session, mkNodeId, get)
import Gargantext.Types (ID, Reload, isPublic, publicize) import Gargantext.Types (ID, Reload, isPublic, publicize)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Routes as GR import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree"
------------------------------------------------------------------------ ------------------------------------------------------------------------
type CommonProps = type CommonProps =
...@@ -58,7 +61,7 @@ treeView :: Record Props -> R.Element ...@@ -58,7 +61,7 @@ treeView :: Record Props -> R.Element
treeView props = R.createElement treeViewCpt props [] treeView props = R.createElement treeViewCpt props []
where where
treeViewCpt :: R.Component Props treeViewCpt :: R.Component Props
treeViewCpt = R.hooksComponent "G.C.Tree.treeView" cpt treeViewCpt = R2.hooksComponent thisModule "treeView" cpt
where where
cpt { root cpt { root
, asyncTasks , asyncTasks
...@@ -83,7 +86,7 @@ treeLoadView :: Record Props -> R.Element ...@@ -83,7 +86,7 @@ treeLoadView :: Record Props -> R.Element
treeLoadView p = R.createElement treeLoadViewCpt p [] treeLoadView p = R.createElement treeLoadViewCpt p []
where where
treeLoadViewCpt :: R.Component Props treeLoadViewCpt :: R.Component Props
treeLoadViewCpt = R.hooksComponent "TreeLoadView" cpt treeLoadViewCpt = R2.hooksComponent thisModule "treeLoadView" cpt
where where
cpt { root cpt { root
, asyncTasks , asyncTasks
...@@ -122,7 +125,7 @@ loadedTreeView :: Record TreeViewProps -> R.Element ...@@ -122,7 +125,7 @@ loadedTreeView :: Record TreeViewProps -> R.Element
loadedTreeView p = R.createElement loadedTreeViewCpt p [] loadedTreeView p = R.createElement loadedTreeViewCpt p []
where where
loadedTreeViewCpt :: R.Component TreeViewProps loadedTreeViewCpt :: R.Component TreeViewProps
loadedTreeViewCpt = R.hooksComponent "LoadedTreeView" cpt loadedTreeViewCpt = R2.hooksComponent thisModule "loadedTreeView" cpt
where where
cpt { asyncTasks cpt { asyncTasks
, frontends , frontends
...@@ -183,7 +186,7 @@ toHtml p@{ asyncTasks ...@@ -183,7 +186,7 @@ toHtml p@{ asyncTasks
} = } =
R.createElement el {} [] R.createElement el {} []
where where
el = R.hooksComponent "NodeView" cpt el = R2.hooksComponent thisModule "nodeView" cpt
commonProps = RecordE.pick p :: Record CommonProps commonProps = RecordE.pick p :: Record CommonProps
pAction a = performAction a (RecordE.pick p :: Record PerformActionProps) pAction a = performAction a (RecordE.pick p :: Record PerformActionProps)
......
...@@ -34,6 +34,8 @@ import Gargantext.Types as GT ...@@ -34,6 +34,8 @@ import Gargantext.Types as GT
import Gargantext.Utils.Popover as Popover import Gargantext.Utils.Popover as Popover
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree.Node"
-- Main Node -- Main Node
type NodeMainSpanProps = type NodeMainSpanProps =
...@@ -51,7 +53,7 @@ nodeMainSpan :: Record NodeMainSpanProps ...@@ -51,7 +53,7 @@ nodeMainSpan :: Record NodeMainSpanProps
-> R.Element -> R.Element
nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createElement el p [] nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createElement el p []
where where
el = R.hooksComponent "G.C.F.T.N.NodeMainSpan" cpt el = R2.hooksComponent thisModule "nodeMainSpan" cpt
cpt props@{id, mCurrentRoute, name, nodeType, tasks: { onTaskFinish, tasks }} _ = do cpt props@{id, mCurrentRoute, name, nodeType, tasks: { onTaskFinish, tasks }} _ = do
-- only 1 popup at a time is allowed to be opened -- only 1 popup at a time is allowed to be opened
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile) droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
...@@ -213,7 +215,7 @@ nodeActions :: Record NodeActionsProps -> R.Element ...@@ -213,7 +215,7 @@ nodeActions :: Record NodeActionsProps -> R.Element
nodeActions p = R.createElement nodeActionsCpt p [] nodeActions p = R.createElement nodeActionsCpt p []
nodeActionsCpt :: R.Component NodeActionsProps nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R.hooksComponent "G.C.F.T.N.B.nodeActions" cpt nodeActionsCpt = R2.hooksComponent thisModule "nodeActions" cpt
where where
cpt { id cpt { id
, nodeType: GT.Graph , nodeType: GT.Graph
......
...@@ -18,6 +18,9 @@ import Gargantext.Routes as GR ...@@ -18,6 +18,9 @@ import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post) import Gargantext.Sessions (Session, post)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Types (NodeType(..)) import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Add"
---------------------------------------------------------------------- ----------------------------------------------------------------------
addNode :: Session -> GT.ID -> AddNodeValue -> Aff (Array GT.ID) addNode :: Session -> GT.ID -> AddNodeValue -> Aff (Array GT.ID)
...@@ -61,7 +64,7 @@ addNodeView :: Record CreateNodeProps ...@@ -61,7 +64,7 @@ addNodeView :: Record CreateNodeProps
-> R.Element -> R.Element
addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p [] addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
where where
el = R.hooksComponent "AddNodeView" cpt el = R2.hooksComponent thisModule "addNodeView" cpt
cpt {id, name} _ = do cpt {id, name} _ = do
nodeName@(name' /\ setNodeName) <- R.useState' "Name" nodeName@(name' /\ setNodeName) <- R.useState' "Name"
nodeType'@(nt /\ setNodeType) <- R.useState' $ fromMaybe Folder $ head nodeTypes nodeType'@(nt /\ setNodeType) <- R.useState' $ fromMaybe Folder $ head nodeTypes
......
...@@ -4,6 +4,10 @@ import Data.Maybe (Maybe(..)) ...@@ -4,6 +4,10 @@ import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff) import Effect.Aff (Aff, launchAff)
import Effect.Uncurried (mkEffectFn1) import Effect.Uncurried (mkEffectFn1)
import Prelude (($))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest.Tree.Node.Action (Action) import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Components.Forest.Tree.Node.Action.Contact.Types (AddContactParams(..)) import Gargantext.Components.Forest.Tree.Node.Action.Contact.Types (AddContactParams(..))
-- import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn) -- import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn)
...@@ -13,9 +17,8 @@ import Gargantext.Sessions (Session, post) ...@@ -13,9 +17,8 @@ import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID) import Gargantext.Types (ID)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Prelude (($))
import Reactix as R thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Contact"
import Reactix.DOM.HTML as H
------------------------------------------------------------------------ ------------------------------------------------------------------------
contactReq :: Session -> ID -> AddContactParams -> Aff ID contactReq :: Session -> ID -> AddContactParams -> Aff ID
...@@ -38,7 +41,7 @@ textInputBox :: Record TextInputBoxProps -> R.Element ...@@ -38,7 +41,7 @@ textInputBox :: Record TextInputBoxProps -> R.Element
textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), params } = R.createElement el p [] textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), params } = R.createElement el p []
where where
{firstname, lastname} = params {firstname, lastname} = params
el = R.hooksComponent (boxName <> "Box") cpt el = R2.hooksComponent thisModule (boxName <> "Box") cpt
cpt {id, params:params'} _ = do cpt {id, params:params'} _ = do
let {firstname, lastname} = params' let {firstname, lastname} = params'
stateFirstname <- R.useState' firstname stateFirstname <- R.useState' firstname
...@@ -77,7 +80,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), para ...@@ -77,7 +80,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), para
} [] } []
textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p [] textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
where where
el = R.hooksComponent (boxName <> "Box") cpt el = R2.hooksComponent thisModule (boxName <> "Box") cpt
cpt {} _ = pure $ H.div {} [] cpt {} _ = pure $ H.div {} []
......
module Gargantext.Components.Forest.Tree.Node.Action.Link module Gargantext.Components.Forest.Tree.Node.Action.Link where
where
import Data.Argonaut as Argonaut import Data.Argonaut as Argonaut
import Data.Generic.Rep (class Generic) import Data.Generic.Rep (class Generic)
...@@ -7,6 +6,9 @@ import Data.Generic.Rep.Show (genericShow) ...@@ -7,6 +6,9 @@ import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest.Tree.Node.Action (Action(..)) import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel) import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn) import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn)
...@@ -16,8 +18,9 @@ import Gargantext.Sessions (Session, post) ...@@ -16,8 +18,9 @@ import Gargantext.Sessions (Session, post)
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson) import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson)
import Reactix as R import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Link"
data LinkNodeReq = LinkNodeReq { nodeType :: GT.NodeType data LinkNodeReq = LinkNodeReq { nodeType :: GT.NodeType
...@@ -56,7 +59,7 @@ linkNode :: Record SubTreeParamsIn -> R.Element ...@@ -56,7 +59,7 @@ linkNode :: Record SubTreeParamsIn -> R.Element
linkNode p = R.createElement linkNodeCpt p [] linkNode p = R.createElement linkNodeCpt p []
linkNodeCpt :: R.Component SubTreeParamsIn linkNodeCpt :: R.Component SubTreeParamsIn
linkNodeCpt = R.hooksComponent "G.C.F.T.N.A.L.linkNode" cpt linkNodeCpt = R2.hooksComponent thisModule "linkNode" cpt
where where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
......
module Gargantext.Components.Forest.Tree.Node.Action.Merge module Gargantext.Components.Forest.Tree.Node.Action.Merge where
where
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Set as Set
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest.Tree.Node.Action (Action(..)) import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel, checkbox, checkboxes) import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel, checkbox, checkboxes)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn) import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (subTreeView, SubTreeParamsIn)
...@@ -11,9 +14,9 @@ import Gargantext.Prelude ...@@ -11,9 +14,9 @@ import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, put_) import Gargantext.Sessions (Session, put_)
import Gargantext.Types as GT import Gargantext.Types as GT
import Reactix as R import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
import Data.Set as Set thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Merge"
mergeNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID) mergeNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID)
mergeNodeReq session fromId toId = mergeNodeReq session fromId toId =
...@@ -23,7 +26,7 @@ mergeNode :: Record SubTreeParamsIn -> R.Element ...@@ -23,7 +26,7 @@ mergeNode :: Record SubTreeParamsIn -> R.Element
mergeNode p = R.createElement mergeNodeCpt p [] mergeNode p = R.createElement mergeNodeCpt p []
mergeNodeCpt :: R.Component SubTreeParamsIn mergeNodeCpt :: R.Component SubTreeParamsIn
mergeNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.mergeNode" cpt mergeNodeCpt = R2.hooksComponent thisModule "mergeNode" cpt
where where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing})
......
module Gargantext.Components.Forest.Tree.Node.Action.Move module Gargantext.Components.Forest.Tree.Node.Action.Move where
where
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
...@@ -14,6 +13,9 @@ import Gargantext.Prelude ...@@ -14,6 +13,9 @@ import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, put_) import Gargantext.Sessions (Session, put_)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Move"
moveNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID) moveNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID)
moveNodeReq session fromId toId = moveNodeReq session fromId toId =
...@@ -23,7 +25,7 @@ moveNode :: Record SubTreeParamsIn -> R.Element ...@@ -23,7 +25,7 @@ moveNode :: Record SubTreeParamsIn -> R.Element
moveNode p = R.createElement moveNodeCpt p [] moveNode p = R.createElement moveNodeCpt p []
moveNodeCpt :: R.Component SubTreeParamsIn moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.moveNode" cpt moveNodeCpt = R2.hooksComponent thisModule "moveNode" cpt
where where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing})
......
...@@ -20,6 +20,8 @@ import Gargantext.Components.Forest.Tree.Node.Action.Search.Types (DataField(..) ...@@ -20,6 +20,8 @@ import Gargantext.Components.Forest.Tree.Node.Action.Search.Types (DataField(..)
import Gargantext.Prelude (discard, identity, pure, unit, ($), (<>), (==), class Show, show) import Gargantext.Prelude (discard, identity, pure, unit, ($), (<>), (==), class Show, show)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Search.Frame"
-------------------- --------------------
data FrameSource = Istex | Searx data FrameSource = Istex | Searx
...@@ -41,7 +43,7 @@ searchIframes :: Record SearchIFramesProps -> R.Element ...@@ -41,7 +43,7 @@ searchIframes :: Record SearchIFramesProps -> R.Element
searchIframes props = R.createElement searchIframesCpt props [] searchIframes props = R.createElement searchIframesCpt props []
searchIframesCpt :: R.Component SearchIFramesProps searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt = R.hooksComponent "G.C.F.T.N.A.S.F.searchIframes" cpt searchIframesCpt = R2.hooksComponent thisModule "searchIframes" cpt
where where
cpt { iframeRef, search: search@(search' /\ _) } _ = do cpt { iframeRef, search: search@(search' /\ _) } _ = do
pure $ if isIsTex_Advanced search'.datafield pure $ if isIsTex_Advanced search'.datafield
...@@ -62,7 +64,7 @@ divIframe :: Record IFrameProps -> R.Element ...@@ -62,7 +64,7 @@ divIframe :: Record IFrameProps -> R.Element
divIframe props = R.createElement divIframeCpt props [] divIframe props = R.createElement divIframeCpt props []
divIframeCpt :: R.Component IFrameProps divIframeCpt :: R.Component IFrameProps
divIframeCpt = R.hooksComponent "G.C.F.T.N.A.S.F.divIframe" cpt divIframeCpt = R2.hooksComponent thisModule "divIframe" cpt
where where
cpt { frameSource, iframeRef, search: search@(search' /\ _) } _ = do cpt { frameSource, iframeRef, search: search@(search' /\ _) } _ = do
pure $ H.div { className: "frame-search panel panel-default" } pure $ H.div { className: "frame-search panel panel-default" }
...@@ -77,7 +79,7 @@ iframeWith :: Record IFrameProps -> R.Element ...@@ -77,7 +79,7 @@ iframeWith :: Record IFrameProps -> R.Element
iframeWith props = R.createElement iframeWithCpt props [] iframeWith props = R.createElement iframeWithCpt props []
iframeWithCpt :: R.Component IFrameProps iframeWithCpt :: R.Component IFrameProps
iframeWithCpt = R.hooksComponent "G.C.F.T.N.A.S.F.iframeWith" cpt iframeWithCpt = R2.hooksComponent thisModule "iframeWith" cpt
where where
cpt { frameSource, iframeRef, search: (search /\ setSearch) } _ = cpt { frameSource, iframeRef, search: (search /\ setSearch) } _ =
pure $ H.iframe { src: src frameSource search.term pure $ H.iframe { src: src frameSource search.term
......
...@@ -4,14 +4,18 @@ module Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar ...@@ -4,14 +4,18 @@ module Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect (Effect) import Effect (Effect)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField (searchField) import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField (searchField)
import Gargantext.Components.Forest.Tree.Node.Action.Search.Types -- (Database, SearchQuery(..), defaultSearchQuery, performSearch, Lang(..)) import Gargantext.Components.Forest.Tree.Node.Action.Search.Types -- (Database, SearchQuery(..), defaultSearchQuery, performSearch, Lang(..))
import Gargantext.Components.Lang (Lang) import Gargantext.Components.Lang (Lang)
import Gargantext.Prelude (Unit, pure, ($)) import Gargantext.Prelude (Unit, pure, ($))
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types as GT import Gargantext.Types as GT
import Reactix as R import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar"
type Props = ( langs :: Array Lang type Props = ( langs :: Array Lang
, onSearch :: GT.AsyncTaskWithType -> Effect Unit , onSearch :: GT.AsyncTaskWithType -> Effect Unit
...@@ -23,7 +27,7 @@ searchBar :: Record Props -> R.Element ...@@ -23,7 +27,7 @@ searchBar :: Record Props -> R.Element
searchBar props = R.createElement searchBarCpt props [] searchBar props = R.createElement searchBarCpt props []
searchBarCpt :: R.Component Props searchBarCpt :: R.Component Props
searchBarCpt = R.hooksComponent "G.C.F.T.N.A.S.SB.searchBar" cpt searchBarCpt = R2.hooksComponent thisModule "searchBar" cpt
where where
cpt {langs, onSearch, search: search@(s /\ _), session} _ = do cpt {langs, onSearch, search: search@(s /\ _), session} _ = do
--onSearchChange session s --onSearchChange session s
......
module Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField module Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField where
where
import DOM.Simple.Console (log, log2) import DOM.Simple.Console (log, log2)
import Data.Maybe (Maybe(..), maybe, fromMaybe) import Data.Maybe (Maybe(..), maybe, fromMaybe)
...@@ -11,6 +10,9 @@ import Data.Tuple.Nested ((/\)) ...@@ -11,6 +10,9 @@ import Data.Tuple.Nested ((/\))
import Effect (Effect) import Effect (Effect)
import Effect.Aff (launchAff_) import Effect.Aff (launchAff_)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest.Tree.Node.Tools (panel) import Gargantext.Components.Forest.Tree.Node.Tools (panel)
import Gargantext.Components.Forest.Tree.Node.Action.Search.Types (DataField(..), Database(..), IMT_org(..), Org(..), SearchQuery(..), allIMTorgs, allOrgs, dataFields, defaultSearchQuery, doc, performSearch, datafield2database, Search) import Gargantext.Components.Forest.Tree.Node.Action.Search.Types (DataField(..), Database(..), IMT_org(..), Org(..), SearchQuery(..), allIMTorgs, allOrgs, dataFields, defaultSearchQuery, doc, performSearch, datafield2database, Search)
import Gargantext.Components.Lang (Lang) import Gargantext.Components.Lang (Lang)
...@@ -19,8 +21,8 @@ import Gargantext.Sessions (Session) ...@@ -19,8 +21,8 @@ import Gargantext.Sessions (Session)
import Gargantext.Components.Forest.Tree.Node.Action.Search.Frame (searchIframes) import Gargantext.Components.Forest.Tree.Node.Action.Search.Frame (searchIframes)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField"
defaultSearch :: Search defaultSearch :: Search
defaultSearch = { databases: Empty defaultSearch = { databases: Empty
...@@ -45,9 +47,9 @@ searchField :: Record Props -> R.Element ...@@ -45,9 +47,9 @@ searchField :: Record Props -> R.Element
searchField p = R.createElement searchFieldComponent p [] searchField p = R.createElement searchFieldComponent p []
--searchFieldComponent :: R.Memo Props --searchFieldComponent :: R.Memo Props
--searchFieldComponent = R.memo (R.hooksComponent "SearchField" cpt) eqProps --searchFieldComponent = R.memo (R2.hooksComponent thisModule "searchField" cpt) eqProps
searchFieldComponent :: R.Component Props searchFieldComponent :: R.Component Props
searchFieldComponent = R.hooksComponent "G.C.F.T.N.A.S.SF.searchField" cpt searchFieldComponent = R2.hooksComponent thisModule "searchField" cpt
where where
cpt props@{onSearch, search: search@(s /\ _)} _ = do cpt props@{onSearch, search: search@(s /\ _)} _ = do
iframeRef <- R.useRef null iframeRef <- R.useRef null
...@@ -335,7 +337,7 @@ searchInput :: Record SearchInputProps -> R.Element ...@@ -335,7 +337,7 @@ searchInput :: Record SearchInputProps -> R.Element
searchInput p = R.createElement searchInputComponent p [] searchInput p = R.createElement searchInputComponent p []
searchInputComponent :: R.Component SearchInputProps searchInputComponent :: R.Component SearchInputProps
searchInputComponent = R.hooksComponent "G.C.S.SearchInput" cpt searchInputComponent = R2.hooksComponent thisModule "searchInput" cpt
where where
cpt {search: (search /\ setSearch)} _ = do cpt {search: (search /\ setSearch)} _ = do
pure $ pure $
...@@ -362,7 +364,7 @@ submitButton :: Record SubmitButtonProps -> R.Element ...@@ -362,7 +364,7 @@ submitButton :: Record SubmitButtonProps -> R.Element
submitButton p = R.createElement submitButtonComponent p [] submitButton p = R.createElement submitButtonComponent p []
submitButtonComponent :: R.Component SubmitButtonProps submitButtonComponent :: R.Component SubmitButtonProps
submitButtonComponent = R.hooksComponent "G.C.S.SubmitButton" cpt submitButtonComponent = R2.hooksComponent thisModule "submitButton" cpt
where where
cpt {onSearch, search: (mySearch /\ _), session} _ = cpt {onSearch, search: (mySearch /\ _), session} _ =
pure $ pure $
......
...@@ -6,6 +6,10 @@ import Data.Generic.Rep.Show (genericShow) ...@@ -6,6 +6,10 @@ import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Prelude (($))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest.Tree.Node.Action (Action) import Gargantext.Components.Forest.Tree.Node.Action (Action)
import Gargantext.Components.Forest.Tree.Node.Action as Action import Gargantext.Components.Forest.Tree.Node.Action as Action
import Gargantext.Components.Forest.Tree.Node.Tools as Tools import Gargantext.Components.Forest.Tree.Node.Tools as Tools
...@@ -16,9 +20,9 @@ import Gargantext.Sessions (Session, post) ...@@ -16,9 +20,9 @@ import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID) import Gargantext.Types (ID)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson) import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson)
import Prelude (($)) import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Share"
------------------------------------------------------------------------ ------------------------------------------------------------------------
shareReq :: Session -> ID -> ShareNodeParams -> Aff ID shareReq :: Session -> ID -> ShareNodeParams -> Aff ID
...@@ -55,7 +59,7 @@ shareNode :: Record SubTreeParamsIn -> R.Element ...@@ -55,7 +59,7 @@ shareNode :: Record SubTreeParamsIn -> R.Element
shareNode p = R.createElement shareNodeCpt p [] shareNode p = R.createElement shareNodeCpt p []
shareNodeCpt :: R.Component SubTreeParamsIn shareNodeCpt :: R.Component SubTreeParamsIn
shareNodeCpt = R.hooksComponent "G.C.F.T.N.A.M.shareNode" cpt shareNodeCpt = R2.hooksComponent thisModule "shareNode" cpt
where where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing}) action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing})
......
...@@ -32,6 +32,8 @@ import Gargantext.Types (NodeType(..), ID) ...@@ -32,6 +32,8 @@ import Gargantext.Types (NodeType(..), ID)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Upload"
-- UploadFile Action -- UploadFile Action
-- | Action : Upload -- | Action : Upload
...@@ -71,7 +73,7 @@ uploadFileView :: Record Props -> R.Element ...@@ -71,7 +73,7 @@ uploadFileView :: Record Props -> R.Element
uploadFileView props = R.createElement uploadFileViewCpt props [] uploadFileView props = R.createElement uploadFileViewCpt props []
uploadFileViewCpt :: R.Component Props uploadFileViewCpt :: R.Component Props
uploadFileViewCpt = R.hooksComponent "G.C.F.T.N.A.U.UploadFileView" cpt uploadFileViewCpt = R2.hooksComponent thisModule "uploadFileView" cpt
where where
cpt {dispatch, id, nodeType} _ = do cpt {dispatch, id, nodeType} _ = do
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
...@@ -140,7 +142,7 @@ uploadButton :: Record UploadButtonProps -> R.Element ...@@ -140,7 +142,7 @@ uploadButton :: Record UploadButtonProps -> R.Element
uploadButton props = R.createElement uploadButtonCpt props [] uploadButton props = R.createElement uploadButtonCpt props []
uploadButtonCpt :: R.Component UploadButtonProps uploadButtonCpt :: R.Component UploadButtonProps
uploadButtonCpt = R.hooksComponent "G.C.F.T.N.A.U.uploadButton" cpt uploadButtonCpt = R2.hooksComponent thisModule "uploadButton" cpt
where where
cpt { dispatch cpt { dispatch
, fileType: (fileType /\ setFileType) , fileType: (fileType /\ setFileType)
...@@ -187,7 +189,7 @@ fileTypeView :: Record FileTypeProps -> R.Element ...@@ -187,7 +189,7 @@ fileTypeView :: Record FileTypeProps -> R.Element
fileTypeView p = R.createElement fileTypeViewCpt p [] fileTypeView p = R.createElement fileTypeViewCpt p []
fileTypeViewCpt :: R.Component FileTypeProps fileTypeViewCpt :: R.Component FileTypeProps
fileTypeViewCpt = R.hooksComponent "G.C.F.T.N.A.U.fileTypeView" cpt fileTypeViewCpt = R2.hooksComponent thisModule "fileTypeView" cpt
where where
cpt { dispatch cpt { dispatch
, droppedFile: Just (DroppedFile {blob, fileType}) /\ setDroppedFile , droppedFile: Just (DroppedFile {blob, fileType}) /\ setDroppedFile
...@@ -326,7 +328,7 @@ uploadTermListView :: Record Props -> R.Element ...@@ -326,7 +328,7 @@ uploadTermListView :: Record Props -> R.Element
uploadTermListView props = R.createElement uploadTermListViewCpt props [] uploadTermListView props = R.createElement uploadTermListViewCpt props []
uploadTermListViewCpt :: R.Component Props uploadTermListViewCpt :: R.Component Props
uploadTermListViewCpt = R.hooksComponent "G.C.F.T.N.A.U.UploadTermListView" cpt uploadTermListViewCpt = R2.hooksComponent thisModule "uploadTermListView" cpt
where where
cpt {dispatch, id, nodeType} _ = do cpt {dispatch, id, nodeType} _ = do
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
...@@ -372,7 +374,7 @@ uploadTermButton :: Record UploadTermButtonProps -> R.Element ...@@ -372,7 +374,7 @@ uploadTermButton :: Record UploadTermButtonProps -> R.Element
uploadTermButton props = R.createElement uploadTermButtonCpt props [] uploadTermButton props = R.createElement uploadTermButtonCpt props []
uploadTermButtonCpt :: R.Component UploadTermButtonProps uploadTermButtonCpt :: R.Component UploadTermButtonProps
uploadTermButtonCpt = R.hooksComponent "G.C.F.T.N.A.U.uploadTermButton" cpt uploadTermButtonCpt = R2.hooksComponent thisModule "uploadTermButton" cpt
where where
cpt {dispatch, id, mFile: (mFile /\ setMFile), nodeType} _ = do cpt {dispatch, id, mFile: (mFile /\ setMFile), nodeType} _ = do
pure $ H.button {className: "btn btn-primary", disabled, on: {click: onClick}} [ H.text "Upload" ] pure $ H.button {className: "btn btn-primary", disabled, on: {click: onClick}} [ H.text "Upload" ]
......
...@@ -35,6 +35,8 @@ import Gargantext.Types as GT ...@@ -35,6 +35,8 @@ import Gargantext.Types as GT
import Gargantext.Utils (glyphicon, glyphiconActive) import Gargantext.Utils (glyphicon, glyphiconActive)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree.Node.Box"
type CommonProps = type CommonProps =
( dispatch :: Action -> Aff Unit ( dispatch :: Action -> Aff Unit
...@@ -48,7 +50,7 @@ nodePopupView :: Record NodePopupProps -> R.Element ...@@ -48,7 +50,7 @@ nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView p = R.createElement nodePopupCpt p [] nodePopupView p = R.createElement nodePopupCpt p []
nodePopupCpt :: R.Component NodePopupProps nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt nodePopupCpt = R2.hooksComponent thisModule "nodePopupView" cpt
where where
cpt p _ = do cpt p _ = do
isOpen <- R.useState' false isOpen <- R.useState' false
...@@ -140,7 +142,7 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt ...@@ -140,7 +142,7 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
-> R.Element -> R.Element
panelBody nodePopupState {dispatch: d, nodeType} = panelBody nodePopupState {dispatch: d, nodeType} =
H.div {className: "panel-body flex-space-between"} H.div {className: "panel-body flex-space-between"}
$ [ H.p { "style": {"margin":"10px"} } [] $ [ H.p { class: "spacer" } []
, H.div { className: "flex-center" } , H.div { className: "flex-center" }
[ buttonClick { action: doc [ buttonClick { action: doc
, state: nodePopupState , state: nodePopupState
...@@ -200,7 +202,7 @@ buttonClick :: Record ButtonClickProps -> R.Element ...@@ -200,7 +202,7 @@ buttonClick :: Record ButtonClickProps -> R.Element
buttonClick p = R.createElement buttonClickCpt p [] buttonClick p = R.createElement buttonClickCpt p []
buttonClickCpt :: R.Component ButtonClickProps buttonClickCpt :: R.Component ButtonClickProps
buttonClickCpt = R.hooksComponent "G.C.F.T.N.B.buttonClick" cpt buttonClickCpt = R2.hooksComponent thisModule "buttonClick" cpt
where where
cpt {action: todo, state: (node@{action} /\ setNodePopup), nodeType} _ = do cpt {action: todo, state: (node@{action} /\ setNodePopup), nodeType} _ = do
pure $ H.div {className: "col-md-1"} pure $ H.div {className: "col-md-1"}
...@@ -260,7 +262,7 @@ panelAction :: Record PanelActionProps -> R.Element ...@@ -260,7 +262,7 @@ panelAction :: Record PanelActionProps -> R.Element
panelAction p = R.createElement panelActionCpt p [] panelAction p = R.createElement panelActionCpt p []
panelActionCpt :: R.Component PanelActionProps panelActionCpt :: R.Component PanelActionProps
panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt panelActionCpt = R2.hooksComponent thisModule "panelAction" cpt
where where
cpt {action: Documentation nodeType} _ = actionDoc nodeType cpt {action: Documentation nodeType} _ = actionDoc nodeType
cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session
......
module Gargantext.Components.Forest.Tree.Node.Tools module Gargantext.Components.Forest.Tree.Node.Tools where
where
import Data.Maybe (fromMaybe, Maybe(..)) import Data.Maybe (fromMaybe, Maybe(..))
import Data.Nullable (null) import Data.Nullable (null)
...@@ -25,6 +24,8 @@ import Gargantext.Utils (toggleSet) ...@@ -25,6 +24,8 @@ import Gargantext.Utils (toggleSet)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.ReactTooltip as ReactTooltip import Gargantext.Utils.ReactTooltip as ReactTooltip
thisModule = "Gargantext.Components.Forest.Tree.Node.Tools"
------------------------------------------------------------------------ ------------------------------------------------------------------------
type Body = Array R.Element type Body = Array R.Element
...@@ -63,7 +64,7 @@ type TextInputBoxProps = ...@@ -63,7 +64,7 @@ type TextInputBoxProps =
textInputBox :: Record TextInputBoxProps -> R.Element textInputBox :: Record TextInputBoxProps -> R.Element
textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R.createElement el p [] textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R.createElement el p []
where where
el = R.hooksComponent (boxName <> "Box") cpt el = R2.hooksComponent thisModule (boxName <> "Box") cpt
cpt {id, text} _ = do cpt {id, text} _ = do
renameNodeName <- R.useState' text renameNodeName <- R.useState' text
pure $ H.div {className: "from-group row-no-padding"} pure $ H.div {className: "from-group row-no-padding"}
...@@ -110,7 +111,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R ...@@ -110,7 +111,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R
launchAff_ $ dispatch ( boxAction newName ) launchAff_ $ dispatch ( boxAction newName )
textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p [] textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
where where
el = R.hooksComponent (boxName <> "Box") cpt el = R2.hooksComponent thisModule (boxName <> "Box") cpt
cpt {text} _ = pure $ H.div {} [] cpt {text} _ = pure $ H.div {} []
-- | END Rename Box -- | END Rename Box
...@@ -278,7 +279,7 @@ nodeLink :: Record NodeLinkProps -> R.Element ...@@ -278,7 +279,7 @@ nodeLink :: Record NodeLinkProps -> R.Element
nodeLink p = R.createElement nodeLinkCpt p [] nodeLink p = R.createElement nodeLinkCpt p []
nodeLinkCpt :: R.Component NodeLinkProps nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponent "G.C.F.T.N.T.nodeLink" cpt nodeLinkCpt = R2.hooksComponent thisModule "nodeLink" cpt
where where
cpt { frontends, id, isSelected, name, nodeType, session, handed} _ = do cpt { frontends, id, isSelected, name, nodeType, session, handed} _ = do
popoverRef <- R.useRef null popoverRef <- R.useRef null
...@@ -315,7 +316,7 @@ nodeText :: Record NodeTextProps -> R.Element ...@@ -315,7 +316,7 @@ nodeText :: Record NodeTextProps -> R.Element
nodeText p = R.createElement nodeTextCpt p [] nodeText p = R.createElement nodeTextCpt p []
nodeTextCpt :: R.Component NodeTextProps nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R.hooksComponent "G.C.F.T.N.T.nodeText" cpt nodeTextCpt = R2.hooksComponent thisModule "nodeText" cpt
where where
cpt { isSelected: true, name } _ = do cpt { isSelected: true, name } _ = do
pure $ H.u {} [ pure $ H.u {} [
......
...@@ -7,12 +7,16 @@ import Effect (Effect) ...@@ -7,12 +7,16 @@ import Effect (Effect)
import Effect.Aff (Aff, launchAff_) import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Effect.Timer (clearInterval, setInterval) import Effect.Timer (clearInterval, setInterval)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
import Gargantext.Types as GT import Gargantext.Types as GT
import Reactix as R import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
thisModule = "Gargantext.Components.Forest.Tree.Node.Tools.ProgressBar"
data BarType = Bar | Pie data BarType = Bar | Pie
...@@ -30,7 +34,7 @@ asyncProgressBar :: Record Props -> R.Element ...@@ -30,7 +34,7 @@ asyncProgressBar :: Record Props -> R.Element
asyncProgressBar p = R.createElement asyncProgressBarCpt p [] asyncProgressBar p = R.createElement asyncProgressBarCpt p []
asyncProgressBarCpt :: R.Component Props asyncProgressBarCpt :: R.Component Props
asyncProgressBarCpt = R.hooksComponent "G.C.F.T.N.PB.asyncProgressBar" cpt asyncProgressBarCpt = R2.hooksComponent thisModule "asyncProgressBar" cpt
where where
cpt props@{ asyncTask: (GT.AsyncTaskWithType {task: GT.AsyncTask {id}}) cpt props@{ asyncTask: (GT.AsyncTaskWithType {task: GT.AsyncTask {id}})
, barType , barType
...@@ -76,7 +80,7 @@ progressIndicator :: Record ProgressIndicatorProps -> R.Element ...@@ -76,7 +80,7 @@ progressIndicator :: Record ProgressIndicatorProps -> R.Element
progressIndicator p = R.createElement progressIndicatorCpt p [] progressIndicator p = R.createElement progressIndicatorCpt p []
progressIndicatorCpt :: R.Component ProgressIndicatorProps progressIndicatorCpt :: R.Component ProgressIndicatorProps
progressIndicatorCpt = R.hooksComponent "G.C.F.T.N.PB.progressIndicator" cpt progressIndicatorCpt = R2.hooksComponent thisModule "progressIndicator" cpt
where where
cpt { barType: Bar, label, progress } _ = do cpt { barType: Bar, label, progress } _ = do
pure $ pure $
......
...@@ -17,6 +17,9 @@ import Gargantext.Prelude (map, pure, show, ($), (&&), (/=), (<>), const, (==), ...@@ -17,6 +17,9 @@ import Gargantext.Prelude (map, pure, show, ($), (&&), (/=), (<>), const, (==),
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Sessions (Session(..), get) import Gargantext.Sessions (Session(..), get)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree.Node.Tools.SubTree"
type SubTreeParamsIn = type SubTreeParamsIn =
( subTreeParams :: SubTreeParams ( subTreeParams :: SubTreeParams
...@@ -34,7 +37,7 @@ subTreeView :: Record SubTreeParamsProps -> R.Element ...@@ -34,7 +37,7 @@ subTreeView :: Record SubTreeParamsProps -> R.Element
subTreeView props = R.createElement subTreeViewCpt props [] subTreeView props = R.createElement subTreeViewCpt props []
subTreeViewCpt :: R.Component SubTreeParamsProps subTreeViewCpt :: R.Component SubTreeParamsProps
subTreeViewCpt = R.hooksComponent "G.C.F.T.N.T.ST.subTreeView" cpt subTreeViewCpt = R2.hooksComponent thisModule "subTreeView" cpt
where where
cpt params@{ action cpt params@{ action
, dispatch , dispatch
...@@ -82,7 +85,7 @@ subTreeViewLoaded :: Record CorpusTreeProps -> R.Element ...@@ -82,7 +85,7 @@ subTreeViewLoaded :: Record CorpusTreeProps -> R.Element
subTreeViewLoaded props = R.createElement subTreeViewLoadedCpt props [] subTreeViewLoaded props = R.createElement subTreeViewLoadedCpt props []
subTreeViewLoadedCpt :: R.Component CorpusTreeProps subTreeViewLoadedCpt :: R.Component CorpusTreeProps
subTreeViewLoadedCpt = R.hooksComponent "G.C.F.T.N.T.ST.subTreeViewLoadedCpt" cpt subTreeViewLoadedCpt = R2.hooksComponent thisModule "subTreeViewLoadedCpt" cpt
where where
cpt p@{dispatch, id, nodeType, session, tree, handed} _ = do cpt p@{dispatch, id, nodeType, session, tree, handed} _ = do
pure $ H.div {className:"tree"} pure $ H.div {className:"tree"}
...@@ -97,7 +100,7 @@ subTreeTreeView :: Record CorpusTreeProps -> R.Element ...@@ -97,7 +100,7 @@ subTreeTreeView :: Record CorpusTreeProps -> R.Element
subTreeTreeView props = R.createElement subTreeTreeViewCpt props [] subTreeTreeView props = R.createElement subTreeTreeViewCpt props []
subTreeTreeViewCpt :: R.Component CorpusTreeProps subTreeTreeViewCpt :: R.Component CorpusTreeProps
subTreeTreeViewCpt = R.hooksComponent "G.C.F.T.N.T.ST.subTreeTreeViewCpt" cpt subTreeTreeViewCpt = R2.hooksComponent thisModule "subTreeTreeViewCpt" cpt
where where
cpt p@{ id cpt p@{ id
, tree: NTree (LNode { id: targetId , tree: NTree (LNode { id: targetId
......
...@@ -13,6 +13,9 @@ import Gargantext.Components.NgramsTable.API as NTAPI ...@@ -13,6 +13,9 @@ import Gargantext.Components.NgramsTable.API as NTAPI
import Gargantext.Prelude (Unit, bind, const, discard, pure, unit, ($), (<>), (==)) import Gargantext.Prelude (Unit, bind, const, discard, pure, unit, ($), (<>), (==))
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Forest.Tree.Node.Tools.Sync"
-- | Sync Node (Graph) -- | Sync Node (Graph)
...@@ -27,7 +30,7 @@ nodeActionsGraph :: Record NodeActionsGraphProps -> R.Element ...@@ -27,7 +30,7 @@ nodeActionsGraph :: Record NodeActionsGraphProps -> R.Element
nodeActionsGraph p = R.createElement nodeActionsGraphCpt p [] nodeActionsGraph p = R.createElement nodeActionsGraphCpt p []
nodeActionsGraphCpt :: R.Component NodeActionsGraphProps nodeActionsGraphCpt :: R.Component NodeActionsGraphProps
nodeActionsGraphCpt = R.hooksComponent "G.C.F.T.N.B.nodeActionsGraph" cpt nodeActionsGraphCpt = R2.hooksComponent thisModule "nodeActionsGraph" cpt
where where
cpt { id, graphVersions, session, triggerRefresh } _ = do cpt { id, graphVersions, session, triggerRefresh } _ = do
pure $ H.div { className: "node-actions" } [ pure $ H.div { className: "node-actions" } [
...@@ -47,7 +50,7 @@ graphUpdateButton :: Record GraphUpdateButtonProps -> R.Element ...@@ -47,7 +50,7 @@ graphUpdateButton :: Record GraphUpdateButtonProps -> R.Element
graphUpdateButton p = R.createElement graphUpdateButtonCpt p [] graphUpdateButton p = R.createElement graphUpdateButtonCpt p []
graphUpdateButtonCpt :: R.Component GraphUpdateButtonProps graphUpdateButtonCpt :: R.Component GraphUpdateButtonProps
graphUpdateButtonCpt = R.hooksComponent "G.C.F.T.N.B.graphUpdateButton" cpt graphUpdateButtonCpt = R2.hooksComponent thisModule "graphUpdateButton" cpt
where where
cpt { id, session, triggerRefresh } _ = do cpt { id, session, triggerRefresh } _ = do
enabled <- R.useState' true enabled <- R.useState' true
...@@ -83,7 +86,7 @@ nodeActionsNodeList :: Record NodeActionsNodeListProps -> R.Element ...@@ -83,7 +86,7 @@ nodeActionsNodeList :: Record NodeActionsNodeListProps -> R.Element
nodeActionsNodeList p = R.createElement nodeActionsNodeListCpt p [] nodeActionsNodeList p = R.createElement nodeActionsNodeListCpt p []
nodeActionsNodeListCpt :: R.Component NodeActionsNodeListProps nodeActionsNodeListCpt :: R.Component NodeActionsNodeListProps
nodeActionsNodeListCpt = R.hooksComponent "G.C.F.T.N.B.nodeActionsNodeList" cpt nodeActionsNodeListCpt = R2.hooksComponent thisModule "nodeActionsNodeList" cpt
where where
cpt props _ = do cpt props _ = do
pure $ H.div { className: "node-actions" } [ pure $ H.div { className: "node-actions" } [
...@@ -102,7 +105,7 @@ nodeListUpdateButton :: Record NodeListUpdateButtonProps -> R.Element ...@@ -102,7 +105,7 @@ nodeListUpdateButton :: Record NodeListUpdateButtonProps -> R.Element
nodeListUpdateButton p = R.createElement nodeListUpdateButtonCpt p [] nodeListUpdateButton p = R.createElement nodeListUpdateButtonCpt p []
nodeListUpdateButtonCpt :: R.Component NodeListUpdateButtonProps nodeListUpdateButtonCpt :: R.Component NodeListUpdateButtonProps
nodeListUpdateButtonCpt = R.hooksComponent "G.C.F.T.N.B.nodeListUpdateButton" cpt nodeListUpdateButtonCpt = R2.hooksComponent thisModule "nodeListUpdateButton" cpt
where where
cpt { listId, nodeId, nodeType, session, triggerRefresh } _ = do cpt { listId, nodeId, nodeType, session, triggerRefresh } _ = do
enabled <- R.useState' true enabled <- R.useState' true
......
...@@ -20,6 +20,9 @@ import Gargantext.Components.GraphExplorer.Types as GET ...@@ -20,6 +20,9 @@ import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Hooks.Sigmax as Sigmax import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Types as SigmaxTypes import Gargantext.Hooks.Sigmax.Types as SigmaxTypes
import Gargantext.Hooks.Sigmax.Sigma as Sigma import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Graph"
type OnProps = () type OnProps = ()
...@@ -44,7 +47,7 @@ graph :: forall s fa2. Record (Props s fa2) -> R.Element ...@@ -44,7 +47,7 @@ graph :: forall s fa2. Record (Props s fa2) -> R.Element
graph props = R.createElement graphCpt props [] graph props = R.createElement graphCpt props []
graphCpt :: forall s fa2. R.Component (Props s fa2) graphCpt :: forall s fa2. R.Component (Props s fa2)
graphCpt = R.hooksComponent "G.C.Graph" cpt graphCpt = R2.hooksComponent thisModule "graph" cpt
where where
cpt props _ = do cpt props _ = do
stageHooks props stageHooks props
......
...@@ -37,6 +37,8 @@ import Gargantext.Types as Types ...@@ -37,6 +37,8 @@ import Gargantext.Types as Types
import Gargantext.Utils.Range as Range import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer"
type LayoutProps = type LayoutProps =
( frontends :: Frontends ( frontends :: Frontends
, graphId :: GET.GraphId , graphId :: GET.GraphId
...@@ -60,7 +62,7 @@ explorerLayout :: Record LayoutProps -> R.Element ...@@ -60,7 +62,7 @@ explorerLayout :: Record LayoutProps -> R.Element
explorerLayout props = R.createElement explorerLayoutCpt props [] explorerLayout props = R.createElement explorerLayoutCpt props []
explorerLayoutCpt :: R.Component LayoutProps explorerLayoutCpt :: R.Component LayoutProps
explorerLayoutCpt = R.hooksComponent "G.C.GraphExplorer.explorerLayout" cpt explorerLayoutCpt = R2.hooksComponent thisModule "explorerLayout" cpt
where where
cpt props _ = do cpt props _ = do
graphVersion <- R.useState' 0 graphVersion <- R.useState' 0
...@@ -70,7 +72,7 @@ explorerLayoutCpt = R.hooksComponent "G.C.GraphExplorer.explorerLayout" cpt ...@@ -70,7 +72,7 @@ explorerLayoutCpt = R.hooksComponent "G.C.GraphExplorer.explorerLayout" cpt
explorerLayoutView :: R.State Int -> Record LayoutProps -> R.Element explorerLayoutView :: R.State Int -> Record LayoutProps -> R.Element
explorerLayoutView graphVersion p = R.createElement el p [] explorerLayoutView graphVersion p = R.createElement el p []
where where
el = R.hooksComponent "G.C.GE.explorerLayoutView" cpt el = R2.hooksComponent thisModule "explorerLayoutView" cpt
cpt props@{ graphId, session } _ = do cpt props@{ graphId, session } _ = do
useLoader graphId (getNodes session graphVersion) handler useLoader graphId (getNodes session graphVersion) handler
where where
...@@ -85,7 +87,7 @@ explorer :: Record Props -> R.Element ...@@ -85,7 +87,7 @@ explorer :: Record Props -> R.Element
explorer props = R.createElement explorerCpt props [] explorer props = R.createElement explorerCpt props []
explorerCpt :: R.Component Props explorerCpt :: R.Component Props
explorerCpt = R.hooksComponent "G.C.GraphExplorer.explorer" cpt explorerCpt = R2.hooksComponent thisModule "explorer" cpt
where where
cpt props@{ frontends cpt props@{ frontends
, graph , graph
...@@ -250,7 +252,7 @@ graphView :: Record GraphProps -> R.Element ...@@ -250,7 +252,7 @@ graphView :: Record GraphProps -> R.Element
graphView props = R.createElement graphViewCpt props [] graphView props = R.createElement graphViewCpt props []
graphViewCpt :: R.Component GraphProps graphViewCpt :: R.Component GraphProps
graphViewCpt = R.hooksComponent "GraphView" cpt graphViewCpt = R2.hooksComponent thisModule "graphView" cpt
where where
cpt { controls cpt { controls
, elRef , elRef
......
...@@ -27,6 +27,9 @@ import Gargantext.Components.GraphExplorer.Utils as GEU ...@@ -27,6 +27,9 @@ import Gargantext.Components.GraphExplorer.Utils as GEU
import Gargantext.Hooks.Sigmax as Sigmax import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Sigma as Sigma import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer.Button"
type Props = ( type Props = (
onClick :: forall e. e -> Effect Unit onClick :: forall e. e -> Effect Unit
...@@ -37,7 +40,7 @@ simpleButton :: Record Props -> R.Element ...@@ -37,7 +40,7 @@ simpleButton :: Record Props -> R.Element
simpleButton props = R.createElement simpleButtonCpt props [] simpleButton props = R.createElement simpleButtonCpt props []
simpleButtonCpt :: R.Component Props simpleButtonCpt :: R.Component Props
simpleButtonCpt = R.hooksComponent "SimpleButton" cpt simpleButtonCpt = R2.hooksComponent thisModule "simpleButton" cpt
where where
cpt {onClick, text} _ = do cpt {onClick, text} _ = do
pure $ pure $
......
...@@ -33,6 +33,8 @@ import Gargantext.Sessions (Session) ...@@ -33,6 +33,8 @@ import Gargantext.Sessions (Session)
import Gargantext.Utils.Range as Range import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer.Controls"
type Controls = type Controls =
( edgeConfluence :: R.State Range.NumberRange ( edgeConfluence :: R.State Range.NumberRange
, edgeWeight :: R.State Range.NumberRange , edgeWeight :: R.State Range.NumberRange
...@@ -74,7 +76,7 @@ controls :: Record Controls -> R.Element ...@@ -74,7 +76,7 @@ controls :: Record Controls -> R.Element
controls props = R.createElement controlsCpt props [] controls props = R.createElement controlsCpt props []
controlsCpt :: R.Component Controls controlsCpt :: R.Component Controls
controlsCpt = R.hooksComponent "GraphControls" cpt controlsCpt = R2.hooksComponent thisModule "controls" cpt
where where
cpt props _ = do cpt props _ = do
localControls <- initialLocalControls localControls <- initialLocalControls
......
...@@ -7,13 +7,17 @@ import Prelude ...@@ -7,13 +7,17 @@ import Prelude
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer.ControlsToggleButton"
type Props = ( state :: R.State Boolean ) type Props = ( state :: R.State Boolean )
controlsToggleButton :: Record Props -> R.Element controlsToggleButton :: Record Props -> R.Element
controlsToggleButton props = R.createElement controlsToggleButtonCpt props [] controlsToggleButton props = R.createElement controlsToggleButtonCpt props []
controlsToggleButtonCpt :: R.Component Props controlsToggleButtonCpt :: R.Component Props
controlsToggleButtonCpt = R.hooksComponent "GraphControlsToggleButton" cpt controlsToggleButtonCpt = R2.hooksComponent thisModule "graphControlsToggleButton" cpt
where where
cpt {state} _ = do cpt {state} _ = do
let (open /\ setOpen) = state let (open /\ setOpen) = state
......
...@@ -8,7 +8,11 @@ import Data.Sequence (Seq) ...@@ -8,7 +8,11 @@ import Data.Sequence (Seq)
import Data.Traversable (foldMap) import Data.Traversable (foldMap)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as RH import Reactix.DOM.HTML as RH
import Gargantext.Components.GraphExplorer.Types (Legend(..), intColor) import Gargantext.Components.GraphExplorer.Types (Legend(..), intColor)
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer.Legend"
type Props = ( items :: Seq Legend ) type Props = ( items :: Seq Legend )
...@@ -16,7 +20,7 @@ legend :: Record Props -> R.Element ...@@ -16,7 +20,7 @@ legend :: Record Props -> R.Element
legend props = R.createElement legendCpt props [] legend props = R.createElement legendCpt props []
legendCpt :: R.Component Props legendCpt :: R.Component Props
legendCpt = R.hooksComponent "Legend" cpt legendCpt = R2.hooksComponent thisModule "legend" cpt
where where
cpt {items} _ = pure $ RH.div {} [foldMap entry items] cpt {items} _ = pure $ RH.div {} [foldMap entry items]
......
...@@ -13,6 +13,9 @@ import Reactix.DOM.HTML as H ...@@ -13,6 +13,9 @@ import Reactix.DOM.HTML as H
import Gargantext.Components.RangeSlider as RS import Gargantext.Components.RangeSlider as RS
import Gargantext.Utils.Range as Range import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer.RangeControl"
type Props = ( type Props = (
caption :: String caption :: String
...@@ -23,7 +26,7 @@ rangeControl :: Record Props -> R.Element ...@@ -23,7 +26,7 @@ rangeControl :: Record Props -> R.Element
rangeControl props = R.createElement rangeControlCpt props [] rangeControl props = R.createElement rangeControlCpt props []
rangeControlCpt :: R.Component Props rangeControlCpt :: R.Component Props
rangeControlCpt = R.hooksComponent "RangeButton" cpt rangeControlCpt = R2.hooksComponent thisModule "rangeButton" cpt
where where
cpt {caption, sliderProps} _ = do cpt {caption, sliderProps} _ = do
pure $ pure $
......
...@@ -13,8 +13,11 @@ import Reactix as R ...@@ -13,8 +13,11 @@ import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Components.InputWithAutocomplete (inputWithAutocomplete) import Gargantext.Components.InputWithAutocomplete (inputWithAutocomplete)
import Gargantext.Utils (queryMatchesLabel)
import Gargantext.Hooks.Sigmax.Types as SigmaxT import Gargantext.Hooks.Sigmax.Types as SigmaxT
import Gargantext.Utils (queryMatchesLabel)
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer.Search"
type Props = ( type Props = (
graph :: SigmaxT.SGraph graph :: SigmaxT.SGraph
...@@ -34,7 +37,7 @@ nodeSearchControl :: Record Props -> R.Element ...@@ -34,7 +37,7 @@ nodeSearchControl :: Record Props -> R.Element
nodeSearchControl props = R.createElement sizeButtonCpt props [] nodeSearchControl props = R.createElement sizeButtonCpt props []
sizeButtonCpt :: R.Component Props sizeButtonCpt :: R.Component Props
sizeButtonCpt = R.hooksComponent "NodeSearchControl" cpt sizeButtonCpt = R2.hooksComponent thisModule "nodeSearchControl" cpt
where where
cpt {graph, multiSelectEnabled, selectedNodeIds} _ = do cpt {graph, multiSelectEnabled, selectedNodeIds} _ = do
search@(search' /\ setSearch) <- R.useState' "" search@(search' /\ setSearch) <- R.useState' ""
......
...@@ -14,6 +14,12 @@ import Data.Tuple.Nested ((/\)) ...@@ -14,6 +14,12 @@ import Data.Tuple.Nested ((/\))
import Effect (Effect) import Effect (Effect)
import Effect.Aff (Aff, launchAff_) import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as RH
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Components.Search (SearchType(..), SearchQuery(..)) import Gargantext.Components.Search (SearchType(..), SearchQuery(..))
import Gargantext.Components.GraphExplorer.Types as GET import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Components.GraphExplorer.Types (SidePanelState(..), SideTab(..)) import Gargantext.Components.GraphExplorer.Types (SidePanelState(..), SideTab(..))
...@@ -28,10 +34,8 @@ import Gargantext.Sessions (Session) ...@@ -28,10 +34,8 @@ import Gargantext.Sessions (Session)
import Gargantext.Types (CTabNgramType, TabSubType(..), TabType(..), TermList(..), modeTabType) import Gargantext.Types (CTabNgramType, TabSubType(..), TabType(..), TermList(..), modeTabType)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Partial.Unsafe (unsafePartial) import Partial.Unsafe (unsafePartial)
import Gargantext.Prelude
import Reactix as R thisModule = "Gargantext.Components.GraphExplorer.Sidebar"
import Reactix.DOM.HTML as RH
import Reactix.DOM.HTML as H
type Props = type Props =
( frontends :: Frontends ( frontends :: Frontends
...@@ -50,7 +54,7 @@ sidebar :: Record Props -> R.Element ...@@ -50,7 +54,7 @@ sidebar :: Record Props -> R.Element
sidebar props = R.createElement sidebarCpt props [] sidebar props = R.createElement sidebarCpt props []
sidebarCpt :: R.Component Props sidebarCpt :: R.Component Props
sidebarCpt = R.hooksComponent "Sidebar" cpt sidebarCpt = R2.hooksComponent thisModule "sidebar" cpt
where where
cpt {showSidePanel: (GET.Closed /\ _)} _children = do cpt {showSidePanel: (GET.Closed /\ _)} _children = do
pure $ RH.div {} [] pure $ RH.div {} []
......
...@@ -16,6 +16,8 @@ import Gargantext.Hooks.Sigmax as Sigmax ...@@ -16,6 +16,8 @@ import Gargantext.Hooks.Sigmax as Sigmax
import Gargantext.Hooks.Sigmax.Sigma as Sigma import Gargantext.Hooks.Sigmax.Sigma as Sigma
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer.SlideButton"
type Props = ( type Props = (
state :: R.State Number state :: R.State Number
, caption :: String , caption :: String
...@@ -28,7 +30,7 @@ sizeButton :: Record Props -> R.Element ...@@ -28,7 +30,7 @@ sizeButton :: Record Props -> R.Element
sizeButton props = R.createElement sizeButtonCpt props [] sizeButton props = R.createElement sizeButtonCpt props []
sizeButtonCpt :: R.Component Props sizeButtonCpt :: R.Component Props
sizeButtonCpt = R.hooksComponent "SizeButton" cpt sizeButtonCpt = R2.hooksComponent thisModule "sizeButton" cpt
where where
cpt {state, caption, min, max, onChange} _ = do cpt {state, caption, min, max, onChange} _ = do
let (value /\ setValue) = state let (value /\ setValue) = state
......
...@@ -21,6 +21,9 @@ import Reactix.DOM.HTML as H ...@@ -21,6 +21,9 @@ import Reactix.DOM.HTML as H
import Gargantext.Components.GraphExplorer.Types as GET import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Hooks.Sigmax.Types as SigmaxTypes import Gargantext.Hooks.Sigmax.Types as SigmaxTypes
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.GraphExplorer.ToggleButton"
type Props = ( type Props = (
state :: R.State Boolean state :: R.State Boolean
...@@ -33,7 +36,7 @@ toggleButton :: Record Props -> R.Element ...@@ -33,7 +36,7 @@ toggleButton :: Record Props -> R.Element
toggleButton props = R.createElement toggleButtonCpt props [] toggleButton props = R.createElement toggleButtonCpt props []
toggleButtonCpt :: R.Component Props toggleButtonCpt :: R.Component Props
toggleButtonCpt = R.hooksComponent "ToggleButton" cpt toggleButtonCpt = R2.hooksComponent thisModule "toggleButton" cpt
where where
cpt {state, onMessage, offMessage, onClick} _ = do cpt {state, onMessage, offMessage, onClick} _ = do
let (toggled /\ _) = state let (toggled /\ _) = state
...@@ -64,7 +67,7 @@ edgesToggleButton :: Record EdgesButtonProps -> R.Element ...@@ -64,7 +67,7 @@ edgesToggleButton :: Record EdgesButtonProps -> R.Element
edgesToggleButton props = R.createElement edgesToggleButtonCpt props [] edgesToggleButton props = R.createElement edgesToggleButtonCpt props []
edgesToggleButtonCpt :: R.Component EdgesButtonProps edgesToggleButtonCpt :: R.Component EdgesButtonProps
edgesToggleButtonCpt = R.hooksComponent "EdgesToggleButton" cpt edgesToggleButtonCpt = R2.hooksComponent thisModule "edgesToggleButton" cpt
where where
cpt {state: (state /\ setState)} _ = do cpt {state: (state /\ setState)} _ = do
pure $ pure $
...@@ -105,7 +108,7 @@ pauseForceAtlasButton :: Record ForceAtlasProps -> R.Element ...@@ -105,7 +108,7 @@ pauseForceAtlasButton :: Record ForceAtlasProps -> R.Element
pauseForceAtlasButton props = R.createElement pauseForceAtlasButtonCpt props [] pauseForceAtlasButton props = R.createElement pauseForceAtlasButtonCpt props []
pauseForceAtlasButtonCpt :: R.Component ForceAtlasProps pauseForceAtlasButtonCpt :: R.Component ForceAtlasProps
pauseForceAtlasButtonCpt = R.hooksComponent "ForceAtlasToggleButton" cpt pauseForceAtlasButtonCpt = R2.hooksComponent thisModule "forceAtlasToggleButton" cpt
where where
cpt {state: (state /\ setState)} _ = do cpt {state: (state /\ setState)} _ = do
pure $ pure $
...@@ -134,7 +137,7 @@ treeToggleButton state = ...@@ -134,7 +137,7 @@ treeToggleButton state =
sidebarToggleButton :: R.State GET.SidePanelState -> R.Element sidebarToggleButton :: R.State GET.SidePanelState -> R.Element
sidebarToggleButton (state /\ setState) = R.createElement el {} [] sidebarToggleButton (state /\ setState) = R.createElement el {} []
where where
el = R.hooksComponent "SidebarToggleButton" cpt el = R2.hooksComponent thisModule "sidebarToggleButton" cpt
cpt {} _ = do cpt {} _ = do
pure $ pure $
H.span {} H.span {}
......
...@@ -13,6 +13,8 @@ import Reactix.DOM.HTML as H ...@@ -13,6 +13,8 @@ import Reactix.DOM.HTML as H
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.InputWithAutocomplete"
type Completions = Array String type Completions = Array String
...@@ -28,7 +30,7 @@ inputWithAutocomplete :: Record Props -> R.Element ...@@ -28,7 +30,7 @@ inputWithAutocomplete :: Record Props -> R.Element
inputWithAutocomplete props = R.createElement inputWithAutocompleteCpt props [] inputWithAutocomplete props = R.createElement inputWithAutocompleteCpt props []
inputWithAutocompleteCpt :: R.Component Props inputWithAutocompleteCpt :: R.Component Props
inputWithAutocompleteCpt = R.hooksComponent "InputWithAutocomplete" cpt inputWithAutocompleteCpt = R2.hooksComponent thisModule "inputWithAutocomplete" cpt
where where
cpt props@{autocompleteSearch, onAutocompleteClick, onEnterPress, state: state@(state' /\ setState)} _ = do cpt props@{autocompleteSearch, onAutocompleteClick, onEnterPress, state: state@(state' /\ setState)} _ = do
inputRef <- R.useRef null inputRef <- R.useRef null
......
...@@ -9,6 +9,8 @@ import Reactix.DOM.HTML as H ...@@ -9,6 +9,8 @@ import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.InputWithEnter"
type Props a = ( type Props a = (
onEnter :: Unit -> Effect Unit onEnter :: Unit -> Effect Unit
, onValueChanged :: String -> Effect Unit , onValueChanged :: String -> Effect Unit
...@@ -24,7 +26,7 @@ inputWithEnter :: forall a. Record (Props a) -> R.Element ...@@ -24,7 +26,7 @@ inputWithEnter :: forall a. Record (Props a) -> R.Element
inputWithEnter props = R.createElement inputWithEnterCpt props [] inputWithEnter props = R.createElement inputWithEnterCpt props []
inputWithEnterCpt :: forall a. R.Component (Props a) inputWithEnterCpt :: forall a. R.Component (Props a)
inputWithEnterCpt = R.hooksComponent "G.C.IWE.inputWithEnter" cpt inputWithEnterCpt = R2.hooksComponent thisModule "inputWithEnter" cpt
where where
cpt props@{ onEnter, onValueChanged cpt props@{ onEnter, onValueChanged
, autoFocus, className, defaultValue, placeholder } _ = do , autoFocus, className, defaultValue, placeholder } _ = do
......
...@@ -7,8 +7,10 @@ import Effect.Aff (Aff) ...@@ -7,8 +7,10 @@ import Effect.Aff (Aff)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Reactix as R import Reactix as R
import Gargantext.Utils.Reactix as R2
import Gargantext.Components.LoadingSpinner (loadingSpinner) import Gargantext.Components.LoadingSpinner (loadingSpinner)
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Loader"
type Props path loaded = type Props path loaded =
( path :: path ( path :: path
...@@ -23,7 +25,7 @@ loader path load paint = ...@@ -23,7 +25,7 @@ loader path load paint =
R.createElement loaderCpt {path,load,paint} [] R.createElement loaderCpt {path,load,paint} []
loaderCpt :: forall path loaded. R.Component (Props path loaded) loaderCpt :: forall path loaded. R.Component (Props path loaded)
loaderCpt = R.hooksComponent "G.C.Loader" cpt where loaderCpt = R2.hooksComponent thisModule "loader" cpt where
cpt {path, load, paint} _ = do cpt {path, load, paint} _ = do
(loaded /\ setLoaded) <- R.useState' Nothing (loaded /\ setLoaded) <- R.useState' Nothing
R.useEffect3 path load paint $ do R.useEffect3 path load paint $ do
......
...@@ -14,6 +14,10 @@ import Data.Tuple.Nested ((/\)) ...@@ -14,6 +14,10 @@ import Data.Tuple.Nested ((/\))
import Effect (Effect) import Effect (Effect)
import Effect.Aff (launchAff_) import Effect.Aff (launchAff_)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Prelude (Unit, bind, const, discard, map, pure, show, ($), (&&), (*>), (/=), (<$>), (<>), (==), (>))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest.Tree.Node.Tools (checkbox) import Gargantext.Components.Forest.Tree.Node.Tools (checkbox)
import Gargantext.Components.Forms (clearfix, cardBlock, cardGroup, center, formGroup) import Gargantext.Components.Forms (clearfix, cardBlock, cardGroup, center, formGroup)
import Gargantext.Components.Login.Types (AuthRequest(..)) import Gargantext.Components.Login.Types (AuthRequest(..))
...@@ -22,9 +26,8 @@ import Gargantext.Sessions (Session, Sessions(..), postAuthRequest, unSessions) ...@@ -22,9 +26,8 @@ import Gargantext.Sessions (Session, Sessions(..), postAuthRequest, unSessions)
import Gargantext.Sessions as Sessions import Gargantext.Sessions as Sessions
import Gargantext.Utils (csrfMiddlewareToken) import Gargantext.Utils (csrfMiddlewareToken)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Prelude (Unit, bind, const, discard, map, pure, show, ($), (&&), (*>), (/=), (<$>), (<>), (==), (>))
import Reactix as R thisModule = "Gargantext.Components.Login"
import Reactix.DOM.HTML as H
-- TODO: ask for login (modal) or account creation after 15 mn when user -- TODO: ask for login (modal) or account creation after 15 mn when user
-- is not logged and has made one search at least -- is not logged and has made one search at least
...@@ -41,7 +44,7 @@ modal :: Record ModalProps -> R.Element -> R.Element ...@@ -41,7 +44,7 @@ modal :: Record ModalProps -> R.Element -> R.Element
modal props child = R.createElement modalCpt props [ child ] modal props child = R.createElement modalCpt props [ child ]
modalCpt :: R.Component ModalProps modalCpt :: R.Component ModalProps
modalCpt = R.hooksComponent "G.C.Login.modal" cpt where modalCpt = R2.hooksComponent thisModule "modal" cpt where
cpt {visible} children = do cpt {visible} children = do
R.createPortal elems <$> R2.getPortalHost R.createPortal elems <$> R2.getPortalHost
where where
...@@ -78,7 +81,7 @@ login :: Record Props -> R.Element ...@@ -78,7 +81,7 @@ login :: Record Props -> R.Element
login props = R.createElement loginCpt props [] login props = R.createElement loginCpt props []
loginCpt :: R.Component Props loginCpt :: R.Component Props
loginCpt = R.hooksComponent "G.C.Login.login" cpt loginCpt = R2.hooksComponent thisModule "login" cpt
where where
cpt props@{backends, sessions, visible} _ = do cpt props@{backends, sessions, visible} _ = do
backend <- R.useState' Nothing backend <- R.useState' Nothing
...@@ -155,7 +158,7 @@ form :: Record FormProps -> R.Element ...@@ -155,7 +158,7 @@ form :: Record FormProps -> R.Element
form props = R.createElement formCpt props [] form props = R.createElement formCpt props []
formCpt :: R.Component FormProps formCpt :: R.Component FormProps
formCpt = R.hooksComponent "G.C.Login.form" cpt where formCpt = R2.hooksComponent thisModule "form" cpt where
cpt :: Record FormProps -> Array R.Element -> R.Hooks R.Element cpt :: Record FormProps -> Array R.Element -> R.Hooks R.Element
cpt props@{backend, sessions, visible} _ = do cpt props@{backend, sessions, visible} _ = do
error <- R.useState' "" error <- R.useState' ""
......
...@@ -14,15 +14,18 @@ import DOM.Simple.Document ( document ) ...@@ -14,15 +14,18 @@ import DOM.Simple.Document ( document )
import Effect (Effect) import Effect (Effect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Modal"
type Props = ( setVisible :: R2.Setter Boolean ) type Props = ( setVisible :: R2.Setter Boolean )
modal :: Record Props -> Array R.Element -> R.Element modal :: Record Props -> Array R.Element -> R.Element
modal = R.createElement modalCpt modal = R.createElement modalCpt
modalCpt :: R.Component Props modalCpt :: R.Component Props
modalCpt = R.hooksComponent "Modal" cpt modalCpt = R2.hooksComponent thisModule "modal" cpt
where where
cpt {setVisible} children = do cpt {setVisible} children = do
host <- R2.getPortalHost host <- R2.getPortalHost
......
...@@ -43,6 +43,8 @@ import Gargantext.Utils.CacheAPI as GUC ...@@ -43,6 +43,8 @@ import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.List (sortWith) as L import Gargantext.Utils.List (sortWith) as L
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.NgramsTable"
type State' = type State' =
CoreState CoreState
( ngramsParent :: Maybe NgramsTerm -- Nothing means we are not currently grouping terms ( ngramsParent :: Maybe NgramsTerm -- Nothing means we are not currently grouping terms
...@@ -135,7 +137,7 @@ tableContainerCpt { dispatch ...@@ -135,7 +137,7 @@ tableContainerCpt { dispatch
, ngramsTable: ngramsTableCache , ngramsTable: ngramsTableCache
, path: {searchQuery, termListFilter, termSizeFilter} /\ setPath , path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
, tabNgramType , tabNgramType
} = R.hooksComponent "G.C.NT.tableContainer" cpt } = R2.hooksComponent thisModule "tableContainer" cpt
where where
cpt props _ = do cpt props _ = do
pure $ H.div {className: "container-fluid"} [ pure $ H.div {className: "container-fluid"} [
...@@ -282,7 +284,7 @@ loadedNgramsTable :: Record Props -> R.Element ...@@ -282,7 +284,7 @@ loadedNgramsTable :: Record Props -> R.Element
loadedNgramsTable p = R.createElement loadedNgramsTableCpt p [] loadedNgramsTable p = R.createElement loadedNgramsTableCpt p []
loadedNgramsTableCpt :: R.Component Props loadedNgramsTableCpt :: R.Component Props
loadedNgramsTableCpt = R.hooksComponent "G.C.NT.loadedNgramsTable" cpt loadedNgramsTableCpt = R2.hooksComponent thisModule "loadedNgramsTable" cpt
where where
cpt { path: path@(path'@{searchQuery, scoreType, params, termListFilter, termSizeFilter} /\ setPath) cpt { path: path@(path'@{searchQuery, scoreType, params, termListFilter, termSizeFilter} /\ setPath)
, state: (state@{ ngramsChildren , state: (state@{ ngramsChildren
...@@ -492,7 +494,7 @@ mainNgramsTable :: Record MainNgramsTableProps -> R.Element ...@@ -492,7 +494,7 @@ mainNgramsTable :: Record MainNgramsTableProps -> R.Element
mainNgramsTable props = R.createElement mainNgramsTableCpt props [] mainNgramsTable props = R.createElement mainNgramsTableCpt props []
mainNgramsTableCpt :: R.Component MainNgramsTableProps mainNgramsTableCpt :: R.Component MainNgramsTableProps
mainNgramsTableCpt = R.hooksComponent "G.C.NT.mainNgramsTable" cpt mainNgramsTableCpt = R2.hooksComponent thisModule "mainNgramsTable" cpt
where where
cpt props@{nodeId, defaultListId, session, tabNgramType, tabType, withAutoUpdate} _ = do cpt props@{nodeId, defaultListId, session, tabNgramType, tabType, withAutoUpdate} _ = do
let path = initialPageParams session nodeId [defaultListId] tabType let path = initialPageParams session nodeId [defaultListId] tabType
...@@ -549,7 +551,7 @@ mainNgramsTablePaint :: Record MainNgramsTablePaintProps -> R.Element ...@@ -549,7 +551,7 @@ mainNgramsTablePaint :: Record MainNgramsTablePaintProps -> R.Element
mainNgramsTablePaint p = R.createElement mainNgramsTablePaintCpt p [] mainNgramsTablePaint p = R.createElement mainNgramsTablePaintCpt p []
mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R.hooksComponent "G.C.NT.mainNgramsTablePaint" cpt mainNgramsTablePaintCpt = R2.hooksComponent thisModule "mainNgramsTablePaint" cpt
where where
cpt {path, tabNgramType, versioned, withAutoUpdate} _ = do cpt {path, tabNgramType, versioned, withAutoUpdate} _ = do
R.useEffect' $ do R.useEffect' $ do
......
...@@ -22,6 +22,8 @@ import Gargantext.Components.Table as Tbl ...@@ -22,6 +22,8 @@ import Gargantext.Components.Table as Tbl
import Gargantext.Types as T import Gargantext.Types as T
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.NgramsTable.Components"
type SearchInputProps = type SearchInputProps =
( (
...@@ -34,7 +36,7 @@ searchInput :: Record SearchInputProps -> R.Element ...@@ -34,7 +36,7 @@ searchInput :: Record SearchInputProps -> R.Element
searchInput props = R.createElement searchInputCpt props [] searchInput props = R.createElement searchInputCpt props []
searchInputCpt :: R.Component SearchInputProps searchInputCpt :: R.Component SearchInputProps
searchInputCpt = R.hooksComponent "G.C.NT.searchInput" cpt searchInputCpt = R2.hooksComponent thisModule "searchInput" cpt
where where
cpt { onSearch, searchQuery } _ = do cpt { onSearch, searchQuery } _ = do
pure $ H.div { className: "input-group" } [ pure $ H.div { className: "input-group" } [
...@@ -61,7 +63,7 @@ selectionCheckbox :: Record SelectionCheckboxProps -> R.Element ...@@ -61,7 +63,7 @@ selectionCheckbox :: Record SelectionCheckboxProps -> R.Element
selectionCheckbox props = R.createElement selectionCheckboxCpt props [] selectionCheckbox props = R.createElement selectionCheckboxCpt props []
selectionCheckboxCpt :: R.Component SelectionCheckboxProps selectionCheckboxCpt :: R.Component SelectionCheckboxProps
selectionCheckboxCpt = R.hooksComponent "G.C.NT.selectionCheckbox" cpt selectionCheckboxCpt = R2.hooksComponent thisModule "selectionCheckbox" cpt
where where
cpt { allNgramsSelected, dispatch, ngramsSelection } _ = do cpt { allNgramsSelected, dispatch, ngramsSelection } _ = do
ref <- R.useRef null ref <- R.useRef null
...@@ -96,7 +98,7 @@ renderNgramsTree :: Record RenderNgramsTree -> R.Element ...@@ -96,7 +98,7 @@ renderNgramsTree :: Record RenderNgramsTree -> R.Element
renderNgramsTree p = R.createElement renderNgramsTreeCpt p [] renderNgramsTree p = R.createElement renderNgramsTreeCpt p []
renderNgramsTreeCpt :: R.Component RenderNgramsTree renderNgramsTreeCpt :: R.Component RenderNgramsTree
renderNgramsTreeCpt = R.hooksComponent "G.C.NT.renderNgramsTree" cpt renderNgramsTreeCpt = R2.hooksComponent thisModule "renderNgramsTree" cpt
where where
cpt { ngramsTable, ngrams, ngramsStyle, ngramsClick, ngramsEdit } _ = cpt { ngramsTable, ngrams, ngramsStyle, ngramsClick, ngramsEdit } _ =
pure $ H.ul {} [ pure $ H.ul {} [
...@@ -127,7 +129,7 @@ tree :: Record TreeProps -> R.Element ...@@ -127,7 +129,7 @@ tree :: Record TreeProps -> R.Element
tree p = R.createElement treeCpt p [] tree p = R.createElement treeCpt p []
treeCpt :: R.Component TreeProps treeCpt :: R.Component TreeProps
treeCpt = R.hooksComponent "G.C.NT.tree" cpt treeCpt = R2.hooksComponent thisModule "tree" cpt
where where
cpt params@{ ngramsClick, ngramsDepth, ngramsEdit, ngramsStyle, ngramsTable } _ = cpt params@{ ngramsClick, ngramsDepth, ngramsEdit, ngramsStyle, ngramsTable } _ =
pure $ pure $
...@@ -172,7 +174,7 @@ renderNgramsItem :: Record RenderNgramsItem -> R.Element ...@@ -172,7 +174,7 @@ renderNgramsItem :: Record RenderNgramsItem -> R.Element
renderNgramsItem p = R.createElement renderNgramsItemCpt p [] renderNgramsItem p = R.createElement renderNgramsItemCpt p []
renderNgramsItemCpt :: R.Component RenderNgramsItem renderNgramsItemCpt :: R.Component RenderNgramsItem
renderNgramsItemCpt = R.hooksComponent "G.C.NT.renderNgramsItem" cpt renderNgramsItemCpt = R2.hooksComponent thisModule "renderNgramsItem" cpt
where where
cpt { dispatch cpt { dispatch
, ngrams , ngrams
......
...@@ -8,6 +8,10 @@ import Data.Maybe (Maybe(..), maybe, fromMaybe) ...@@ -8,6 +8,10 @@ import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Tuple (fst, snd) import Data.Tuple (fst, snd)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Prelude (bind, const, identity, pure, ($), (<$>), (<>))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types as CT import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types as CT
import Gargantext.Components.Table as T import Gargantext.Components.Table as T
import Gargantext.Ends (url, Frontends) import Gargantext.Ends (url, Frontends)
...@@ -16,9 +20,9 @@ import Gargantext.Routes (SessionRoute(..)) ...@@ -16,9 +20,9 @@ import Gargantext.Routes (SessionRoute(..))
import Gargantext.Routes as Routes import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, sessionId, get) import Gargantext.Sessions (Session, sessionId, get)
import Gargantext.Types (NodeType(..), AffTableResult, TableResult) import Gargantext.Types (NodeType(..), AffTableResult, TableResult)
import Prelude (bind, const, identity, pure, ($), (<$>), (<>)) import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H thisModule = "Gargantext.Components.Nodes.Annuaire"
newtype IndividuView = newtype IndividuView =
CorpusView CorpusView
...@@ -42,7 +46,7 @@ annuaireLayout :: Record LayoutProps -> R.Element ...@@ -42,7 +46,7 @@ annuaireLayout :: Record LayoutProps -> R.Element
annuaireLayout props = R.createElement annuaireLayoutCpt props [] annuaireLayout props = R.createElement annuaireLayoutCpt props []
annuaireLayoutCpt :: R.Component LayoutProps annuaireLayoutCpt :: R.Component LayoutProps
annuaireLayoutCpt = R.hooksComponent "G.C.N.A.annuaireLayout" cpt annuaireLayoutCpt = R2.hooksComponent thisModule "annuaireLayout" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
...@@ -58,7 +62,7 @@ annuaireLayoutWithKey :: Record KeyLayoutProps -> R.Element ...@@ -58,7 +62,7 @@ annuaireLayoutWithKey :: Record KeyLayoutProps -> R.Element
annuaireLayoutWithKey props = R.createElement annuaireLayoutWithKeyCpt props [] annuaireLayoutWithKey props = R.createElement annuaireLayoutWithKeyCpt props []
annuaireLayoutWithKeyCpt :: R.Component KeyLayoutProps annuaireLayoutWithKeyCpt :: R.Component KeyLayoutProps
annuaireLayoutWithKeyCpt = R.hooksComponent "G.C.N.A.annuaireLayoutWithKey" cpt annuaireLayoutWithKeyCpt = R2.hooksComponent thisModule "annuaireLayoutWithKey" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session } _ = do
path <- R.useState' nodeId path <- R.useState' nodeId
...@@ -78,7 +82,7 @@ annuaire props = R.createElement annuaireCpt props [] ...@@ -78,7 +82,7 @@ annuaire props = R.createElement annuaireCpt props []
-- Abuses closure to work around the Loader -- Abuses closure to work around the Loader
annuaireCpt :: R.Component AnnuaireProps annuaireCpt :: R.Component AnnuaireProps
annuaireCpt = R.hooksComponent "G.P.Annuaire.annuaire" cpt annuaireCpt = R2.hooksComponent thisModule "annuaire" cpt
where where
cpt {session, path, info: info@(AnnuaireInfo {name, date: date'}), frontends} _ = do cpt {session, path, info: info@(AnnuaireInfo {name, date: date'}), frontends} _ = do
pagePath <- R.useState' $ initialPagePath (fst path) pagePath <- R.useState' $ initialPagePath (fst path)
...@@ -111,7 +115,7 @@ pageLayout :: Record PageLayoutProps -> R.Element ...@@ -111,7 +115,7 @@ pageLayout :: Record PageLayoutProps -> R.Element
pageLayout props = R.createElement pageLayoutCpt props [] pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R.hooksComponent "G.P.Annuaire.pageLayout" cpt pageLayoutCpt = R2.hooksComponent thisModule "pageLayout" cpt
where where
cpt {info, frontends, pagePath, session} _ = do cpt {info, frontends, pagePath, session} _ = do
useLoader (fst pagePath) (loadPage session) $ useLoader (fst pagePath) (loadPage session) $
...@@ -129,7 +133,7 @@ page :: Record PageProps -> R.Element ...@@ -129,7 +133,7 @@ page :: Record PageProps -> R.Element
page props = R.createElement pageCpt props [] page props = R.createElement pageCpt props []
pageCpt :: R.Component PageProps pageCpt :: R.Component PageProps
pageCpt = R.hooksComponent "LoadedAnnuairePage" cpt pageCpt = R2.hooksComponent thisModule "page" cpt
where where
cpt { session, pagePath, frontends cpt { session, pagePath, frontends
, table: ({count: totalRecords, docs})} _ = do , table: ({count: totalRecords, docs})} _ = do
...@@ -162,7 +166,7 @@ contactCells :: Record ContactCellsProps -> R.Element ...@@ -162,7 +166,7 @@ contactCells :: Record ContactCellsProps -> R.Element
contactCells p = R.createElement contactCellsCpt p [] contactCells p = R.createElement contactCellsCpt p []
contactCellsCpt :: R.Component ContactCellsProps contactCellsCpt :: R.Component ContactCellsProps
contactCellsCpt = R.hooksComponent "G.C.N.A.contactCells" cpt contactCellsCpt = R2.hooksComponent thisModule "contactCells" cpt
where where
cpt { annuaireId cpt { annuaireId
, contact: (CT.NodeContact { id, hyperdata: (CT.HyperdataContact {who : Nothing}) }) , contact: (CT.NodeContact { id, hyperdata: (CT.HyperdataContact {who : Nothing}) })
......
...@@ -24,6 +24,9 @@ import Gargantext.Prelude (Unit, bind, const, discard, pure, show, unit, ($), (+ ...@@ -24,6 +24,9 @@ import Gargantext.Prelude (Unit, bind, const, discard, pure, show, unit, ($), (+
import Gargantext.Routes as Routes import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, get, put, sessionId) import Gargantext.Sessions (Session, get, put, sessionId)
import Gargantext.Types (NodeType(..)) import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts"
display :: String -> Array R.Element -> R.Element display :: String -> Array R.Element -> R.Element
display title elems = display title elems =
...@@ -80,7 +83,7 @@ contactInfoItem :: Record ContactInfoItemProps -> R.Element ...@@ -80,7 +83,7 @@ contactInfoItem :: Record ContactInfoItemProps -> R.Element
contactInfoItem props = R.createElement contactInfoItemCpt props [] contactInfoItem props = R.createElement contactInfoItemCpt props []
contactInfoItemCpt :: R.Component ContactInfoItemProps contactInfoItemCpt :: R.Component ContactInfoItemProps
contactInfoItemCpt = R.hooksComponent "G.C.N.A.U.C.contactInfoItem" cpt contactInfoItemCpt = R2.hooksComponent thisModule "contactInfoItem" cpt
where where
cpt {hyperdata, label, lens, onUpdateHyperdata, placeholder} _ = do cpt {hyperdata, label, lens, onUpdateHyperdata, placeholder} _ = do
isEditing <- R.useState' false isEditing <- R.useState' false
...@@ -154,7 +157,7 @@ userLayout :: Record LayoutProps -> R.Element ...@@ -154,7 +157,7 @@ userLayout :: Record LayoutProps -> R.Element
userLayout props = R.createElement userLayoutCpt props [] userLayout props = R.createElement userLayoutCpt props []
userLayoutCpt :: R.Component LayoutProps userLayoutCpt :: R.Component LayoutProps
userLayoutCpt = R.hooksComponent "G.C.N.A.U.C.userLayout" cpt userLayoutCpt = R2.hooksComponent thisModule "userLayout" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
...@@ -165,7 +168,7 @@ userLayoutWithKey :: Record KeyLayoutProps -> R.Element ...@@ -165,7 +168,7 @@ userLayoutWithKey :: Record KeyLayoutProps -> R.Element
userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props [] userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props []
userLayoutWithKeyCpt :: R.Component KeyLayoutProps userLayoutWithKeyCpt :: R.Component KeyLayoutProps
userLayoutWithKeyCpt = R.hooksComponent "G.C.N.A.U.C.userLayoutWithKey" cpt userLayoutWithKeyCpt = R2.hooksComponent thisModule "userLayoutWithKey" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session } _ = do
reload <- R.useState' 0 reload <- R.useState' 0
...@@ -214,7 +217,7 @@ annuaireUserLayout :: Record AnnuaireLayoutProps -> R.Element ...@@ -214,7 +217,7 @@ annuaireUserLayout :: Record AnnuaireLayoutProps -> R.Element
annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props [] annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props []
annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps
annuaireUserLayoutCpt = R.hooksComponent "G.C.Nodes.Annuaire.User.Contacts.annuaireUserLayout" cpt annuaireUserLayoutCpt = R2.hooksComponent thisModule "annuaireUserLayout" cpt
where where
cpt {annuaireId, frontends, nodeId, session} _ = do cpt {annuaireId, frontends, nodeId, session} _ = do
useLoader nodeId (getAnnuaireContact session annuaireId) $ useLoader nodeId (getAnnuaireContact session annuaireId) $
......
...@@ -15,6 +15,9 @@ import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (ContactData) ...@@ -15,6 +15,9 @@ import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (ContactData)
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (TabType(..), TabSubType(..), CTabNgramType(..), PTabNgramType(..)) import Gargantext.Types (TabType(..), TabSubType(..), CTabNgramType(..), PTabNgramType(..))
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts.Tabs"
data Mode = Patents | Books | Communication data Mode = Patents | Books | Communication
...@@ -47,7 +50,7 @@ tabs :: Record TabsProps -> R.Element ...@@ -47,7 +50,7 @@ tabs :: Record TabsProps -> R.Element
tabs props = R.createElement tabsCpt props [] tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component TabsProps tabsCpt :: R.Component TabsProps
tabsCpt = R.hooksComponent "G.P.Annuaire.User.Contacts.Tabs.tabs" cpt tabsCpt = R2.hooksComponent thisModule "tabs" cpt
where where
cpt {frontends, nodeId, contactData: {defaultListId}, session} _ = do cpt {frontends, nodeId, contactData: {defaultListId}, session} _ = do
active <- R.useState' 0 active <- R.useState' 0
......
...@@ -30,6 +30,8 @@ import Gargantext.Types (NodeType(..), AffTableResult) ...@@ -30,6 +30,8 @@ import Gargantext.Types (NodeType(..), AffTableResult)
import Gargantext.Utils.Crypto as Crypto import Gargantext.Utils.Crypto as Crypto
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Corpus"
type Props = type Props =
( nodeId :: Int ( nodeId :: Int
, session :: Session , session :: Session
...@@ -46,7 +48,7 @@ corpusLayout :: Record Props -> R.Element ...@@ -46,7 +48,7 @@ corpusLayout :: Record Props -> R.Element
corpusLayout props = R.createElement corpusLayoutCpt props [] corpusLayout props = R.createElement corpusLayoutCpt props []
corpusLayoutCpt :: R.Component Props corpusLayoutCpt :: R.Component Props
corpusLayoutCpt = R.hooksComponent "G.C.N.C.corpusLayout" cpt corpusLayoutCpt = R2.hooksComponent thisModule "corpusLayout" cpt
where where
cpt { nodeId, session } _ = do cpt { nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
...@@ -58,7 +60,7 @@ corpusLayoutWithKey :: Record KeyProps -> R.Element ...@@ -58,7 +60,7 @@ corpusLayoutWithKey :: Record KeyProps -> R.Element
corpusLayoutWithKey props = R.createElement corpusLayoutWithKeyCpt props [] corpusLayoutWithKey props = R.createElement corpusLayoutWithKeyCpt props []
corpusLayoutWithKeyCpt :: R.Component KeyProps corpusLayoutWithKeyCpt :: R.Component KeyProps
corpusLayoutWithKeyCpt = R.hooksComponent "G.C.N.C.corpusLayoutWithKey" cpt corpusLayoutWithKeyCpt = R2.hooksComponent thisModule "corpusLayoutWithKey" cpt
where where
cpt { nodeId, session } _ = do cpt { nodeId, session } _ = do
reload <- R.useState' 0 reload <- R.useState' 0
...@@ -82,7 +84,7 @@ corpusLayoutView :: Record ViewProps -> R.Element ...@@ -82,7 +84,7 @@ corpusLayoutView :: Record ViewProps -> R.Element
corpusLayoutView props = R.createElement corpusLayoutViewCpt props [] corpusLayoutView props = R.createElement corpusLayoutViewCpt props []
corpusLayoutViewCpt :: R.Component ViewProps corpusLayoutViewCpt :: R.Component ViewProps
corpusLayoutViewCpt = R.hooksComponent "G.C.N.C.corpusLayoutView" cpt corpusLayoutViewCpt = R2.hooksComponent thisModule "corpusLayoutView" cpt
where where
cpt {corpus: (NodePoly {hyperdata: Hyperdata {fields}}), nodeId, reload, session} _ = do cpt {corpus: (NodePoly {hyperdata: Hyperdata {fields}}), nodeId, reload, session} _ = do
let fieldsWithIndex = List.mapWithIndex (\idx -> \t -> Tuple idx t) fields let fieldsWithIndex = List.mapWithIndex (\idx -> \t -> Tuple idx t) fields
...@@ -146,7 +148,7 @@ fieldsCodeEditor :: Record FieldsCodeEditorProps -> R.Element ...@@ -146,7 +148,7 @@ fieldsCodeEditor :: Record FieldsCodeEditorProps -> R.Element
fieldsCodeEditor props = R.createElement fieldsCodeEditorCpt props [] fieldsCodeEditor props = R.createElement fieldsCodeEditorCpt props []
fieldsCodeEditorCpt :: R.Component FieldsCodeEditorProps fieldsCodeEditorCpt :: R.Component FieldsCodeEditorProps
fieldsCodeEditorCpt = R.hooksComponent "G.C.N.C.fieldsCodeEditorCpt" cpt fieldsCodeEditorCpt = R2.hooksComponent thisModule "fieldsCodeEditorCpt" cpt
where where
cpt {nodeId, fields: fS@(fields /\ _), session} _ = do cpt {nodeId, fields: fS@(fields /\ _), session} _ = do
masterKey <- R.useState' 0 masterKey <- R.useState' 0
...@@ -215,7 +217,7 @@ fieldCodeEditorWrapper :: Record FieldCodeEditorProps -> R.Element ...@@ -215,7 +217,7 @@ fieldCodeEditorWrapper :: Record FieldCodeEditorProps -> R.Element
fieldCodeEditorWrapper props = R.createElement fieldCodeEditorWrapperCpt props [] fieldCodeEditorWrapper props = R.createElement fieldCodeEditorWrapperCpt props []
fieldCodeEditorWrapperCpt :: R.Component FieldCodeEditorProps fieldCodeEditorWrapperCpt :: R.Component FieldCodeEditorProps
fieldCodeEditorWrapperCpt = R.hooksComponent "G.C.N.C.fieldCodeEditorWrapperCpt" cpt fieldCodeEditorWrapperCpt = R2.hooksComponent thisModule "fieldCodeEditorWrapperCpt" cpt
where where
cpt props@{canMoveDown, canMoveUp, field: Field {name, typ}, onMoveDown, onMoveUp, onRemove, onRename} _ = do cpt props@{canMoveDown, canMoveUp, field: Field {name, typ}, onMoveDown, onMoveUp, onRemove, onRename} _ = do
pure $ H.div { className: "row panel panel-default" } [ pure $ H.div { className: "row panel panel-default" } [
...@@ -263,7 +265,7 @@ renameable :: Record RenameableProps -> R.Element ...@@ -263,7 +265,7 @@ renameable :: Record RenameableProps -> R.Element
renameable props = R.createElement renameableCpt props [] renameable props = R.createElement renameableCpt props []
renameableCpt :: R.Component RenameableProps renameableCpt :: R.Component RenameableProps
renameableCpt = R.hooksComponent "G.C.N.C.renameableCpt" cpt renameableCpt = R2.hooksComponent thisModule "renameableCpt" cpt
where where
cpt {onRename, text} _ = do cpt {onRename, text} _ = do
isEditing <- R.useState' false isEditing <- R.useState' false
...@@ -293,7 +295,7 @@ renameableText :: Record RenameableTextProps -> R.Element ...@@ -293,7 +295,7 @@ renameableText :: Record RenameableTextProps -> R.Element
renameableText props = R.createElement renameableTextCpt props [] renameableText props = R.createElement renameableTextCpt props []
renameableTextCpt :: R.Component RenameableTextProps renameableTextCpt :: R.Component RenameableTextProps
renameableTextCpt = R.hooksComponent "G.C.N.C.renameableTextCpt" cpt renameableTextCpt = R2.hooksComponent thisModule "renameableTextCpt" cpt
where where
cpt {isEditing: (false /\ setIsEditing), state: (text /\ _)} _ = do cpt {isEditing: (false /\ setIsEditing), state: (text /\ _)} _ = do
pure $ H.div {} [ pure $ H.div {} [
...@@ -328,7 +330,7 @@ fieldCodeEditor :: Record FieldCodeEditorProps -> R.Element ...@@ -328,7 +330,7 @@ fieldCodeEditor :: Record FieldCodeEditorProps -> R.Element
fieldCodeEditor props = R.createElement fieldCodeEditorCpt props [] fieldCodeEditor props = R.createElement fieldCodeEditorCpt props []
fieldCodeEditorCpt :: R.Component FieldCodeEditorProps fieldCodeEditorCpt :: R.Component FieldCodeEditorProps
fieldCodeEditorCpt = R.hooksComponent "G.C.N.C.fieldCodeEditorCpt" cpt fieldCodeEditorCpt = R2.hooksComponent thisModule "fieldCodeEditorCpt" cpt
where where
cpt {field: Field {typ: typ@(Haskell {haskell})}, onChange} _ = do cpt {field: Field {typ: typ@(Haskell {haskell})}, onChange} _ = do
pure $ CE.codeEditor {code: haskell, defaultCodeType: CE.Haskell, onChange: changeCode onChange typ} pure $ CE.codeEditor {code: haskell, defaultCodeType: CE.Haskell, onChange: changeCode onChange typ}
......
...@@ -13,6 +13,9 @@ import Gargantext.Hooks.Loader (HashedResponse, useLoader, useLoaderWithCacheAPI ...@@ -13,6 +13,9 @@ import Gargantext.Hooks.Loader (HashedResponse, useLoader, useLoaderWithCacheAPI
import Gargantext.Utils.Crypto (Hash) import Gargantext.Utils.Crypto (Hash)
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Corpus.Chart.Common"
type MetricsLoadViewProps a = ( type MetricsLoadViewProps a = (
getMetrics :: Session -> ReloadPath -> Aff a getMetrics :: Session -> ReloadPath -> Aff a
...@@ -27,7 +30,7 @@ metricsLoadView :: forall a. Record (MetricsLoadViewProps a) -> R.Element ...@@ -27,7 +30,7 @@ metricsLoadView :: forall a. Record (MetricsLoadViewProps a) -> R.Element
metricsLoadView p = R.createElement metricsLoadViewCpt p [] metricsLoadView p = R.createElement metricsLoadViewCpt p []
metricsLoadViewCpt :: forall a. R.Component (MetricsLoadViewProps a) metricsLoadViewCpt :: forall a. R.Component (MetricsLoadViewProps a)
metricsLoadViewCpt = R.hooksComponent "G.C.N.C.C.metricsLoadView" cpt metricsLoadViewCpt = R2.hooksComponent thisModule "metricsLoadView" cpt
where where
cpt { getMetrics, loaded, path, reload, session } _ = do cpt { getMetrics, loaded, path, reload, session } _ = do
useLoader (fst reload /\ path) (getMetrics session) $ \l -> useLoader (fst reload /\ path) (getMetrics session) $ \l ->
...@@ -47,7 +50,7 @@ metricsWithCacheLoadView p = R.createElement metricsWithCacheLoadViewCpt p [] ...@@ -47,7 +50,7 @@ metricsWithCacheLoadView p = R.createElement metricsWithCacheLoadViewCpt p []
metricsWithCacheLoadViewCpt :: forall res ret. DecodeJson res => metricsWithCacheLoadViewCpt :: forall res ret. DecodeJson res =>
R.Component (MetricsWithCacheLoadViewProps res ret) R.Component (MetricsWithCacheLoadViewProps res ret)
metricsWithCacheLoadViewCpt = R.hooksComponent "G.C.N.C.C.metricsWithCacheLoadView" cpt metricsWithCacheLoadViewCpt = R2.hooksComponent thisModule "metricsWithCacheLoadView" cpt
where where
cpt { getMetricsHash, handleResponse, loaded, mkRequest, path, reload, session } _ = do cpt { getMetricsHash, handleResponse, loaded, mkRequest, path, reload, session } _ = do
useLoaderWithCacheAPI { cacheEndpoint: (getMetricsHash session) useLoaderWithCacheAPI { cacheEndpoint: (getMetricsHash session)
......
...@@ -6,6 +6,9 @@ import Data.Maybe (Maybe(..)) ...@@ -6,6 +6,9 @@ import Data.Maybe (Maybe(..))
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Charts.Options.Color (grey) import Gargantext.Components.Charts.Options.Color (grey)
import Gargantext.Components.Charts.Options.Data (dataSerie) import Gargantext.Components.Charts.Options.Data (dataSerie)
import Gargantext.Components.Charts.Options.ECharts (Options(..), chart, xAxis', yAxis') import Gargantext.Components.Charts.Options.ECharts (Options(..), chart, xAxis', yAxis')
...@@ -20,8 +23,9 @@ import Gargantext.Routes (SessionRoute(..)) ...@@ -20,8 +23,9 @@ import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
import Gargantext.Types (ChartType(..), TabType(..)) import Gargantext.Types (ChartType(..), TabType(..))
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Reactix as R import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
thisModule = "Gargantext.Components.Nodes.Corpus.Chart.Histo"
newtype ChartMetrics = ChartMetrics { newtype ChartMetrics = ChartMetrics {
"data" :: HistoMetrics "data" :: HistoMetrics
...@@ -81,7 +85,7 @@ histo :: Record Props -> R.Element ...@@ -81,7 +85,7 @@ histo :: Record Props -> R.Element
histo props = R.createElement histoCpt props [] histo props = R.createElement histoCpt props []
histoCpt :: R.Component Props histoCpt :: R.Component Props
histoCpt = R.hooksComponent "G.C.N.C.C.H.histo" cpt histoCpt = R2.hooksComponent thisModule "histo" cpt
where where
cpt { path, session } _ = do cpt { path, session } _ = do
reload <- R.useState' 0 reload <- R.useState' 0
......
...@@ -27,6 +27,9 @@ import Gargantext.Routes (SessionRoute(..)) ...@@ -27,6 +27,9 @@ import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
import Gargantext.Types (ChartType(..), TabType, TermList(..)) import Gargantext.Types (ChartType(..), TabType, TermList(..))
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Corpus.Chart.Metrics"
newtype Metric = Metric newtype Metric = Metric
{ label :: String { label :: String
...@@ -115,7 +118,7 @@ metrics :: Record Props -> R.Element ...@@ -115,7 +118,7 @@ metrics :: Record Props -> R.Element
metrics props = R.createElement metricsCpt props [] metrics props = R.createElement metricsCpt props []
metricsCpt :: R.Component Props metricsCpt :: R.Component Props
metricsCpt = R.hooksComponent "G.C.N.C.C.M.metrics" cpt metricsCpt = R2.hooksComponent thisModule "etrics" cpt
where where
cpt {path, session} _ = do cpt {path, session} _ = do
reload <- R.useState' 0 reload <- R.useState' 0
......
...@@ -9,6 +9,9 @@ import Data.String (take, joinWith, Pattern(..), split, length) ...@@ -9,6 +9,9 @@ import Data.String (take, joinWith, Pattern(..), split, length)
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Charts.Options.Color (blue) import Gargantext.Components.Charts.Options.Color (blue)
import Gargantext.Components.Charts.Options.Data (dataSerie) import Gargantext.Components.Charts.Options.Data (dataSerie)
import Gargantext.Components.Charts.Options.ECharts (Options(..), chart, xAxis', yAxis') import Gargantext.Components.Charts.Options.ECharts (Options(..), chart, xAxis', yAxis')
...@@ -23,8 +26,9 @@ import Gargantext.Routes (SessionRoute(..)) ...@@ -23,8 +26,9 @@ import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
import Gargantext.Types (ChartType(..), TabType) import Gargantext.Types (ChartType(..), TabType)
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Reactix as R import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
thisModule = "Gargantext.Components.Nodes.Corpus.Chart.Pie"
newtype ChartMetrics = ChartMetrics { newtype ChartMetrics = ChartMetrics {
"data" :: HistoMetrics "data" :: HistoMetrics
...@@ -100,7 +104,7 @@ pie :: Record Props -> R.Element ...@@ -100,7 +104,7 @@ pie :: Record Props -> R.Element
pie props = R.createElement pieCpt props [] pie props = R.createElement pieCpt props []
pieCpt :: R.Component Props pieCpt :: R.Component Props
pieCpt = R.hooksComponent "G.C.N.C.C.P.pie" cpt pieCpt = R2.hooksComponent thisModule "pie" cpt
where where
cpt { path, session } _ = do cpt { path, session } _ = do
reload <- R.useState' 0 reload <- R.useState' 0
...@@ -126,7 +130,7 @@ bar :: Record Props -> R.Element ...@@ -126,7 +130,7 @@ bar :: Record Props -> R.Element
bar props = R.createElement barCpt props [] bar props = R.createElement barCpt props []
barCpt :: R.Component Props barCpt :: R.Component Props
barCpt = R.hooksComponent "LoadedMetricsBar" cpt barCpt = R2.hooksComponent thisModule "bar" cpt
where where
cpt {path, session} _ = do cpt {path, session} _ = do
reload <- R.useState' 0 reload <- R.useState' 0
......
...@@ -22,6 +22,9 @@ import Gargantext.Routes (SessionRoute(..)) ...@@ -22,6 +22,9 @@ import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
import Gargantext.Types (ChartType(..), TabType) import Gargantext.Types (ChartType(..), TabType)
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Corpus.Chart.Tree"
newtype Metrics = Metrics { newtype Metrics = Metrics {
"data" :: Array TreeNode "data" :: Array TreeNode
...@@ -74,7 +77,7 @@ tree :: Record Props -> R.Element ...@@ -74,7 +77,7 @@ tree :: Record Props -> R.Element
tree props = R.createElement treeCpt props [] tree props = R.createElement treeCpt props []
treeCpt :: R.Component Props treeCpt :: R.Component Props
treeCpt = R.hooksComponent "G.C.N.C.C.T.tree" cpt treeCpt = R2.hooksComponent thisModule "tree" cpt
where where
cpt {path, session} _ = do cpt {path, session} _ = do
reload <- R.useState' 0 reload <- R.useState' 0
......
...@@ -14,6 +14,9 @@ import Gargantext.Components.Nodes.Corpus.Chart.API (recomputeChart) ...@@ -14,6 +14,9 @@ import Gargantext.Components.Nodes.Corpus.Chart.API (recomputeChart)
import Gargantext.Components.Nodes.Corpus.Chart.Types (Path) import Gargantext.Components.Nodes.Corpus.Chart.Types (Path)
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types as T import Gargantext.Types as T
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Corpus.Chart.Utils"
reloadButtonWrap :: R.State Int -> R.Element -> R.Element reloadButtonWrap :: R.State Int -> R.Element -> R.Element
reloadButtonWrap setReload el = H.div {} [ reloadButtonWrap setReload el = H.div {} [
...@@ -41,7 +44,7 @@ chartUpdateButton :: Record ChartUpdateButtonProps -> R.Element ...@@ -41,7 +44,7 @@ chartUpdateButton :: Record ChartUpdateButtonProps -> R.Element
chartUpdateButton p = R.createElement chartUpdateButtonCpt p [] chartUpdateButton p = R.createElement chartUpdateButtonCpt p []
chartUpdateButtonCpt :: R.Component ChartUpdateButtonProps chartUpdateButtonCpt :: R.Component ChartUpdateButtonProps
chartUpdateButtonCpt = R.hooksComponent "G.C.N.C.C.U.chartUpdateButton" cpt chartUpdateButtonCpt = R2.hooksComponent thisModule "chartUpdateButton" cpt
where where
cpt { chartType cpt { chartType
, path: { corpusId, listId, tabType } , path: { corpusId, listId, tabType }
......
...@@ -19,6 +19,8 @@ import Gargantext.Sessions (Session, sessionId) ...@@ -19,6 +19,8 @@ import Gargantext.Sessions (Session, sessionId)
import Gargantext.Types (NodeID) import Gargantext.Types (NodeID)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Corpus.Dashboard"
type Props = type Props =
( nodeId :: NodeID ( nodeId :: NodeID
, session :: Session , session :: Session
...@@ -28,7 +30,7 @@ dashboardLayout :: Record Props -> R.Element ...@@ -28,7 +30,7 @@ dashboardLayout :: Record Props -> R.Element
dashboardLayout props = R.createElement dashboardLayoutCpt props [] dashboardLayout props = R.createElement dashboardLayoutCpt props []
dashboardLayoutCpt :: R.Component Props dashboardLayoutCpt :: R.Component Props
dashboardLayoutCpt = R.hooksComponent "G.C.N.C.D.dashboardLayout" cpt dashboardLayoutCpt = R2.hooksComponent thisModule "dashboardLayout" cpt
where where
cpt { nodeId, session } _ = do cpt { nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
...@@ -44,7 +46,7 @@ dashboardLayoutWithKey :: Record KeyProps -> R.Element ...@@ -44,7 +46,7 @@ dashboardLayoutWithKey :: Record KeyProps -> R.Element
dashboardLayoutWithKey props = R.createElement dashboardLayoutWithKeyCpt props [] dashboardLayoutWithKey props = R.createElement dashboardLayoutWithKeyCpt props []
dashboardLayoutWithKeyCpt :: R.Component KeyProps dashboardLayoutWithKeyCpt :: R.Component KeyProps
dashboardLayoutWithKeyCpt = R.hooksComponent "G.C.N.C.D.dashboardLayoutWithKey" cpt dashboardLayoutWithKeyCpt = R2.hooksComponent thisModule "dashboardLayoutWithKey" cpt
where where
cpt { nodeId, session } _ = do cpt { nodeId, session } _ = do
reload <- R.useState' 0 reload <- R.useState' 0
...@@ -82,7 +84,7 @@ dashboardLayoutLoaded :: Record LoadedProps -> R.Element ...@@ -82,7 +84,7 @@ dashboardLayoutLoaded :: Record LoadedProps -> R.Element
dashboardLayoutLoaded props = R.createElement dashboardLayoutLoadedCpt props [] dashboardLayoutLoaded props = R.createElement dashboardLayoutLoadedCpt props []
dashboardLayoutLoadedCpt :: R.Component LoadedProps dashboardLayoutLoadedCpt :: R.Component LoadedProps
dashboardLayoutLoadedCpt = R.hooksComponent "G.C.N.C.D.dashboardLayoutLoaded" cpt dashboardLayoutLoadedCpt = R2.hooksComponent thisModule "dashboardLayoutLoaded" cpt
where where
cpt props@{ charts, corpusId, defaultListId, onChange, session } _ = do cpt props@{ charts, corpusId, defaultListId, onChange, session } _ = do
pure $ pure $
...@@ -119,7 +121,7 @@ renderChart :: Record PredefinedChartProps -> R.Element ...@@ -119,7 +121,7 @@ renderChart :: Record PredefinedChartProps -> R.Element
renderChart props = R.createElement renderChartCpt props [] renderChart props = R.createElement renderChartCpt props []
renderChartCpt :: R.Component PredefinedChartProps renderChartCpt :: R.Component PredefinedChartProps
renderChartCpt = R.hooksComponent "G.C.N.C.D.renderChart" cpt renderChartCpt = R2.hooksComponent thisModule "renderChart" cpt
where where
cpt { chart, corpusId, defaultListId, onChange, onRemove, session } _ = do cpt { chart, corpusId, defaultListId, onChange, onRemove, session } _ = do
pure $ H.div { className: "row" } [ pure $ H.div { className: "row" } [
......
...@@ -26,6 +26,8 @@ import Gargantext.Types (CTabNgramType(..), NodeType(..), TabSubType(..), TabTyp ...@@ -26,6 +26,8 @@ import Gargantext.Types (CTabNgramType(..), NodeType(..), TabSubType(..), TabTyp
import Gargantext.Utils as U import Gargantext.Utils as U
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Corpus.Document"
type DocPath = type DocPath =
{ {
corpusId :: Maybe Int corpusId :: Maybe Int
...@@ -300,7 +302,7 @@ docViewWrapper :: Record Props -> R.Element ...@@ -300,7 +302,7 @@ docViewWrapper :: Record Props -> R.Element
docViewWrapper props = R.createElement docViewWrapperCpt props [] docViewWrapper props = R.createElement docViewWrapperCpt props []
docViewWrapperCpt :: R.Component Props docViewWrapperCpt :: R.Component Props
docViewWrapperCpt = R.hooksComponent "G.C.N.C.D.docViewWrapper" cpt docViewWrapperCpt = R2.hooksComponent thisModule "docViewWrapper" cpt
where where
cpt { loaded, path } _ = do cpt { loaded, path } _ = do
state <- R.useState' $ initialState { loaded } state <- R.useState' $ initialState { loaded }
...@@ -316,7 +318,7 @@ docView :: Record DocViewProps -> R.Element ...@@ -316,7 +318,7 @@ docView :: Record DocViewProps -> R.Element
docView props = R.createElement docViewCpt props [] docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component DocViewProps docViewCpt :: R.Component DocViewProps
docViewCpt = R.hooksComponent "G.C.N.C.D.docView" cpt docViewCpt = R2.hooksComponent thisModule "docView" cpt
where where
cpt props@{ loaded: loaded@{ ngramsTable: Versioned { data: initTable }, document }, state } _ = do cpt props@{ loaded: loaded@{ ngramsTable: Versioned { data: initTable }, document }, state } _ = do
pure $ H.div {} [ pure $ H.div {} [
...@@ -386,7 +388,7 @@ documentLayout :: Record LayoutProps -> R.Element ...@@ -386,7 +388,7 @@ documentLayout :: Record LayoutProps -> R.Element
documentLayout props = R.createElement documentLayoutCpt props [] documentLayout props = R.createElement documentLayoutCpt props []
documentLayoutCpt :: R.Component LayoutProps documentLayoutCpt :: R.Component LayoutProps
documentLayoutCpt = R.hooksComponent "G.C.N.C.D.documentLayout" cpt documentLayoutCpt = R2.hooksComponent thisModule "documentLayout" cpt
where where
cpt { corpusId, listId, nodeId, session } _ = do cpt { corpusId, listId, nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
...@@ -406,7 +408,7 @@ documentLayoutWithKey :: Record KeyLayoutProps -> R.Element ...@@ -406,7 +408,7 @@ documentLayoutWithKey :: Record KeyLayoutProps -> R.Element
documentLayoutWithKey props = R.createElement documentLayoutWithKeyCpt props [] documentLayoutWithKey props = R.createElement documentLayoutWithKeyCpt props []
documentLayoutWithKeyCpt :: R.Component KeyLayoutProps documentLayoutWithKeyCpt :: R.Component KeyLayoutProps
documentLayoutWithKeyCpt = R.hooksComponent "G.C.N.C.D.documentLayoutWithKey" cpt documentLayoutWithKeyCpt = R2.hooksComponent thisModule "documentLayoutWithKey" cpt
where where
cpt { corpusId, listId, nodeId, session } _ = do cpt { corpusId, listId, nodeId, session } _ = do
useLoader path loadData $ \loaded -> useLoader path loadData $ \loaded ->
......
...@@ -11,6 +11,9 @@ import Gargantext.Components.Table as T ...@@ -11,6 +11,9 @@ import Gargantext.Components.Table as T
import Gargantext.Components.Tab as Tab import Gargantext.Components.Tab as Tab
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Corpus.Graph.Tabs"
type Props = type Props =
( frontends :: Frontends ( frontends :: Frontends
...@@ -24,7 +27,7 @@ tabs props = R.createElement tabsCpt props [] ...@@ -24,7 +27,7 @@ tabs props = R.createElement tabsCpt props []
-- TODO no need for Children here -- TODO no need for Children here
tabsCpt :: R.Component Props tabsCpt :: R.Component Props
tabsCpt = R.hooksComponent "G.P.Corpus.Graph.Tabs.tabs" cpt tabsCpt = R2.hooksComponent thisModule "tabs" cpt
where where
cpt {frontends, query, session, sides} _ = do cpt {frontends, query, session, sides} _ = do
active <- R.useState' 0 active <- R.useState' 0
......
...@@ -13,6 +13,9 @@ import Gargantext.Hooks.Loader (useLoader) ...@@ -13,6 +13,9 @@ import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
import Gargantext.Types as T import Gargantext.Types as T
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.File"
newtype HyperdataFile = HyperdataFile { newtype HyperdataFile = HyperdataFile {
...@@ -67,7 +70,7 @@ fileLayout :: Record FileLayoutProps -> R.Element ...@@ -67,7 +70,7 @@ fileLayout :: Record FileLayoutProps -> R.Element
fileLayout props = R.createElement fileLayoutCpt props [] fileLayout props = R.createElement fileLayoutCpt props []
fileLayoutCpt :: R.Component FileLayoutProps fileLayoutCpt :: R.Component FileLayoutProps
fileLayoutCpt = R.hooksComponent "G.C.N.F.fileLayout" cpt fileLayoutCpt = R2.hooksComponent thisModule "fileLayout" cpt
where where
cpt { nodeId, session } _ = do cpt { nodeId, session } _ = do
useLoader { nodeId } (loadFile session) $ \loaded -> useLoader { nodeId } (loadFile session) $ \loaded ->
...@@ -89,7 +92,7 @@ fileLayoutLoaded :: Record FileLayoutLoadedProps -> R.Element ...@@ -89,7 +92,7 @@ fileLayoutLoaded :: Record FileLayoutLoadedProps -> R.Element
fileLayoutLoaded props = R.createElement fileLayoutLoadedCpt props [] fileLayoutLoaded props = R.createElement fileLayoutLoadedCpt props []
fileLayoutLoadedCpt :: R.Component FileLayoutLoadedProps fileLayoutLoadedCpt :: R.Component FileLayoutLoadedProps
fileLayoutLoadedCpt = R.hooksComponent "G.C.N.F.fileLayoutLoaded" cpt fileLayoutLoadedCpt = R2.hooksComponent thisModule "fileLayoutLoaded" cpt
where where
cpt { loaded: File { hyperdata: HyperdataFile hyperdata }, nodeId, session } _ = do cpt { loaded: File { hyperdata: HyperdataFile hyperdata }, nodeId, session } _ = do
R.useEffect' $ do R.useEffect' $ do
......
...@@ -18,6 +18,9 @@ import Gargantext.Routes (SessionRoute(NodeAPI)) ...@@ -18,6 +18,9 @@ import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, get, sessionId) import Gargantext.Sessions (Session, get, sessionId)
import Gargantext.Types (NodeType(..)) import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Argonaut (genericSumEncodeJson) import Gargantext.Utils.Argonaut (genericSumEncodeJson)
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Frame"
data Hyperdata = data Hyperdata =
Hyperdata { base :: String Hyperdata { base :: String
...@@ -61,7 +64,7 @@ frameLayout :: Record Props -> R.Element ...@@ -61,7 +64,7 @@ frameLayout :: Record Props -> R.Element
frameLayout props = R.createElement frameLayoutCpt props [] frameLayout props = R.createElement frameLayoutCpt props []
frameLayoutCpt :: R.Component Props frameLayoutCpt :: R.Component Props
frameLayoutCpt = R.hooksComponent "G.C.N.F.frameLayout" cpt frameLayoutCpt = R2.hooksComponent thisModule "frameLayout" cpt
where where
cpt {nodeId, session} _ = do cpt {nodeId, session} _ = do
let sid = sessionId session let sid = sessionId session
...@@ -72,7 +75,7 @@ frameLayoutWithKey :: Record KeyProps -> R.Element ...@@ -72,7 +75,7 @@ frameLayoutWithKey :: Record KeyProps -> R.Element
frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props [] frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props []
frameLayoutWithKeyCpt :: R.Component KeyProps frameLayoutWithKeyCpt :: R.Component KeyProps
frameLayoutWithKeyCpt = R.hooksComponent "G.C.N.F.frameLayoutWithKey" cpt frameLayoutWithKeyCpt = R2.hooksComponent thisModule "frameLayoutWithKey" cpt
where where
cpt { nodeId, session } _ = do cpt { nodeId, session } _ = do
reload <- R.useState' 0 reload <- R.useState' 0
...@@ -98,7 +101,7 @@ frameLayoutView :: Record ViewProps -> R.Element ...@@ -98,7 +101,7 @@ frameLayoutView :: Record ViewProps -> R.Element
frameLayoutView props = R.createElement frameLayoutViewCpt props [] frameLayoutView props = R.createElement frameLayoutViewCpt props []
frameLayoutViewCpt :: R.Component ViewProps frameLayoutViewCpt :: R.Component ViewProps
frameLayoutViewCpt = R.hooksComponent "G.C.N.C.frameLayoutView" cpt frameLayoutViewCpt = R2.hooksComponent thisModule "frameLayoutView" cpt
where where
cpt {frame: (NodePoly {hyperdata: Hyperdata {base, frame_id}}), nodeId, reload, session} _ = do cpt {frame: (NodePoly {hyperdata: Hyperdata {base, frame_id}}), nodeId, reload, session} _ = do
pure $ H.div { className : "frame" } pure $ H.div { className : "frame" }
......
...@@ -2,6 +2,10 @@ module Gargantext.Components.Nodes.Home where ...@@ -2,6 +2,10 @@ module Gargantext.Components.Nodes.Home where
import Data.Newtype (class Newtype) import Data.Newtype (class Newtype)
import Effect (Effect) import Effect (Effect)
import Reactix as R
import Reactix.DOM.HTML as H
import Routing.Hash (setHash)
import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..)) import Gargantext.Components.Data.Landing (BlockText(..), BlockTexts(..), Button(..), LandingData(..))
import Gargantext.Components.Lang (LandingLang(..)) import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Lang.Landing.EnUS as En import Gargantext.Components.Lang.Landing.EnUS as En
...@@ -9,9 +13,9 @@ import Gargantext.Components.Lang.Landing.FrFR as Fr ...@@ -9,9 +13,9 @@ import Gargantext.Components.Lang.Landing.FrFR as Fr
import Gargantext.Components.Nodes.Home.Public (renderPublic) import Gargantext.Components.Nodes.Home.Public (renderPublic)
import Gargantext.License (license) import Gargantext.License (license)
import Gargantext.Prelude (Unit, map, pure, unit, void, ($), (<>)) import Gargantext.Prelude (Unit, map, pure, unit, void, ($), (<>))
import Reactix as R import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
import Routing.Hash (setHash) thisModule = "Gargantext.Components.Nodes.Home"
type Props = () type Props = ()
...@@ -48,7 +52,7 @@ homeLayout lang = R.createElement homeLayoutCpt {landingData} [] ...@@ -48,7 +52,7 @@ homeLayout lang = R.createElement homeLayoutCpt {landingData} []
where landingData = langLandingData lang where landingData = langLandingData lang
homeLayoutCpt :: R.Component ( landingData :: LandingData ) homeLayoutCpt :: R.Component ( landingData :: LandingData )
homeLayoutCpt = R.hooksComponent "LayoutLanding" cpt homeLayoutCpt = R2.hooksComponent thisModule "homeLayout" cpt
where where
cpt {landingData} _ = do cpt {landingData} _ = do
pure $ H.span {} pure $ H.span {}
......
...@@ -8,18 +8,22 @@ import Data.Generic.Rep.Show (genericShow) ...@@ -8,18 +8,22 @@ import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.NonEmpty (head) import Data.NonEmpty (head)
import Data.String (take) import Data.String (take)
import Data.Traversable (traverse)
import Data.Tuple (fst) import Data.Tuple (fst)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Config (publicBackend) import Gargantext.Config (publicBackend)
import Gargantext.Config.REST (get) import Gargantext.Config.REST (get)
import Gargantext.Ends (backendUrl, Backend(..)) import Gargantext.Ends (backendUrl, Backend(..))
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson) import Gargantext.Utils.Argonaut (genericSumDecodeJson, genericSumEncodeJson)
import Reactix as R import Gargantext.Utils.Reactix as R2
import Reactix.DOM.HTML as H
import Data.Traversable (traverse) thisModule = "Gargantext.Components.Nodes.Home.Public"
type PublicProps = (publicDatas :: (Array PublicData) type PublicProps = (publicDatas :: (Array PublicData)
-- , session :: Session -- , session :: Session
...@@ -75,7 +79,7 @@ renderPublic :: R.Element ...@@ -75,7 +79,7 @@ renderPublic :: R.Element
renderPublic = R.createElement renderPublicCpt {} [] renderPublic = R.createElement renderPublicCpt {} []
renderPublicCpt :: R.Component LoadData renderPublicCpt :: R.Component LoadData
renderPublicCpt = R.hooksComponent "G.C.N.Home.Public.renderPublic" cpt renderPublicCpt = R2.hooksComponent thisModule "renderPublic" cpt
where where
cpt {} _ = do cpt {} _ = do
reload <- R.useState' 0 reload <- R.useState' 0
...@@ -87,7 +91,7 @@ publicLayout :: Record PublicProps -> R.Element ...@@ -87,7 +91,7 @@ publicLayout :: Record PublicProps -> R.Element
publicLayout props = R.createElement publicLayoutCpt props [] publicLayout props = R.createElement publicLayoutCpt props []
publicLayoutCpt :: R.Component PublicProps publicLayoutCpt :: R.Component PublicProps
publicLayoutCpt = R.hooksComponent "[G.C.N.H.Public.publicLayout" cpt publicLayoutCpt = R2.hooksComponent thisModule "publicLayout" cpt
where where
cpt {publicDatas} _ = do cpt {publicDatas} _ = do
pure $ H.span {} pure $ H.span {}
......
...@@ -10,6 +10,9 @@ import Gargantext.Components.Table as Table ...@@ -10,6 +10,9 @@ import Gargantext.Components.Table as Table
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Sessions (Session, sessionId) import Gargantext.Sessions (Session, sessionId)
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Lists"
------------------------------------------------------------------------ ------------------------------------------------------------------------
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -22,7 +25,7 @@ listsLayout :: Record Props -> R.Element ...@@ -22,7 +25,7 @@ listsLayout :: Record Props -> R.Element
listsLayout props = R.createElement listsLayoutCpt props [] listsLayout props = R.createElement listsLayoutCpt props []
listsLayoutCpt :: R.Component Props listsLayoutCpt :: R.Component Props
listsLayoutCpt = R.hooksComponent "G.C.N.L.listsLayout" cpt listsLayoutCpt = R2.hooksComponent thisModule "listsLayout" cpt
where where
cpt path@{ nodeId, session } _ = do cpt path@{ nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
...@@ -38,7 +41,7 @@ listsLayoutWithKey :: Record KeyProps -> R.Element ...@@ -38,7 +41,7 @@ listsLayoutWithKey :: Record KeyProps -> R.Element
listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props [] listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props []
listsLayoutWithKeyCpt :: R.Component KeyProps listsLayoutWithKeyCpt :: R.Component KeyProps
listsLayoutWithKeyCpt = R.hooksComponent "G.C.N.L.listsLayoutWithKey" cpt listsLayoutWithKeyCpt = R2.hooksComponent thisModule "listsLayoutWithKey" cpt
where where
cpt { nodeId, session } _ = do cpt { nodeId, session } _ = do
let path = { nodeId, session } let path = { nodeId, session }
......
...@@ -18,6 +18,8 @@ import Gargantext.Sessions (Session) ...@@ -18,6 +18,8 @@ import Gargantext.Sessions (Session)
import Gargantext.Types (ChartType(..), CTabNgramType(..), Mode(..), TabSubType(..), TabType(..), chartTypeFromString, modeTabType) import Gargantext.Types (ChartType(..), CTabNgramType(..), Mode(..), TabSubType(..), TabType(..), chartTypeFromString, modeTabType)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Lists.Tabs"
type Props = ( session :: Session type Props = ( session :: Session
, corpusId :: Int , corpusId :: Int
, corpusData :: CorpusData , corpusData :: CorpusData
...@@ -27,7 +29,7 @@ tabs :: Record Props -> R.Element ...@@ -27,7 +29,7 @@ tabs :: Record Props -> R.Element
tabs props = R.createElement tabsCpt props [] tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component Props tabsCpt :: R.Component Props
tabsCpt = R.hooksComponent "G.C.N.L.T.tabs" cpt tabsCpt = R2.hooksComponent thisModule "tabs" cpt
where where
cpt { corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do cpt { corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do
(selected /\ setSelected) <- R.useState' 0 (selected /\ setSelected) <- R.useState' 0
...@@ -45,7 +47,7 @@ ngramsView :: Record NgramsViewProps -> R.Element ...@@ -45,7 +47,7 @@ ngramsView :: Record NgramsViewProps -> R.Element
ngramsView props = R.createElement ngramsViewCpt props [] ngramsView props = R.createElement ngramsViewCpt props []
ngramsViewCpt :: R.Component NgramsViewProps ngramsViewCpt :: R.Component NgramsViewProps
ngramsViewCpt = R.hooksComponent "G.C.N.L.T.ngramsView" cpt ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
where where
cpt { corpusData: { defaultListId } cpt { corpusData: { defaultListId }
, corpusId , corpusId
......
...@@ -19,6 +19,9 @@ import Gargantext.Components.Table as Table ...@@ -19,6 +19,9 @@ import Gargantext.Components.Table as Table
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Sessions (Session, sessionId) import Gargantext.Sessions (Session, sessionId)
import Gargantext.Types (CTabNgramType(..), TabSubType(..), TabType(..)) import Gargantext.Types (CTabNgramType(..), TabSubType(..), TabType(..))
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Nodes.Texts"
-------------------------------------------------------- --------------------------------------------------------
type Props = ( type Props = (
...@@ -32,7 +35,7 @@ textsLayout props = R.createElement textsLayoutCpt props [] ...@@ -32,7 +35,7 @@ textsLayout props = R.createElement textsLayoutCpt props []
------------------------------------------------------------------------ ------------------------------------------------------------------------
textsLayoutCpt :: R.Component Props textsLayoutCpt :: R.Component Props
textsLayoutCpt = R.hooksComponent "G.C.N.T.textsLayout" cpt where textsLayoutCpt = R2.hooksComponent thisModule "textsLayout" cpt where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
...@@ -47,7 +50,7 @@ textsLayoutWithKey :: Record KeyProps -> R.Element ...@@ -47,7 +50,7 @@ textsLayoutWithKey :: Record KeyProps -> R.Element
textsLayoutWithKey props = R.createElement textsLayoutWithKeyCpt props [] textsLayoutWithKey props = R.createElement textsLayoutWithKeyCpt props []
textsLayoutWithKeyCpt :: R.Component KeyProps textsLayoutWithKeyCpt :: R.Component KeyProps
textsLayoutWithKeyCpt = R.hooksComponent "G.C.N.T.textsLayoutWithKey" cpt textsLayoutWithKeyCpt = R2.hooksComponent thisModule "textsLayoutWithKey" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session } _ = do
pure $ loader {session, nodeId} loadCorpusWithChild paint pure $ loader {session, nodeId} loadCorpusWithChild paint
...@@ -80,7 +83,7 @@ tabs :: Record TabsProps -> R.Element ...@@ -80,7 +83,7 @@ tabs :: Record TabsProps -> R.Element
tabs props = R.createElement tabsCpt props [] tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component TabsProps tabsCpt :: R.Component TabsProps
tabsCpt = R.hooksComponent "G.C.Nodes.Texts.tabs" cpt tabsCpt = R2.hooksComponent thisModule "tabs" cpt
where where
cpt {frontends, session, corpusId, corpusData} _ = do cpt {frontends, session, corpusId, corpusData} _ = do
(selected /\ setSelected) <- R.useState' 0 (selected /\ setSelected) <- R.useState' 0
...@@ -108,7 +111,7 @@ docView :: forall a. Record (DocViewProps a) -> R.Element ...@@ -108,7 +111,7 @@ docView :: forall a. Record (DocViewProps a) -> R.Element
docView props = R.createElement docViewCpt props [] docView props = R.createElement docViewCpt props []
docViewCpt :: forall a. R.Component (DocViewProps a) docViewCpt :: forall a. R.Component (DocViewProps a)
docViewCpt = R.hooksComponent "G.C.Nodes.Texts.docView" cpt docViewCpt = R2.hooksComponent thisModule "docView" cpt
where where
cpt {frontends, session, corpusId, corpusData: {defaultListId}, tabType} _children = do cpt {frontends, session, corpusId, corpusData: {defaultListId}, tabType} _children = do
pure $ DT.docViewLayout $ params tabType pure $ DT.docViewLayout $ params tabType
......
...@@ -27,6 +27,8 @@ import Reactix.DOM.HTML as H ...@@ -27,6 +27,8 @@ import Reactix.DOM.HTML as H
import Gargantext.Utils.Math (roundToMultiple) import Gargantext.Utils.Math (roundToMultiple)
import Gargantext.Utils.Range as Range import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.RangeSlider"
-- data Axis = X | Y -- data Axis = X | Y
type Bounds = Range.NumberRange type Bounds = Range.NumberRange
...@@ -53,7 +55,7 @@ data Knob = MinKnob | MaxKnob ...@@ -53,7 +55,7 @@ data Knob = MinKnob | MaxKnob
data RangeUpdate = SetMin Number | SetMax Number data RangeUpdate = SetMin Number | SetMax Number
rangeSliderCpt :: R.Component Props rangeSliderCpt :: R.Component Props
rangeSliderCpt = R.hooksComponent "RangeSlider" cpt rangeSliderCpt = R2.hooksComponent thisModule "rangeSlider" cpt
where where
cpt props _ = do cpt props _ = do
-- rounding precision (i.e. how many decimal digits are in epsilon) -- rounding precision (i.e. how many decimal digits are in epsilon)
......
...@@ -7,6 +7,10 @@ import Data.Tuple.Nested ((/\)) ...@@ -7,6 +7,10 @@ import Data.Tuple.Nested ((/\))
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Tab"
type TabsProps = ( tabs :: Array (Tuple String R.Element), selected :: Int ) type TabsProps = ( tabs :: Array (Tuple String R.Element), selected :: Int )
tabs :: Record TabsProps -> R.Element tabs :: Record TabsProps -> R.Element
...@@ -14,7 +18,7 @@ tabs props = R.createElement tabsCpt props [] ...@@ -14,7 +18,7 @@ tabs props = R.createElement tabsCpt props []
-- this is actually just the list of tabs, not the tab contents itself -- this is actually just the list of tabs, not the tab contents itself
tabsCpt :: R.Component TabsProps tabsCpt :: R.Component TabsProps
tabsCpt = R.hooksComponent "G.C.Tab.tabs" cpt tabsCpt = R2.hooksComponent thisModule "tabs" cpt
where where
cpt props _ = do cpt props _ = do
(activeTab /\ setActiveTab) <- R.useState' props.selected (activeTab /\ setActiveTab) <- R.useState' props.selected
......
...@@ -15,6 +15,8 @@ import Gargantext.Utils.Reactix as R2 ...@@ -15,6 +15,8 @@ import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix (effectLink) import Gargantext.Utils.Reactix (effectLink)
import Gargantext.Components.Search import Gargantext.Components.Search
thisModule = "Gargantext.Components.Table"
type TableContainerProps = type TableContainerProps =
( pageSizeControl :: R.Element ( pageSizeControl :: R.Element
, pageSizeDescription :: R.Element , pageSizeDescription :: R.Element
...@@ -100,7 +102,7 @@ tableHeaderLayout :: Record TableHeaderLayoutProps -> R.Element ...@@ -100,7 +102,7 @@ tableHeaderLayout :: Record TableHeaderLayoutProps -> R.Element
tableHeaderLayout props = R.createElement tableHeaderLayoutCpt props [] tableHeaderLayout props = R.createElement tableHeaderLayoutCpt props []
tableHeaderLayoutCpt :: R.Component TableHeaderLayoutProps tableHeaderLayoutCpt :: R.Component TableHeaderLayoutProps
tableHeaderLayoutCpt = R.hooksComponent "G.C.Table.tableHeaderLayout" cpt tableHeaderLayoutCpt = R2.hooksComponent thisModule "tableHeaderLayout" cpt
where where
cpt {title, desc, query, date, user} _ = cpt {title, desc, query, date, user} _ =
pure $ R.fragment pure $ R.fragment
...@@ -139,7 +141,7 @@ table :: Record Props -> R.Element ...@@ -139,7 +141,7 @@ table :: Record Props -> R.Element
table props = R.createElement tableCpt props [] table props = R.createElement tableCpt props []
tableCpt :: R.Component Props tableCpt :: R.Component Props
tableCpt = R.hooksComponent "G.C.Table.table" cpt tableCpt = R2.hooksComponent thisModule "table" cpt
where where
cpt {container, colNames, wrapColElts, totalRecords, rows, params} _ = do cpt {container, colNames, wrapColElts, totalRecords, rows, params} _ = do
let let
...@@ -214,7 +216,7 @@ sizeDD :: Record SizeDDProps -> R.Element ...@@ -214,7 +216,7 @@ sizeDD :: Record SizeDDProps -> R.Element
sizeDD p = R.createElement sizeDDCpt p [] sizeDD p = R.createElement sizeDDCpt p []
sizeDDCpt :: R.Component SizeDDProps sizeDDCpt :: R.Component SizeDDProps
sizeDDCpt = R.hooksComponent "G.C.T.sizeDD" cpt sizeDDCpt = R2.hooksComponent thisModule "sizeDD" cpt
where where
cpt {params: params /\ setParams} _ = do cpt {params: params /\ setParams} _ = do
pure $ H.span {} [ pure $ H.span {} [
......
...@@ -42,6 +42,12 @@ import Web.HTML (window) ...@@ -42,6 +42,12 @@ import Web.HTML (window)
import Web.HTML.Window (localStorage) import Web.HTML.Window (localStorage)
import Web.Storage.Storage (Storage, getItem, setItem) import Web.Storage.Storage (Storage, getItem, setItem)
-- TODO Reactix should export this definition
type HooksComponent props = Record props -> Array R.Element -> R.Hooks R.Element
hooksComponent :: forall props. String -> String -> HooksComponent props -> R.Component props
hooksComponent module' name c = R.hooksComponent (module' <> "." <> name) c
newtype Point = Point { x :: Number, y :: Number } newtype Point = Point { x :: Number, y :: Number }
-- a setter function, for useState -- a setter function, for useState
......
...@@ -12,6 +12,9 @@ import Gargantext.Config.REST as REST ...@@ -12,6 +12,9 @@ import Gargantext.Config.REST as REST
import Gargantext.Ends (toUrl) import Gargantext.Ends (toUrl)
import Gargantext.Sessions (Session(..)) import Gargantext.Sessions (Session(..))
import Gargantext.Sessions as Sessions import Gargantext.Sessions as Sessions
import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Version"
type Version = String type Version = String
...@@ -30,7 +33,7 @@ versionView :: Record VersionProps -> R.Element ...@@ -30,7 +33,7 @@ versionView :: Record VersionProps -> R.Element
versionView props = R.createElement versionCpt props [] versionView props = R.createElement versionCpt props []
versionCpt :: R.Component VersionProps versionCpt :: R.Component VersionProps
versionCpt = R.hooksComponent "G.C.A.version" cpt versionCpt = R2.hooksComponent thisModule "version" cpt
where where
cpt { session } _ = do cpt { session } _ = do
(versionBack /\ setVer) <- R.useState' "No Backend Version" (versionBack /\ setVer) <- R.useState' "No Backend Version"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment