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
bcd18e87
Commit
bcd18e87
authored
Jan 28, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NGRAMSTABLE] WIP fix default behavior.
parent
eef156fc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
20 deletions
+28
-20
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+1
-1
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+3
-3
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+3
-3
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+13
-5
Core.purs
src/Gargantext/Components/NgramsTable/Core.purs
+6
-6
Tabs.purs
src/Gargantext/Components/Nodes/Lists/Tabs.purs
+1
-1
Table.purs
src/Gargantext/Components/Table.purs
+1
-1
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
bcd18e87
...
...
@@ -343,7 +343,7 @@ loadPage session {nodeId, tabType, query, listId, corpusId, params: {limit, offs
let docs = res2corpus <$> res.docs
pure $
if mock then
Tuple
4737
(take limit $ drop offset sampleData)
Tuple
0
(take limit $ drop offset sampleData)
else
Tuple res.count docs
where
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
bcd18e87
...
...
@@ -96,10 +96,10 @@ toHtml reload treeState@(ts@{tree: (NTree (LNode {id, name, nodeType}) ary), asy
pAction = performAction session reload openNodes treeState
cpt props _ = do
let folderIsOpen = Set.member id (fst openNodes)
let setFn = if folderIsOpen then Set.delete else Set.insert
let folderIsOpen
= Set.member id (fst openNodes)
let setFn
= if folderIsOpen then Set.delete else Set.insert
let toggleFolderIsOpen _ = (snd openNodes) (setFn id)
let folderOpen = Tuple folderIsOpen toggleFolderIsOpen
let folderOpen
= Tuple folderIsOpen toggleFolderIsOpen
let withId (NTree (LNode {id: id'}) _) = id'
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
bcd18e87
...
...
@@ -57,10 +57,10 @@ nodeMainSpan d p folderOpen session frontends = R.createElement el p []
el = R.hooksComponent "NodeMainSpan" cpt
cpt props@{id, asyncTasks, mCurrentRoute, name, nodeType, onAsyncTaskFinish} _ = do
-- only 1 popup at a time is allowed to be opened
popupOpen <- R.useState' (Nothing :: Maybe NodePopup)
popupOpen
<- R.useState' (Nothing :: Maybe NodePopup)
popupPosition <- R.useState' (Nothing :: Maybe R2.Point)
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
isDragOver <- R.useState' false
droppedFile
<- R.useState' (Nothing :: Maybe DroppedFile)
isDragOver
<- R.useState' false
pure $ H.span (dropProps droppedFile isDragOver) $
[ folderIcon nodeType folderOpen
...
...
src/Gargantext/Components/NgramsTable.purs
View file @
bcd18e87
...
...
@@ -167,7 +167,10 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
, H.div {} (
if A.null props.tableBody && searchQuery /= "" then [
H.button { className: "btn btn-primary"
, on: {click: const $ dispatch $ addNewNgramA $ normNgram tabNgramType searchQuery}
, on: {click: const $ dispatch
$ addNewNgramA
$ normNgram tabNgramType searchQuery
}
}
[ H.text ("Add " <> searchQuery) ]
] else [])]
...
...
@@ -204,7 +207,7 @@ tableContainer { path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
ngramsClick {depth: 1, ngrams: child} =
Just $ dispatch $ ToggleChild false child
ngramsClick _ = Nothing
ngramsEdit _ = Nothing
ngramsEdit
_ = Nothing
in
[ H.p {} [H.text $ "Editing " <> ngramsTermText ngrams]
, R2.buff $ renderNgramsTree { ngramsTable, ngrams, ngramsStyle: [], ngramsClick, ngramsEdit }
...
...
@@ -336,7 +339,7 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
}
]
where
totalRecords =
47361 -- TODO
totalRecords =
0 -- TODO, 0 to show first users that it is fake (until it is fixed)
colNames = T.ColumnName <$> ["Select", "Map", "Stop", "Terms", "Score"] -- see convOrderBy
selected =
input
...
...
@@ -354,7 +357,7 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
ngramsTable = applyNgramsPatches state initTable
orderWith =
case convOrderBy <$> params.orderBy of
Just ScoreAsc -> A.sortWith \x -> (snd x) ^. _NgramsElement <<< _occurrences
Just ScoreAsc -> A.sortWith \x -> (snd x)
^. _NgramsElement <<< _occurrences
Just ScoreDesc -> A.sortWith \x -> Down $ (snd x) ^. _NgramsElement <<< _occurrences
_ -> identity -- the server ordering is enough here
...
...
@@ -365,7 +368,12 @@ loadedNgramsTableSpec = Thermite.simpleSpec performAction render
ngramsParentRoot :: Maybe NgramsTerm
ngramsParentRoot =
(\np -> ngramsTable ^? at np <<< _Just <<< _NgramsElement <<< _root <<< _Just) =<< ngramsParent
(\np -> ngramsTable ^? at np
<<< _Just
<<< _NgramsElement
<<< _root
<<< _Just
) =<< ngramsParent
displayRow (NgramsElement {ngrams, root}) =
root == Nothing
...
...
src/Gargantext/Components/NgramsTable/Core.purs
View file @
bcd18e87
...
...
@@ -180,13 +180,13 @@ _list = prop (SProxy :: SProxy "list")
derive instance newtypeNgramsElement :: Newtype NgramsElement _
_NgramsElement :: Iso' NgramsElement {
children :: Set NgramsTerm
, list :: TermList
, ngrams :: NgramsTerm
_NgramsElement
:: Iso' NgramsElement {
children
:: Set NgramsTerm
, list
:: TermList
, ngrams
:: NgramsTerm
, occurrences :: Int
, parent :: Maybe NgramsTerm
, root :: Maybe NgramsTerm
, parent
:: Maybe NgramsTerm
, root
:: Maybe NgramsTerm
}
_NgramsElement = _Newtype
...
...
src/Gargantext/Components/Nodes/Lists/Tabs.purs
View file @
bcd18e87
...
...
@@ -57,4 +57,4 @@ ngramsViewCpt = R.staticComponent "ListsNgramsView" cpt
chart Authors = pie {session, path}
chart Sources = bar {session, path}
chart Institutes = tree {session, path: path2}
chart Terms = metrics {session, path: path2}
chart Terms
= metrics {session, path: path2}
src/Gargantext/Components/Table.purs
View file @
bcd18e87
...
...
@@ -79,7 +79,7 @@ type TableHeaderLayoutProps =
)
initialParams :: Params
initialParams = stateParams {page: 1, pageSize: PS10, orderBy:
Nothing
}
initialParams = stateParams {page: 1, pageSize: PS10, orderBy:
Just (DESC $ ColumnName "Score")
}
-- TODO: Not sure this is the right place for this
tableHeaderLayout :: Record TableHeaderLayoutProps -> R.Element
...
...
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