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
729f7840
Commit
729f7840
authored
Jul 30, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-doc-table-columns' into dev
parents
88cdabd4
74638ba3
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
218 additions
and
189 deletions
+218
-189
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+79
-51
Login.purs
src/Gargantext/Components/Login.purs
+3
-6
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+4
-6
Table.purs
src/Gargantext/Components/Table.purs
+2
-1
Tree.purs
src/Gargantext/Components/Tree.purs
+0
-3
Config.purs
src/Gargantext/Config.purs
+3
-3
Specs.purs
src/Gargantext/Pages/Annuaire/User/Contacts/Tabs/Specs.purs
+3
-1
Graph.purs
src/Gargantext/Pages/Corpus/Graph.purs
+1
-1
Specs.purs
src/Gargantext/Pages/Layout/Specs.purs
+106
-106
Search.purs
src/Gargantext/Pages/Layout/Specs/Search.purs
+8
-11
Specs.purs
src/Gargantext/Pages/Texts/Tabs/Specs.purs
+5
-0
Reactix.purs
src/Gargantext/Utils/Reactix.purs
+4
-0
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
729f7840
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Login.purs
View file @
729f7840
...
...
@@ -22,6 +22,7 @@ import Gargantext.Config (toUrl, Path(..), End(..))
import Gargantext.Config.REST (post)
import Gargantext.Components.Modals.Modal (modalHide)
import Gargantext.Components.Login.Types
import Gargantext.Utils.Reactix as R2
-- TODO: ask for login (modal) or account creation after 15 mn when user
-- is not logged and has made one search at least
...
...
@@ -128,10 +129,10 @@ renderSpec = simpleSpec performAction render
, div [className "form-group"]
[ p [] [text state.errorMessage]
, input [className "form-control", _id "id_username",maxLength "254", name "username", placeholder "username", _type "text",value state.username, onInput \e -> dispatch (SetUserName
(unsafeEventValue e)
)]
, input [className "form-control", _id "id_username",maxLength "254", name "username", placeholder "username", _type "text",value state.username, onInput \e -> dispatch (SetUserName
$ R2.unsafeEventValue e
)]
]
, div [className "form-group"]
[ input [className "form-control", _id "id_password", name "password", placeholder "password", _type "password",value state.password,onInput \e -> dispatch (SetPassword
(unsafeEventValue e)
)]
[ input [className "form-control", _id "id_password", name "password", placeholder "password", _type "password",value state.password,onInput \e -> dispatch (SetPassword
$ R2.unsafeEventValue e
)]
, div [className "clearfix"] []
]
, div [className "center"]
...
...
@@ -186,10 +187,6 @@ renderSpec = simpleSpec performAction render
-- ]
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
getAuthData :: Effect (Maybe AuthData)
getAuthData = do
w <- window
...
...
src/Gargantext/Components/NgramsTable.purs
View file @
729f7840
...
...
@@ -40,6 +40,7 @@ import Gargantext.Components.Table as T
import Gargantext.Prelude
import Gargantext.Components.Loader as Loader
import Gargantext.Components.NgramsTable.Core
import Gargantext.Utils.Reactix as R2
type State =
CoreState
...
...
@@ -119,7 +120,7 @@ tableContainer { pageParams
, name "search", placeholder "Search"
, _type "value"
, value pageParams.searchQuery
, onInput \e -> setSearchQuery (unsafeEventValue e)
, onInput \e -> setSearchQuery (
R2.
unsafeEventValue e)
]
, div [] (
if A.null props.tableBody && pageParams.searchQuery /= "" then [
...
...
@@ -134,7 +135,7 @@ tableContainer { pageParams
[ select [ _id "picklistmenu"
, className "form-control custom-select"
, value (maybe "" show pageParams.termListFilter)
, onChange (\e -> setTermListFilter $ readTermList $ unsafeEventValue e)
, onChange (\e -> setTermListFilter $ readTermList $
R2.
unsafeEventValue e)
] $ map optps1 termLists
]
]
...
...
@@ -143,7 +144,7 @@ tableContainer { pageParams
[ select [ _id "picktermtype"
, className "form-control custom-select"
, value (maybe "" show pageParams.termSizeFilter)
, onChange (\e -> setTermSizeFilter $ readTermSize $ unsafeEventValue e)
, onChange (\e -> setTermSizeFilter $ readTermSize $
R2.
unsafeEventValue e)
] $ map optps1 termSizes
]
]
...
...
@@ -420,6 +421,3 @@ optps1 :: forall a. Show a => { desc :: String, mval :: Maybe a } -> ReactElemen
optps1 { desc, mval } = option [value val] [text desc]
where
val = maybe "" show mval
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
src/Gargantext/Components/Table.purs
View file @
729f7840
...
...
@@ -14,6 +14,7 @@ import Thermite (PerformAction, Render, Spec, modifyState_, simpleSpec, StateCoT
import Unsafe.Coerce (unsafeCoerce)
import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2
type TableContainerProps =
{ pageSizeControl :: ReactElement
...
...
@@ -218,7 +219,7 @@ sizeDD :: PageSizes -> (Action -> Effect Unit) -> ReactElement
sizeDD ps d
= span []
[ select [ className "form-control"
, onChange (\e -> d (ChangePageSize $ string2PageSize $
(unsafeCoerce e).target.valu
e))
, onChange (\e -> d (ChangePageSize $ string2PageSize $
R2.unsafeEventValue
e))
] $ map (optps ps) aryPS
]
...
...
src/Gargantext/Components/Tree.purs
View file @
729f7840
...
...
@@ -695,6 +695,3 @@ uploadFile id fileType (UploadFileContents fileContents) = postWwwUrlencoded url
fnTransform :: LNode -> FTree
fnTransform n = NTree n []
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
src/Gargantext/Config.purs
View file @
729f7840
...
...
@@ -142,9 +142,9 @@ showTabType' (TabPairing t) = show t
data TabPostQuery = TabPostQuery {
offset :: Int
, limit :: Int
, orderBy ::
Maybe
OrderBy
, orderBy :: OrderBy
, tabType :: TabType
,
mQuery :: Maybe
String
,
query ::
String
}
instance encodeJsonTabPostQuery :: EncodeJson TabPostQuery where
...
...
@@ -153,7 +153,7 @@ instance encodeJsonTabPostQuery :: EncodeJson TabPostQuery where
~> "offset" := post.offset
~> "limit" := post.limit
~> "orderBy" := show post.orderBy
~> "query" := post.
mQ
uery
~> "query" := post.
q
uery
~> jsonEmptyObject
pathUrl :: Config -> Path -> Maybe Id -> UrlPath
...
...
src/Gargantext/Pages/Annuaire/User/Contacts/Tabs/Specs.purs
View file @
729f7840
...
...
@@ -78,7 +78,9 @@ statefulTabs =
, tabType: TabPairing TabDocs
, totalRecords: 4736
, listId: defaultListId
, corpusId: Nothing}
, corpusId: Nothing
, showSearch: true
}
ngramsViewSpec :: {mode :: Mode} -> Spec Tab.State Props Tab.Action
ngramsViewSpec {mode} =
...
...
src/Gargantext/Pages/Corpus/Graph.purs
View file @
729f7840
...
...
@@ -419,7 +419,7 @@ specOld = fold [treespec treeSpec, graphspec $ simpleSpec performAction render']
Nothing ->
simpleSpec defaultPerformAction defaultRender
Just treeId ->
(cmapProps (const {root: treeId, mCurrentRoute: Nothing}) (noState Tree.treeview))
cmapProps (const {root: treeId, mCurrentRoute: Nothing}) $ noState $ Tree.treeview
render' :: Render State {} Action
...
...
src/Gargantext/Pages/Layout/Specs.purs
View file @
729f7840
This diff is collapsed.
Click to expand it.
src/Gargantext/Pages/Layout/Specs/Search.purs
View file @
729f7840
...
...
@@ -7,7 +7,8 @@ import React.DOM (br', button, div, input, text)
import React.DOM.Props (_id, _type, className, name, onClick, onInput, placeholder, value)
import Routing.Hash (setHash)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Gargantext.Utils.Reactix as R2
type State =
{
...
...
@@ -26,20 +27,16 @@ data Action
= GO
| SetQuery String
performAction :: PerformAction State {} Action
performAction (SetQuery q) _ _ = void do
modifyState $ _ { query = q }
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
performAction GO _ _ = void do
liftEffect $ setHash "/addCorpus"
searchSpec :: Spec State {} Action
searchSpec = simpleSpec performAction render
where
performAction :: PerformAction State {} Action
performAction (SetQuery q) _ _ = void do
modifyState $ _ { query = q }
performAction GO _ _ = void do
liftEffect $ setHash "/addCorpus"
render :: Render State {} Action
render dispatch _ state _ =
[ div [className "container1"] []
...
...
@@ -56,7 +53,7 @@ searchSpec = simpleSpec performAction render
, placeholder "Query, URL or FILE (works best with Firefox or Chromium browsers)"
, _type "text"
, value state.query
, onInput \e -> dispatch (SetQuery (unsafeEventValue e))
, onInput \e -> dispatch (SetQuery (
R2.
unsafeEventValue e))
]
, br'
]
...
...
src/Gargantext/Pages/Texts/Tabs/Specs.purs
View file @
729f7840
...
...
@@ -89,6 +89,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId
, showSearch: true
}
params TabMoreLikeFav = {
nodeId: corpusId
...
...
@@ -98,6 +99,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId
, showSearch: false
}
params TabMoreLikeTrash = {
nodeId: corpusId
...
...
@@ -107,6 +109,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737
, listId: defaultListId
, corpusId: Just corpusId
, showSearch: false
}
params TabTrash = {
nodeId: corpusId
...
...
@@ -116,6 +119,7 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737
, listId: defaultListId
, corpusId: Nothing
, showSearch: true
}
-- DUMMY
params _ = {
...
...
@@ -126,4 +130,5 @@ docViewSpec tst = R2.elSpec $ R.hooksComponent "DocViewSpecWithCorpus" cpt
, totalRecords: 4737
, listId: defaultListId
, corpusId: Nothing
, showSearch: true
}
src/Gargantext/Utils/Reactix.purs
View file @
729f7840
...
...
@@ -89,3 +89,7 @@ select = createDOMElement "select"
effToggler :: forall e. R.State Boolean -> EffectFn1 e Unit
effToggler (value /\ setValue) = mkEffectFn1 $ \e -> setValue $ const $ not value
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
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