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
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Grégoire Locqueville
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)
do
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)
, reload: (_ /\ setReload)
...
...
src/Gargantext/Components/Forest/Tree/Node/Action.purs
View file @
dd7ba4de
...
...
@@ -24,6 +24,7 @@ data Action = AddNode String GT.NodeType
| RenameNode String
| UpdateNode UpdateNodeParams
| ShareTeam String
| SharePublic
| DoSearch GT.AsyncTaskWithType
| UploadFile GT.NodeType FileType (Maybe String) UploadFileContents
| DownloadNode
...
...
@@ -55,6 +56,7 @@ instance showShow :: Show Action where
show (RenameNode _ )= "RenameNode"
show (UpdateNode _ )= "UpdateNode"
show (ShareTeam _ )= "ShareTeam"
show (SharePublic )= "SharePublic"
show (DoSearch _ )= "SearchQuery"
show (UploadFile _ _ _ _)= "UploadFile"
show RefreshTree = "RefreshTree"
...
...
@@ -71,6 +73,7 @@ icon DeleteNode = glyphiconNodeAction Delete
icon (RenameNode _) = glyphiconNodeAction Config
icon (UpdateNode _) = glyphiconNodeAction Refresh
icon (ShareTeam _) = glyphiconNodeAction Share
icon (SharePublic ) = glyphiconNodeAction Publish
icon (DoSearch _) = glyphiconNodeAction SearchBox
icon (UploadFile _ _ _ _) = glyphiconNodeAction Upload
icon RefreshTree = glyphiconNodeAction Refresh
...
...
@@ -88,13 +91,14 @@ text (AddNode _ _ )= "Add !"
text DeleteNode = "Delete !"
text (RenameNode _ )= "Rename !"
text (UpdateNode _ )= "Update !"
text (ShareTeam _ )= "Share !"
text (ShareTeam _ )= "Share with team !"
text (SharePublic )= "Publish !"
text (DoSearch _ )= "Launch search !"
text (UploadFile _ _ _ _)= "Upload File !"
text RefreshTree = "Refresh Tree !"
text DownloadNode = "Download !"
text (MoveNode _ ) = "Move !"
text (MergeNode _ ) = "Merge !"
text (LinkNode _ ) = "Link !"
text (MoveNode _ )
= "Move !"
text (MergeNode _ )
= "Merge !"
text (LinkNode _ )
= "Link !"
text NoAction = "No Action"
-----------------------------------------------------------------------
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
dd7ba4de
...
...
@@ -11,7 +11,7 @@ import Reactix as R
import Reactix.DOM.HTML as H
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.Delete (actionDelete)
import Gargantext.Components.Forest.Tree.Node.Action.Documentation (actionDoc)
...
...
@@ -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.Settings (NodeAction(..), SettingsBox(..), glyphiconNodeAction, settingsBox)
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.Types (Name, ID)
import Gargantext.Types as GT
...
...
@@ -297,6 +297,11 @@ panelActionCpt = R.hooksComponent "G.C.F.T.N.B.panelAction" cpt
, isOpen
}
]
cpt {action : Publish, dispatch } _ = do
pure $ H.div {className:"center"} [ submitButton SharePublic dispatch ]
cpt props@{action: SearchBox, id, session, 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
| Download | Upload | Refresh | Config
| Delete
| Share
| Publish
| Add (Array NodeType)
| Merge { subTreeParams :: SubTreeParams }
| Move { subTreeParams :: SubTreeParams }
...
...
@@ -41,6 +42,7 @@ instance eqNodeAction :: Eq NodeAction where
eq (Add x) (Add y) = x == y
eq (Merge x) (Merge y) = x == y
eq Config Config = true
eq Publish Publish = true
eq _ _ = false
instance showNodeAction :: Show NodeAction where
...
...
@@ -57,7 +59,7 @@ instance showNodeAction :: Show NodeAction where
show (Link x) = "Link to " <> show x
show (Add xs) = foldl (\a b -> a <> show b) "Add " xs
show (Merge t) = "Merge with subtree" <> show t
show Publish = "Publish"
glyphiconNodeAction :: NodeAction -> String
glyphiconNodeAction (Documentation _) = "question-circle"
...
...
@@ -72,9 +74,9 @@ glyphiconNodeAction Refresh = "refresh"
glyphiconNodeAction Config = "wrench"
glyphiconNodeAction Share = "user-plus"
glyphiconNodeAction (Move _) = "share-square-o"
glyphiconNodeAction Publish = fldr FolderPublic true
glyphiconNodeAction _ = ""
------------------------------------------------------------------------
data SettingsBox =
SettingsBox { show :: Boolean
...
...
@@ -195,6 +197,7 @@ settingsBox Graph =
, buttons : [ Refresh
, Config
, Download -- TODO as GEXF or JSON
, Publish
, 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