Commit b689fd11 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into 301-dev-visio-integration

parents a60f6f9e 04f748e9
...@@ -9945,5 +9945,8 @@ h3 { ...@@ -9945,5 +9945,8 @@ h3 {
border-color: #dee2e6; border-color: #dee2e6;
} }
} }
.with-icon-font {
font-family: ForkAwesome, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
/*# sourceMappingURL=bootstrap-default.css.map */ /*# sourceMappingURL=bootstrap-default.css.map */
...@@ -535,6 +535,11 @@ li .leaf:hover a.settings { ...@@ -535,6 +535,11 @@ li .leaf:hover a.settings {
color: black; color: black;
} }
.forest-tree-node-action-move {
max-height: 50vh;
overflow-y: scroll;
}
.forest-layout { .forest-layout {
background-color: #fff; background-color: #fff;
position: fixed; position: fixed;
......
{"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","../../src/sass/_annotation.sass","../../src/sass/_folder_view.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;EACA;EACA;;;AAEF;AAkCE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAxCA;EAZA;EACA;EAEA;EAWE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AAGA;EACE;EACA;;AACN;EACE;;AACF;EACE;;AAEF;EApCA;EACA;EAEA;EAmCE;EACA;;AACF;EACE;;AACF;EACE;;AAWF;EAEE;EAEA;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AAEJ;EACE;;AAEA;EACE;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACtFJ;EAEE;;;AAQF;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;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;;;AAGF;EACE;;;AAEJ;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;ACzKF;EACE;;;AAGA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGA;EACE;;AACF;EACE;;AAEJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAGN;EACE;;;AAIA;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;;;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;;;AAGN;EACE;;AACF;EACE;;AACF;EACE;;;AAEJ;EACE;EACA;EACA;EACA;EACA;;;AAEA;EACE;;;AAEF;EACE;;;AC9JA;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;EApCR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA0CM;EACE;EACA;EACA;EACA;EACA;EA5CR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAkDE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;;ACtFZ;EACE;;;AAEA;EAEE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAER;EAEE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAEV;EACE;;AACA;EACE;;AACF;EACE;EACA;EACA;;;AAIA;EACE;;AACA;EACE;EACA;;AACF;EACE;;AACA;EACE;;AACJ;EACE;;;AAER;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;AAGI;EACE;;AACF;EACE;;;AAEN;EACE;EACA;EACA;;;AAIA;EACE;;AACF;EACE;;;AAEJ;EACE;;AACA;EACE;;;AAEJ;EACE;EACA;;;ACtGF;EACE;AACA;EACA;;AAEA;EACE;EACA;;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;;;AAGN;EACE;;;ACxBJ;EACE;;AAEA;EANE;EACA;;AAQF;EAbE;EACA;;AAeF;EAhBE;EACA;;AAkBF;EAnBE;EACA;;AAqBF;EA1BE;EACA,kBANyB;;AAkC3B;EA7BE;EACA,kBAPqB;;AAsCvB;EAhCE;EACA,kBAJoB;;;AAuCtB;EApCE;EACA,kBANyB;;AA4C3B;EAvCE;EACA,kBAPqB;;AAgDvB;EA1CE;EACA,kBAJoB;;;ACRxB;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;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","../../src/sass/_annotation.sass","../../src/sass/_folder_view.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;EACA;EACA;;;AAEF;AAkCE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAxCA;EAZA;EACA;EAEA;EAWE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AAGA;EACE;EACA;;AACN;EACE;;AACF;EACE;;AAEF;EApCA;EACA;EAEA;EAmCE;EACA;;AACF;EACE;;AACF;EACE;;AAWF;EAEE;EAEA;EACA;EACA;EAEA;EACA;EACA;;AAEA;EACE;;AAEJ;EACE;;AAEA;EACE;;AAEJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;ACtFJ;EAEE;;;AAQF;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;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;;;AAGF;EACE;;;AAEJ;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;ACzKF;EACE;;;AAGA;EACE;EACA;EACA;;AAEA;EACE;EACA;;AAGA;EACE;;AACF;EACE;;AAEJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAGN;EACE;;;AAIA;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;;;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;;;AAGN;EACE;;AACF;EACE;;AACF;EACE;;;AAEJ;EAEE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEA;EACE;;;AAEF;EACE;;;ACnKA;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;EApCR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA0CM;EACE;EACA;EACA;EACA;EACA;EA5CR;EACA;EACA;EACA;EACA;EACA;EACA;EAlBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAkDE;EACE;EACA;EACA;EACA;EACA;EACA;;AACF;EACE;EACA;EACA;;AACA;EACE;EACA;;AACF;EACE;EACA;;AACF;EACE;EACA;;AAGE;EACE;;AAEF;EACE;;;ACtFZ;EACE;;;AAEA;EAEE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAER;EAEE;EACA;EACA;EACA;EACA;EACA;;AACA;EACE;;AAGE;EACE;EACA;;AAEF;EACE;EACA;;;AAEV;EACE;;AACA;EACE;;AACF;EACE;EACA;EACA;;;AAIA;EACE;;AACA;EACE;EACA;;AACF;EACE;;AACA;EACE;;AACJ;EACE;;;AAER;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;AAGI;EACE;;AACF;EACE;;;AAEN;EACE;EACA;EACA;;;AAIA;EACE;;AACF;EACE;;;AAEJ;EACE;;AACA;EACE;;;AAEJ;EACE;EACA;;;ACtGF;EACE;AACA;EACA;;AAEA;EACE;EACA;;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;;;AAGN;EACE;;;ACxBJ;EACE;;AAEA;EANE;EACA;;AAQF;EAbE;EACA;;AAeF;EAhBE;EACA;;AAkBF;EAnBE;EACA;;AAqBF;EA1BE;EACA,kBANyB;;AAkC3B;EA7BE;EACA,kBAPqB;;AAsCvB;EAhCE;EACA,kBAJoB;;;AAuCtB;EApCE;EACA,kBANyB;;AA4C3B;EAvCE;EACA,kBAPqB;;AAgDvB;EA1CE;EACA,kBAJoB;;;ACRxB;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA","file":"sass.css"}
\ No newline at end of file \ No newline at end of file
...@@ -9,12 +9,12 @@ import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), setting ...@@ -9,12 +9,12 @@ import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), setting
import Gargantext.Components.Forest.Tree.Node.Tools (prettyNodeType) import Gargantext.Components.Forest.Tree.Node.Tools (prettyNodeType)
import Gargantext.Types (ID, Name) import Gargantext.Types (ID, Name)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils (glyphicon) import Gargantext.Utils.Glyphicon (glyphicon)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.FolderView.Box" here = R2.here "Gargantext.Components.FolderView.Box"
......
...@@ -13,14 +13,16 @@ import Toestand as T ...@@ -13,14 +13,16 @@ import Toestand as T
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..)) import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, formChoiceSafe, panel) import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox)
import Gargantext.Components.Forest.Tree.Node.Tools (formChoiceSafe, panel, submitButton)
import Gargantext.Components.InputWithEnter (inputWithEnter) import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.Lang (Lang(..), translate)
import Gargantext.Routes as GR import Gargantext.Routes as GR
import Gargantext.Sessions (Session, post) import Gargantext.Sessions (Session, post)
import Gargantext.Types as GT import Gargantext.Types (NodeType(..), charCodeIcon)
import Gargantext.Types (NodeType(..)) import Gargantext.Types as GT
import Gargantext.Utils (nbsp)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
here :: R2.Here here :: R2.Here
...@@ -75,12 +77,18 @@ addNodeViewCpt = here.component "addNodeView" cpt where ...@@ -75,12 +77,18 @@ addNodeViewCpt = here.component "addNodeView" cpt where
nodeType' <- T.useLive T.unequal nodeType nodeType' <- T.useLive T.unequal nodeType
let let
print nt = charCodeIcon nt true
-- as we are printing within an HTML text node,
-- margins will directly rely on content text spacing
<> nbsp 4
<> translate EN nt -- @TODO "EN" assumption
SettingsBox {edit} = settingsBox nodeType' SettingsBox {edit} = settingsBox nodeType'
setNodeType' nt = do setNodeType' nt = do
T.write_ (GT.prettyNodeType nt) nodeName T.write_ (GT.prettyNodeType nt) nodeName
T.write_ nt nodeType T.write_ nt nodeType
(maybeChoose /\ nt') = if length nodeTypes > 1 (maybeChoose /\ nt') = if length nodeTypes > 1
then ([ formChoiceSafe nodeTypes Error setNodeType' ] /\ nodeType') then ([ formChoiceSafe nodeTypes Error setNodeType' print ] /\ nodeType')
else ([H.div {} [H.text $ "Creating a node of type " else ([H.div {} [H.text $ "Creating a node of type "
<> show defaultNt <> show defaultNt
<> " with name:" <> " with name:"
...@@ -113,4 +121,3 @@ showConfig FolderPrivate = H.div {} [H.text "This folder will be private only"] ...@@ -113,4 +121,3 @@ showConfig FolderPrivate = H.div {} [H.text "This folder will be private only"]
showConfig FolderShared = H.div {} [H.text "This folder will be shared"] showConfig FolderShared = H.div {} [H.text "This folder will be shared"]
showConfig FolderPublic = H.div {} [H.text "This folder will be public"] showConfig FolderPublic = H.div {} [H.text "This folder will be public"]
showConfig nt = H.div {} [H.h4 {} [H.text $ "Config of " <> show nt ]] showConfig nt = H.div {} [H.h4 {} [H.text $ "Config of " <> show nt ]]
...@@ -38,7 +38,12 @@ moveNodeCpt = here.component "moveNode" cpt ...@@ -38,7 +38,12 @@ moveNodeCpt = here.component "moveNode" cpt
Nothing -> H.div {} [] Nothing -> H.div {} []
_ -> H.div {} [] _ -> H.div {} []
pure $ panel [ subTreeView { action pure $
H.div
{ className: "forest-tree-node-action-move" }
[
panel [ subTreeView { action
, dispatch , dispatch
, handed , handed
, id , id
...@@ -47,3 +52,4 @@ moveNodeCpt = here.component "moveNode" cpt ...@@ -47,3 +52,4 @@ moveNodeCpt = here.component "moveNode" cpt
, subTreeParams , subTreeParams
} [] } []
] button ] button
]
...@@ -52,7 +52,7 @@ updateDashboardCpt = here.component "updateDashboard" cpt where ...@@ -52,7 +52,7 @@ updateDashboardCpt = here.component "updateDashboard" cpt where
methodBoard' <- T.useLive T.unequal methodBoard methodBoard' <- T.useLive T.unequal methodBoard
pure $ panel [ -- H.text "Update with" pure $ panel [ -- H.text "Update with"
formChoiceSafe [All, Sources, Authors, Institutes, Ngrams] All (\val -> T.write_ val methodBoard) formChoiceSafe [All, Sources, Authors, Institutes, Ngrams] All (\val -> T.write_ val methodBoard) show
] ]
(submitButton (UpdateNode $ UpdateNodeParamsBoard { methodBoard: methodBoard' }) dispatch) (submitButton (UpdateNode $ UpdateNodeParamsBoard { methodBoard: methodBoard' }) dispatch)
...@@ -65,7 +65,7 @@ updateGraphCpt = here.component "updateGraph" cpt where ...@@ -65,7 +65,7 @@ updateGraphCpt = here.component "updateGraph" cpt where
methodGraph' <- T.useLive T.unequal methodGraph methodGraph' <- T.useLive T.unequal methodGraph
pure $ panel [ -- H.text "Update with" pure $ panel [ -- H.text "Update with"
formChoiceSafe [Order1, Order2] Order1 (\val -> T.write_ val methodGraph) formChoiceSafe [Order1, Order2] Order1 (\val -> T.write_ val methodGraph) show
] ]
(submitButton (UpdateNode $ UpdateNodeParamsGraph { methodGraph: methodGraph' }) dispatch) (submitButton (UpdateNode $ UpdateNodeParamsGraph { methodGraph: methodGraph' }) dispatch)
...@@ -78,7 +78,7 @@ updateNodeListCpt = here.component "updateNodeList" cpt where ...@@ -78,7 +78,7 @@ updateNodeListCpt = here.component "updateNodeList" cpt where
methodList' <- T.useLive T.unequal methodList methodList' <- T.useLive T.unequal methodList
pure $ panel [ -- H.text "Update with" pure $ panel [ -- H.text "Update with"
formChoiceSafe [Basic, Advanced, WithModel] Basic (\val -> T.write_ val methodList) formChoiceSafe [Basic, Advanced, WithModel] Basic (\val -> T.write_ val methodList) show
] ]
(submitButton (UpdateNode $ UpdateNodeParamsList { methodList: methodList' }) dispatch) (submitButton (UpdateNode $ UpdateNodeParamsList { methodList: methodList' }) dispatch)
...@@ -91,7 +91,7 @@ updateTextsCpt = here.component "updateTexts" cpt where ...@@ -91,7 +91,7 @@ updateTextsCpt = here.component "updateTexts" cpt where
methodTexts' <- T.useLive T.unequal methodTexts methodTexts' <- T.useLive T.unequal methodTexts
pure $ panel [ -- H.text "Update with" pure $ panel [ -- H.text "Update with"
formChoiceSafe [NewNgrams, NewTexts, Both] NewNgrams (\val -> T.write_ val methodTexts) formChoiceSafe [NewNgrams, NewTexts, Both] NewNgrams (\val -> T.write_ val methodTexts) show
] ]
(submitButton (UpdateNode $ UpdateNodeParamsTexts { methodTexts: methodTexts' }) dispatch) (submitButton (UpdateNode $ UpdateNodeParamsTexts { methodTexts: methodTexts' }) dispatch)
......
...@@ -80,7 +80,7 @@ instance Eq DroppedFile where ...@@ -80,7 +80,7 @@ instance Eq DroppedFile where
type FileHash = String type FileHash = String
type UploadFile = type UploadFile =
{ blob :: UploadFileBlob { blob :: UploadFileBlob
, name :: String , name :: String
} }
...@@ -120,12 +120,14 @@ uploadFileViewCpt = here.component "uploadFileView" cpt ...@@ -120,12 +120,14 @@ uploadFileViewCpt = here.component "uploadFileView" cpt
, WOS , WOS
, PresseRIS , PresseRIS
, Arbitrary , Arbitrary
] CSV setFileType' ] CSV setFileType' show
] ]
] ]
, R2.row , R2.row
[ H.div {className:"col-6 flex-space-around"} [ H.div {className:"col-6 flex-space-around"}
[ formChoiceSafe [EN, FR, No_extraction, Universal] EN setLang' ] [ formChoiceSafe [EN, FR, No_extraction, Universal] EN setLang'
show
]
] ]
] ]
...@@ -326,7 +328,7 @@ uploadFile session nodeType id fileType {mName, blob: UploadFileBlob blob} = do ...@@ -326,7 +328,7 @@ uploadFile session nodeType id fileType {mName, blob: UploadFileBlob blob} = do
Corpus -> GR.NodeAPI nodeType (Just id) $ GT.asyncTaskTypePath GT.Form Corpus -> GR.NodeAPI nodeType (Just id) $ GT.asyncTaskTypePath GT.Form
Annuaire -> GR.NodeAPI nodeType (Just id) "annuaire" Annuaire -> GR.NodeAPI nodeType (Just id) "annuaire"
_ -> GR.NodeAPI nodeType (Just id) "" _ -> GR.NodeAPI nodeType (Just id) ""
bodyParams c = [ Tuple "_wf_data" (Just c) bodyParams c = [ Tuple "_wf_data" (Just c)
, Tuple "_wf_filetype" (Just $ show fileType) , Tuple "_wf_filetype" (Just $ show fileType)
, Tuple "_wf_name" mName , Tuple "_wf_name" mName
......
...@@ -26,7 +26,7 @@ import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT, p ...@@ -26,7 +26,7 @@ import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT, p
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (Name, ID, prettyNodeType) import Gargantext.Types (Name, ID, prettyNodeType)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils (glyphicon, glyphiconActive) import Gargantext.Utils.Glyphicon (glyphicon, glyphiconActive)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
......
...@@ -2,7 +2,7 @@ module Gargantext.Components.Forest.Tree.Node.Tools where ...@@ -2,7 +2,7 @@ module Gargantext.Components.Forest.Tree.Node.Tools where
import Gargantext.Prelude import Gargantext.Prelude
( class Ord, class Read, class Show, Unit ( class Ord, class Read, class Show, Unit
, bind, const, discard, map, not, pure, read, show, when , bind, const, discard, map, not, pure, read, show, when, mempty
, ($), (<), (<<<), (<>), (<$>), (<*>) ) , ($), (<), (<<<), (<>), (<$>), (<*>) )
import Data.Maybe (fromMaybe, Maybe(..)) import Data.Maybe (fromMaybe, Maybe(..))
import Data.Nullable (null) import Data.Nullable (null)
...@@ -10,8 +10,6 @@ import Data.Set (Set) ...@@ -10,8 +10,6 @@ import Data.Set (Set)
import Data.Set as Set import Data.Set as Set
import Data.String as S import Data.String as S
import Data.String.CodeUnits as DSCU import Data.String.CodeUnits as DSCU
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import Effect (Effect) import Effect (Effect)
import Effect.Aff (Aff, launchAff, launchAff_) import Effect.Aff (Aff, launchAff, launchAff_)
import Reactix as R import Reactix as R
...@@ -21,12 +19,12 @@ import Toestand as T ...@@ -21,12 +19,12 @@ import Toestand as T
import Gargantext.Components.Forest.Tree.Node.Action (Action, icon, text) import Gargantext.Components.Forest.Tree.Node.Action (Action, icon, text)
import Gargantext.Components.InputWithEnter (inputWithEnter) import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Ends (Frontends, url) import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Sessions (Session, sessionId) import Gargantext.Sessions (Session, sessionId)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils (glyphicon, toggleSet) import Gargantext.Utils (toggleSet)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Glyphicon (glyphicon)
import Gargantext.Utils.ReactTooltip as ReactTooltip import Gargantext.Utils.ReactTooltip as ReactTooltip
import Gargantext.Utils.Reactix as R2
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.Forest.Tree.Node.Tools" here = R2.here "Gargantext.Components.Forest.Tree.Node.Tools"
...@@ -103,7 +101,7 @@ type DefaultText = String ...@@ -103,7 +101,7 @@ type DefaultText = String
formEdit :: forall prev next formEdit :: forall prev next
. DefaultText -> ((prev -> String) -> Effect next) -> R.Element . DefaultText -> ((prev -> String) -> Effect next) -> R.Element
formEdit defaultValue setter = formEdit defaultValue setter =
H.div { className: "form-group" } H.div { className: "form-group" }
[ H.input { defaultValue, type: "text", on: { input } [ H.input { defaultValue, type: "text", on: { input }
, placeholder: defaultValue, className: "form-control" } , placeholder: defaultValue, className: "form-control" }
...@@ -111,58 +109,71 @@ formEdit defaultValue setter = ...@@ -111,58 +109,71 @@ formEdit defaultValue setter =
-- | Form Choice input -- | Form Choice input
-- if the list of options is not big enough, a button is used instead -- if the list of options is not big enough, a button is used instead
formChoiceSafe :: forall a b c formChoiceSafe :: forall item m
. Read a . Read item
=> Show a => Show item
=> Array a => Array item
-> a -> item
-> (a -> Effect c) -> (item -> Effect m)
-- -> ((b -> a) -> Effect c) -> (item -> String)
-> R.Element -> R.Element
formChoiceSafe [] _ _ = H.div {} [] formChoiceSafe [] _ _ _ = mempty
formChoiceSafe [n] _ cbk prnt = formButton n cbk prnt
formChoiceSafe [n] _defaultNodeType setNodeType = formChoiceSafe arr def cbk prnt = formChoice arr def cbk prnt
formButton n setNodeType
formChoiceSafe nodeTypes defaultNodeType setNodeType =
formChoice nodeTypes defaultNodeType setNodeType
-- | List Form -- | List Form
formChoice :: forall a b c d formChoice :: forall item m
. Read b . Read item
=> Show d => Show item
=> Array d => Array item
-> b -> item
-> (b -> Effect a) -> (item -> Effect m)
-- -> ((c -> b) -> Effect a) -> (item -> String)
-> R.Element -> R.Element
formChoice nodeTypes defaultNodeType setNodeType = formChoice items def cbk prnt =
H.div { className: "form-group"} H.div { className: "form-group"}
[ R2.select { className: "form-control" [
, on: { change: \e -> setNodeType $ fromMaybe defaultNodeType $ read $ R.unsafeEventValue e } R2.select
} { className: "form-control with-icon-font"
(map (\opt -> H.option {} [ H.text $ show opt ]) nodeTypes) , on: { change }
] } $
map option items
]
where
change e = cbk $ fromMaybe def $ read $ R.unsafeEventValue e
option opt =
H.option { value: show opt }
[ H.text $ prnt opt ]
-- | Button Form -- | Button Form
-- FIXME: currently needs a click from the user (by default, we could avoid such click) -- FIXME: currently needs a click from the user (by default, we could avoid such click)
formButton :: forall a b c formButton :: forall item m
. Show a . item
=> a -> (item -> Effect m)
-> (a -> Effect c) -> (item -> String)
-- -> ((b -> a) -> Effect c) -> R.Element
-> R.Element formButton item cbk prnt =
formButton nodeType setNodeType =
H.div {} [ H.text $ "Confirm the selection of: " <> show nodeType H.div {}
, bouton [
] H.text $ "Confirm the selection of: " <> prnt item
where ,
bouton = H.button { className : "cold-md-5 btn btn-primary center" cta
, type : "button" ]
, title: "Form Button"
, style : { width: "100%" } where
, on: { click: \_ -> setNodeType nodeType } cta =
} [H.text $ "Confirmation"] H.button
{ className : "cold-md-5 btn btn-primary center"
, type : "button"
, title: "Form Button"
, style : { width: "100%" }
, on: { click: \_ -> cbk item }
}
[ H.text "Confirmation" ]
------------------------------------------------------------------------ ------------------------------------------------------------------------
------------------------------------------------------------------------ ------------------------------------------------------------------------
......
...@@ -35,3 +35,7 @@ instance EncodeJson Lang where ...@@ -35,3 +35,7 @@ instance EncodeJson Lang where
-- Language used for the landing page -- Language used for the landing page
data LandingLang = LL_EN | LL_FR data LandingLang = LL_EN | LL_FR
-- @TODO a possible method/class that a real i18n logic could later replace
class Show t <= Translate t where
translate :: Lang -> t -> String
module Gargantext.Types where module Gargantext.Types where
import Data.Array as A import Data.Array as A
import Data.Newtype (class Newtype)
import Data.String as S
import Data.Generic.Rep (class Generic) import Data.Generic.Rep (class Generic)
import Data.Eq.Generic (genericEq) import Data.Eq.Generic (genericEq)
import Data.Int (toNumber)
import Data.Maybe (Maybe(..), fromMaybe, maybe)
import Data.Newtype (class Newtype)
import Data.Ord.Generic (genericCompare) import Data.Ord.Generic (genericCompare)
import Data.Show.Generic (genericShow) import Data.Show.Generic (genericShow)
import Data.Int (toNumber) import Data.String as S
import Data.Maybe (Maybe(..), maybe)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Foreign as F import Foreign as F
import Prim.Row (class Union) import Prim.Row (class Union)
...@@ -19,6 +19,9 @@ import URI.Query (Query) ...@@ -19,6 +19,9 @@ import URI.Query (Query)
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Components.Lang (class Translate, Lang(..))
import Gargantext.Utils.Glyphicon (classNamePrefix, glyphiconToCharCode)
data Handed = LeftHanded | RightHanded data Handed = LeftHanded | RightHanded
switchHanded :: forall a. a -> a -> Handed -> a switchHanded :: forall a. a -> a -> Handed -> a
...@@ -224,62 +227,137 @@ instance Read NodeType where ...@@ -224,62 +227,137 @@ instance Read NodeType where
-- TODO NodePublic read ? -- TODO NodePublic read ?
read _ = Nothing read _ = Nothing
------------------------------------------------------
instance translateNodeType :: Translate NodeType where
translate l n = case l of
FR -> _translateFR n
_ -> _translateEN n
_translateFR :: NodeType -> String
_translateFR = case _ of
Annuaire -> "Annuaire"
Corpus -> "Corpus"
Dashboard -> "Dashboard"
Error -> "Erreur"
Folder -> "Dossier"
FolderPrivate -> "Dossier privé"
FolderPublic -> "Dossier public"
FolderShared -> "Dossier partagé"
Graph -> "Graphe"
Individu -> "Individu"
Node -> "Nœud"
NodeContact -> "Contact"
NodeList -> "Liste"
NodeUser -> "Utilisateur"
Nodes -> "Nœuds"
Phylo -> "Phylo"
Team -> "Équipe"
Texts -> "Textes"
Tree -> "Arbre"
Url_Document -> "Document URL"
--
NodeFile -> "Fichier"
NodeFrameCalc -> "Feuilles de calcul"
NodeFrameNotebook -> "Carnet de notes"
NodeFrameWrite -> "Éditeur de texte"
NodeFrameVisio -> "Visio"
NodePublic n -> _translateFR n
_translateEN :: NodeType -> String
_translateEN = case _ of
Annuaire -> "Annuaire"
Corpus -> "Corpus"
Dashboard -> "Dashboard"
Error -> "Error"
Folder -> "Folder"
FolderPrivate -> "Private folder"
FolderPublic -> "Public folder"
FolderShared -> "Shared folder"
Graph -> "Graph"
Individu -> "Person"
Node -> "Node"
NodeContact -> "Contact"
NodeList -> "List"
NodeUser -> "User"
Nodes -> "Nodes"
Phylo -> "Phylo"
Team -> "Team"
Texts -> "Texts"
Tree -> "Tree"
Url_Document -> "URL document"
--
NodeFile -> "File"
NodeFrameCalc -> "Calc"
NodeFrameNotebook -> "Notebook"
NodeFrameWrite -> "Write"
NodeFrameVisio -> "Visio"
NodePublic n -> _translateEN n
fldr :: NodeType -> Boolean -> String
fldr NodeUser false = "fa fa-user-circle"
fldr NodeUser true = "fa fa-user"
------------------------------------------------------ ------------------------------------------------------
fldr Folder false = "fa fa-folder"
fldr Folder true = "fa fa-folder-open-o" _getIcon :: NodeType -> Boolean -> String
_getIcon NodeUser false = "user-circle"
_getIcon NodeUser true = "user"
------------------------------------------------------
_getIcon Folder false = "folder"
_getIcon Folder true = "folder-open-o"
------------------------------------------------------ ------------------------------------------------------
fldr FolderPrivate true = "fa fa-lock" _getIcon FolderPrivate true = "lock"
fldr FolderPrivate false = "fa fa-lock-circle" _getIcon FolderPrivate false = "lock-circle"
fldr FolderShared true = "fa fa-share-alt" _getIcon FolderShared true = "share-alt"
fldr FolderShared false = "fa fa-share-circle" _getIcon FolderShared false = "share-circle"
fldr Team true = "fa fa-users" _getIcon Team true = "users"
fldr Team false = "fa fa-users-closed" _getIcon Team false = "users-closed"
fldr FolderPublic true = "fa fa-globe-circle" _getIcon FolderPublic true = "globe-circle"
fldr FolderPublic false = "fa fa-globe" _getIcon FolderPublic false = "globe"
------------------------------------------------------ ------------------------------------------------------
fldr Corpus true = "fa fa-book" _getIcon Corpus true = "book"
fldr Corpus false = "fa fa-book-circle" _getIcon Corpus false = "book-circle"
fldr Phylo _ = "fa fa-code-fork" _getIcon Phylo _ = "code-fork"
fldr Graph _ = "fa fa-hubzilla" _getIcon Graph _ = "hubzilla"
fldr Texts _ = "fa fa-newspaper-o" _getIcon Texts _ = "newspaper-o"
fldr Dashboard _ = "fa fa-signal" _getIcon Dashboard _ = "signal"
fldr NodeList _ = "fa fa-list" _getIcon NodeList _ = "list"
fldr NodeFile _ = "fa fa-file" -- TODO depending on mime type we can use fa-file-image etc _getIcon NodeFile _ = "file" -- TODO depending on mime type we can use fa-file-image etc
fldr Annuaire true = "fa fa-address-card-o" _getIcon Annuaire true = "address-card-o"
fldr Annuaire false = "fa fa-address-card" _getIcon Annuaire false = "address-card"
fldr NodeContact true = "fa fa-address-card-o" _getIcon NodeContact true = "address-card-o"
fldr NodeContact false = "fa fa-address-card" _getIcon NodeContact false = "address-card"
fldr NodeFrameWrite true = "fa fa-file-text-o" _getIcon NodeFrameWrite true = "file-text-o"
fldr NodeFrameWrite false = "fa fa-file-text" _getIcon NodeFrameWrite false = "file-text"
fldr NodeFrameCalc true = "fa fa-calculator" _getIcon NodeFrameCalc true = "calculator"
fldr NodeFrameCalc false = "fa fa-calculator" _getIcon NodeFrameCalc false = "calculator"
fldr NodeFrameNotebook true = "fa fa-file-code-o" _getIcon NodeFrameNotebook true = "file-code-o"
fldr NodeFrameNotebook false = "fa fa-code" _getIcon NodeFrameNotebook false = "code"
fldr NodeFrameVisio true = "fa fa-video-camera" _getIcon NodeFrameVisio true = "video-camera"
fldr NodeFrameVisio false = "fa fa-video-camera" _getIcon NodeFrameVisio false = "video-camera"
fldr (NodePublic nt) b = fldr nt b _getIcon (NodePublic nt) b = _getIcon nt b
fldr _ true = "fa fa-folder-open" _getIcon _ true = "folder-open"
fldr _ false = "fa fa-folder-o" _getIcon _ false = "folder-o"
------------------------------------------------------
fldr :: NodeType -> Boolean -> String
fldr nt flag = classNamePrefix <> _getIcon nt flag
charCodeIcon :: NodeType -> Boolean -> String
charCodeIcon nt flag = glyphiconToCharCode $ _getIcon nt flag
publicize :: NodeType -> NodeType publicize :: NodeType -> NodeType
publicize (NodePublic nt) = NodePublic nt publicize (NodePublic nt) = NodePublic nt
......
module Gargantext.Utils where module Gargantext.Utils where
import Data.Char (fromCharCode)
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Foldable (class Foldable, foldr) import Data.Foldable (class Foldable, foldr)
import Data.Lens (Lens', lens) import Data.Lens (Lens', lens)
import Data.Maybe (fromJust)
import Data.Newtype (class Newtype, unwrap, wrap) import Data.Newtype (class Newtype, unwrap, wrap)
import Data.Sequence.Ordered as OSeq
import Data.Set (Set) import Data.Set (Set)
import Data.Set as Set import Data.Set as Set
import Data.Sequence.Ordered as OSeq
import Data.String as S import Data.String as S
import Data.String.CodeUnits (singleton)
import Data.Unfoldable (class Unfoldable) import Data.Unfoldable (class Unfoldable)
import DOM.Simple.Window (window)
import Effect (Effect) import Effect (Effect)
import Prelude import Prelude
import Partial.Unsafe (unsafePartial)
import Web.HTML as WHTML import Web.HTML as WHTML
import Web.HTML.Window (location)
import Web.HTML.Location as WHL import Web.HTML.Location as WHL
import Web.HTML.Window (location)
-- | TODO (hard coded) -- | TODO (hard coded)
csrfMiddlewareToken :: String csrfMiddlewareToken :: String
...@@ -58,12 +61,6 @@ invertOrdering EQ = EQ ...@@ -58,12 +61,6 @@ invertOrdering EQ = EQ
_unit :: forall s. Lens' s Unit _unit :: forall s. Lens' s Unit
_unit = lens (\_ -> unit) (\s _ -> s) _unit = lens (\_ -> unit) (\s _ -> s)
glyphicon :: String -> String
glyphicon t = "btn glyphitem fa fa-" <> t
glyphiconActive :: String -> Boolean -> String
glyphiconActive icon b = glyphicon icon <> if b then " active" else ""
-- | Format a number with specified amount of zero-padding -- | Format a number with specified amount of zero-padding
zeroPad :: Int -> Int -> String zeroPad :: Int -> Int -> String
zeroPad pad num = zeros <> (show num) zeroPad pad num = zeros <> (show num)
...@@ -106,3 +103,12 @@ href = do ...@@ -106,3 +103,12 @@ href = do
w <- WHTML.window w <- WHTML.window
loc <- location w loc <- location w
WHL.href loc WHL.href loc
nbsp :: Int -> String
nbsp = nbsp' ""
where
char = singleton $ unsafePartial $ fromJust $ fromCharCode 160
nbsp' acc n
| n <= 0 = acc
| otherwise = nbsp' (acc <> char) (n - 1)
This diff is collapsed.
...@@ -168,6 +168,11 @@ li ...@@ -168,6 +168,11 @@ li
.ok-to-use .ok-to-use
color: black color: black
.forest-tree-node-action-move
// empirical value (see issue #308)
max-height: 50vh
overflow-y: scroll
.forest-layout .forest-layout
background-color: #fff background-color: #fff
position: fixed position: fixed
......
...@@ -9,3 +9,6 @@ $theme-colors: ("primary": $blue, "secondary": $black) ...@@ -9,3 +9,6 @@ $theme-colors: ("primary": $blue, "secondary": $black)
// Bootstrap and its default variables // Bootstrap and its default variables
@import ../../../node_modules/bootstrap/scss/bootstrap @import ../../../node_modules/bootstrap/scss/bootstrap
.with-icon-font
font-family: ForkAwesome, $font-family-base
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