Commit 58c85c17 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FOREST] fix warnings.

parent d15f7da9
......@@ -71,6 +71,7 @@ glyphiconNodeAction _ = ""
data SettingsBox =
SettingsBox { show :: Boolean
, edit :: Boolean
, doc :: NodeAction
, buttons :: Array NodeAction
}
------------------------------------------------------------------------
......@@ -78,8 +79,8 @@ data SettingsBox =
settingsBox :: NodeType -> SettingsBox
settingsBox NodeUser = SettingsBox { show : true
, edit : false
, buttons : [Documentation NodeUser
, SearchBox
, doc : Documentation NodeUser
, buttons : [ SearchBox
, Add [ FolderPrivate
, FolderShared
, FolderPublic
......@@ -90,8 +91,8 @@ settingsBox NodeUser = SettingsBox { show : true
settingsBox FolderPrivate = SettingsBox { show: true
, edit : false
, buttons : [Documentation FolderPrivate
, SearchBox
, doc : Documentation FolderPrivate
, buttons : [ SearchBox
, Add [ Corpus
, Folder
, Annuaire
......@@ -100,40 +101,40 @@ settingsBox FolderPrivate = SettingsBox { show: true
}
settingsBox Team = SettingsBox { show: true
, edit : false
, buttons : [Documentation Team
, SearchBox
, Add [ Corpus
, Folder
, Annuaire
]
, Delete]
}
, edit : false
, doc : Documentation Team
, buttons : [ SearchBox
, Add [ Corpus
, Folder
, Annuaire
]
, Delete]
}
settingsBox FolderShared = SettingsBox { show: true
, edit : true
, buttons : [Documentation FolderShared
, Add [Team, FolderShared]
, Delete
]
, doc : Documentation FolderShared
, buttons : [ Add [Team, FolderShared]
, Delete
]
}
settingsBox FolderPublic = SettingsBox { show: true
settingsBox FolderPublic = SettingsBox { show : true
, edit : false
, buttons : [Documentation FolderPublic
{-, SearchBox
, doc : Documentation FolderPublic
, buttons : [{-, SearchBox
, Add [ Corpus
, Folder
]-}
, Delete
Delete
]
}
settingsBox Folder = SettingsBox { show : true
, edit : true
, buttons : [ Documentation Folder
, SearchBox
, doc : Documentation Folder
, buttons : [ SearchBox
, Add [ Corpus
, Folder
, Annuaire
......@@ -144,32 +145,33 @@ settingsBox Folder = SettingsBox { show : true
settingsBox Corpus = SettingsBox { show : true
, edit : true
, buttons : [ Documentation Corpus
, SearchBox
, Add [ NodeList
, doc : Documentation Corpus
, buttons : [ SearchBox
, Add [ NodeList
, Graph
, Dashboard
]
, Link Annuaire
, Upload
, Download
--, Share
--, Move
--, Clone
, Link Annuaire
, Delete
]
}
settingsBox Texts = SettingsBox { show : true
, edit : false
, buttons : [ Documentation Texts
, Upload
, doc : Documentation Texts
, buttons : [ Upload
, Download
]
}
settingsBox Graph = SettingsBox { show : true
, edit : false
, doc : Documentation Graph
, buttons : [ Documentation Graph
, Download
]
......@@ -177,21 +179,22 @@ settingsBox Graph = SettingsBox { show : true
settingsBox NodeList = SettingsBox { show : true
, edit : false
, buttons : [ Documentation NodeList
, Upload
, doc : Documentation NodeList
, buttons : [ Upload
, Download
]
}
settingsBox Dashboard = SettingsBox { show : true
, edit : false
, buttons : [ Documentation Dashboard
]
, doc : Documentation Dashboard
, buttons : []
}
settingsBox _ = SettingsBox { show : false
, edit : false
, doc : Documentation NodeUser
, buttons : []
}
......
......@@ -4,12 +4,12 @@ import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyO
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..), fromJust)
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Effect.Aff (Aff, launchAff, runAff)
import Gargantext.Routes (AppRoute, SessionRoute(..))
import Gargantext.Sessions (Session, sessionId, get, put, post, postWwwUrlencoded, delete)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType)
import Effect.Aff (Aff)
import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get, put, post, delete)
import Gargantext.Types (NodeType(..))
import Prelude hiding (div)
data Action = Submit String
......@@ -35,14 +35,12 @@ readFileType "CSV" = Just CSV
readFileType "PresseRIS" = Just PresseRIS
readFileType _ = Nothing
data DroppedFile = DroppedFile {
contents :: UploadFileContents
, fileType :: Maybe FileType
}
type FileHash = String
type Name = String
type ID = Int
type Reload = Int
......
module Gargantext.Components.Forest.Tree.Node.Action.Add where
import DOM.Simple.Console (log2)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Array (filter, null, length, head, elem)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..), fromJust, fromMaybe)
import Data.Newtype (class Newtype)
import Data.Tuple (Tuple)
import Data.Array (length, head)
import Data.Maybe (Maybe(..), fromMaybe)
-- import Data.Newtype (class Newtype)
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff, runAff)
import Effect.Class (liftEffect)
import Effect.Aff (Aff, launchAff)
import Effect.Uncurried (mkEffectFn1)
import FFI.Simple ((..))
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Components.Forest.Tree.Node
import Gargantext.Ends (Frontends, url)
import Gargantext.Components.Loader (loader)
import Gargantext.Routes (AppRoute, SessionRoute(..))
import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, sessionId, get, put, post, postWwwUrlencoded, delete)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType)
import Gargantext.Utils (id, glyphicon)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..), ID, Name)
import Gargantext.Components.Forest.Tree.Node (SettingsBox(..), settingsBox)
import Gargantext.Types (NodeType(..), readNodeType)
import Gargantext.Utils.Reactix as R2
import Partial.Unsafe (unsafePartial)
import Prelude hiding (div)
import React.SyntheticEvent as E
import Prelude (Unit, bind, const, discard, map, pure, show, ($), (<>), (>))
import Reactix as R
import Reactix.DOM.HTML as H
import URI.Extra.QueryPairs as QP
import URI.Query as Q
import Web.File.File (toBlob)
import Web.File.FileList (FileList, item)
import Web.File.FileReader.Aff (readAsText)
-- START Create Node
......@@ -55,10 +35,10 @@ createNodeView d p@{nodeType} (_ /\ setPopupOpen) nodeTypes = R.createElement el
el = R.hooksComponent "CreateNodeView" cpt
cpt {id, name} _ = do
nodeName <- R.useState' "Default Name"
nodeType <- R.useState' $ fromMaybe NodeUser $ head nodeTypes
nodeType' <- R.useState' $ fromMaybe NodeUser $ head nodeTypes
pure $ H.div {}
[ panelBody readNodeType nodeName nodeType
, panelFooter nodeName nodeType
[ panelBody readNodeType nodeName nodeType'
, panelFooter nodeName nodeType'
]
where
panelBody :: (String -> NodeType)
......@@ -125,10 +105,6 @@ createNodeView d p@{nodeType} (_ /\ setPopupOpen) nodeTypes = R.createElement el
} [H.text "Add"]
]
createNodeView _ _ _ _ = R.createElement el {} []
where
el = R.hooksComponent "CreateNodeView" cpt
cpt props _ = pure $ H.div {} []
-- END Create Node
......
module Gargantext.Components.Forest.Tree.Node.Action.Rename where
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff, launchAff, runAff)
import Effect.Aff (Aff, launchAff)
import Effect.Uncurried (mkEffectFn1)
import FFI.Simple ((..))
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Types (NodeType(..))
import Prelude hiding (div)
import Gargantext.Types (NodeType)
import Prelude (Unit, bind, const, discard, pure, ($))
import Reactix as R
import Reactix.DOM.HTML as H
-- | START Rename Box
type RenameBoxProps =
( id :: ID
......
module Gargantext.Components.Forest.Tree.Node.Action.Upload where
import Data.Newtype (class Newtype)
import Effect.Aff (Aff, launchAff, runAff)
import Gargantext.Sessions (Session, sessionId, get, put, post, postWwwUrlencoded, delete)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType)
import Gargantext.Routes (AppRoute, SessionRoute(..))
import Prelude hiding (div)
import Data.Maybe (Maybe(..), fromJust)
import Effect.Aff (Aff, launchAff)
import Gargantext.Sessions (Session, postWwwUrlencoded)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..))
import Gargantext.Routes (SessionRoute(..))
import Prelude (class Show, Unit, const, discard, map, pure, show, ($), (<>))
import Data.Maybe (Maybe(..))
import URI.Extra.QueryPairs as QP
import Gargantext.Components.Forest.Tree.Node.Action
import Reactix as R
......@@ -15,11 +15,10 @@ import URI.Query as Q
import Reactix.DOM.HTML as H
import Effect.Uncurried (mkEffectFn1)
import FFI.Simple ((..))
import Gargantext.Utils (id, glyphicon)
import Gargantext.Utils (id)
import Gargantext.Utils.Reactix as R2
import Data.Tuple.Nested ((/\))
-- START File Type View
type FileTypeProps =
( id :: ID
......
......@@ -220,7 +220,7 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
, placement: "right"}
}
SettingsBox {edit, buttons} = settingsBox nodeType
SettingsBox {edit, doc, buttons} = settingsBox nodeType
removeCircleGeneral (Just _) setNodePopup = removeCircle setNodePopup
removeCircleGeneral Nothing _ = H.div {} []
......@@ -259,8 +259,11 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
editIcon (true /\ _) = H.div {} []
panelBody nodePopupState d' =
H.div {className: "panel-body flex-center"}
$ map (buttonClick nodePopupState d') buttons
H.div {className: "panel-body flex-space-between"}
[ H.div {className: "flex-center"} [buttonClick nodePopupState d' doc]
, H.div {className: "flex-center"}
$ map (buttonClick nodePopupState d') buttons
]
searchIsTexIframe _id _session search@(search' /\ _) =
if isIsTex search'.datafield then
......
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