Commit 7b463fdd authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev-tree-reload' into dev-bootstrap-v4-upgrade

parents 87460766 3b60b4ef
...@@ -696,10 +696,18 @@ li .leaf:hover a.settings { ...@@ -696,10 +696,18 @@ li .leaf:hover a.settings {
text-decoration: line-through; text-decoration: line-through;
} }
.action-search {
margin: 10px;
}
.context-menu { .context-menu {
position: fixed; position: fixed;
} }
.search-bar {
margin: 10px;
}
.range { .range {
width: 400px; width: 400px;
/* some space for the right knob */ /* some space for the right knob */
......
{"version":3,"sourceRoot":"","sources":["../../src/sass/_menu.sass","../../src/sass/_context_menu.sass","../../src/sass/_graph.sass","../../src/sass/_login.sass","../../src/sass/_tree.sass","../../src/sass/_code_editor.sass","../../src/sass/_styles.sass","../../src/sass/_range_slider.sass"],"names":[],"mappings":"AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;;;AAEF;AACI;EACA;;;AAEJ;AACI;EACA;;;AAGJ;AACA;EACI;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;EACA;;;AAEF;EACE;;;AC7CF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;;;AClBF;EACE;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAnBA;EACE;EACA;;AAEA;EACE;EACA;EACA;;AACA;EACE;EACA;;AAWN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EAxCA;EACA;EAEA;EAuCE;EACA;;AACF;EACE;;AACF;EACE;;AAEF;EACE;;AAEF;EApDA;EACA;EAEA;EAmDE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AAGA;EACE;EACA;;AACN;EACE;;AACF;EACE;;AAEF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACvFJ;EACE;;;AAOF;EACE;;AACA;EACE;EACA;;;AAEJ;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAGF;EACE;;AAEE;EACE;EACA;;AACA;EACE;;;AAIJ;EACE;EACA;EACA;EACA;;;AAKJ;EACE;EACA;EACA;;;AAGJ;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACA;EACE;EACA;EACA;;AACA;EACE;;AACF;EACE;EACA;EACA;EACA;;AACA;EACE;;AACN;EACE;EACA;EACA;EACA;;;AAGN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;;AAGF;EACE;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAGF;EACE;;;AAEJ;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AC1KF;EACE;;;AAGA;EACE;EACA;;AACA;EACE;;AACF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAER;EACE;;AAEE;EACE;;AACA;EACE;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;EACA;EACA;;AACF;EACE;;AACF;EACE;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AACF;EACE;;AAGN;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AAIR;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAEV;EACE;;AACF;EACE;;AAEE;EACE;;AACF;EACE;;AACN;EACE;;AAEE;EACE;EACA;;;AAGR;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;;AAIF;EACE;;AAEA;EACE;;;AC/HR;EACE;;AAEA;EACE;;AACA;EACE;;AACJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AACF;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EArDR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA2DM;EACE;EACA;EACA;EACA;EACA;EA7DR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAmEE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;;ACtGV;EACE;;AACF;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAEV;EACE;;AACA;EACE;EACA;EACA;;;AAKE;EACE;EACA;;AACF;EACE;;AACA;EACE;;AACJ;EACE;;;AAER;EACE;;;AC3CF;EACE;AACA;EACA;;AAEA;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;;AAEA;EACE;EAEA;EACA;EACA","file":"sass.css"} {"version":3,"sourceRoot":"","sources":["../../src/sass/_menu.sass","../../src/sass/_context_menu.sass","../../src/sass/_graph.sass","../../src/sass/_login.sass","../../src/sass/_tree.sass","../../src/sass/_code_editor.sass","../../src/sass/_styles.sass","../../src/sass/_range_slider.sass"],"names":[],"mappings":"AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;;;AAEF;AACI;EACA;;;AAEJ;AACI;EACA;;;AAGJ;AACA;EACI;;;AAEJ;EACI;EACA;EACA;EACA;;;AAEJ;EACE;EACA;;;AAEF;EACE;;;AC7CF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;;;AClBF;EACE;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAnBA;EACE;EACA;;AAEA;EACE;EACA;EACA;;AACA;EACE;EACA;;AAWN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EAxCA;EACA;EAEA;EAuCE;EACA;;AACF;EACE;;AACF;EACE;;AAEF;EACE;;AAEF;EApDA;EACA;EAEA;EAmDE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AAGA;EACE;EACA;;AACN;EACE;;AACF;EACE;;AAEF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACvFJ;EACE;;;AAOF;EACE;;AACA;EACE;EACA;;;AAEJ;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAGF;EACE;;AAEE;EACE;EACA;;AACA;EACE;;;AAIJ;EACE;EACA;EACA;EACA;;;AAKJ;EACE;EACA;EACA;;;AAGJ;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACA;EACE;EACA;EACA;;AACA;EACE;;AACF;EACE;EACA;EACA;EACA;;AACA;EACE;;AACN;EACE;EACA;EACA;EACA;;;AAGN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;;AAGE;EACE;;;AAEN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;;;AAGF;EACE;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;;;AAGF;EACE;;;AAEJ;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AC1KF;EACE;;;AAGA;EACE;EACA;;AACA;EACE;;AACF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAER;EACE;;AAEE;EACE;;AACA;EACE;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;EACA;EACA;;AACF;EACE;;AACF;EACE;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AACF;EACE;;AAGN;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AAIR;EACE;;AACF;EACE;;AACA;EACE;EACA;;AAEE;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAEV;EACE;;AACF;EACE;;AAEE;EACE;;AACF;EACE;;AACN;EACE;;AAEE;EACE;EACA;;;AAGR;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;;AAIF;EACE;;AAEA;EACE;;;AC/HR;EACE;;AAEA;EACE;;AACA;EACE;;AACJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AACF;EACE;EACA;;AACA;EACE;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EArDR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA2DM;EACE;EACA;EACA;EACA;EACA;EA7DR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAmEE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;;ACtGV;EACE;;AACF;EACE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAEV;EACE;;AACA;EACE;EACA;EACA;;;AAKE;EACE;EACA;;AACF;EACE;;AACA;EACE;;AACJ;EACE;;;AAER;EACE;;;AAEF;EACE;;;AAEF;EACE;;;ACjDF;EACE;AACA;EACA;;AAEA;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;;AAEA;EACE;EAEA;EACA;EACA","file":"sass.css"}
\ No newline at end of file \ No newline at end of file
...@@ -64,9 +64,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where ...@@ -64,9 +64,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
let forested = forestLayout { appReload let forested = forestLayout { appReload
, asyncTasksRef , asyncTasksRef
, backend , backend
, currentRoute: fst route
, frontends , frontends
, handed , handed
, route: fst route
, sessions: fst sessions , sessions: fst sessions
, showLogin: snd showLogin , showLogin: snd showLogin
, treeReloadRef , treeReloadRef
...@@ -74,9 +74,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where ...@@ -74,9 +74,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
let forestedTB = forestLayoutWithTopBar { appReload let forestedTB = forestLayoutWithTopBar { appReload
, asyncTasksRef , asyncTasksRef
, backend , backend
, currentRoute: fst route
, frontends , frontends
, handed , handed
, route: fst route
, sessions: fst sessions , sessions: fst sessions
, showLogin: snd showLogin , showLogin: snd showLogin
, treeReloadRef , treeReloadRef
...@@ -89,7 +89,6 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where ...@@ -89,7 +89,6 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
, visible: showLogin , visible: showLogin
} }
] ]
let mCurrentRoute = fst route
let withSession sid f = maybe' defaultView (ff f) (Sessions.lookup sid (fst sessions)) let withSession sid f = maybe' defaultView (ff f) (Sessions.lookup sid (fst sessions))
let sessionUpdate s = snd sessions $ Sessions.Update s let sessionUpdate s = snd sessions $ Sessions.Update s
...@@ -139,9 +138,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where ...@@ -139,9 +138,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
appReload appReload
, asyncTasksRef , asyncTasksRef
, backend , backend
, currentRoute: fst route
, frontends , frontends
, handed , handed
, route: fst route
, sessions: fst sessions , sessions: fst sessions
, showLogin: snd showLogin , showLogin: snd showLogin
, treeReloadRef , treeReloadRef
...@@ -162,10 +161,10 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where ...@@ -162,10 +161,10 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
simpleLayout { handed } [ simpleLayout { handed } [
explorerLayout { asyncTasksRef explorerLayout { asyncTasksRef
, backend , backend
, currentRoute: fst route
, frontends , frontends
, graphId , graphId
, handed: fst handed , handed: fst handed
, mCurrentRoute
, session , session
, sessions: (fst sessions) , sessions: (fst sessions)
, showLogin , showLogin
...@@ -190,9 +189,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where ...@@ -190,9 +189,9 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
appReload appReload
, asyncTasksRef , asyncTasksRef
, backend , backend
, currentRoute: fst route
, frontends , frontends
, handed , handed
, route: fst route
, sessions: fst sessions , sessions: fst sessions
, showLogin: snd showLogin , showLogin: snd showLogin
, treeReloadRef , treeReloadRef
......
...@@ -27,9 +27,9 @@ type Props = ( ...@@ -27,9 +27,9 @@ type Props = (
appReload :: ReloadS appReload :: ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor) , asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend) , backend :: R.State (Maybe Backend)
, currentRoute :: AppRoute
, frontends :: Frontends , frontends :: Frontends
, handed :: Handed , handed :: Handed
, route :: AppRoute
, sessions :: Sessions , sessions :: Sessions
, showLogin :: R.Setter Boolean , showLogin :: R.Setter Boolean
, treeReloadRef :: R.Ref (Maybe ReloadS) , treeReloadRef :: R.Ref (Maybe ReloadS)
...@@ -37,62 +37,63 @@ type Props = ( ...@@ -37,62 +37,63 @@ type Props = (
forest :: R2.Component Props forest :: R2.Component Props
forest = R.createElement forestCpt forest = R.createElement forestCpt
where
forestCpt :: R.Component Props
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt
forestCpt :: R.Component Props cpt { appReload
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where , asyncTasksRef
cpt { appReload , backend
, asyncTasksRef , currentRoute
, backend , frontends
, frontends , handed
, handed , sessions
, route , showLogin
, sessions , treeReloadRef } _ = do
, showLogin -- NOTE: this is a hack to reload the tree view on demand
, treeReloadRef } _ = do reload <- R.useState' (0 :: Reload)
-- NOTE: this is a hack to reload the tree view on demand asyncTasks <- GAT.useTasks appReload reload
reload <- R.useState' (0 :: Reload) openNodes <- R2.useLocalStorageState R2.openNodesKey (Set.empty :: OpenNodes)
asyncTasks <- GAT.useTasks appReload reload
openNodes <- R2.useLocalStorageState R2.openNodesKey (Set.empty :: OpenNodes) -- TODO If `treeReloadRef` is set, `reload` state should be updated
R.useEffect' $ do
-- TODO If `treeReloadRef` is set, `reload` state should be updated R.setRef asyncTasksRef $ Just asyncTasks
R.useEffect' $ do case R.readRef treeReloadRef of
R.setRef asyncTasksRef $ Just asyncTasks Nothing -> R.setRef treeReloadRef $ Just reload
case R.readRef treeReloadRef of Just _ -> pure unit
Nothing -> R.setRef treeReloadRef $ Just reload
Just _ -> pure unit R2.useCache (
frontends
R2.useCache ( /\ currentRoute
frontends /\ sessions
/\ route /\ fst openNodes
/\ sessions /\ fst appReload
/\ fst openNodes /\ fst reload
/\ fst appReload /\ (fst asyncTasks).storage
/\ fst reload /\ handed
/\ (fst asyncTasks).storage )
/\ handed (cpt' openNodes asyncTasks appReload reload showLogin backend)
) cpt' openNodes asyncTasks appReload reload showLogin backend (frontends /\ currentRoute /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do
(cpt' openNodes asyncTasks appReload reload showLogin backend) pure $ H.div { className: "forest" } $ [plus handed showLogin backend] <> trees
cpt' openNodes asyncTasks appReload reload showLogin backend (frontends /\ route /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do where
pure $ H.div { className: "forest" } $ [plus handed showLogin backend] <> trees trees = tree <$> unSessions sessions
where tree s@(Session {treeId}) =
trees = tree <$> unSessions sessions treeView { appReload
tree s@(Session {treeId}) = , asyncTasks
treeView { appReload , currentRoute
, asyncTasks , frontends
, frontends , handed
, handed , openNodes
, mCurrentRoute: Just route , reload
, openNodes , root: treeId
, reload , session: s
, root: treeId } []
, session: s
} []
plus :: Handed -> R.Setter Boolean -> R.State (Maybe Backend) -> R.Element plus :: Handed -> R.Setter Boolean -> R.State (Maybe Backend) -> R.Element
plus handed showLogin backend = H.div { className: "row" } [ plus handed showLogin backend = H.div { className: "row" } [
H.button { title: "Add or remove connections to the server(s)." H.button { className: "btn btn-secondary col-5 " <> if handed == RightHanded then "ml-1 mr-auto" else "ml-auto mr-1"
, on: {click} , on: {click}
, className: "btn btn-secondary col-5 " <> if handed == RightHanded then "ml-1 mr-auto" else "ml-auto mr-1" , title: "Add or remove connections to the server(s)."
} }
[ H.div { "type": "" [ H.div { "type": ""
, className: "fa fa-universal-access" -- fa-lg , className: "fa fa-universal-access" -- fa-lg
...@@ -114,9 +115,9 @@ type ForestLayoutProps = ( ...@@ -114,9 +115,9 @@ type ForestLayoutProps = (
appReload :: ReloadS appReload :: ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor) , asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend) , backend :: R.State (Maybe Backend)
, currentRoute :: AppRoute
, frontends :: Frontends , frontends :: Frontends
, handed :: R.State Handed , handed :: R.State Handed
, route :: AppRoute
, sessions :: Sessions , sessions :: Sessions
, showLogin :: R.Setter Boolean , showLogin :: R.Setter Boolean
, treeReloadRef :: R.Ref (Maybe ReloadS) , treeReloadRef :: R.Ref (Maybe ReloadS)
...@@ -124,10 +125,10 @@ type ForestLayoutProps = ( ...@@ -124,10 +125,10 @@ type ForestLayoutProps = (
forestLayout :: R2.Component ForestLayoutProps forestLayout :: R2.Component ForestLayoutProps
forestLayout props = R.createElement forestLayoutCpt props forestLayout props = R.createElement forestLayoutCpt props
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
where where
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
cpt props@{ handed } children = do cpt props@{ handed } children = do
pure $ R.fragment [ topBar { handed } [], forestLayoutMain props children ] pure $ R.fragment [ topBar { handed } [], forestLayoutMain props children ]
...@@ -135,10 +136,10 @@ forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt ...@@ -135,10 +136,10 @@ forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
-- while the remaining ones are put into the main view -- while the remaining ones are put into the main view
forestLayoutWithTopBar :: R2.Component ForestLayoutProps forestLayoutWithTopBar :: R2.Component ForestLayoutProps
forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props forestLayoutWithTopBar props = R.createElement forestLayoutWithTopBarCpt props
forestLayoutWithTopBarCpt :: R.Component ForestLayoutProps
forestLayoutWithTopBarCpt = R.hooksComponentWithModule thisModule "forestLayoutWithTopBar" cpt
where where
forestLayoutWithTopBarCpt :: R.Component ForestLayoutProps
forestLayoutWithTopBarCpt = R.hooksComponentWithModule thisModule "forestLayoutWithTopBar" cpt
cpt props@{ handed } children = do cpt props@{ handed } children = do
let { head: topBarChild, tail: mainChildren } = let { head: topBarChild, tail: mainChildren } =
fromMaybe { head: H.div {} [], tail: [] } $ A.uncons children fromMaybe { head: H.div {} [], tail: [] } $ A.uncons children
...@@ -149,10 +150,10 @@ forestLayoutWithTopBarCpt = R.hooksComponentWithModule thisModule "forestLayoutW ...@@ -149,10 +150,10 @@ forestLayoutWithTopBarCpt = R.hooksComponentWithModule thisModule "forestLayoutW
forestLayoutMain :: R2.Component ForestLayoutProps forestLayoutMain :: R2.Component ForestLayoutProps
forestLayoutMain props = R.createElement forestLayoutMainCpt props forestLayoutMain props = R.createElement forestLayoutMainCpt props
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
where where
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
cpt props children = do cpt props children = do
pure $ forestLayoutRaw props [ pure $ forestLayoutRaw props [
mainPage {} children mainPage {} children
...@@ -160,16 +161,16 @@ forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" c ...@@ -160,16 +161,16 @@ forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" c
forestLayoutRaw :: R2.Component ForestLayoutProps forestLayoutRaw :: R2.Component ForestLayoutProps
forestLayoutRaw props = R.createElement forestLayoutRawCpt props forestLayoutRaw props = R.createElement forestLayoutRawCpt props
forestLayoutRawCpt :: R.Component ForestLayoutProps
forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt
where where
forestLayoutRawCpt :: R.Component ForestLayoutProps
forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt
cpt { appReload cpt { appReload
, asyncTasksRef , asyncTasksRef
, backend , backend
, currentRoute
, frontends , frontends
, handed , handed
, route
, sessions , sessions
, showLogin , showLogin
, treeReloadRef } children = do , treeReloadRef } children = do
...@@ -183,9 +184,9 @@ forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt ...@@ -183,9 +184,9 @@ forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt
forest { appReload forest { appReload
, asyncTasksRef , asyncTasksRef
, backend , backend
, currentRoute
, frontends , frontends
, handed: fst handed , handed: fst handed
, route
, sessions , sessions
, showLogin , showLogin
, treeReloadRef } [] , treeReloadRef } []
...@@ -194,10 +195,10 @@ forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt ...@@ -194,10 +195,10 @@ forestLayoutRawCpt = R.hooksComponentWithModule thisModule "forestLayoutRaw" cpt
mainPage :: R2.Component () mainPage :: R2.Component ()
mainPage = R.createElement mainPageCpt mainPage = R.createElement mainPageCpt
mainPageCpt :: R.Component ()
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
where where
mainPageCpt :: R.Component ()
mainPageCpt = R.hooksComponentWithModule thisModule "mainPage" cpt
cpt {} children = do cpt {} children = do
pure $ H.div {className: "col-md-10"} [ pure $ H.div {className: "col-md-10"} [
H.div {id: "page-wrapper"} [ H.div {id: "page-wrapper"} [
......
...@@ -46,9 +46,9 @@ thisModule = "Gargantext.Components.Forest.Tree" ...@@ -46,9 +46,9 @@ thisModule = "Gargantext.Components.Forest.Tree"
------------------------------------------------------------------------ ------------------------------------------------------------------------
type CommonProps = ( type CommonProps = (
appReload :: GT.ReloadS appReload :: GT.ReloadS
, currentRoute :: AppRoute
, frontends :: Frontends , frontends :: Frontends
, handed :: GT.Handed , handed :: GT.Handed
, mCurrentRoute :: Maybe AppRoute
, openNodes :: R.State OpenNodes , openNodes :: R.State OpenNodes
, reload :: GT.ReloadS , reload :: GT.ReloadS
, session :: Session , session :: Session
...@@ -69,9 +69,9 @@ treeView = R.createElement elCpt ...@@ -69,9 +69,9 @@ treeView = R.createElement elCpt
cpt { appReload cpt { appReload
, asyncTasks , asyncTasks
, currentRoute
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload , reload
, root , root
...@@ -79,9 +79,9 @@ treeView = R.createElement elCpt ...@@ -79,9 +79,9 @@ treeView = R.createElement elCpt
} _children = do } _children = do
pure $ treeLoadView { appReload pure $ treeLoadView { appReload
, asyncTasks , asyncTasks
, currentRoute
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload , reload
, root , root
...@@ -96,9 +96,9 @@ treeLoadView = R.createElement elCpt ...@@ -96,9 +96,9 @@ treeLoadView = R.createElement elCpt
cpt { appReload cpt { appReload
, asyncTasks , asyncTasks
, currentRoute
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload , reload
, root , root
...@@ -106,9 +106,9 @@ treeLoadView = R.createElement elCpt ...@@ -106,9 +106,9 @@ treeLoadView = R.createElement elCpt
} _children = do } _children = do
let fetch _ = getNodeTree session root let fetch _ = getNodeTree session root
-- let paint loaded = loadedTreeView { asyncTasks -- let paint loaded = loadedTreeView { asyncTasks
-- , currentRoute
-- , frontends -- , frontends
-- , handed -- , handed
-- , mCurrentRoute
-- , openNodes -- , openNodes
-- , reload -- , reload
-- , session -- , session
...@@ -117,9 +117,9 @@ treeLoadView = R.createElement elCpt ...@@ -117,9 +117,9 @@ treeLoadView = R.createElement elCpt
-- } [] -- } []
let paint loaded = loadedTreeViewFirstLevel { appReload let paint loaded = loadedTreeViewFirstLevel { appReload
, asyncTasks , asyncTasks
, currentRoute
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload , reload
, session , session
...@@ -151,9 +151,9 @@ type TreeViewProps = ( ...@@ -151,9 +151,9 @@ type TreeViewProps = (
-- cpt { appReload -- cpt { appReload
-- , asyncTasks -- , asyncTasks
-- , currentRoute
-- , frontends -- , frontends
-- , handed -- , handed
-- , mCurrentRoute
-- , openNodes -- , openNodes
-- , reload -- , reload
-- , session -- , session
...@@ -164,9 +164,9 @@ type TreeViewProps = ( ...@@ -164,9 +164,9 @@ type TreeViewProps = (
-- H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" } [ -- H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" } [
-- toHtml { appReload -- toHtml { appReload
-- , asyncTasks -- , asyncTasks
-- , currentRoute
-- , frontends -- , frontends
-- , handed -- , handed
-- , mCurrentRoute
-- , openNodes -- , openNodes
-- , reload -- , reload
-- , session -- , session
...@@ -184,9 +184,9 @@ loadedTreeViewFirstLevel = R.createElement elCpt ...@@ -184,9 +184,9 @@ loadedTreeViewFirstLevel = R.createElement elCpt
cpt { appReload cpt { appReload
, asyncTasks , asyncTasks
, currentRoute
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload , reload
, session , session
...@@ -197,9 +197,9 @@ loadedTreeViewFirstLevel = R.createElement elCpt ...@@ -197,9 +197,9 @@ loadedTreeViewFirstLevel = R.createElement elCpt
H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" } [ H.div { className: if handed == GT.RightHanded then "righthanded" else "lefthanded" } [
toHtmlFirstLevel { appReload toHtmlFirstLevel { appReload
, asyncTasks , asyncTasks
, currentRoute
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload , reload
, reloadTree: reload , reloadTree: reload
...@@ -229,9 +229,9 @@ type ToHtmlProps = ( ...@@ -229,9 +229,9 @@ type ToHtmlProps = (
-- cpt p@{ appReload -- cpt p@{ appReload
-- , asyncTasks -- , asyncTasks
-- , currentRoute
-- , frontends -- , frontends
-- , handed -- , handed
-- , mCurrentRoute
-- , openNodes -- , openNodes
-- , reload: reload@(_ /\ setReload) -- , reload: reload@(_ /\ setReload)
-- , session -- , session
...@@ -264,13 +264,13 @@ type ToHtmlProps = ( ...@@ -264,13 +264,13 @@ type ToHtmlProps = (
-- pure $ H.li { className: if A.null ary then "no-children" else "with-children" } -- pure $ H.li { className: if A.null ary then "no-children" else "with-children" }
-- [ nodeSpan { appReload -- [ nodeSpan { appReload
-- , asyncTasks -- , asyncTasks
-- , currentRoute
-- , dispatch: pAction -- , dispatch: pAction
-- , folderOpen -- , folderOpen
-- , frontends -- , frontends
-- , handed -- , handed
-- , id -- , id
-- , isLeaf: A.null ary -- , isLeaf: A.null ary
-- , mCurrentRoute
-- , name -- , name
-- , nodeType -- , nodeType
-- , session -- , session
...@@ -301,9 +301,9 @@ toHtmlFirstLevel = R.createElement elCpt ...@@ -301,9 +301,9 @@ toHtmlFirstLevel = R.createElement elCpt
cpt p@{ appReload cpt p@{ appReload
, asyncTasks , asyncTasks
, currentRoute
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload: reload@(_ /\ setReload) , reload: reload@(_ /\ setReload)
, reloadTree , reloadTree
...@@ -330,13 +330,13 @@ toHtmlFirstLevel = R.createElement elCpt ...@@ -330,13 +330,13 @@ toHtmlFirstLevel = R.createElement elCpt
pure $ H.li { className: if A.null ary then "no-children" else "with-children" } $ pure $ H.li { className: if A.null ary then "no-children" else "with-children" } $
[ nodeSpan { appReload [ nodeSpan { appReload
, asyncTasks , asyncTasks
, currentRoute
, dispatch: pAction , dispatch: pAction
, folderOpen , folderOpen
, frontends , frontends
, handed , handed
, id , id
, isLeaf: A.null ary , isLeaf: A.null ary
, mCurrentRoute
, name , name
, nodeType , nodeType
, session , session
...@@ -425,11 +425,11 @@ childNodeFirstLevel = R.createElement elCpt ...@@ -425,11 +425,11 @@ childNodeFirstLevel = R.createElement elCpt
cpt props@{ appReload cpt props@{ appReload
, asyncTasks , asyncTasks
, currentRoute
, folderOpen , folderOpen
, id , id
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload , reload
, reloadTree , reloadTree
...@@ -439,10 +439,10 @@ childNodeFirstLevel = R.createElement elCpt ...@@ -439,10 +439,10 @@ childNodeFirstLevel = R.createElement elCpt
let fetch _ = getNodeTreeFirstLevel session id let fetch _ = getNodeTreeFirstLevel session id
let paint loaded = childNodeFirstLevelPaint { appReload let paint loaded = childNodeFirstLevelPaint { appReload
, asyncTasks , asyncTasks
, currentRoute
, folderOpen , folderOpen
, frontends , frontends
, handed , handed
, mCurrentRoute
, openNodes , openNodes
, reload: cptReload , reload: cptReload
, reloadTree , reloadTree
......
...@@ -44,11 +44,11 @@ thisModule = "Gargantext.Components.Forest.Tree.Node" ...@@ -44,11 +44,11 @@ thisModule = "Gargantext.Components.Forest.Tree.Node"
type NodeMainSpanProps = ( type NodeMainSpanProps = (
appReload :: GT.ReloadS appReload :: GT.ReloadS
, asyncTasks :: GAT.Reductor , asyncTasks :: GAT.Reductor
, currentRoute :: Routes.AppRoute
, folderOpen :: R.State Boolean , folderOpen :: R.State Boolean
, frontends :: Frontends , frontends :: Frontends
, id :: ID , id :: ID
, isLeaf :: IsLeaf , isLeaf :: IsLeaf
, mCurrentRoute :: Maybe Routes.AppRoute
, name :: Name , name :: Name
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
, setPopoverRef :: R.Ref (Maybe (Boolean -> Effect Unit)) , setPopoverRef :: R.Ref (Maybe (Boolean -> Effect Unit))
...@@ -59,28 +59,28 @@ type IsLeaf = Boolean ...@@ -59,28 +59,28 @@ type IsLeaf = Boolean
nodeSpan :: R2.Component NodeMainSpanProps nodeSpan :: R2.Component NodeMainSpanProps
nodeSpan = R.createElement nodeSpanCpt nodeSpan = R.createElement nodeSpanCpt
nodeSpanCpt :: R.Component NodeMainSpanProps
nodeSpanCpt = R.hooksComponentWithModule thisModule "nodeSpan" cpt
where where
nodeSpanCpt :: R.Component NodeMainSpanProps
nodeSpanCpt = R.hooksComponentWithModule thisModule "nodeSpan" cpt
cpt props children = do cpt props children = do
pure $ H.div {} ([ nodeMainSpan props [] ] <> children) pure $ H.div {} ([ nodeMainSpan props [] ] <> children)
nodeMainSpan :: R2.Component NodeMainSpanProps nodeMainSpan :: R2.Component NodeMainSpanProps
nodeMainSpan = R.createElement nodeMainSpanCpt nodeMainSpan = R.createElement nodeMainSpanCpt
nodeMainSpanCpt :: R.Component NodeMainSpanProps
nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
where where
nodeMainSpanCpt :: R.Component NodeMainSpanProps
nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
cpt props@{ appReload cpt props@{ appReload
, asyncTasks: (asyncTasks /\ dispatchAsyncTasks) , asyncTasks: (asyncTasks /\ dispatchAsyncTasks)
, currentRoute
, dispatch , dispatch
, folderOpen , folderOpen
, frontends , frontends
, handed , handed
, id , id
, isLeaf , isLeaf
, mCurrentRoute
, name , name
, nodeType , nodeType
, session , session
...@@ -100,7 +100,7 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt ...@@ -100,7 +100,7 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
GT.LeftHanded -> reverse GT.LeftHanded -> reverse
GT.RightHanded -> identity GT.RightHanded -> identity
let isSelected = mCurrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id let isSelected = Just currentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id
pure $ H.span (dropProps droppedFile isDragOver) pure $ H.span (dropProps droppedFile isDragOver)
$ ordering $ ordering
...@@ -142,8 +142,8 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt ...@@ -142,8 +142,8 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
, nodeActions { id , nodeActions { id
, nodeType , nodeType
, refreshTree: const $ dispatch RefreshTree
, session , session
, triggerRefresh: const $ dispatch RefreshTree
} }
...@@ -242,33 +242,33 @@ fldr nt open = if open ...@@ -242,33 +242,33 @@ fldr nt open = if open
type NodeActionsProps = type NodeActionsProps =
( id :: ID ( id :: ID
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
, refreshTree :: Unit -> Aff Unit
, session :: Session , session :: Session
, triggerRefresh :: Unit -> Aff Unit
) )
nodeActions :: Record NodeActionsProps -> R.Element nodeActions :: Record NodeActionsProps -> R.Element
nodeActions p = R.createElement nodeActionsCpt p [] nodeActions p = R.createElement nodeActionsCpt p []
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt
where where
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt
cpt { id cpt { id
, nodeType: GT.Graph , nodeType: GT.Graph
, refreshTree
, session , session
, triggerRefresh
} _ = do } _ = do
useLoader id (graphVersions session) $ \gv -> useLoader id (graphVersions session) $ \gv ->
nodeActionsGraph { id nodeActionsGraph { id
, graphVersions: gv , graphVersions: gv
, session , session
, triggerRefresh: triggerRefresh refreshTree , triggerRefresh
} }
cpt { id cpt { id
, nodeType: GT.NodeList , nodeType: GT.NodeList
, refreshTree
, session , session
, triggerRefresh
} _ = do } _ = do
useLoader { nodeId: id, session } loadCorpusWithChild $ useLoader { nodeId: id, session } loadCorpusWithChild $
\{ corpusId } -> \{ corpusId } ->
...@@ -276,13 +276,12 @@ nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt ...@@ -276,13 +276,12 @@ nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt
, nodeId: corpusId , nodeId: corpusId
, nodeType: GT.TabNgramType GT.CTabTerms , nodeType: GT.TabNgramType GT.CTabTerms
, session , session
, triggerRefresh: triggerRefresh refreshTree , triggerRefresh
} }
cpt _ _ = do cpt _ _ = do
pure $ H.div {} [] pure $ H.div {} []
graphVersions session graphId = GraphAPI.graphVersions { graphId, session } graphVersions session graphId = GraphAPI.graphVersions { graphId, session }
triggerRefresh refreshTree = refreshTree
-- END nodeActions -- END nodeActions
...@@ -3,17 +3,20 @@ module Gargantext.Components.Forest.Tree.Node.Action.Search where ...@@ -3,17 +3,20 @@ module Gargantext.Components.Forest.Tree.Node.Action.Search where
import Data.Maybe (Maybe) import Data.Maybe (Maybe)
import Effect (Effect) import Effect (Effect)
import Effect.Aff (Aff, launchAff) import Effect.Aff (Aff, launchAff)
import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.Components.Forest.Tree.Node.Action (Action(..)) import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup) import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup)
import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar (searchBar) import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar (searchBar)
import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField (defaultSearch) import Gargantext.Components.Forest.Tree.Node.Action.Search.SearchField (defaultSearch)
import Gargantext.Components.Lang (allLangs) import Gargantext.Components.Lang (allLangs)
import Gargantext.Prelude (Unit, bind, pure, unit, ($), (<>))
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (ID) import Gargantext.Types (ID)
import Gargantext.Types as GT import Gargantext.Types as GT
import Reactix as R
import Reactix.DOM.HTML as H
-- | Action : Search -- | Action : Search
...@@ -24,7 +27,7 @@ actionSearch :: Session ...@@ -24,7 +27,7 @@ actionSearch :: Session
-> R.Hooks R.Element -> R.Hooks R.Element
actionSearch session id dispatch nodePopup = do actionSearch session id dispatch nodePopup = do
search <- R.useState' $ defaultSearch { node_id = id } search <- R.useState' $ defaultSearch { node_id = id }
pure $ R.fragment [ H.p {"style": {"margin" :"10px"}} pure $ R.fragment [ H.p { className: "action-search" }
[ H.text $ "Search and create a private " [ H.text $ "Search and create a private "
<> "corpus with the search query as corpus name." ] <> "corpus with the search query as corpus name." ]
, searchBar { langs: allLangs , searchBar { langs: allLangs
...@@ -41,6 +44,7 @@ actionSearch session id dispatch nodePopup = do ...@@ -41,6 +44,7 @@ actionSearch session id dispatch nodePopup = do
searchOn dispatch' p task = do searchOn dispatch' p task = do
_ <- launchAff $ dispatch' (DoSearch task) _ <- launchAff $ dispatch' (DoSearch task)
-- close popup -- close popup
_ <- launchAff $ dispatch' ClosePopover
-- TODO -- TODO
--snd p $ const Nothing --snd p $ const Nothing
pure unit pure unit
module Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar module Gargantext.Components.Forest.Tree.Node.Action.Search.SearchBar
( Props, searchBar, searchBarCpt ( Props
, searchBar
) where ) where
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
...@@ -25,13 +26,13 @@ type Props = ( langs :: Array Lang ...@@ -25,13 +26,13 @@ type Props = ( langs :: Array Lang
searchBar :: Record Props -> R.Element searchBar :: Record Props -> R.Element
searchBar props = R.createElement searchBarCpt props [] searchBar props = R.createElement searchBarCpt props []
searchBarCpt :: R.Component Props
searchBarCpt = R.hooksComponentWithModule thisModule "searchBar" cpt
where where
searchBarCpt :: R.Component Props
searchBarCpt = R.hooksComponentWithModule thisModule "searchBar" cpt
cpt {langs, onSearch, search: search@(s /\ _), session} _ = do cpt {langs, onSearch, search: search@(s /\ _), session} _ = do
--onSearchChange session s --onSearchChange session s
pure $ H.div {"style": {"margin" :"10px"}} pure $ H.div { className: "search-bar" }
[ searchField { databases:allDatabases [ searchField { databases:allDatabases
, langs , langs
, onSearch , onSearch
......
...@@ -45,12 +45,12 @@ type Props = ...@@ -45,12 +45,12 @@ type Props =
searchField :: Record Props -> R.Element searchField :: Record Props -> R.Element
searchField p = R.createElement searchFieldComponent p [] searchField p = R.createElement searchFieldComponent p []
--searchFieldComponent :: R.Memo Props
--searchFieldComponent = R.memo (R.hooksComponentWithModule thisModule "searchField" cpt) eqProps
searchFieldComponent :: R.Component Props
searchFieldComponent = R.hooksComponentWithModule thisModule "searchField" cpt
where where
--searchFieldComponent :: R.Memo Props
--searchFieldComponent = R.memo (R.hooksComponentWithModule thisModule "searchField" cpt) eqProps
searchFieldComponent :: R.Component Props
searchFieldComponent = R.hooksComponentWithModule thisModule "searchField" cpt
cpt props@{onSearch, search: search@(s /\ _)} _ = do cpt props@{onSearch, search: search@(s /\ _)} _ = do
iframeRef <- R.useRef null iframeRef <- R.useRef null
let params = let params =
...@@ -361,15 +361,15 @@ type SubmitButtonProps = ...@@ -361,15 +361,15 @@ type SubmitButtonProps =
submitButton :: Record SubmitButtonProps -> R.Element submitButton :: Record SubmitButtonProps -> R.Element
submitButton p = R.createElement submitButtonComponent p [] submitButton p = R.createElement submitButtonComponent p []
submitButtonComponent :: R.Component SubmitButtonProps
submitButtonComponent = R.hooksComponentWithModule thisModule "submitButton" cpt
where where
submitButtonComponent :: R.Component SubmitButtonProps
submitButtonComponent = R.hooksComponentWithModule thisModule "submitButton" cpt
cpt {onSearch, search: (mySearch /\ _), session} _ = cpt {onSearch, search: (mySearch /\ _), session} _ =
pure $ pure $
H.button { className: "btn btn-primary" H.button { className: "btn btn-primary"
, "type" : "button" , "type" : "button"
, on : {click: doSearch onSearch session mySearch} , on : { click: doSearch onSearch session mySearch }
, style : { width: "100%" } , style : { width: "100%" }
} [ H.text "Launch Search" ] } [ H.text "Launch Search" ]
......
...@@ -48,10 +48,10 @@ type CommonProps = ...@@ -48,10 +48,10 @@ type CommonProps =
nodePopupView :: Record NodePopupProps -> R.Element nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView p = R.createElement nodePopupCpt p [] nodePopupView p = R.createElement nodePopupCpt p []
nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R.hooksComponentWithModule thisModule "nodePopupView" cpt
where where
nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R.hooksComponentWithModule thisModule "nodePopupView" cpt
cpt p _ = do cpt p _ = do
isOpen <- R.useState' false isOpen <- R.useState' false
......
...@@ -44,10 +44,10 @@ thisModule = "Gargantext.Components.GraphExplorer" ...@@ -44,10 +44,10 @@ thisModule = "Gargantext.Components.GraphExplorer"
type LayoutProps = ( type LayoutProps = (
asyncTasksRef :: R.Ref (Maybe GAT.Reductor) asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend) , backend :: R.State (Maybe Backend)
, currentRoute :: AppRoute
, frontends :: Frontends , frontends :: Frontends
, graphId :: GET.GraphId , graphId :: GET.GraphId
, handed :: Types.Handed , handed :: Types.Handed
, mCurrentRoute :: AppRoute
, session :: Session , session :: Session
, sessions :: Sessions , sessions :: Sessions
, showLogin :: R.State Boolean , showLogin :: R.State Boolean
...@@ -94,13 +94,13 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt ...@@ -94,13 +94,13 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
where where
cpt props@{ asyncTasksRef cpt props@{ asyncTasksRef
, backend , backend
, currentRoute
, frontends , frontends
, graph , graph
, graphId , graphId
, graphVersion , graphVersion
, handed , handed
, hyperdataGraph , hyperdataGraph
, mCurrentRoute
, mMetaData , mMetaData
, session , session
, sessions , sessions
...@@ -161,9 +161,9 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt ...@@ -161,9 +161,9 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
, R2.row $ mainLayout handed $ , R2.row $ mainLayout handed $
tree { asyncTasksRef tree { asyncTasksRef
, backend , backend
, currentRoute
, frontends , frontends
, handed , handed
, mCurrentRoute
, reload: treeReload , reload: treeReload
, sessions , sessions
, show: fst controls.showTree , show: fst controls.showTree
...@@ -219,14 +219,14 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt ...@@ -219,14 +219,14 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
tree :: Record TreeProps -> R.Element tree :: Record TreeProps -> R.Element
tree { show: false } = RH.div { id: "tree" } [] tree { show: false } = RH.div { id: "tree" } []
tree { asyncTasksRef, backend, frontends, handed, mCurrentRoute: route, reload, sessions, showLogin, treeReloadRef } = tree { asyncTasksRef, backend, frontends, handed, currentRoute, reload, sessions, showLogin, treeReloadRef } =
RH.div {className: "col-md-2 graph-tree"} [ RH.div {className: "col-md-2 graph-tree"} [
forest { appReload: reload forest { appReload: reload
, asyncTasksRef , asyncTasksRef
, backend , backend
, currentRoute
, frontends , frontends
, handed , handed
, route
, sessions , sessions
, showLogin , showLogin
, treeReloadRef } [] , treeReloadRef } []
...@@ -243,9 +243,9 @@ type TreeProps = ...@@ -243,9 +243,9 @@ type TreeProps =
( (
asyncTasksRef :: R.Ref (Maybe GAT.Reductor) asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, backend :: R.State (Maybe Backend) , backend :: R.State (Maybe Backend)
, currentRoute :: AppRoute
, frontends :: Frontends , frontends :: Frontends
, handed :: Types.Handed , handed :: Types.Handed
, mCurrentRoute :: AppRoute
, reload :: Types.ReloadS , reload :: Types.ReloadS
, sessions :: Sessions , sessions :: Sessions
, show :: Boolean , show :: Boolean
......
...@@ -40,5 +40,11 @@ ...@@ -40,5 +40,11 @@
.trash .trash
text-decoration: line-through text-decoration: line-through
.action-search
margin: 10px
.context-menu .context-menu
position: fixed position: fixed
.search-bar
margin: 10px
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