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
83807ead
Commit
83807ead
authored
Jun 26, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] checkboxes
parent
5052a542
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
6 deletions
+36
-6
Merge.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
+7
-3
Status.purs
src/Gargantext/Components/Forest/Tree/Node/Status.purs
+1
-0
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+27
-2
Types.purs
src/Gargantext/Types.purs
+1
-1
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
View file @
83807ead
...
...
@@ -5,7 +5,7 @@ import Data.Maybe (Maybe(..))
import Data.Tuple.Nested ((/\))
import Effect.Aff (Aff)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel, checkbox)
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel, checkbox
, checkboxes
)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (SubTreeParamsIn, subTreeView, SubTreeOut(..))
import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(..))
...
...
@@ -13,7 +13,7 @@ import Gargantext.Sessions (Session, put_)
import Gargantext.Types as GT
import Reactix as R
import Reactix.DOM.HTML as H
import Data.Set as Set
mergeNodeReq :: Session -> GT.ID -> GT.ID -> Aff (Array GT.ID)
mergeNodeReq session fromId toId =
...
...
@@ -24,7 +24,8 @@ mergeNode p@{dispatch, subTreeParams, id, nodeType, session} = do
subTreeOut@(subTreeOutParams /\ setSubTreeOut) :: R.State (Maybe SubTreeOut)
<- R.useState' Nothing
merge <- R.useState' false
merge <- R.useState' false
options <- R.useState' (Set.singleton GT.GraphTerm)
let button = case subTreeOutParams of
Nothing -> H.div {} []
...
...
@@ -39,6 +40,9 @@ mergeNode p@{dispatch, subTreeParams, id, nodeType, session} = do
, nodeType
, session
}
, H.div {} [ H.text "Merge which list?"
, checkboxes [GT.GraphTerm, GT.CandidateTerm, GT.StopTerm] options
]
, H.div {className: "checkbox"} [checkbox merge, H.text "Merge data?"]
] button
src/Gargantext/Components/Forest/Tree/Node/Status.purs
View file @
83807ead
...
...
@@ -16,5 +16,6 @@ hasStatus _ (Merge _) = Dev
hasStatus _ (Move _) = Test
hasStatus _ (Documentation _) = Dev
hasStatus Annuaire Upload = Dev
hasStatus Texts Upload = Dev
hasStatus _ _ = Stable
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
83807ead
...
...
@@ -2,14 +2,17 @@ module Gargantext.Components.Forest.Tree.Node.Tools
where
import Data.Maybe (fromMaybe)
import Data.Set (Set)
import Data.Set as Set
import Data.String as S
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (Aff, launchAff)
import Effect.Uncurried (mkEffectFn1)
import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Prelude (Unit, bind, const, discard, pure, show, ($), (<<<), (<>), read, map, class Read, class Show, not)
import Gargantext.Prelude (Unit, bind, const, discard, pure, show, ($), (<<<), (<>), read, map, class Read, class Show, not
, class Ord
)
import Gargantext.Types (ID)
import Gargantext.Utils (toggleSet)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
...
...
@@ -203,7 +206,7 @@ submitButtonHref action href =
------------------------------------------------------------------------
-- | CheckBox tools
-- checkboxes: Array of poolean values
-- checkboxes: Array of poolean values
(basic: without pending option)
-- checkbox : One boolean value only
checkbox :: R.State Boolean -> R.Element
...
...
@@ -215,3 +218,25 @@ checkbox ( val /\ set ) =
, on: { click: \_ -> set $ const $ not val}
}
data CheckBoxes = Multiple | Uniq
checkboxes :: forall a
. Ord a
=> Show a
=> Array a
-> R.State (Set a)
-> R.Element
checkboxes xs (val /\ set) =
H.div {} $ map (\a -> H.div {} [ H.input { type: "checkbox"
, checked: Set.member a val
, on: { click: \_ -> set
$ const
$ toggleSet a val
}
}
, H.div {} [H.text $ show a]
]
) xs
src/Gargantext/Types.purs
View file @
83807ead
...
...
@@ -10,7 +10,7 @@ import Data.Generic.Rep.Show (genericShow)
import Data.Int (toNumber)
import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Effect.Aff (Aff)
import Gargantext.Prelude (class Read, read)
import Gargantext.Prelude (class Read, read
, class Show, show
)
import Prelude
import Prim.Row (class Union)
import URI.Query (Query)
...
...
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