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
2c7fecfd
Commit
2c7fecfd
authored
Jul 29, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Tabs] more reactix components
parent
70fe17b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
66 deletions
+77
-66
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+3
-2
Specs.purs
src/Gargantext/Pages/Annuaire/User/Contacts/Tabs/Specs.purs
+11
-7
Specs.purs
src/Gargantext/Pages/Lists/Tabs/Specs.purs
+0
-22
Specs.purs
src/Gargantext/Pages/Texts/Tabs/Specs.purs
+63
-35
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
2c7fecfd
...
@@ -157,9 +157,10 @@ instance decodeResponse :: DecodeJson Response where
...
@@ -157,9 +157,10 @@ instance decodeResponse :: DecodeJson Response where
pure $ Response { cid, category: decodeCategory favorite, ngramCount, hyperdata }
pure $ Response { cid, category: decodeCategory favorite, ngramCount, hyperdata }
docViewSpec ::
Spec {} Props Void
docViewSpec ::
Props -> R.Element
docViewSpec
= R2.elSpec $ R.hooksComponent "DocView" cpt
docViewSpec
p = R.createElement el p []
where
where
el = R.hooksComponent "DocView" cpt
cpt p _children = do
cpt p _children = do
documentIdsDeleted <- R.useState' (mempty :: DocumentIdsDeleted)
documentIdsDeleted <- R.useState' (mempty :: DocumentIdsDeleted)
localCategories <- R.useState' (mempty :: LocalCategories)
localCategories <- R.useState' (mempty :: LocalCategories)
...
...
src/Gargantext/Pages/Annuaire/User/Contacts/Tabs/Specs.purs
View file @
2c7fecfd
...
@@ -14,7 +14,10 @@ import Gargantext.Components.DocsTable as DT
...
@@ -14,7 +14,10 @@ import Gargantext.Components.DocsTable as DT
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Tab as Tab
import Gargantext.Pages.Annuaire.User.Contacts.Types (ContactData)
import Gargantext.Pages.Annuaire.User.Contacts.Types (ContactData)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import React (Children, ReactElement, ReactClass, createElement)
import React (Children, ReactElement, ReactClass, createElement)
import Thermite (Spec, focus, hideState, noState, cmapProps, createClass)
import Thermite (Spec, focus, hideState, noState, cmapProps, createClass)
...
@@ -68,13 +71,14 @@ statefulTabs =
...
@@ -68,13 +71,14 @@ statefulTabs =
where
where
chart = mempty
chart = mempty
-- TODO totalRecords
-- TODO totalRecords
docs = cmapProps (\{nodeId, contactData: {defaultListId}} ->
docs = noState $ R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" $ \{nodeId, contactData: {defaultListId}} _ -> do
{ nodeId, chart
pure $ DT.docViewSpec
, tabType: TabPairing TabDocs
{ nodeId
, totalRecords: 4736
, chart
, listId: defaultListId
, tabType: TabPairing TabDocs
, corpusId: Nothing}) $
, totalRecords: 4736
noState DT.docViewSpec
, listId: defaultListId
, corpusId: Nothing}
ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action
ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action
ngramsViewSpec {mode} =
ngramsViewSpec {mode} =
...
...
src/Gargantext/Pages/Lists/Tabs/Specs.purs
View file @
2c7fecfd
...
@@ -58,28 +58,6 @@ statefulTabs =
...
@@ -58,28 +58,6 @@ statefulTabs =
, Tuple "Institutes" $ ngramsViewSpec {mode: Institutes}
, Tuple "Institutes" $ ngramsViewSpec {mode: Institutes}
, Tuple "Terms" $ ngramsViewSpec {mode: Terms }
, Tuple "Terms" $ ngramsViewSpec {mode: Terms }
]
]
where
-- TODO totalRecords
docs = noState ( cmapProps (\{corpusId} -> {corpusId, tabType: TabCorpus TabDocs}) histoSpec
<>
(cmapProps (\{corpusId, corpusData: {defaultListId}} ->
{ nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
, chart : H.div {} []
, tabType: TabCorpus TabDocs
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId}) $ noState DT.docViewSpec
)
)
trash = cmapProps (\{corpusId, corpusData: {defaultListId}} ->
{ nodeId: corpusId
, chart : H.div {} []
, tabType: TabCorpus TabTrash
, totalRecords: 4736
, listId: defaultListId
, corpusId: Nothing}) $ noState DT.docViewSpec
ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action
ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action
...
...
src/Gargantext/Pages/Texts/Tabs/Specs.purs
View file @
2c7fecfd
...
@@ -22,6 +22,7 @@ import Gargantext.Components.DocsTable as DT
...
@@ -22,6 +22,7 @@ import Gargantext.Components.DocsTable as DT
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Tab as Tab
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import React (ReactElement, ReactClass, createElement, Children)
import React (ReactElement, ReactClass, createElement, Children)
import Thermite (Spec, hideState, noState, cmapProps, createClass)
import Thermite (Spec, hideState, noState, cmapProps, createClass)
...
@@ -61,41 +62,68 @@ statefulTabs =
...
@@ -61,41 +62,68 @@ statefulTabs =
docs = noState ( cmapProps (\{corpusId} -> {corpusId, tabType: TabCorpus TabDocs}) histoSpec
docs = noState ( cmapProps (\{corpusId} -> {corpusId, tabType: TabCorpus TabDocs}) histoSpec
<>
<>
(cmapProps (\{corpusId, corpusData: {defaultListId}} ->
(cmapProps identity $ docViewSpec TabDocs)
{ nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
, chart : H.div {} []
, tabType: TabCorpus TabDocs
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId}) $ noState DT.docViewSpec
)
)
)
moreLikeFav = noState (cmapProps (\{corpusId, corpusData: {defaultListId}} ->
moreLikeFav = noState $ cmapProps identity $ docViewSpec TabMoreLikeFav
{ nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
moreLikeTrash = noState $ cmapProps identity $ docViewSpec TabMoreLikeTrash
, chart : H.div {} []
, tabType: TabCorpus TabMoreLikeFav
trash = noState $ cmapProps identity $ docViewSpec TabTrash
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId}) $ noState DT.docViewSpec
)
moreLikeTrash = noState (cmapProps (\{corpusId, corpusData: {defaultListId}} ->
{ nodeId: corpusId
--docViewSpec :: forall a. TabSubType a -> Props -> R.Element
-- ^ TODO merge nodeId and corpusId in DT
docViewSpec :: forall a. TabSubType a -> Spec {} Props Void
, chart : H.div {} []
docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, tabType: TabCorpus TabMoreLikeTrash
where
, totalRecords: 4737
cpt {corpusId, corpusData: {defaultListId}} _children = do
, listId: defaultListId
pure $ DT.docViewSpec $ params tst
, corpusId: Just corpusId}) $ noState DT.docViewSpec
)
where
params :: forall a. TabSubType a -> DT.Props
trash = cmapProps (\{corpusId, corpusData: {defaultListId}} ->
params TabDocs = {
{ nodeId: corpusId
nodeId: corpusId
, chart : H.div {} []
-- ^ TODO merge nodeId and corpusId in DT
, tabType: TabCorpus TabTrash
, chart : H.div {} []
, totalRecords: 4736
, tabType: TabCorpus TabDocs
, listId: defaultListId
, totalRecords: 4737
, corpusId: Nothing}) $ noState DT.docViewSpec
, listId: defaultListId
, corpusId: Just corpusId
}
params TabMoreLikeFav = {
nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
, chart : H.div {} []
, tabType: TabCorpus TabMoreLikeFav
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId
}
params TabMoreLikeTrash = {
nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
, chart : H.div {} []
, tabType: TabCorpus TabMoreLikeTrash
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId
}
params TabTrash = {
nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
, chart : H.div {} []
, tabType: TabCorpus TabTrash
, totalRecords: 4737
, listId: defaultListId
, corpusId: Nothing
}
-- DUMMY
params _ = {
nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT
, chart : H.div {} []
, tabType: TabCorpus TabTrash
, totalRecords: 4737
, listId: defaultListId
, corpusId: Nothing
}
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