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
e566f802
Commit
e566f802
authored
Feb 01, 2023
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Node team] invite multiple people without closing the modal
parent
6a0286f5
Pipeline
#3631
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
9 deletions
+66
-9
Share.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
+11
-9
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+55
-0
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
View file @
e566f802
...
...
@@ -5,6 +5,7 @@ import Gargantext.Prelude
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Gargantext.Components.Forest.Tree.Node.Action.Types (Action)
import Gargantext.Components.Forest.Tree.Node.Action.Types as Action
...
...
@@ -16,11 +17,11 @@ import Gargantext.Sessions (Session, post)
import Gargantext.Types (ID)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.SimpleJSON as GUSJ
import Reactix as R
import Reactix.DOM.HTML as H
import Simple.JSON as JSON
import Simple.JSON.Generics as JSONG
import Toestand as T
here :: R2.Here
...
...
@@ -59,15 +60,16 @@ shareNodeCpt :: R.Component ShareNode
shareNodeCpt = here.component "shareNode" cpt
where
cpt { dispatch, id } _ = do
isOpen <- T.useBox true
username' /\ username <- R2.useBox' ""
pure $ Tools.panel
[ Tools.
text
InputBox { boxAction: shareAction
, boxName: "Share"
, dispatch
, id
, isOpen
, text: "username"
} []
] (H.div {} [])
[ Tools.
invite
InputBox { boxAction: shareAction
, boxName: "Share"
, dispatch
, id
, text: "username"
, username
} []
] (H.div {} [
H.text username'
])
------------------------------------------------------------------------
publishNode :: R2.Component SubTreeParamsIn
publishNode = R.createElement publishNodeCpt
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
e566f802
...
...
@@ -109,6 +109,61 @@ textInputBoxCpt = here.component "textInputBox" cpt where
launchAff_ $ dispatch (boxAction $ R.readRef ref)
T.write_ false isOpen
type InviteInputBoxProps =
( id :: GT.ID
, dispatch :: Action -> Aff Unit
, text :: String
, boxName :: String
, boxAction :: String -> Action
, username :: T.Box String
)
inviteInputBox :: R2.Component InviteInputBoxProps
inviteInputBox = R.createElement inviteInputBoxCpt
inviteInputBoxCpt :: R.Component InviteInputBoxProps
inviteInputBoxCpt = here.component "textInputBox" cpt where
cpt { boxAction, boxName, dispatch, text, username } _ =
content <$> R.useRef text
where
content renameNodeNameRef =
H.div
{ className: "d-flex align-items-center" }
[
textInput renameNodeNameRef
,
B.wad_ [ "d-inline-block", "w-3" ]
,
submitBtn renameNodeNameRef
]
textInput renameNodeNameRef =
H.div
{}
[
inputWithEnter
{ autoFocus: true
, className: "form-control"
, defaultValue: text
, onBlur: R.setRef renameNodeNameRef
, onEnter: submit renameNodeNameRef
, onValueChanged: R.setRef renameNodeNameRef
, placeholder: (boxName <> " Node")
, type: "text"
}
]
submitBtn renameNodeNameRef =
B.iconButton
{ callback: submit renameNodeNameRef
, title: "Submit"
, name: "plus"
, elevation: Level1
}
submit ref _ = do
T.write_ ("Invited " <> R.readRef ref <> " to the team") username
launchAff_ $ dispatch (boxAction $ R.readRef ref)
type DefaultText = String
formEdit :: forall prev next
...
...
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