Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
138
Issues
138
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
purescript-gargantext
Commits
dd7ba4de
Commit
dd7ba4de
authored
Jul 08, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Publish button
parent
99a19646
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
8 deletions
+27
-8
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+7
-0
Action.purs
src/Gargantext/Components/Forest/Tree/Node/Action.purs
+8
-4
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+7
-2
Settings.purs
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
+5
-2
No files found.
src/Gargantext/Components/Forest/Tree.purs
View file @
dd7ba4de
...
@@ -281,6 +281,13 @@ performAction (ShareTeam username) p@{ reload: (_ /\ setReload)
...
@@ -281,6 +281,13 @@ performAction (ShareTeam username) p@{ reload: (_ /\ setReload)
do
do
void $ Share.share session id $ Share.ShareTeam {username}
void $ Share.share session id $ Share.ShareTeam {username}
performAction SharePublic p@{ reload: (_ /\ setReload)
, session
, tree: (NTree (LNode {id}) _)
} =
do
void $ Share.share session id $ Share.SharePublic {rights:"public"}
-------
-------
performAction (AddNode name nodeType) p@{ openNodes: (_ /\ setOpenNodes)
performAction (AddNode name nodeType) p@{ openNodes: (_ /\ setOpenNodes)
, reload: (_ /\ setReload)
, reload: (_ /\ setReload)
...
...
src/Gargantext/Components/Forest/Tree/Node/Action.purs
View file @
dd7ba4de
...
@@ -24,6 +24,7 @@ data Action = AddNode String GT.NodeType
...
@@ -24,6 +24,7 @@ data Action = AddNode String GT.NodeType
| RenameNode String
| RenameNode String
| UpdateNode UpdateNodeParams
| UpdateNode UpdateNodeParams
| ShareTeam String
| ShareTeam String
| SharePublic
| DoSearch GT.AsyncTaskWithType
| DoSearch GT.AsyncTaskWithType
| UploadFile GT.NodeType FileType (Maybe String) UploadFileContents
| UploadFile GT.NodeType FileType (Maybe String) UploadFileContents
| DownloadNode
| DownloadNode
...
@@ -55,6 +56,7 @@ instance showShow :: Show Action where
...
@@ -55,6 +56,7 @@ instance showShow :: Show Action where
show (RenameNode _ )= "RenameNode"
show (RenameNode _ )= "RenameNode"
show (UpdateNode _ )= "UpdateNode"
show (UpdateNode _ )= "UpdateNode"
show (ShareTeam _ )= "ShareTeam"
show (ShareTeam _ )= "ShareTeam"
show (SharePublic )= "SharePublic"
show (DoSearch _ )= "SearchQuery"
show (DoSearch _ )= "SearchQuery"
show (UploadFile _ _ _ _)= "UploadFile"
show (UploadFile _ _ _ _)= "UploadFile"
show RefreshTree = "RefreshTree"
show RefreshTree = "RefreshTree"
...
@@ -71,6 +73,7 @@ icon DeleteNode = glyphiconNodeAction Delete
...
@@ -71,6 +73,7 @@ icon DeleteNode = glyphiconNodeAction Delete
icon (RenameNode _) = glyphiconNodeAction Config
icon (RenameNode _) = glyphiconNodeAction Config
icon (UpdateNode _) = glyphiconNodeAction Refresh
icon (UpdateNode _) = glyphiconNodeAction Refresh
icon (ShareTeam _) = glyphiconNodeAction Share
icon (ShareTeam _) = glyphiconNodeAction Share
icon (SharePublic ) = glyphiconNodeAction Publish
icon (DoSearch _) = glyphiconNodeAction SearchBox
icon (DoSearch _) = glyphiconNodeAction SearchBox
icon (UploadFile _ _ _ _) = glyphiconNodeAction Upload
icon (UploadFile _ _ _ _) = glyphiconNodeAction Upload
icon RefreshTree = glyphiconNodeAction Refresh
icon RefreshTree = glyphiconNodeAction Refresh
...
@@ -88,13 +91,14 @@ text (AddNode _ _ )= "Add !"
...
@@ -88,13 +91,14 @@ text (AddNode _ _ )= "Add !"
text DeleteNode = "Delete !"
text DeleteNode = "Delete !"
text (RenameNode _ )= "Rename !"
text (RenameNode _ )= "Rename !"
text (UpdateNode _ )= "Update !"
text (UpdateNode _ )= "Update !"
text (ShareTeam _ )= "Share !"
text (ShareTeam _ )= "Share with team !"
text (SharePublic )= "Publish !"
text (DoSearch _ )= "Launch search !"
text (DoSearch _ )= "Launch search !"
text (UploadFile _ _ _ _)= "Upload File !"
text (UploadFile _ _ _ _)= "Upload File !"
text RefreshTree = "Refresh Tree !"
text RefreshTree = "Refresh Tree !"
text DownloadNode = "Download !"
text DownloadNode = "Download !"
text (MoveNode _ ) = "Move !"
text (MoveNode _ )
= "Move !"
text (MergeNode _ ) = "Merge !"
text (MergeNode _ )
= "Merge !"
text (LinkNode _ ) = "Link !"
text (LinkNode _ )
= "Link !"
text NoAction = "No Action"
text NoAction = "No Action"
-----------------------------------------------------------------------
-----------------------------------------------------------------------
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
dd7ba4de
...
@@ -11,7 +11,7 @@ import Reactix as R
...
@@ -11,7 +11,7 @@ import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Gargantext.Prelude
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(..), addNodeView)
import Gargantext.Components.Forest.Tree.Node.Action.Add (NodePopup(..), addNodeView)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (actionDelete)
import Gargantext.Components.Forest.Tree.Node.Action.Delete (actionDelete)
import Gargantext.Components.Forest.Tree.Node.Action.Documentation (actionDoc)
import Gargantext.Components.Forest.Tree.Node.Action.Documentation (actionDoc)
...
@@ -28,7 +28,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Merge (mergeNode)
...
@@ -28,7 +28,7 @@ import Gargantext.Components.Forest.Tree.Node.Action.Merge (mergeNode)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Box.Types (NodePopupProps, NodePopupS)
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
import Gargantext.Components.Forest.Tree.Node.Status (Status(..), hasStatus)
import Gargantext.Components.Forest.Tree.Node.Status (Status(..), hasStatus)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT)
import Gargantext.Components.Forest.Tree.Node.Tools (textInputBox, fragmentPT
, submitButton
)
import Gargantext.Sessions (Session)
import Gargantext.Sessions (Session)
import Gargantext.Types (Name, ID)
import Gargantext.Types (Name, ID)
import Gargantext.Types as GT
import Gargantext.Types as GT
...
@@ -297,6 +297,11 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
...
@@ -297,6 +297,11 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
, isOpen
, isOpen
}
}
]
]
cpt {action : Publish, dispatch } _ = do
pure $ H.div {className:"center"} [ submitButton SharePublic dispatch ]
cpt props@{action: SearchBox, id, session, dispatch, nodePopup} _ =
cpt props@{action: SearchBox, id, session, dispatch, nodePopup} _ =
actionSearch session (Just id) dispatch nodePopup
actionSearch session (Just id) dispatch nodePopup
...
...
src/Gargantext/Components/Forest/Tree/Node/Settings.purs
View file @
dd7ba4de
...
@@ -20,6 +20,7 @@ data NodeAction = Documentation NodeType
...
@@ -20,6 +20,7 @@ data NodeAction = Documentation NodeType
| Download | Upload | Refresh | Config
| Download | Upload | Refresh | Config
| Delete
| Delete
| Share
| Share
| Publish
| Add (Array NodeType)
| Add (Array NodeType)
| Merge { subTreeParams :: SubTreeParams }
| Merge { subTreeParams :: SubTreeParams }
| Move { subTreeParams :: SubTreeParams }
| Move { subTreeParams :: SubTreeParams }
...
@@ -41,6 +42,7 @@ instance eqNodeAction :: Eq NodeAction where
...
@@ -41,6 +42,7 @@ instance eqNodeAction :: Eq NodeAction where
eq (Add x) (Add y) = x == y
eq (Add x) (Add y) = x == y
eq (Merge x) (Merge y) = x == y
eq (Merge x) (Merge y) = x == y
eq Config Config = true
eq Config Config = true
eq Publish Publish = true
eq _ _ = false
eq _ _ = false
instance showNodeAction :: Show NodeAction where
instance showNodeAction :: Show NodeAction where
...
@@ -57,7 +59,7 @@ instance showNodeAction :: Show NodeAction where
...
@@ -57,7 +59,7 @@ instance showNodeAction :: Show NodeAction where
show (Link x) = "Link to " <> show x
show (Link x) = "Link to " <> show x
show (Add xs) = foldl (\a b -> a <> show b) "Add " xs
show (Add xs) = foldl (\a b -> a <> show b) "Add " xs
show (Merge t) = "Merge with subtree" <> show t
show (Merge t) = "Merge with subtree" <> show t
show Publish = "Publish"
glyphiconNodeAction :: NodeAction -> String
glyphiconNodeAction :: NodeAction -> String
glyphiconNodeAction (Documentation _) = "question-circle"
glyphiconNodeAction (Documentation _) = "question-circle"
...
@@ -72,9 +74,9 @@ glyphiconNodeAction Refresh = "refresh"
...
@@ -72,9 +74,9 @@ glyphiconNodeAction Refresh = "refresh"
glyphiconNodeAction Config = "wrench"
glyphiconNodeAction Config = "wrench"
glyphiconNodeAction Share = "user-plus"
glyphiconNodeAction Share = "user-plus"
glyphiconNodeAction (Move _) = "share-square-o"
glyphiconNodeAction (Move _) = "share-square-o"
glyphiconNodeAction Publish = fldr FolderPublic true
glyphiconNodeAction _ = ""
glyphiconNodeAction _ = ""
------------------------------------------------------------------------
------------------------------------------------------------------------
data SettingsBox =
data SettingsBox =
SettingsBox { show :: Boolean
SettingsBox { show :: Boolean
...
@@ -195,6 +197,7 @@ settingsBox Graph =
...
@@ -195,6 +197,7 @@ settingsBox Graph =
, buttons : [ Refresh
, buttons : [ Refresh
, Config
, Config
, Download -- TODO as GEXF or JSON
, Download -- TODO as GEXF or JSON
, Publish
, Delete
, Delete
]
]
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment