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
132
Issues
132
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
ae221fac
Commit
ae221fac
authored
Jan 22, 2025
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy
parent
b41ffafb
Pipeline
#7255
passed with stages
in 19 minutes and 13 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
124 deletions
+128
-124
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+107
-103
SubcorpusCreation.purs
src/Gargantext/Components/DocsTable/SubcorpusCreation.purs
+20
-21
Types.purs
src/Gargantext/Components/DocsTable/Types.purs
+1
-0
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
ae221fac
...
...
@@ -197,7 +197,6 @@ docViewCpt = R2.hereComponent here "docView" hCpt
T2.reload reloadForest
goToRoute $ Routes.Corpus (sessionId session) id
-- handleRESTError hp errors eTask
-- \t -> liftEffect $ launchDocumentCreationProgress
-- errors
...
...
@@ -270,8 +269,7 @@ docViewCpt = R2.hereComponent here "docView" hCpt
, hasCollapsibleBackground: false
, size: LargeModalSize
}
[
DFC.documentFormCreation
[ DFC.documentFormCreation
{ callback: createDocumentCallback
, status: onDocumentCreationPending ? Deferred $ Enabled
}
...
...
@@ -284,8 +282,7 @@ docViewCpt = R2.hereComponent here "docView" hCpt
, hasCollapsibleBackground: false
, size: MediumModalSize
}
[
subcorpusCreation
[ subcorpusCreation
{ callback: createSubcorpusCallback
, query'
, reuseParentList
...
...
@@ -337,7 +334,7 @@ docViewCpt = R2.hereComponent here "docView" hCpt
---------------------------------------------------
type SearchBarProps =
(
query :: T.Box Query, isSubcorpusModalVisibleBox :: T.Box Boolean
)
(
query :: T.Box Query, isSubcorpusModalVisibleBox :: T.Box Boolean
)
searchBar :: R2.Component SearchBarProps
searchBar = R.createElement searchBarCpt
...
...
@@ -345,24 +342,26 @@ searchBar = R.createElement searchBarCpt
searchBarCpt :: R.Component SearchBarProps
searchBarCpt = here.component "searchBar" cpt
where
cpt { query, isSubcorpusModalVisibleBox
} _children = do
cpt { query, isSubcorpusModalVisibleBox
} _children = do
query' <- T.useLive T.unequal query
queryText <- T.useBox query'
queryText' <- T.useLive T.unequal queryText
pure $ R.fragment [
H.div {className: "input-group px-5"}
[ H.input { className: "form-control"
pure $ R.fragment
[ H.div { className: "input-group px-5" }
[ H.input
{ className: "form-control"
, id: "docs-input-search"
, defaultValue: query'
, on: { change: onSearchChange queryText
, keyUp: onSearchKeyup query queryText' }
, on:
{ change: onSearchChange queryText
, keyUp: onSearchKeyup query queryText'
}
, placeholder: "Search in documents"
, type: "text" }
, H.div {className: "input-group-append"}
[
if query' /= ""
then
, type: "text"
}
, H.div { className: "input-group-append" }
[ if query' /= "" then
R.fragment
[ clearButton query
, searchButton query queryText'
...
...
@@ -405,12 +404,17 @@ searchBarCpt = here.component "searchBar" cpt
[ H.span { className: "text-danger fa fa-times" } [] ]
subCorpusButton modalVisible queryText' query =
H.button { className: "input-group-text btn btn-light text-secondary"
, on: { click: \_ -> do
H.button
{ className: "input-group-text btn btn-light text-secondary"
, on:
{ click: \_ -> do
T.write_ queryText' query
T.write_ true modalVisible }
, type: "submit" }
[ H.span {className: "fa fa-filter"} [] ]
T.write_ true modalVisible
}
, type: "submit"
, title: "Create a subcorpus"
}
[ H.span { className: "fa fa-filter" } [] ]
mock :: Boolean
mock = false
...
...
src/Gargantext/Components/DocsTable/SubcorpusCreation.purs
View file @
ae221fac
...
...
@@ -22,26 +22,25 @@ subcorpusCreation :: R2.Leaf Props
subcorpusCreation = R2.leaf component
component :: R.Component Props
component = R.hooksComponent "subcorpusCreation" cpt where
cpt {query', reuseParentList, reuseParentList', onSubcorpusCreationPending', callback} _ = do
pure $ H.div {} [
H.div {className: "form-group"} [
H.label {} [ H.text $ "Creating subcorpus from query: " <> query' ]
component = R.hooksComponent "subcorpusCreation" cpt
where
cpt { query', reuseParentList, reuseParentList', onSubcorpusCreationPending', callback } _ = do
pure $ H.div {}
[ H.div { className: "form-group" }
[ H.label {} [ H.text $ "Creating subcorpus from query: " <> query' ]
]
,
H.div {className: "form-check" } [
B.formCheckbox
, H.div { className: "form-check" }
[ B.formCheckbox
{ value: reuseParentList'
, callback: \_ -> T.modify_ not reuseParentList
}
, H.label { className: "form-check-label"} [H.text "Reuse parent list?"
]
, H.label { className: "form-check-label" } [ H.text "Reuse parent list?"
]
]
,
B.button
, B.button
{ callback: \_ -> callback query' reuseParentList'
, type: "submit"
, variant: ButtonVariant Primary
, status: if query' == "" then Disabled else if onSubcorpusCreationPending' then Deferred else Enabled
}
[ H.text "Create!"
]
[ H.text "Create!"
]
]
src/Gargantext/Components/DocsTable/Types.purs
View file @
ae221fac
...
...
@@ -124,6 +124,7 @@ newtype SubcorpusParams = SubcorpusParams
{ query :: Query
, reuseParentList :: Boolean
}
derive instance Eq SubcorpusParams
derive instance Generic SubcorpusParams _
derive newtype instance JSON.ReadForeign SubcorpusParams
...
...
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