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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
a716a918
Commit
a716a918
authored
Jun 26, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] checkbox
parent
df89d465
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
16 deletions
+24
-16
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+1
-1
Merge.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
+6
-1
Status.purs
src/Gargantext/Components/Forest/Tree/Node/Status.purs
+1
-0
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+14
-4
Login.purs
src/Gargantext/Components/Login.purs
+2
-10
No files found.
src/Gargantext/Components/FacetsTable.purs
View file @
a716a918
...
...
@@ -348,7 +348,7 @@ pageCpt = R.hooksComponent "G.C.FacetsTable.Page" cpt
]
, delete: true }
where
markClick _ = markCategory session nodeId category [id]
markClick
_ = markCategory session nodeId category [id]
toggleClick _ = togglePendingDeletion deletions id
maybeStricken delete
| delete = H.div { style: { textDecoration: "line-through" } }
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Merge.purs
View file @
a716a918
...
...
@@ -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)
import Gargantext.Components.Forest.Tree.Node.Tools (submitButton, panel
, checkbox
)
import Gargantext.Components.Forest.Tree.Node.Tools.SubTree (SubTreeParamsIn, subTreeView, SubTreeOut(..))
import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(..))
...
...
@@ -23,11 +23,15 @@ mergeNode :: Record SubTreeParamsIn -> R.Hooks R.Element
mergeNode p@{dispatch, subTreeParams, id, nodeType, session} = do
subTreeOut@(subTreeOutParams /\ setSubTreeOut) :: R.State (Maybe SubTreeOut)
<- R.useState' Nothing
merge <- R.useState' false
let button = case subTreeOutParams of
Nothing -> H.div {} []
Just sbto -> submitButton (MergeNode inId outId) dispatch
where
(SubTreeOut { in:inId, out:outId}) = sbto
pure $ panel [ subTreeView { subTreeOut
, dispatch
, subTreeParams
...
...
@@ -35,5 +39,6 @@ mergeNode p@{dispatch, subTreeParams, id, nodeType, session} = do
, nodeType
, session
}
, H.div {className: "checkbox"} [checkbox merge, H.text "Merge data?"]
] button
src/Gargantext/Components/Forest/Tree/Node/Status.purs
View file @
a716a918
...
...
@@ -9,6 +9,7 @@ data Status = Stable | Test | Dev
hasStatus :: NodeType -> NodeAction -> Status
hasStatus _ SearchBox = Dev
hasStatus _ Refresh = Dev
hasStatus _ Config = Dev
hasStatus _ (Link _) = Test
hasStatus _ (Move _) = Test
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
a716a918
...
...
@@ -8,7 +8,7 @@ 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)
import Gargantext.Prelude (Unit, bind, const, discard, pure, show, ($), (<<<), (<>), read, map, class Read, class Show
, not
)
import Gargantext.Types (ID)
import Gargantext.Utils.Reactix as R2
import Reactix as R
...
...
@@ -201,7 +201,17 @@ submitButtonHref action href =
}
[ H.text $ " " <> text action]
------------------------------------------------------------------------
-- | CheckBox tools
-- checkboxes: Array of poolean values
-- checkbox : One boolean value only
checkbox :: R.State Boolean -> R.Element
checkbox ( val /\ set ) =
H.input { id: "checkbox-id"
, type: "checkbox"
, value: val
, className : "checkbox"
, on: { click: \_ -> set $ const $ not val}
}
src/Gargantext/Components/Login.purs
View file @
a716a918
...
...
@@ -19,6 +19,7 @@ import Reactix as R
import Reactix.DOM.HTML as H
------------------------------------------------------------------------
import Gargantext.Components.Forest.Tree.Node.Tools (checkbox)
import Gargantext.Components.Forms (clearfix, cardBlock, cardGroup, center, formGroup)
import Gargantext.Components.Login.Types (AuthRequest(..))
import Gargantext.Ends (Backend(..))
...
...
@@ -178,7 +179,7 @@ formCpt = R.hooksComponent "G.C.Login.form" cpt where
, center
[ H.label {}
[ H.div {className: "checkbox"}
[
termsC
heckbox setBox
[
c
heckbox setBox
, H.text "I hereby accept "
, H.a { target: "_blank"
, href: "http://gitlab.iscpif.fr/humanities/tofu/tree/master"
...
...
@@ -213,15 +214,6 @@ csrfTokenInput _ =
, value: csrfMiddlewareToken
} -- TODO hard-coded CSRF token
termsCheckbox :: R.State Boolean -> R.Element
termsCheckbox setCheckBox =
H.input { id: "terms-accept"
, type: "checkbox"
, value: fst setCheckBox
, className: "checkbox"
, on: { click: \_ -> (snd setCheckBox) $ const $ not (fst setCheckBox)}
}
termsLink :: {} -> R.Element
termsLink _ =
H.a { target: "_blank", href: termsUrl } [ H.text "the terms of use" ]
...
...
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