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
e755e9e3
Commit
e755e9e3
authored
Nov 22, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FOREST] Search fix.
parent
fbd2a276
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
SearchField.purs
src/Gargantext/Components/Search/SearchField.purs
+23
-1
Types.purs
src/Gargantext/Components/Search/Types.purs
+6
-4
No files found.
src/Gargantext/Components/Search/SearchField.purs
View file @
e755e9e3
...
...
@@ -76,7 +76,6 @@ searchFieldComponent = R.memo (R.hooksComponent "SearchField" cpt) eqProps
, if isExternal s.datafield
then databaseInput search props.databases
else div {} []
, H.text $ show s.datafield
, if isHAL s.datafield
then orgInput search allOrgs
else div {} []
...
...
@@ -221,6 +220,29 @@ dataFieldNav ({datafield} /\ setSearch) datafields =
------------------------------------------------------------------------
databaseNav :: R.State Search
-> Array Database
-> R.Element
databaseNav ({datafield} /\ setSearch) dbs =
R.fragment [ div {className: "text-primary center"} [text "with DataField"]
, div { className: "nav nav-tabs"} (liItem <$> dbs)
, div {className:"center"} [ text $ maybe "" doc db ]
]
where
db = case datafield of
(Just (External (Just x))) -> Just x
_ -> Nothing
liItem :: Database -> R.Element
liItem df' =
div { className : "nav-item nav-link" <> if (Just $ External $ Just df') == datafield then " active" else ""
, on: { click: \_ -> setSearch $ _ { datafield = Just $ External $ Just df' } }
} [ text (show df') ]
databaseInput :: R.State Search
-> Array Database
-> R.Element
...
...
src/Gargantext/Components/Search/Types.purs
View file @
e755e9e3
...
...
@@ -71,8 +71,8 @@ data DataField = Gargantext
| Files
instance showDataField :: Show DataField where
show Gargantext = "
Interne
"
show (External x) = "Extern
e "
<> show x
show Gargantext = "
Gargantext
"
show (External x) = "Extern
al" --
<> show x
show Web = "Web"
show Files = "Files"
...
...
@@ -83,12 +83,15 @@ instance docDataField :: Doc DataField where
doc Files = "Zip files with formats.."
-- derive instance eqDataField :: Eq DataField
derive instance eqDataField :: Eq DataField
{-
instance eqDataField :: Eq DataField where
eq Gargantext Gargantext = true
eq (External _) (External _) = true
eq Web Web = true
eq _ _ = false
-}
------------------------------------------------------------------------
-- | Database search specifications
...
...
@@ -141,7 +144,6 @@ readDatabase _ = Nothing
derive instance eqDatabase :: Eq Database
instance encodeJsonDatabase :: EncodeJson Database where
encodeJson a = encodeJson (show a)
------------------------------------------------------------------------
...
...
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