Commit d541f304 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FEAT] Text Flow with NoList built as option

parent 198b1db4
...@@ -40,11 +40,11 @@ selectionCpt = here.component "selection" cpt where ...@@ -40,11 +40,11 @@ selectionCpt = here.component "selection" cpt where
, list: [ MyListsFirst , list: [ MyListsFirst
, OtherListsFirst , OtherListsFirst
, SelectedLists [] , SelectedLists []
, NoList
] ]
} }
[] []
, , selectedIds { selection, session } []
selectedIds { selection, session } []
] ]
selectedIds :: R2.Component Props selectedIds :: R2.Component Props
...@@ -88,7 +88,8 @@ type ListTreeProps = ...@@ -88,7 +88,8 @@ type ListTreeProps =
, nodeType :: NodeType , nodeType :: NodeType
, root :: ID , root :: ID
, selection :: T.Box Selection , selection :: T.Box Selection
, session :: Session ) , session :: Session
)
listTree :: R2.Leaf ListTreeProps listTree :: R2.Leaf ListTreeProps
listTree props = R.createElement listTreeCpt props [] listTree props = R.createElement listTreeCpt props []
...@@ -110,7 +111,8 @@ type ListTreeChildrenProps = ...@@ -110,7 +111,8 @@ type ListTreeChildrenProps =
( render :: Render ( render :: Render
, root :: ID , root :: ID
, selection :: T.Box Selection , selection :: T.Box Selection
, session :: Session ) , session :: Session
)
listTreeChildren :: R2.Component ListTreeChildrenProps listTreeChildren :: R2.Component ListTreeChildrenProps
listTreeChildren = R.createElement listTreeChildrenCpt listTreeChildren = R.createElement listTreeChildrenCpt
......
...@@ -9,20 +9,23 @@ import Data.Newtype (class Newtype) ...@@ -9,20 +9,23 @@ import Data.Newtype (class Newtype)
import Gargantext.Types (ID, ListId, NodeType) import Gargantext.Types (ID, ListId, NodeType)
import Simple.JSON as JSON import Simple.JSON as JSON
data Selection = MyListsFirst | OtherListsFirst | SelectedLists (Array ListId) data Selection = MyListsFirst | OtherListsFirst | SelectedLists (Array ListId) | NoList
derive instance Generic Selection _ derive instance Generic Selection _
instance Show Selection where instance Show Selection where
show MyListsFirst = "My lists first" show MyListsFirst = "My lists first"
show OtherListsFirst = "Other lists first" show OtherListsFirst = "Other lists first"
show NoList = "NoList"
show (SelectedLists _) = "Selected lists" show (SelectedLists _) = "Selected lists"
instance Eq Selection where eq = genericEq instance Eq Selection where eq = genericEq
instance Read Selection where instance Read Selection where
read "My lists first" = Just MyListsFirst read "My lists first" = Just MyListsFirst
read "Other lists first" = Just OtherListsFirst read "Other lists first" = Just OtherListsFirst
read "Selected lists" = Just $ SelectedLists [] read "Selected lists" = Just $ SelectedLists []
read "NoList" = Just NoList
read _ = Nothing read _ = Nothing
instance JSON.WriteForeign Selection where instance JSON.WriteForeign Selection where
writeImpl MyListsFirst = JSON.writeImpl { "type": "MyListsFirst" } writeImpl MyListsFirst = JSON.writeImpl { "type": "MyListsFirst" }
writeImpl NoList = JSON.writeImpl { "type": "NoList" }
writeImpl OtherListsFirst = JSON.writeImpl { "type": "OtherListsFirst" } writeImpl OtherListsFirst = JSON.writeImpl { "type": "OtherListsFirst" }
writeImpl (SelectedLists ids) = JSON.writeImpl { "type": "SelectedLists", value: ids } writeImpl (SelectedLists ids) = JSON.writeImpl { "type": "SelectedLists", value: ids }
......
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