Commit 8ccdc2e6 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[DocsTable] showSearch is switchable

parent c50a84aa
...@@ -76,6 +76,7 @@ type Props = ...@@ -76,6 +76,7 @@ type Props =
, tabType :: TabType , tabType :: TabType
, listId :: Int , listId :: Int
, corpusId :: Maybe Int , corpusId :: Maybe Int
, showSearch :: Boolean
-- ^ tabType is not ideal here since it is too much entangled with tabs and -- ^ tabType is not ideal here since it is too much entangled with tabs and
-- ngramtable. Let's see how this evolves. -- ngramtable. Let's see how this evolves.
} }
...@@ -174,11 +175,11 @@ layoutDocview :: R.State DocumentIdsDeleted -> R.State LocalCategories -> R.Stat ...@@ -174,11 +175,11 @@ layoutDocview :: R.State DocumentIdsDeleted -> R.State LocalCategories -> R.Stat
layoutDocview documentIdsDeleted@(_ /\ setDocumentIdsDeleted) localCategories query tableParams@(params /\ _) p = R.createElement el p [] layoutDocview documentIdsDeleted@(_ /\ setDocumentIdsDeleted) localCategories query tableParams@(params /\ _) p = R.createElement el p []
where where
el = R.hooksComponent "LayoutDocView" cpt el = R.hooksComponent "LayoutDocView" cpt
cpt {nodeId, tabType, listId, corpusId, totalRecords, chart} _children = do cpt {nodeId, tabType, listId, corpusId, totalRecords, chart, showSearch} _children = do
pure $ H.div {className: "container1"} pure $ H.div {className: "container1"}
[ H.div {className: "row"} [ H.div {className: "row"}
[ chart [ chart
, searchBar query , if showSearch then searchBar query else H.div {} []
, H.div {className: "col-md-12"} , H.div {className: "col-md-12"}
[ pageLoader localCategories tableParams {nodeId, totalRecords, tabType, listId, corpusId, query: fst query} ] [ pageLoader localCategories tableParams {nodeId, totalRecords, tabType, listId, corpusId, query: fst query} ]
, H.div {className: "col-md-1 col-md-offset-11"} , H.div {className: "col-md-1 col-md-offset-11"}
......
...@@ -78,7 +78,9 @@ statefulTabs = ...@@ -78,7 +78,9 @@ statefulTabs =
, tabType: TabPairing TabDocs , tabType: TabPairing TabDocs
, totalRecords: 4736 , totalRecords: 4736
, listId: defaultListId , listId: defaultListId
, corpusId: Nothing} , corpusId: Nothing
, showSearch: true
}
ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action
ngramsViewSpec {mode} = ngramsViewSpec {mode} =
......
...@@ -89,6 +89,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt ...@@ -89,6 +89,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737 , totalRecords: 4737
, listId: defaultListId , listId: defaultListId
, corpusId: Just corpusId , corpusId: Just corpusId
, showSearch: true
} }
params TabMoreLikeFav = { params TabMoreLikeFav = {
nodeId: corpusId nodeId: corpusId
...@@ -98,6 +99,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt ...@@ -98,6 +99,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737 , totalRecords: 4737
, listId: defaultListId , listId: defaultListId
, corpusId: Just corpusId , corpusId: Just corpusId
, showSearch: false
} }
params TabMoreLikeTrash = { params TabMoreLikeTrash = {
nodeId: corpusId nodeId: corpusId
...@@ -107,6 +109,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt ...@@ -107,6 +109,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737 , totalRecords: 4737
, listId: defaultListId , listId: defaultListId
, corpusId: Just corpusId , corpusId: Just corpusId
, showSearch: false
} }
params TabTrash = { params TabTrash = {
nodeId: corpusId nodeId: corpusId
...@@ -116,6 +119,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt ...@@ -116,6 +119,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737 , totalRecords: 4737
, listId: defaultListId , listId: defaultListId
, corpusId: Nothing , corpusId: Nothing
, showSearch: true
} }
-- DUMMY -- DUMMY
params _ = { params _ = {
...@@ -126,4 +130,5 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt ...@@ -126,4 +130,5 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737 , totalRecords: 4737
, listId: defaultListId , listId: defaultListId
, corpusId: Nothing , corpusId: Nothing
, showSearch: true
} }
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