Commit dd733412 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[toestand] fixes for compilation errors

parent 24e8392f
......@@ -7,7 +7,7 @@ let
owner = "justinwoo";
repo = "easy-dhall-nix";
rev = "90957969850a44481c6e150350c56e8b53b29e1e";
sha256 = "12v4ql1nm1famz8r80k1xkkdgj7285vy2vn16iili0qwvz3i98ah";
sha256 = "1hsmp3cb0k554kh0jlfzpdzx2b8ndyh2gdykmw9hw41haaw16mmi";
}
) {
inherit pkgs;
......
......@@ -21,11 +21,11 @@
};
"affjax" = {
name = "affjax";
version = "v10.1.0";
version = "v11.0.0";
src = pkgs.fetchgit {
url = "https://github.com/slamdata/purescript-affjax.git";
rev = "v10.1.0";
sha256 = "129g7x9icaqj158snzl0ilbd0dipl4bmk49is8dh8jvh0z97k700";
rev = "v11.0.0";
sha256 = "0dfwayw6h49hm5ikq6sic0yi44w8hmqx4nx5xfavqk4ary1z3ifq";
};
};
"ansi" = {
......@@ -57,11 +57,11 @@
};
"argonaut-core" = {
name = "argonaut-core";
version = "v5.0.2";
version = "v5.1.0";
src = pkgs.fetchgit {
url = "https://github.com/purescript-contrib/purescript-argonaut-core.git";
rev = "v5.0.2";
sha256 = "1rfd1brvzp9akx6hypxql2qv9bhlcqks1xwqfqqf31dqvcl7vvhc";
rev = "v5.1.0";
sha256 = "0x52vz5pdiamwq9cznm5mkhfcgk6raapqwdj7cmiblkflra32lhr";
};
};
"argonaut-traversals" = {
......@@ -163,15 +163,6 @@
sha256 = "1nm45khn2dvlyv059nzpz1w7d3nfsvq45hnb2qllrbzyv7rlxmi8";
};
};
"coroutines" = {
name = "coroutines";
version = "v5.0.1";
src = pkgs.fetchgit {
url = "https://github.com/purescript-contrib/purescript-coroutines.git";
rev = "v5.0.1";
sha256 = "1is83blf44sflhwsaixpd1irlm33fsd1p919gbcn79mmmwi4bxdl";
};
};
"css" = {
name = "css";
version = "v4.0.0";
......@@ -192,11 +183,11 @@
};
"debug" = {
name = "debug";
version = "v4.0.0";
version = "v4.0.1";
src = pkgs.fetchgit {
url = "https://github.com/garyb/purescript-debug.git";
rev = "v4.0.0";
sha256 = "0gwjj80akys0h111i74n429fmny992gx0r4rk1n98gqlqm5cmi21";
rev = "v4.0.1";
sha256 = "03xmchfzx7anks6b3yrrhf5b0bx7n390c814nhhxdl98936wydg4";
};
};
"distributive" = {
......@@ -221,7 +212,7 @@
name = "dom-simple";
version = "v0.2.7";
src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-dom-simple";
url = "https://github.com/poorscript/purescript-dom-simple";
rev = "v0.2.7";
sha256 = "02f1vsjk5frva3p3xpbrnj2zg4rg01l07dnvc3i6axvc5k30i282";
};
......@@ -275,7 +266,7 @@
name = "ffi-simple";
version = "v0.2.10";
src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-ffi-simple";
url = "https://github.com/poorscript/purescript-ffi-simple";
rev = "v0.2.10";
sha256 = "14slcccmy96ml7r8rzhhqnw486qj1b385i9095fdymms78g5gnj5";
};
......@@ -334,6 +325,15 @@
sha256 = "1kl937qxnbn9m1bn0ijpnfiizgpcvcrnzqcc1scwq2kxvxh8kqap";
};
};
"formula" = {
name = "formula";
version = "v0.2.1";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-formula";
rev = "v0.2.1";
sha256 = "0511r2n51sz59ksalzvrcbwwhbpj42h2dj2zknns7dnhkdkmf4a6";
};
};
"free" = {
name = "free";
version = "v5.2.0";
......@@ -343,15 +343,6 @@
sha256 = "1bwj0ay7q9lm4ir29jy549m05jvaqik1s615biv23y51ngx3fn49";
};
};
"freet" = {
name = "freet";
version = "v5.0.0";
src = pkgs.fetchgit {
url = "https://github.com/purescript-contrib/purescript-freet.git";
rev = "v5.0.0";
sha256 = "0j8y47x672z8h809hxl1n502yj0y3yv8zsln8bk17rcz06x8frv9";
};
};
"functions" = {
name = "functions";
version = "v4.0.0";
......@@ -651,11 +642,11 @@
};
"parsing" = {
name = "parsing";
version = "v5.0.3";
version = "v5.1.0";
src = pkgs.fetchgit {
url = "https://github.com/purescript-contrib/purescript-parsing.git";
rev = "v5.0.3";
sha256 = "0m5xvb5kis28laj3navyyakyq408vw115c2dvngf1vljzh1hk5kj";
rev = "v5.1.0";
sha256 = "199wjj02hh7wzkvh036vqv3369jrw1dpcb11n0nnqlqvvihfcy87";
};
};
"partial" = {
......@@ -757,22 +748,13 @@
sha256 = "1agpsxwz1i8pavcrpgnir5sk9vwrwk406psykjxmyahxby1dhwqi";
};
};
"react-dom" = {
name = "react-dom";
version = "v6.1.0";
src = pkgs.fetchgit {
url = "https://github.com/purescript-contrib/purescript-react-dom.git";
rev = "v6.1.0";
sha256 = "19kzsahx3kvgbi9bhnnz50fjmqvvgslsg6rk028bj4v28m8gra40";
};
};
"reactix" = {
name = "reactix";
version = "v0.4.6";
version = "v0.4.11";
src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-reactix";
rev = "v0.4.6";
sha256 = "0q3cq3d9385jq9dlpjhfqdc4b4nvxxlmjncs3fr4xk8vv24j3kns";
url = "https://github.com/poorscript/purescript-reactix";
rev = "v0.4.11";
sha256 = "1prxqww81lk32cp4mr318yanvf51kf9hz7x4n6rxdbcprj27710d";
};
};
"read" = {
......@@ -928,15 +910,6 @@
sha256 = "0n0sxr44d1lwlrgv8b48ml6vg0r5abfvyywn50jb0i1agnm53i4n";
};
};
"thermite" = {
name = "thermite";
version = "hide-2020-03-04";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-thermite.git";
rev = "hide-2020-03-04";
sha256 = "1s0fj6f7kqafiw027yw65f5193kph51x6dxw0wv3g6j77yxmk92i";
};
};
"these" = {
name = "these";
version = "v4.0.0";
......@@ -946,6 +919,15 @@
sha256 = "0ywwpbcz1d0pdi3f9h9kla52vq1if8zwdz7jq7lqz5s8zj8kyg5r";
};
};
"toestand" = {
name = "toestand";
version = "v0.5.0";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-toestand";
rev = "v0.5.0";
sha256 = "1y4pji0gw5dzmxxnrzmzfncq6m6qx7yqac2f758fvv6mi6fmf928";
};
};
"transformers" = {
name = "transformers";
version = "v4.2.0";
......@@ -1000,6 +982,15 @@
sha256 = "1kp1b35y8wzin9m5lfyp239nclq703xz2b4373x3075xfp6qdcwf";
};
};
"typisch" = {
name = "typisch";
version = "v0.2.1";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-typisch";
rev = "v0.2.1";
sha256 = "1jccgfayh20qsmqgbh54knl4dwbwk3144mkzzv2pi07jprp8mzbf";
};
};
"uint" = {
name = "uint";
version = "v5.1.1";
......
......@@ -6,7 +6,7 @@ import Data.Array as A
import Data.Maybe (Maybe(..))
import Data.Monoid (guard)
import Data.Set as Set
import Data.Traversable (traverse_)
import Data.Traversable (traverse_, traverse)
import Data.Tuple (Tuple(..), fst, snd)
import Data.Tuple.Nested ((/\))
import Effect (Effect)
......@@ -51,8 +51,8 @@ here = R2.here "Gargantext.Components.Forest.Tree"
-- Shared by every component here + performAction + nodeSpan
type Universal =
( tasks :: GAT.Reductor
, reloadRoot :: T.Cursor T2.Reload )
( reloadRoot :: T.Cursor T2.Reload
, tasks :: GAT.Reductor )
-- Shared by every component here + nodeSpan
type Global =
......@@ -78,7 +78,7 @@ treeLoaderCpt = here.component "treeLoader" cpt where
app <- T.useLive T.unequal p.reloadRoot
reload <- T.useLive T.unequal p.reload
let fetch _ = getNodeTree session root
useLoader { app, forest, root } fetch (loaded session) where
useLoader { app, root } fetch (loaded session) where
loaded session tree' = tree props [] where
props = Record.merge common extra where
common = RecordE.pick p :: Record Common
......@@ -168,12 +168,14 @@ type PerformActionProps =
-- | This thing is basically a hangover from when garg was a thermite
-- | application. we should slowly get rid of it.
performAction :: Action -> Record PerformActionProps -> Aff Unit
performAction (DeleteNode nt) p@{ forestOpen: (_ /\ setOpenNodes), tree: (NTree (LNode {id, parent_id}) _) } = do
performAction (DeleteNode nt) p@{ forestOpen
, session
, tree: (NTree (LNode {id, parent_id}) _) } = do
case nt of
GT.NodePublic GT.FolderPublic -> void $ deleteNode session nt id
GT.NodePublic _ -> void $ unpublishNode session parent_id id
_ -> void $ deleteNode session nt id
liftEffect $ setOpenNodes (Set.delete (mkNodeId session id))
_ <- liftEffect $ T.modify (Set.delete (mkNodeId session id)) forestOpen
performAction RefreshTree p
performAction (DoSearch task) p@{ tree: (NTree (LNode {id}) _) } = liftEffect $ do
(snd p.tasks) $ GAT.Insert id task
......@@ -188,16 +190,17 @@ performAction (RenameNode name) p@{ tree: (NTree (LNode {id}) _) } = do
performAction RefreshTree p
performAction (ShareTeam username) p@{ tree: (NTree (LNode {id}) _)} =
void $ Share.shareReq p.session id $ Share.ShareTeamParams {username}
performAction (SharePublic { params }) p@{ forestOpen: (_ /\ setOpenNodes)} = traverse_ f params where
performAction (SharePublic { params }) p@{ forestOpen } = traverse_ f params where
f (SubTreeOut { in: inId, out }) = do
void $ Share.shareReq p.session inId $ Share.SharePublicParams { node_id: out }
liftEffect $ setOpenNodes (Set.insert (mkNodeId p.session out))
_ <- liftEffect $ T.modify (Set.insert (mkNodeId p.session out)) forestOpen
performAction RefreshTree p
performAction (AddContact params) p@{ tree: (NTree (LNode {id}) _) } =
void $ Contact.contactReq p.session id params
performAction (AddNode name nodeType) p@{ forestOpen: (_ /\ setOpenNodes), tree: (NTree (LNode { id }) _) } = do
performAction (AddNode name nodeType) p@{ forestOpen
, tree: (NTree (LNode { id }) _) } = do
task <- addNode p.session id $ AddNodeValue {name, nodeType}
liftEffect $ setOpenNodes (Set.insert (mkNodeId p.session id))
_ <- liftEffect $ T.modify (Set.insert (mkNodeId p.session id)) forestOpen
performAction RefreshTree p
performAction (UploadFile nodeType fileType mName blob) p@{ tree: (NTree (LNode { id }) _) } = do
task <- uploadFile p.session nodeType id fileType {mName, blob}
......@@ -210,16 +213,17 @@ performAction (UploadArbitraryFile mName blob) p@{ tree: (NTree (LNode { id }) _
(snd p.tasks) $ GAT.Insert id task
log2 "[performAction] UploadArbitraryFile, uploaded, task:" task
performAction DownloadNode _ = liftEffect $ log "[performAction] DownloadNode"
performAction (MoveNode {params}) p@{ forestOpen: (_ /\ setOpenNodes) } = traverse_ f params where
f SubTreeOut { in: in', out } = do
performAction (MoveNode {params}) p@{ forestOpen
, session } = traverse_ f params where
f (SubTreeOut { in: in', out }) = do
void $ moveNodeReq p.session in' out
liftEffect $ setOpenNodes (Set.insert (mkNodeId session out))
_ <- liftEffect $ T.modify (Set.insert (mkNodeId session out)) forestOpen
performAction RefreshTree p
performAction (MergeNode { params }) p = traverse f params where
performAction (MergeNode { params }) p = traverse_ f params where
f (SubTreeOut { in: in', out }) = do
void $ mergeNodeReq p.session in' out
performAction RefreshTree p
performAction (LinkNode { nodeType, params }) p = traverse f params where
performAction (LinkNode { nodeType, params }) p = traverse_ f params where
f (SubTreeOut { in: in', out }) = do
void $ linkNodeReq p.session nodeType in' out
performAction RefreshTree p
......
......@@ -44,16 +44,16 @@ here = R2.here "Gargantext.Components.Forest.Tree.Node"
-- Main Node
type NodeMainSpanProps =
( reloadRoot :: T.Cursor T2.Reload
, tasks :: GAT.Reductor
, route :: Routes.AppRoute
, folderOpen :: T.Cursor Boolean
( folderOpen :: T.Cursor Boolean
, frontends :: Frontends
, id :: ID
, isLeaf :: IsLeaf
, name :: Name
, nodeType :: GT.NodeType
, reloadRoot :: T.Cursor T2.Reload
, route :: Routes.AppRoute
, setPopoverRef :: R.Ref (Maybe (Boolean -> Effect Unit))
, tasks :: GAT.Reductor
| CommonProps
)
......@@ -97,9 +97,9 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
let isSelected = Just route == Routes.nodeTypeAppRoute nodeType (sessionId session) id
pure $ H.span (dropProps droppedFile isDragOver)
$ switchHanded
[ folderIcon nodeType folderOpen
, chevronIcon isLeaf handed nodeType folderOpen
$ GT.reverseHanded
[ folderIcon { folderOpen, nodeType } []
, chevronIcon { folderOpen, handed, isLeaf, nodeType } []
, nodeLink { frontends, handed, folderOpen, id, isSelected
, name: name' props, nodeType, session } []
......@@ -129,9 +129,9 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
, nodeActions { id
, nodeType
, refresh: const $ dispatch RefreshTree
, session
, triggerRefresh: const $ dispatch RefreshTree
}
} []
] handed
where
onTaskFinish id t _ = do
......@@ -153,21 +153,6 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
, session
}
chevronIcon true handed' nodeType (open /\ setOpen) = H.div {} []
chevronIcon false handed' nodeType (open /\ setOpen) =
H.a { className: "chevron-icon"
, on: { click: \_ -> setOpen $ not }
}
[ H.i { className: if open
then "fa fa-chevron-down"
else if handed' == GT.RightHanded
then "fa fa-chevron-right"
else "fa fa-chevron-left"
} [] ]
folderIcon nodeType (open /\ setOpen) =
H.a { className: "folder-icon", on: { click: \_ -> setOpen $ not } }
[ H.i {className: GT.fldr nodeType open} [] ]
popOverIcon =
H.a { className: "settings fa fa-cog"
, title : "Each node of the Tree can perform some actions.\n"
......@@ -204,6 +189,49 @@ nodeMainSpanCpt = here.component "nodeMainSpan" cpt
setIsDragOver $ const true
onDragLeave (_ /\ setIsDragOver) _ = setIsDragOver $ const false
type FolderIconProps = (
folderOpen :: T.Cursor Boolean
, nodeType :: GT.NodeType
)
folderIcon :: R2.Component FolderIconProps
folderIcon = R.createElement folderIconCpt
folderIconCpt :: R.Component FolderIconProps
folderIconCpt = here.component "folderIcon" cpt
where
cpt { folderOpen, nodeType } _ = do
open <- T.read folderOpen
pure $ H.a { className: "folder-icon", on: { click: \_ -> T.modify not folderOpen } }
[ H.i { className: GT.fldr nodeType open } [] ]
type ChevronIconProps = (
folderOpen :: T.Cursor Boolean
, handed :: GT.Handed
, isLeaf :: Boolean
, nodeType :: GT.NodeType
)
chevronIcon :: R2.Component ChevronIconProps
chevronIcon = R.createElement chevronIconCpt
chevronIconCpt :: R.Component ChevronIconProps
chevronIconCpt = here.component "chevronIcon" cpt
where
cpt { folderOpen, handed, isLeaf: true, nodeType } _ = do
pure $ H.div {} []
cpt { folderOpen, handed, isLeaf: false, nodeType } _ = do
open <- T.read folderOpen
pure $ H.a { className: "chevron-icon"
, on: { click: \_ -> T.modify not folderOpen }
}
[ H.i { className: if open
then "fa fa-chevron-down"
else if handed == GT.RightHanded
then "fa fa-chevron-right"
else "fa fa-chevron-left"
} [] ]
{-
fldr nt open = if open
then "fa fa-globe" -- <> color nt
......@@ -221,14 +249,14 @@ fldr nt open = if open
type NodeActionsCommon =
( id :: ID
, session :: Session
, refresh :: Unit -> Aff Unit
, session :: Session
)
type NodeActionsProps = ( nodeType :: GT.NodeType | NodeActionsCommon )
nodeActions :: Record NodeActionsProps -> R.Element
nodeActions p = R.createElement nodeActionsCpt p []
nodeActions :: R2.Component NodeActionsProps
nodeActions = R.createElement nodeActionsCpt
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = here.component "nodeActions" cpt where
......
-- TODO copy of Gargantext.Components.Nodes.Corpus.Tabs.Specs
module Gargantext.Components.Nodes.Annuaire.User.Tabs where
module Gargantext.Components.Nodes.Annuaire.Tabs where
import Prelude hiding (div)
import Effect.Aff (Aff)
......@@ -51,22 +51,17 @@ modeTabType' Books = CTabAuthors
modeTabType' Communication = CTabAuthors
type TabsProps =
( tasks :: R.Ref (Maybe GAT.Reductor)
, cacheState :: R.State LTypes.CacheState
( cacheState :: R.State LTypes.CacheState
, contactData :: ContactData
, frontends :: Frontends
, nodeId :: Int
, session :: Session
, sidePanelTriggers :: Record LTypes.SidePanelTriggers
, reloadForest :: T.Cursor (T2.InitReload T.Cursor)
, reloadRoot :: T.Cursor T2.Reload
, session :: Session
, sidePanelTriggers :: Record LTypes.SidePanelTriggers
, tasks :: R.Ref (Maybe GAT.Reductor)
)
type NgramsViewTabsProps =
( mode :: Mode
, defaultListId :: Int
| TabsProps )
tabs :: R2.Leaf TabsProps
tabs props = R.createElement tabsCpt props []
......@@ -83,31 +78,40 @@ tabsCpt = here.component "tabs" cpt where
, "Communication" /\ ngramsView (viewProps Communication)
, "Trash" /\ docs trg -- TODO pass-in trash mode
] where
viewProps mode = Record.merge dtCommon { mode }
viewProps mode = Record.merge props { defaultListId: props.contactData.defaultListId
, mode }
totalRecords = 4736 -- TODO lol
docs sidePanelTriggers = DT.docViewLayout (Record.merge dtCommon dtExtra)
docs sidePanelTriggers = DT.docViewLayout (Record.merge { sidePanelTriggers } $ Record.merge dtCommon dtExtra)
dtCommon = RX.pick props :: Record DTCommon
dtExtra =
{ chart: mempty, mCorpusId: Nothing, showSearch: true
dtExtra =
{ chart: mempty
, listId: props.contactData.defaultListId
, tabType: TabPairing TabDocs, totalRecords
, mCorpusId: Nothing
, showSearch: true
, tabType: TabPairing TabDocs
, totalRecords
}
type DTCommon =
( cacheState :: R.State LTypes.CacheState
, contactData :: ContactData
-- , contactData :: ContactData
, frontends :: Frontends
, nodeId :: Int
, session :: Session
, sidePanelTriggers :: Record LTypes.SidePanelTriggers
-- , sidePanelTriggers :: Record LTypes.SidePanelTriggers
)
type NgramsViewTabsProps =
( defaultListId :: Int
, mode :: Mode
| TabsProps )
ngramsView :: R2.Leaf NgramsViewTabsProps
ngramsView props = R.createElement ngramsViewCpt props []
ngramsViewCpt :: R.Component NgramsViewTabsProps
ngramsViewCpt = here.component "ngramsView" cpt where
cpt props@{ defaultListId, nodeId, session, mode } _ = do
cpt props@{ defaultListId, mode, nodeId, session } _ = do
path <- R.useState' $
NTC.initialPageParams session nodeId
[ defaultListId ] (TabDocument TabDocs)
......@@ -123,12 +127,12 @@ ngramsViewCpt = here.component "ngramsView" cpt where
afterSync _ = pure unit
type NTCommon =
( tasks :: R.Ref (Maybe GAT.Reductor)
, cacheState :: R.State LTypes.CacheState
( cacheState :: R.State LTypes.CacheState
, defaultListId :: Int
, nodeId :: Int
, session :: Session
, sidePanelTriggers :: Record LTypes.SidePanelTriggers
, reloadForest :: T.Cursor (T2.InitReload T.Cursor)
, reloadRoot :: T.Cursor T2.Reload
, defaultListId :: Int
, session :: Session
, sidePanelTriggers :: Record LTypes.SidePanelTriggers
, tasks :: R.Ref (Maybe GAT.Reductor)
)
......@@ -14,11 +14,12 @@ import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.Nodes.Annuaire.User.Tabs as Tabs
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (Contact(..), ContactData, ContactTouch(..), ContactWhere(..), ContactWho(..), HyperdataContact(..), HyperdataUser(..), _city, _country, _firstName, _labTeamDeptsJoinComma, _lastName, _mail, _office, _organizationJoinComma, _ouFirst, _phone, _role, _shared, _touch, _who, defaultContactTouch, defaultContactWhere, defaultContactWho, defaultHyperdataContact, defaultHyperdataUser)
import Gargantext.Components.Nodes.Annuaire.Tabs as Tabs
import Gargantext.Components.Nodes.Lists.Types as LT
import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Loader (useLoader)
......@@ -28,9 +29,10 @@ import Gargantext.Sessions (Session, get, put, sessionId)
import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reload as GUR
import Gargantext.Utils.Toestand as T2
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Annuaire.User"
here :: R2.Here
here = R2.here "Gargantext.Components.Nodes.Annuaire.User"
type DisplayProps = (
title :: String
......@@ -40,7 +42,7 @@ display :: R2.Component DisplayProps
display = R.createElement displayCpt
displayCpt :: R.Component DisplayProps
displayCpt = R.hooksComponentWithModule thisModule "display" cpt
displayCpt = here.component "display" cpt
where
cpt { title } children = do
pure $ H.div { className: "container-fluid" }
......@@ -96,7 +98,7 @@ contactInfoItem :: Record ContactInfoItemProps -> R.Element
contactInfoItem props = R.createElement contactInfoItemCpt props []
contactInfoItemCpt :: R.Component ContactInfoItemProps
contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
contactInfoItemCpt = here.component "contactInfoItem" cpt
where
cpt {hyperdata, label, lens, onUpdateHyperdata, placeholder} _ = do
isEditing <- R.useState' false
......@@ -150,12 +152,12 @@ listElement :: Array R.Element -> R.Element
listElement = H.li { className: "list-group-item justify-content-between" }
type LayoutProps =
( reloadRoot :: GUR.ReloadS
, tasks :: R.Ref (Maybe GAT.Reductor)
, frontends :: Frontends
, nodeId :: Int
, session :: Session
, reloadForest :: GUR.ReloadWithInitializeRef
( frontends :: Frontends
, nodeId :: Int
, reloadForest :: T.Cursor (T2.InitReload T.Cursor)
, reloadRoot :: T.Cursor T2.Reload
, session :: Session
, tasks :: R.Ref (Maybe GAT.Reductor)
)
type KeyLayoutProps = (
......@@ -167,7 +169,7 @@ userLayout :: Record LayoutProps -> R.Element
userLayout props = R.createElement userLayoutCpt props []
userLayoutCpt :: R.Component LayoutProps
userLayoutCpt = R.hooksComponentWithModule thisModule "userLayout" cpt
userLayoutCpt = here.component "userLayout" cpt
where
cpt { reloadRoot, tasks, frontends, nodeId, session, reloadForest } _ = do
let sid = sessionId session
......@@ -186,9 +188,9 @@ userLayoutWithKey :: Record KeyLayoutProps -> R.Element
userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props []
userLayoutWithKeyCpt :: R.Component KeyLayoutProps
userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey" cpt
userLayoutWithKeyCpt = here.component "userLayoutWithKey" cpt
where
cpt { reloadRoot, tasks, frontends, nodeId, session, reloadForest } _ = do
cpt { frontends, nodeId, reloadForest, reloadRoot, session, tasks } _ = do
reload <- GUR.new
cacheState <- R.useState' LT.CacheOn
......@@ -201,15 +203,15 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
display { title: fromMaybe "no name" name }
(contactInfos hyperdata (onUpdateHyperdata reload))
, Tabs.tabs {
reloadRoot
, tasks
, cacheState
cacheState
, contactData
, frontends
, nodeId
, reloadForest
, reloadRoot
, session
, sidePanelTriggers
, reloadForest
, tasks
}
]
where
......
......@@ -96,7 +96,7 @@ corpus :: Record Props -> SessionId -> NodeId -> R.Element
corpus props@{ tasks, cursors, views } sessionId nodeId =
authed props sessionId $
forested props
[ corpusLayout { nodeId, session: views.session }
[ corpusLayout { nodeId, session: views.session } ]
corpusDocument :: Record Props -> SessionId -> CorpusId -> ListId -> NodeId -> R.Element
corpusDocument props@{ tasks, cursors, views } sessionId corpusId' listId nodeId =
......@@ -127,8 +127,15 @@ lists props@{ tasks
, views: { backend, route, handed, sessions } } sessionId nodeId =
authed props sessionId $
Lists.listsWithForest
{ forestProps: { tasks, backend, route, handed, sessions,
, reloadForest, reloadRoot, showLogin, frontends }
{ forestProps: { backend
, frontends
, handed
, reloadForest
, reloadRoot
, route
, sessions
, showLogin
, tasks }
, listsProps: { tasks, reloadRoot, reloadForest, nodeId, session }
} []
where frontends = defaultFrontends
......
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