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
6db7d12b
Commit
6db7d12b
authored
Apr 06, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[searchfield] term escape double quotes
parent
8627e463
Pipeline
#2664
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+5
-4
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
6db7d12b
...
@@ -7,7 +7,8 @@ import Data.Maybe (Maybe(..), maybe, fromMaybe)
...
@@ -7,7 +7,8 @@ import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Newtype (over)
import Data.Newtype (over)
import Data.Nullable (null)
import Data.Nullable (null)
import Data.Set as Set
import Data.Set as Set
import Data.String.Common (joinWith)
import Data.String.Common (joinWith, replaceAll)
import Data.String.Pattern (Pattern(..), Replacement(..))
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import DOM.Simple.Console (log, log2)
import DOM.Simple.Console (log, log2)
import Effect (Effect)
import Effect (Effect)
...
@@ -613,15 +614,15 @@ searchQuery selection { databases, datafield, lang, term, node_id } =
...
@@ -613,15 +614,15 @@ searchQuery selection { databases, datafield, lang, term, node_id } =
queryHAL :: String -> Maybe (Set.Set IMT_org) -> Maybe Lang -> Array String -> String
queryHAL :: String -> Maybe (Set.Set IMT_org) -> Maybe Lang -> Array String -> String
queryHAL term mIMTOrgs lang years =
queryHAL term mIMTOrgs lang years =
"(" <> langPrefix <> "_title_t:
\"
" <> termEscaped <>
"(" <> langPrefix <> "_title_t:" <> termEscaped <>
"
\"
OR " <> langPrefix <> "_abstract_t:\"" <> termEscaped <> "\")" <>
" OR " <> langPrefix <> "_abstract_t:\"" <> termEscaped <> "\")" <>
structQuery <> yearQuery
structQuery <> yearQuery
where
where
langPrefix = case lang of
langPrefix = case lang of
Just FR -> "fr"
Just FR -> "fr"
_ -> "en"
_ -> "en"
-- TODO: Escape double quotes
-- TODO: Escape double quotes
termEscaped =
term
termEscaped =
"\"" <> (replaceAll (Pattern "\"") (Replacement "\\\"") term) <> "\""
structQuery = case mIMTOrgs of
structQuery = case mIMTOrgs of
Nothing -> ""
Nothing -> ""
Just imtOrgs -> if Set.isEmpty imtOrgs then
Just imtOrgs -> if Set.isEmpty imtOrgs then
...
...
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