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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
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
...
@@ -157,12 +157,12 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested [
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested [
frameLayout { nodeId, nodeType: GT.NodeFrameCalc, session }
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 [
RouteFrameCode sid nodeId -> withSession sid $ \session -> forested [
frameLayout { nodeId, nodeType: GT.NodeFrameNotebook, session }
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 [
Team sid nodeId -> withSession sid $ \session -> forested [
corpusLayout { nodeId, session }
corpusLayout { nodeId, session }
]
]
...
...
src/Gargantext/Components/ContextMenu/ContextMenu.purs
View file @
5c7de476
...
@@ -29,7 +29,7 @@ type Props t = (
...
@@ -29,7 +29,7 @@ type Props t = (
, onClose :: Effect Unit
, 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
contextMenu = R.createElement contextMenuCpt
contextMenuCpt :: forall t. R.Component (Props t)
contextMenuCpt :: forall t. R.Component (Props t)
...
...
src/Gargantext/Components/Forest.purs
View file @
5c7de476
...
@@ -126,17 +126,17 @@ type ForestLayoutProps = (
...
@@ -126,17 +126,17 @@ type ForestLayoutProps = (
, treeReloadRef :: R.Ref (Maybe ReloadS)
, 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
forestLayout props = R.createElement forestLayoutCpt props
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
where
where
cpt props@{ handed }
_
= do
cpt props@{ handed }
children
= do
pure $ R.fragment [ topBar { handed }, forestLayoutMain props ]
pure $ R.fragment [ topBar { handed }, forestLayoutMain props
children
]
forestLayoutMain :: R
ecord ForestLayoutProps -> R.Element
forestLayoutMain :: R
2.Component ForestLayoutProps
forestLayoutMain props = R.createElement forestLayoutMainCpt props
[]
forestLayoutMain props = R.createElement forestLayoutMainCpt props
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
...
@@ -166,11 +166,11 @@ forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" c
...
@@ -166,11 +166,11 @@ forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" c
, sessions
, sessions
, showLogin
, showLogin
, treeReloadRef } ]
, treeReloadRef } ]
, mainPage children
, mainPage
{}
children
]
]
mainPage ::
Array R.Element -> R.Element
mainPage ::
R2.Component ()
mainPage = R.createElement mainPageCpt
{}
mainPage = R.createElement mainPageCpt
mainPageCpt :: R.Component ()
mainPageCpt :: R.Component ()
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
...
...
src/Gargantext/Components/Modal.purs
View file @
5c7de476
...
@@ -21,7 +21,7 @@ thisModule = "Gargantext.Components.Modal"
...
@@ -21,7 +21,7 @@ thisModule = "Gargantext.Components.Modal"
type Props = ( setVisible :: R.Setter Boolean )
type Props = ( setVisible :: R.Setter Boolean )
modal :: R
ecord Props -> Array R.Element -> R.Element
modal :: R
2.Component Props
modal = R.createElement modalCpt
modal = R.createElement modalCpt
modalCpt :: R.Component Props
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, ($), (+
...
@@ -26,25 +26,35 @@ 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(..), ReloadS)
import Gargantext.Types (NodeType(..), ReloadS)
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts"
thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts"
display :: String -> Array R.Element -> R.Element
type DisplayProps = (
display title elems =
title :: String
H.div { className: "container-fluid" }
)
[ H.div { className: "row", id: "contact-page-header" }
[ H.div { className: "col-md-6"} [ H.h3 {} [ H.text title ] ]
display :: R2.Component DisplayProps
, H.div { className: "col-md-8"} []
display = R.createElement displayCpt
, H.div { className: "col-md-2"} [ H.span {} [ H.text "" ] ]
]
displayCpt :: R.Component DisplayProps
, H.div { className: "row", id: "contact-page-info" }
displayCpt = R.hooksComponentWithModule thisModule "display" cpt
[ H.div { className: "col-md-12" }
where
[ H.div { className: "row" }
cpt { title } children = do
[ H.div { className: "col-md-2" } [ H.img { src: "/images/Gargantextuel-212x300.jpg"} ]
pure $ H.div { className: "container-fluid" }
, H.div { className: "col-md-1"} []
[ H.div { className: "row", id: "contact-page-header" }
, H.div { className: "col-md-8"} elems
[ 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
-- | TODO format data in better design (UI) shape
contactInfos :: HyperdataUser -> (HyperdataUser -> Effect Unit) -> Array R.Element
contactInfos :: HyperdataUser -> (HyperdataUser -> Effect Unit) -> Array R.Element
...
@@ -191,7 +201,7 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
...
@@ -191,7 +201,7 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
useLoader {nodeId, reload: fst reload, session} getContactWithReload $
useLoader {nodeId, reload: fst reload, session} getContactWithReload $
\contactData@{contactNode: Contact {name, hyperdata}} ->
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
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 {
, Tabs.tabs {
appReload
appReload
, asyncTasksRef
, asyncTasksRef
...
@@ -249,7 +259,7 @@ annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayou
...
@@ -249,7 +259,7 @@ annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayou
useLoader nodeId (getAnnuaireContact session annuaireId) $
useLoader nodeId (getAnnuaireContact session annuaireId) $
\contactData@{contactNode: Contact {name, hyperdata}} ->
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
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 {
, Tabs.tabs {
appReload
appReload
, asyncTasksRef
, asyncTasksRef
...
...
src/Gargantext/Components/Nodes/Lists.purs
View file @
5c7de476
...
@@ -35,6 +35,20 @@ type Props = (
...
@@ -35,6 +35,20 @@ type Props = (
, treeReloadRef :: R.Ref (Maybe GT.ReloadS)
, 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 :: Record Props -> R.Element
listsLayout props = R.createElement listsLayoutCpt props []
listsLayout props = R.createElement listsLayoutCpt props []
...
...
src/Gargantext/Components/Tab.purs
View file @
5c7de476
...
@@ -45,7 +45,7 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
...
@@ -45,7 +45,7 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
-- TODO: document what these are (selection, item indices)
-- TODO: document what these are (selection, item indices)
type TabProps = ( selected :: Int, index :: Int )
type TabProps = ( selected :: Int, index :: Int )
tab :: R
ecord TabProps -> Array R.Element -> R.Element
tab :: R
2.Component TabProps
tab = R.createElement tabCpt
tab = R.createElement tabCpt
-- | A tab only shows its contents if it is currently selected
-- | 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)
...
@@ -42,6 +42,8 @@ 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)
type Component p = Record p -> Array R.Element -> R.Element
newtype Point = Point { x :: Number, y :: Number }
newtype Point = Point { x :: Number, y :: Number }
-- a reducer function living in effector, for useReductor
-- 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