Verified Commit 3d3ebc38 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into 203-dev-corpus-json-upload

parents 6095011f d720b1a6
{ {
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.6.9.9.4.3", "version": "0.0.6.9.9.4.5",
"scripts": { "scripts": {
"generate-purs-packages-nix": "./nix/generate-purs-packages.nix", "generate-purs-packages-nix": "./nix/generate-purs-packages.nix",
"generate-psc-packages-nix": "./nix/generate-packages-json.bash", "generate-psc-packages-nix": "./nix/generate-packages-json.bash",
......
...@@ -586,7 +586,7 @@ uploadFile { contents, fileFormat, lang, fileType, id, nodeType, mName, selectio ...@@ -586,7 +586,7 @@ uploadFile { contents, fileFormat, lang, fileType, id, nodeType, mName, selectio
, Tuple "_wjf_name" mName , Tuple "_wjf_name" mName
] ]
csvBodyParams = [ Tuple "_wtf_data" (Just contents) csvBodyParams = [ Tuple "_wtf_data" (Just contents)
, Tuple "_wtf_filetype" (Just $ show NodeList) , Tuple "_wtf_filetype" (Just $ show fileType)
, Tuple "_wtf_fileformat" (Just $ show fileFormat) , Tuple "_wtf_fileformat" (Just $ show fileFormat)
, Tuple "_wf_lang" (Just $ show lang) , Tuple "_wf_lang" (Just $ show lang)
, Tuple "_wtf_name" mName , Tuple "_wtf_name" mName
......
...@@ -13,6 +13,7 @@ import Gargantext.Prelude ...@@ -13,6 +13,7 @@ import Gargantext.Prelude
import Data.Array as A import Data.Array as A
import Data.Array as Array import Data.Array as Array
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Foldable (any)
import Data.FunctorWithIndex (mapWithIndex) import Data.FunctorWithIndex (mapWithIndex)
import Data.Lens (to, view, (.~), (^.), (^?)) import Data.Lens (to, view, (.~), (^.), (^?))
import Data.Lens.At (at) import Data.Lens.At (at)
...@@ -47,7 +48,7 @@ import Gargantext.Components.Table.Types (Params, orderByToGTOrderBy) ...@@ -47,7 +48,7 @@ import Gargantext.Components.Table.Types (Params, orderByToGTOrderBy)
import Gargantext.Components.Table.Types as TT import Gargantext.Components.Table.Types as TT
import Gargantext.Config.REST (AffRESTError, RESTError, logRESTError) import Gargantext.Config.REST (AffRESTError, RESTError, logRESTError)
import Gargantext.Core.NgramsTable.Functions (addNewNgramA, applyNgramsPatches, chartsAfterSync, commitPatch, convOrderBy, coreDispatch, filterTermSize, ngramsRepoElementToNgramsElement, normNgram, patchSetFromMap, singletonNgramsTablePatch, tablePatchHasNgrams, toVersioned) import Gargantext.Core.NgramsTable.Functions (addNewNgramA, applyNgramsPatches, chartsAfterSync, commitPatch, convOrderBy, coreDispatch, filterTermSize, ngramsRepoElementToNgramsElement, normNgram, patchSetFromMap, singletonNgramsTablePatch, tablePatchHasNgrams, toVersioned)
import Gargantext.Core.NgramsTable.Types (Action(..), CoreAction(..), State, Dispatch, NgramsActionRef, NgramsClick, NgramsElement(..), NgramsPatch(..), NgramsTable, NgramsTablePatch(..), NgramsTerm(..), PageParams, PatchMap(..), Versioned(..), VersionedNgramsTable, VersionedWithCountNgramsTable, _NgramsElement, _NgramsRepoElement, _NgramsTable, _children, _list, _ngrams, _ngrams_repo_elements, _ngrams_scores, _occurrences, _root, applyPatchSet, ngramsTermText, replace) import Gargantext.Core.NgramsTable.Types (Action(..), CoreAction(..), State, Dispatch, NgramsActionRef, NgramsClick, NgramsElement(..), NgramsPatch(..), NgramsRepoElement(..), NgramsTable, NgramsTablePatch(..), NgramsTerm(..), PageParams, PatchMap(..), Versioned(..), VersionedNgramsTable, VersionedWithCountNgramsTable, _NgramsElement, _NgramsRepoElement, _NgramsTable, _children, _list, _ngrams, _ngrams_repo_elements, _ngrams_scores, _occurrences, _root, applyPatchSet, ngramsTermText, replace)
import Gargantext.Hooks.Loader (useLoaderBox) import Gargantext.Hooks.Loader (useLoaderBox)
import Gargantext.Routes (SessionRoute(..)) as Routes import Gargantext.Routes (SessionRoute(..)) as Routes
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
...@@ -525,7 +526,11 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where ...@@ -525,7 +526,11 @@ loadedNgramsTableBodyCpt = here.component "loadedNgramsTableBody" cpt where
exactMatches :: Boolean exactMatches :: Boolean
exactMatches = not $ Seq.null $ Seq.filter fltr nres exactMatches = not $ Seq.null $ Seq.filter fltr nres
where where
fltr (Tuple ng _) = queryExactMatchesLabel searchQuery (ngramsTermText ng) -- | Match either ngrams term or its children with the
-- | `queryExactMatchesLabel` function.
fltr :: Tuple NgramsTerm NgramsRepoElement -> Boolean
fltr (Tuple ng (NgramsRepoElement { children })) =
any (queryExactMatchesLabel searchQuery) $ (Set.map ngramsTermText $ Set.insert ng children)
rowsFilter :: NgramsElement -> Maybe NgramsElement rowsFilter :: NgramsElement -> Maybe NgramsElement
rowsFilter ngramsElement = rowsFilter ngramsElement =
if displayRow { ngramsElement if displayRow { ngramsElement
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment