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
139
Issues
139
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
e70e19ad
Commit
e70e19ad
authored
Dec 20, 2024
by
Przemyslaw Kaminski
Committed by
Fabien Maniere
Jan 03, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[form] add labels to action dialog forms
parent
c64760c7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
48 deletions
+61
-48
Add.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
+36
-30
Update.purs
...Gargantext/Components/Forest/Tree/Node/Action/Update.purs
+8
-8
Upload.purs
...Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
+9
-5
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+7
-4
ListSelection.purs
src/Gargantext/Components/ListSelection.purs
+1
-1
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
View file @
e70e19ad
...
...
@@ -100,37 +100,35 @@ addNodeViewCpt = here.component "addNodeView" cpt
T.write_ nt nodeType
maybeChoose =
if length nodeTypes > 1 then
[
Tools.formChoice
{ items: nodeTypes
, default: nodeType'
, callback: setNodeType'
, print: print hasChromeAgent'
}
[]
]
Tools.formChoice
{ items: nodeTypes
, default: nodeType'
, callback: setNodeType'
, print: print hasChromeAgent'
, label: "Node type:"
}
[
]
else
[ H.div {}
[ H.text $ "Creating a node of type "
<> show defaultNodeType
<> " with name:"
]
]
H.div {}
[ H.text $ "Creating a node of type "
<> show defaultNodeType
<> " with name:"
]
maybeEdit =
if edit then
[ inputWithEnterWithKey
{ autoFocus: true
, className: "form-control"
, defaultValue: nodeName' -- (prettyNodeType nt')
, key: show nodeType'
, onBlur: \val -> T.write_ val nodeName
, onEnter: \_ -> launchAff_ $ dispatch action
, onValueChanged: \val -> T.write_ val nodeName
, placeholder: nodeName' -- (prettyNodeType nt')
, required: false
, type: "text"
}
]
else []
inputWithEnterWithKey
{ autoFocus: true
, className: "form-control"
, defaultValue: nodeName' -- (prettyNodeType nt')
, key: show nodeType'
, onBlur: \val -> T.write_ val nodeName
, onEnter: \_ -> launchAff_ $ dispatch action
, onValueChanged: \val -> T.write_ val nodeName
, placeholder: nodeName' -- (prettyNodeType nt')
, required: false
, type: "text"
}
else H.div {} []
pure $
Tools.panelWithSubmitButton
...
...
@@ -140,8 +138,16 @@ addNodeViewCpt = here.component "addNodeView" cpt
, iconName: "plus"
, textTitle: "Add a child node element"
}
[ H.div { className: "pt-2" }
(maybeChoose <> maybeEdit)
[ R2.row
[ R2.col 6
[ H.div { className: "form-group" } [ maybeChoose ] ]
, R2.col 6
[ H.div { className: "form-group" }
[ H.label {} [ H.text "Name:" ]
, maybeEdit
]
]
]
]
-- END Create Node
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Update.purs
View file @
e70e19ad
...
...
@@ -75,12 +75,12 @@ updateDashboardCpt = here.component "updateDashboard" cpt
, iconName: ""
, textTitle: "Update the dashboard"
}
[ -- H.text "Update with"
Tools.formChoiceSafe
[ Tools.formChoiceSafe
{ items: [ All, Sources, Authors, Institutes, Ngrams ]
, default: methodBoard'
, callback: \val -> T.write_ val methodBoard
, print: show
, label: "Update with:"
}
[]
]
...
...
@@ -133,12 +133,12 @@ updateGraphCpt = here.component "updateGraph" cpt
, iconName: "reload-with-settings"
, textTitle: "Update the graph"
}
[ H.text "Show subjects with Order1 or concepts with Order2 ?"
, Tools.formChoiceSafe
[ Tools.formChoiceSafe
{ items: [ Order1, Order2 ]
, default: methodGraphMetric'
, callback: \val -> T.write_ val methodGraphMetric
, print: show
, label: "Show subjects with Order1 or concepts with Order2 ?"
}
[]
]
...
...
@@ -296,12 +296,12 @@ updateCorpusCpt = here.component "updateTexts" cpt
]
-- H.p {} [ H.text "Update both term and document indexing." ]
, H.p {}
[ H.text "Term update mode"
, Tools.formChoiceSafe
[ Tools.formChoiceSafe
{ items: [ Basic, Advanced, WithModel ]
, default: methodList'
, callback: \val -> T.write_ val methodList
, print: show
, label: "Term update mode"
}
[]
]
...
...
@@ -326,12 +326,12 @@ updateNodeListCpt = here.component "updateNodeList" cpt
, iconName: "reload-with-settings"
, textTitle: "Update terms"
}
[ -- H.text "Update with"
Tools.formChoiceSafe
[ Tools.formChoiceSafe
{ items: [ Basic, Advanced, WithModel ]
, default: methodList'
, callback: \val -> T.write_ val methodList
, print: show
, label: "Update with:"
}
[]
]
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Upload.purs
View file @
e70e19ad
...
...
@@ -258,7 +258,7 @@ uploadFileViewWithLangsCpt = here.component "uploadFileViewWithLangs" cpt
selects =
if processed' then
[ R2.row
[ H.div { className: "col-12 f
lex-space-around
" }
[ H.div { className: "col-12 f
orm-group]
" }
[ B.formSelect'
{ list:
[ TSV
...
...
@@ -286,16 +286,20 @@ uploadFileViewWithLangsCpt = here.component "uploadFileViewWithLangs" cpt
, H.div { className: "alert alert-info", role: "alert" }
[ H.text infoText' ]
, R2.row
[ H.div { className: "col-12 flex-space-around" }
[ H.text "Please choose the language of your documents:"
, Tools.formChoiceSafe
[ H.div { className: "col-12" }
[ Tools.formChoiceSafe
{ items: langs <> [ No_extraction ]
, default: EN
, callback: setLang'
, print: show
, label: "Please choose the language of your documents:"
}
[]
, H.text "Please choose the list of terms to use:"
]
]
, R2.row
[ H.div { className: "col-12 form-group" }
[ H.label {} [ H.text "Please choose the list of terms to use:" ]
, ListSelection.selection { selection, session } []
]
]
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
e70e19ad
...
...
@@ -263,6 +263,7 @@ type FormChoiceSafeProps item m =
, default :: item
, callback :: item -> Effect m
, print :: item -> String
, label :: String
)
-- | Form Choice input
...
...
@@ -276,17 +277,18 @@ formChoiceSafe = R.createElement formChoiceSafeCpt
formChoiceSafeCpt :: forall item m. Show item => R.Component (FormChoiceSafeProps item m)
formChoiceSafeCpt = here.component "formChoiceSafe" cpt
where
cpt { items, default, callback, print } _ = do
cpt { items, default, callback, print
, label
} _ = do
pure $ case items of
[] -> H.div {} []
[ n ] -> formButton { item: n, callback, print } []
_ -> formChoice { items, default, callback, print } []
_ -> formChoice { items, default, callback, print
, label
} []
type FormChoiceProps item m =
( items :: Array item
, default :: item
, callback :: item -> Effect m
, print :: item -> String
, label :: String
)
-- | List Form
...
...
@@ -299,9 +301,10 @@ formChoice = R.createElement formChoiceCpt
formChoiceCpt :: forall item m. Show item => R.Component (FormChoiceProps item m)
formChoiceCpt = here.component "formChoice" cpt
where
cpt { items, callback, default, print } _ = do
cpt { items, callback, default, print
, label
} _ = do
pure $ H.div { className: "form-group" }
[ R2.select
[ H.label {} [ H.text label ]
, R2.select
{ className: "form-control with-icon-font"
, defaultValue: show default
, on: { change }
...
...
src/Gargantext/Components/ListSelection.purs
View file @
e70e19ad
...
...
@@ -32,7 +32,7 @@ selectionCpt = here.component "selection" cpt
where
cpt { selection, session } _ = do
selection' <- R2.useLive' selection
pure $ H.div { className: "list-selection
p-1
" }
pure $ H.div { className: "list-selection" }
[ B.formSelect'
{ callback: flip T.write_ selection
, value: selection'
...
...
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