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
a3c5d466
Commit
a3c5d466
authored
Aug 30, 2024
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/262-dev-phylo-doc-search-ux-improvements' into dev
parents
02a5acef
805b1361
Pipeline
#6572
passed with stages
in 22 minutes and 49 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
DocList.purs
src/Gargantext/Components/PhyloExplorer/Sidebar/DocList.purs
+9
-4
No files found.
src/Gargantext/Components/PhyloExplorer/Sidebar/DocList.purs
View file @
a3c5d466
...
...
@@ -12,7 +12,7 @@ import Data.Sequence as Seq
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..), Variant(..))
import Gargantext.Components.Bootstrap.Types (ButtonVariant(..),
ComponentStatus(..),
Variant(..))
import Gargantext.Components.FacetsTable (DocumentsView(..), Rows(..), publicationDate, initialPageGQL, loadPageGQL)
import Gargantext.Components.PhyloExplorer.Store as PhyloStore
import Gargantext.Components.PhyloExplorer.Types (CorpusId, DocId, FrameDoc(..), ListId)
...
...
@@ -190,6 +190,8 @@ docListCpt = here.component "main" cpt where
Docs { docs } -> T.write_ (Just docs) rows
_ -> T.write_ (Just Seq.empty) rows
let statusOrAndButtons = if A.length q' >= 2 then Enabled else Disabled
-- | Computed
-- |
let
...
...
@@ -246,7 +248,7 @@ docListCpt = here.component "main" cpt where
H.div {}
[
H.ul { className: "flex-row list-group justify-content-space-between align-items-center mb-1" }
[ H.li {} [ andOrButton { state: buttonState } ]
[ H.li {} [ andOrButton { state: buttonState
, buttonStatus: statusOrAndButtons
} ]
, H.li {} [ H.p { className: "text-bold" } [ H.text "No related documents" ] ]
, H.li {} [ B.iconButton { name: "search", title: "Search the web", callback: \_ -> webSearch q' goToURLInNewTab} ]
, H.li {} [ B.iconButton { name: "wikipedia-w", title: "Search Wikipedia", callback: \_ -> wikipediaSearch q' goToURLInNewTab} ]
...
...
@@ -262,7 +264,7 @@ docListCpt = here.component "main" cpt where
H.div {}
[
H.ul { className: "flex-row list-group justify-content-space-between align-items-center mb-1" }
[ H.li {} [ andOrButton { state: buttonState } ]
[ H.li {} [ andOrButton { state: buttonState
, buttonStatus: statusOrAndButtons
} ]
, H.li {} [ H.p { className: "text-bold" } [ H.text $ show (Seq.length results) <> " related documents" ] ]
, H.li {} [ B.iconButton { name: "search", title: "Search the web", callback: \_ -> webSearch q' goToURLInNewTab} ]
, H.li {} [ B.iconButton { name: "wikipedia-w", title: "Search Wikipedia", callback: \_ -> wikipediaSearch q' goToURLInNewTab} ]
...
...
@@ -382,6 +384,7 @@ itemCpt = here.component "item" cpt where
type AndOrButtonProps =
( state :: T.Box Boolean
, buttonStatus :: ComponentStatus
)
andOrButton :: R2.Leaf AndOrButtonProps
...
...
@@ -389,7 +392,7 @@ andOrButton = R2.leaf andOrButtonCpt
andOrButtonCpt :: R.Component AndOrButtonProps
andOrButtonCpt = here.component "andOrButton" cpt
where
cpt { state } _ = do
cpt { state
, buttonStatus
} _ = do
state' <- R2.useLive' state
pure $
...
...
@@ -403,6 +406,7 @@ andOrButtonCpt = here.component "andOrButton" cpt
[
B.button
{ className: "btn-sm"
, status: buttonStatus
, callback: \_ -> T.write_ false state
, variant: state' ?
OutlinedButtonVariant Secondary $
...
...
@@ -412,6 +416,7 @@ andOrButtonCpt = here.component "andOrButton" cpt
,
B.button
{ className: "btn-sm"
, status: buttonStatus
, callback: \_ -> T.write_ true state
, variant: state' ?
ButtonVariant Secondary $
...
...
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