Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
5c7de476
Commit
5c7de476
authored
Nov 12, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[reactix] R2.Component
parent
83b75761
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
31 deletions
+57
-31
App.purs
src/Gargantext/Components/App.purs
+3
-3
ContextMenu.purs
src/Gargantext/Components/ContextMenu/ContextMenu.purs
+1
-1
Forest.purs
src/Gargantext/Components/Forest.purs
+8
-8
Modal.purs
src/Gargantext/Components/Modal.purs
+1
-1
Contacts.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
+27
-17
Lists.purs
src/Gargantext/Components/Nodes/Lists.purs
+14
-0
Tab.purs
src/Gargantext/Components/Tab.purs
+1
-1
Reactix.purs
src/Gargantext/Utils/Reactix.purs
+2
-0
No files found.
src/Gargantext/Components/App.purs
View file @
5c7de476
...
...
@@ -157,12 +157,12 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested [
frameLayout { nodeId, nodeType: GT.NodeFrameCalc, session }
]
RouteFrameWrite sid nodeId -> withSession sid $ \session -> forested [
frameLayout { nodeId, nodeType: GT.NodeFrameWrite, session }
]
RouteFrameCode sid nodeId -> withSession sid $ \session -> forested [
frameLayout { nodeId, nodeType: GT.NodeFrameNotebook, session }
]
RouteFrameWrite sid nodeId -> withSession sid $ \session -> forested [
frameLayout { nodeId, nodeType: GT.NodeFrameWrite, session }
]
Team sid nodeId -> withSession sid $ \session -> forested [
corpusLayout { nodeId, session }
]
...
...
src/Gargantext/Components/ContextMenu/ContextMenu.purs
View file @
5c7de476
...
...
@@ -29,7 +29,7 @@ type Props t = (
, onClose :: Effect Unit
)
contextMenu :: forall t. R
ecord (Props t) -> Array R.Element -> R.Element
contextMenu :: forall t. R
2.Component (Props t)
contextMenu = R.createElement contextMenuCpt
contextMenuCpt :: forall t. R.Component (Props t)
...
...
src/Gargantext/Components/Forest.purs
View file @
5c7de476
...
...
@@ -126,17 +126,17 @@ type ForestLayoutProps = (
, treeReloadRef :: R.Ref (Maybe ReloadS)
)
forestLayout :: R
ecord ForestLayoutProps -> Array R.Element -> R.Element
forestLayout :: R
2.Component ForestLayoutProps
forestLayout props = R.createElement forestLayoutCpt props
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
where
cpt props@{ handed }
_
= do
pure $ R.fragment [ topBar { handed }, forestLayoutMain props ]
cpt props@{ handed }
children
= do
pure $ R.fragment [ topBar { handed }, forestLayoutMain props
children
]
forestLayoutMain :: R
ecord ForestLayoutProps -> R.Element
forestLayoutMain props = R.createElement forestLayoutMainCpt props
[]
forestLayoutMain :: R
2.Component ForestLayoutProps
forestLayoutMain props = R.createElement forestLayoutMainCpt props
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
...
...
@@ -166,11 +166,11 @@ forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" c
, sessions
, showLogin
, treeReloadRef } ]
, mainPage children
, mainPage
{}
children
]
mainPage ::
Array R.Element -> R.Element
mainPage = R.createElement mainPageCpt
{}
mainPage ::
R2.Component ()
mainPage = R.createElement mainPageCpt
mainPageCpt :: R.Component ()
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
...
...
src/Gargantext/Components/Modal.purs
View file @
5c7de476
...
...
@@ -21,7 +21,7 @@ thisModule = "Gargantext.Components.Modal"
type Props = ( setVisible :: R.Setter Boolean )
modal :: R
ecord Props -> Array R.Element -> R.Element
modal :: R
2.Component Props
modal = R.createElement modalCpt
modalCpt :: R.Component Props
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
View file @
5c7de476
...
...
@@ -26,25 +26,35 @@ import Gargantext.Prelude (Unit, bind, const, discard, pure, show, unit, ($), (+
import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, get, put, sessionId)
import Gargantext.Types (NodeType(..), ReloadS)
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts"
display :: String -> Array R.Element -> R.Element
display title elems =
H.div { className: "container-fluid" }
[ H.div { className: "row", id: "contact-page-header" }
[ H.div { className: "col-md-6"} [ H.h3 {} [ H.text title ] ]
, H.div { className: "col-md-8"} []
, H.div { className: "col-md-2"} [ H.span {} [ H.text "" ] ]
]
, H.div { className: "row", id: "contact-page-info" }
[ H.div { className: "col-md-12" }
[ H.div { className: "row" }
[ H.div { className: "col-md-2" } [ H.img { src: "/images/Gargantextuel-212x300.jpg"} ]
, H.div { className: "col-md-1"} []
, H.div { className: "col-md-8"} elems
]]]]
type DisplayProps = (
title :: String
)
display :: R2.Component DisplayProps
display = R.createElement displayCpt
displayCpt :: R.Component DisplayProps
displayCpt = R.hooksComponentWithModule thisModule "display" cpt
where
cpt { title } children = do
pure $ H.div { className: "container-fluid" }
[ H.div { className: "row", id: "contact-page-header" }
[ H.div { className: "col-md-6"} [ H.h3 {} [ H.text title ] ]
, H.div { className: "col-md-8"} []
, H.div { className: "col-md-2"} [ H.span {} [ H.text "" ] ]
]
, H.div { className: "row", id: "contact-page-info" }
[ H.div { className: "col-md-12" }
[ H.div { className: "row" }
[ H.div { className: "col-md-2" } [ H.img { src: "/images/Gargantextuel-212x300.jpg"} ]
, H.div { className: "col-md-1"} []
, H.div { className: "col-md-8"} children
]]]]
-- | TODO format data in better design (UI) shape
contactInfos :: HyperdataUser -> (HyperdataUser -> Effect Unit) -> Array R.Element
...
...
@@ -191,7 +201,7 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
useLoader {nodeId, reload: fst reload, session} getContactWithReload $
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
display
(fromMaybe "no name" name)
(contactInfos hyperdata (onUpdateHyperdata reload))
display
{ title: fromMaybe "no name" name }
(contactInfos hyperdata (onUpdateHyperdata reload))
, Tabs.tabs {
appReload
, asyncTasksRef
...
...
@@ -249,7 +259,7 @@ annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayou
useLoader nodeId (getAnnuaireContact session annuaireId) $
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
display
(fromMaybe "no name" name)
(contactInfos hyperdata onUpdateHyperdata)
display
{ title: fromMaybe "no name" name }
(contactInfos hyperdata onUpdateHyperdata)
, Tabs.tabs {
appReload
, asyncTasksRef
...
...
src/Gargantext/Components/Nodes/Lists.purs
View file @
5c7de476
...
...
@@ -35,6 +35,20 @@ type Props = (
, treeReloadRef :: R.Ref (Maybe GT.ReloadS)
)
type WithTreeProps = (
handed :: GT.Handed
| Props
)
listsLayoutWithTree :: R2.Component WithTreeProps
listsLayoutWithTree props = R.createElement listsLayoutWithTreeCpt props
listsLayoutWithTreeCpt :: R.Component WithTreeProps
listsLayoutWithTreeCpt = R.hooksComponentWithModule thisModule "listsLayoutWithTree" cpt
where
cpt { appReload, asyncTasksRef, handed, nodeId, session, sessionUpdate, treeReloadRef } _ = do
pure $ listsLayout { appReload, asyncTasksRef, nodeId, session, sessionUpdate, treeReloadRef }
listsLayout :: Record Props -> R.Element
listsLayout props = R.createElement listsLayoutCpt props []
...
...
src/Gargantext/Components/Tab.purs
View file @
5c7de476
...
...
@@ -45,7 +45,7 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
-- TODO: document what these are (selection, item indices)
type TabProps = ( selected :: Int, index :: Int )
tab :: R
ecord TabProps -> Array R.Element -> R.Element
tab :: R
2.Component TabProps
tab = R.createElement tabCpt
-- | A tab only shows its contents if it is currently selected
...
...
src/Gargantext/Utils/Reactix.purs
View file @
5c7de476
...
...
@@ -42,6 +42,8 @@ import Web.HTML (window)
import Web.HTML.Window (localStorage)
import Web.Storage.Storage (Storage, getItem, setItem)
type Component p = Record p -> Array R.Element -> R.Element
newtype Point = Point { x :: Number, y :: Number }
-- a reducer function living in effector, for useReductor
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment