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

[FEAT] Text Flow with NoList built as option

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