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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
7cdf92d2
Commit
7cdf92d2
authored
Apr 16, 2020
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
82a95f5d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
11 deletions
+31
-11
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+8
-1
Core.purs
src/Gargantext/Components/NgramsTable/Core.purs
+2
-2
Ends.purs
src/Gargantext/Ends.purs
+19
-6
Routes.purs
src/Gargantext/Routes.purs
+2
-2
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
7cdf92d2
...
...
@@ -332,7 +332,8 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
render dispatch { path: path@({searchQuery, scoreType, params, termListFilter} /\ setPath)
, versioned: Versioned { data: initTable }
, tabNgramType }
state@{ ngramsParent, ngramsChildren, ngramsLocalPatch
state@{ ngramsParent, ngramsChildren
, ngramsLocalPatch, ngramsStagePatch, ngramsValidPatch
, ngramsSelection, ngramsSelectAll }
_reactChildren =
[ autoUpdateElt { duration: 3000, effect: dispatch Synchronize }
...
...
@@ -394,9 +395,15 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
-- ^ unless they are scheduled to be removed.
|| tablePatchHasNgrams ngramsLocalPatch ngrams
-- ^ unless they are being processed at the moment.
|| tablePatchHasNgrams ngramsStagePatch ngrams
-- ^ unless they are being processed at the moment.
|| tablePatchHasNgrams ngramsValidPatch ngrams
-- ^ unless they are part of our local patches.
convertRow (Tuple ngrams ngramsElement) =
{ row: R2.buff <$> renderNgramsItem { ngramsTable, ngrams,
ngramsLocalPatch,
ngramsStagePatch,
ngramsValidPatch,
ngramsParent, ngramsElement,
ngramsSelection, dispatch }
, delete: false
...
...
src/Gargantext/Components/NgramsTable/Core.purs
View file @
7cdf92d2
...
...
@@ -616,7 +616,7 @@ postNewNgrams newNgrams mayList {nodeId, listIds, tabType, session} =
when (not (A.null newNgrams)) $ do
(_ :: Array Unit) <- post session p newNgrams
pure unit
where p = P
u
tNgrams tabType (head listIds) mayList (Just nodeId)
where p = P
os
tNgrams tabType (head listIds) mayList (Just nodeId)
postNewElems :: forall s. NewElems -> CoreParams s -> Aff Unit
postNewElems newElems params = void $ traverseWithIndex postNewElem newElems
...
...
@@ -630,7 +630,7 @@ addNewNgram ngrams list =
putNgramsPatches :: forall s. CoreParams s -> VersionedNgramsPatches -> Aff VersionedNgramsPatches
putNgramsPatches {session, nodeId, listIds, tabType} = put session putNgrams
where putNgrams = PutNgrams tabType (
head listIds) Nothing
(Just nodeId)
where putNgrams = PutNgrams tabType (
unsafePartial $ head listIds)
(Just nodeId)
syncPatches :: forall p s. CoreParams p -> CoreState s -> StateCoTransformer (CoreState s) Unit
syncPatches props { ngramsLocalPatch: ngramsLocalPatch@{ngramsNewElems, ngramsPatches}
...
...
src/Gargantext/Ends.purs
View file @
7cdf92d2
...
...
@@ -9,7 +9,9 @@ import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Maybe (Maybe(..), maybe)
import Gargantext.Routes as R
import Gargantext.Types (ApiVersion, Limit, NodePath, NodeType(..), Offset, TabType(..), TermSize(..), nodePath, nodeTypePath, showTabType')
import Gargantext.Types (ApiVersion, Limit, NodePath, NodeType(..), Offset,
TabType(..), TermSize(..), nodePath, nodeTypePath, showTabType', ListId,
TermList)
import Prelude (class Eq, class Show, identity, show, ($), (<>), bind, pure, (<<<), (==))
-- | A means of generating a url to visit, a destination
...
...
@@ -124,8 +126,8 @@ sessionPath (R.GetNgrams opts i) =
<> offsetUrl opts.offset
<> limitUrl opts.limit
<> orderByUrl opts.orderBy
<> foldMap
(\x -> "&list=" <> show x)
opts.listIds
<> foldMap
(\x -> "&listType=" <> show x)
opts.termListFilter
<> foldMap
listUrl
opts.listIds
<> foldMap
listTypeUrl
opts.termListFilter
<> foldMap termSizeFilter opts.termSizeFilter
<> "&scoreType=" <> show opts.scoreType
<> search opts.searchQuery
...
...
@@ -138,12 +140,17 @@ sessionPath (R.GetNgrams opts i) =
search s = "&search=" <> s
sessionPath (R.ListDocument lId dId) =
sessionPath $ R.NodeAPI NodeList lId ("document/" <> (show $ maybe 0 identity dId))
sessionPath (R.PutNgrams t listId
termList
i) =
sessionPath (R.PutNgrams t listId i) =
sessionPath $ R.NodeAPI Node i
$ "ngrams?ngramsType="
<> showTabType' t
<> maybe "" (\x -> "&list=" <> show x) listId
<> foldMap (\x -> "&listType=" <> show x) termList
<> listUrl listId
sessionPath (R.PostNgrams t listId termList i) =
sessionPath $ R.NodeAPI Node i
$ "ngrams?ngramsType="
<> showTabType' t
<> listUrl listId
<> foldMap listTypeUrl termList
sessionPath (R.NodeAPI nt i p) = nodeTypePath nt
<> (maybe "" (\i' -> "/" <> show i') i)
<> (if p == "" then "" else "/" <> p)
...
...
@@ -193,6 +200,12 @@ orderUrl = maybe "" (\x -> "&order=" <> show x)
orderByUrl :: forall a. Show a => Maybe a -> String
orderByUrl = maybe "" (\x -> "&orderBy=" <> show x)
listUrl :: ListId -> String
listUrl l = "&list=" <> show l
listTypeUrl :: TermList -> String
listTypeUrl l = "&listType=" <> show l
-- nodeTypePath :: NodeType -> Path
-- nodeTypePath = NodeAPI
...
...
src/Gargantext/Routes.purs
View file @
7cdf92d2
...
...
@@ -28,8 +28,8 @@ data SessionRoute
= Tab TabType (Maybe Id)
| Children NodeType Offset Limit (Maybe OrderBy) (Maybe Id)
| GetNgrams NgramsGetOpts (Maybe Id)
| PutNgrams TabType
(Maybe ListId) (Maybe TermList)
(Maybe Id)
-- ^ This name is not good. In particular this URL is used both in PUT and POST.
| PutNgrams TabType
ListId
(Maybe Id)
| PostNgrams TabType ListId (Maybe TermList) (Maybe Id)
| NodeAPI NodeType (Maybe Id) String
| ListDocument (Maybe ListId) (Maybe Id)
| Search SearchOpts (Maybe Id)
...
...
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