Commit 2c5ab6c1 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[CorpusView/Trash] Activating the REST route.

parent d8e86fc8
......@@ -47,10 +47,10 @@ type NodeID = Int
type TotalRecords = Int
type Props =
{ nodeId :: Int
{ nodeId :: Int
, totalRecords :: Int
, chart :: ReactElement
, tabType :: TabType
, chart :: ReactElement
, tabType :: TabType
-- ^ tabType is not ideal here since it is too much entangled with tabs and
-- ngramtable. Let's see how this evolves.
}
......@@ -69,8 +69,8 @@ initialState =
}
_documentIdsToDelete = prop (SProxy :: SProxy "documentIdsToDelete")
_documentIdsDeleted = prop (SProxy :: SProxy "documentIdsDeleted")
_localFavorites = prop (SProxy :: SProxy "localFavorites")
_documentIdsDeleted = prop (SProxy :: SProxy "documentIdsDeleted")
_localFavorites = prop (SProxy :: SProxy "localFavorites")
data Action
= MarkFavorites Int Boolean
......
......@@ -30,10 +30,10 @@ instance showMode :: Show Mode where
derive instance eqMode :: Eq Mode
modeTabType :: Mode -> CTabNgramType
modeTabType Authors = CTabAuthors
modeTabType Sources = CTabSources
modeTabType Authors = CTabAuthors
modeTabType Sources = CTabSources
modeTabType Institutes = CTabInstitutes
modeTabType Terms = CTabTerms
modeTabType Terms = CTabTerms
pureTabs :: Spec {} Props Void
pureTabs = hideState (const {activeTab: 0}) statefulTabs
......@@ -46,15 +46,22 @@ statefulTabs =
, Tuple "Sources" $ ngramsViewSpec {mode: Sources}
, Tuple "Institutes" $ ngramsViewSpec {mode: Institutes}
, Tuple "Terms" $ ngramsViewSpec {mode: Terms}
, Tuple "Trash" $ docs -- TODO pass-in trash mode
, Tuple "Trash" $ trash
]
where
-- TODO totalRecords
chart = ECharts.chart globalPublis
docs = cmapProps (\{path: nodeId} ->
{nodeId, chart, tabType: TabCorpus TabDocs, totalRecords: 4736}) $
noState DT.docViewSpec
trash = cmapProps (\{path: nodeId} ->
{nodeId, chart, tabType: TabCorpus TabTrash, totalRecords: 4736}) $
noState DT.docViewSpec
ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action
ngramsViewSpec {mode} =
noState (
......
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