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
ca3e15c8
Commit
ca3e15c8
authored
Apr 15, 2022
by
arturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
>>> continue
parent
2bf57e5c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
54 deletions
+45
-54
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+9
-6
InputWithEnter.purs
src/Gargantext/Components/InputWithEnter.purs
+5
-9
Components.purs
src/Gargantext/Components/NgramsTable/Components.purs
+7
-7
User.purs
src/Gargantext/Components/Nodes/Annuaire/User.purs
+2
-7
Contact.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contact.purs
+14
-10
Lists.purs
src/Gargantext/Components/Nodes/Lists.purs
+2
-6
Tabs.purs
src/Gargantext/Components/Nodes/Lists/Tabs.purs
+2
-4
Score.purs
src/Gargantext/Components/Score.purs
+4
-5
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
ca3e15c8
...
...
@@ -54,6 +54,7 @@ import Gargantext.Utils.Toestand as GUT
import Gargantext.Utils.Toestand as T2
import Reactix as R
import Reactix.DOM.HTML as H
import Record.Extra as RX
import Simple.JSON as JSON
import Toestand as T
...
...
@@ -94,8 +95,7 @@ type LayoutProps =
)
type PageLayoutProps =
( key :: String -- NOTE Necessary to clear the component when cache state changes
, params :: TT.Params
( params :: TT.Params
, query :: Query
| CommonProps
)
...
...
@@ -377,9 +377,10 @@ filterDocsByYear year docs = A.filter filterFunc docs
filterFunc :: Response -> Boolean
filterFunc (Response { hyperdata: Hyperdata { pub_year } }) = eq year $ show pub_year
pageLayout :: R2.Component PageLayoutProps
-- NOTE "key": Necessary to clear the component when cache state changes
pageLayout :: R2.Component ( key :: String | PageLayoutProps )
pageLayout = R.createElement pageLayoutCpt
pageLayoutCpt :: R.Component
PageLayoutProps
pageLayoutCpt :: R.Component
( key :: String | PageLayoutProps )
pageLayoutCpt = here.component "pageLayout" cpt where
cpt props@{ boxes
, cacheState
...
...
@@ -395,6 +396,8 @@ pageLayoutCpt = here.component "pageLayout" cpt where
cacheState' <- T.useLive T.unequal cacheState
yearFilter' <- T.useLive T.unequal yearFilter
let props' = (RX.pick props :: Record PageLayoutProps)
let path = { listId, mCorpusId, nodeId, params, query, tabType, yearFilter: yearFilter' }
handleResponse :: HashedResponse (TableResult Response) -> Tuple Int (Array DocumentsView)
handleResponse (HashedResponse { value: res }) = ret
...
...
@@ -419,7 +422,7 @@ pageLayoutCpt = here.component "pageLayout" cpt where
NT.CacheOn -> do
let paint (Tuple count docs) = page { boxes
, documents: docs
, layout: props { totalRecords = count }
, layout: props
'
{ totalRecords = count }
, params } []
mkRequest :: PageParams -> GUC.Request
mkRequest p = GUC.makeGetRequest session $ tableRoute p
...
...
@@ -444,7 +447,7 @@ pageLayoutCpt = here.component "pageLayout" cpt where
-- here.log2 "table res" eRes
pure $ handleResponse <$> eRes
let render (Tuple count documents) = pagePaintRaw { documents
, layout: props { params = paramsS'
, layout: props
'
{ params = paramsS'
, totalRecords = count }
, localCategories
, params: paramsS } []
...
...
src/Gargantext/Components/InputWithEnter.purs
View file @
ca3e15c8
...
...
@@ -10,7 +10,7 @@ import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.InputWithEnter"
type Props
a
=
type Props =
( onBlur :: String -> Effect Unit
, onEnter :: Unit -> Effect Unit
, onValueChanged :: String -> Effect Unit
...
...
@@ -22,12 +22,9 @@ type Props a =
, type :: String
)
type PropsKey a =
( key :: String
| Props a )
inputWithEnterWithKey :: forall a. R2.Leaf (PropsKey a)
inputWithEnterWithKey :: R2.Leaf ( key :: String | Props )
inputWithEnterWithKey = R2.leafComponent inputWithEnterWithKeyCpt
inputWithEnterWithKeyCpt :: R.Component ( key :: String | Props )
inputWithEnterWithKeyCpt = here.component "inputWithEnterWithKey" cpt where
cpt { onBlur, onEnter, onValueChanged, autoFocus, className, defaultValue, placeholder, type: t } _ = do
pure $ inputWithEnter { onBlur
...
...
@@ -39,9 +36,9 @@ inputWithEnterWithKeyCpt = here.component "inputWithEnterWithKey" cpt where
, placeholder
, type: t }
inputWithEnter ::
forall a. R2.Leaf (Props a)
inputWithEnter ::
R2.Leaf Props
inputWithEnter = R2.leafComponent inputWithEnterCpt
inputWithEnterCpt ::
forall a. R.Component (Props a)
inputWithEnterCpt ::
R.Component Props
inputWithEnterCpt = here.component "inputWithEnter" cpt
where
cpt props@{ onBlur, onEnter, onValueChanged
...
...
@@ -65,4 +62,3 @@ inputWithEnterCpt = here.component "inputWithEnter" cpt
onEnter unit
else
pure unit
src/Gargantext/Components/NgramsTable/Components.purs
View file @
ca3e15c8
...
...
@@ -26,13 +26,13 @@ here :: R2.Here
here = R2.here "Gargantext.Components.NgramsTable.Components"
type SearchInputProps =
( key :: String -- to prevent refreshing & losing input
, searchQuery :: T.Box String
( searchQuery :: T.Box String
)
searchInput :: R2.Leaf SearchInputProps
-- "key": to prevent refreshing & losing input
searchInput :: R2.Leaf ( key :: String | SearchInputProps )
searchInput = R2.leafComponent searchInputCpt
searchInputCpt :: R.Component
SearchInputProps
searchInputCpt :: R.Component
( key :: String | SearchInputProps )
searchInputCpt = here.component "searchInput" cpt
where
cpt { searchQuery } _ = do
...
...
@@ -55,7 +55,7 @@ searchButtonCpt :: R.Component SearchButtonProps
searchButtonCpt = here.component "searchButton" cpt where
cpt { searchQuery } _ = do
searchQuery' <- T.useLive T.unequal searchQuery
pure $ H.div { className: "input-group-prepend" }
[ if searchQuery' /= ""
then
...
...
@@ -75,7 +75,7 @@ searchFieldInputCpt :: R.Component SearchFieldInputProps
searchFieldInputCpt = here.component "searchFieldInput" cpt where
cpt { searchQuery } _ = do
-- searchQuery' <- T.useLive T.unequal searchQuery
pure $ H.input { className: "form-control"
-- , defaultValue: searchQuery'
, name: "search"
...
...
@@ -83,7 +83,7 @@ searchFieldInputCpt = here.component "searchFieldInput" cpt where
, placeholder: "Search"
, type: "value"
}
type SelectionCheckboxProps =
( allNgramsSelected :: Boolean
, dispatch :: Dispatch
...
...
src/Gargantext/Components/Nodes/Annuaire/User.purs
View file @
ca3e15c8
...
...
@@ -73,11 +73,6 @@ type LayoutProps = WithSession LayoutNoSessionProps
type LayoutSessionContextProps = WithSessionContext LayoutNoSessionProps
type KeyLayoutProps = (
key :: String
| LayoutProps
)
userLayout :: R2.Component LayoutProps
userLayout = R.createElement userLayoutCpt
userLayoutCpt :: R.Component LayoutProps
...
...
@@ -89,9 +84,9 @@ userLayoutCpt = here.component "userLayout" cpt
pure $ userLayoutWithKey $ Record.merge props { key: show sid <> "-" <> show nodeId }
userLayoutWithKey :: R2.Leaf
KeyLayoutProps
userLayoutWithKey :: R2.Leaf
( key :: String | LayoutProps )
userLayoutWithKey = R2.leafComponent userLayoutWithKeyCpt
userLayoutWithKeyCpt :: R.Component
KeyLayoutProps
userLayoutWithKeyCpt :: R.Component
( key :: String | LayoutProps )
userLayoutWithKeyCpt = here.component "userLayoutWithKey" cpt where
cpt { boxes: boxes@{ sidePanelTexts }
, frontends
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contact.purs
View file @
ca3e15c8
...
...
@@ -117,7 +117,7 @@ contactInfoItemCpt = here.component "contactInfoItem" cpt
]
where
cLens = L.cloneLens lens
type ItemProps =
( defaultVal :: String
, isEditing :: T.Box Boolean
...
...
@@ -133,7 +133,7 @@ itemNotEditingCpt :: R.Component ItemProps
itemNotEditingCpt = here.component "itemEditing" cpt where
cpt { isEditing, valueBox } _ = do
valueBox' <- T.useLive T.unequal valueBox
pure $ H.div { className: "input-group col-sm-6" }
[ H.input
{ className: "form-control", type: "text"
...
...
@@ -183,12 +183,8 @@ type ReloadProps =
type LayoutProps =
( session :: Session
| ReloadProps )
type KeyLayoutProps =
( key :: String
, session :: Session
| ReloadProps )
| ReloadProps
)
saveContactHyperdata :: Session -> Int -> HyperdataContact -> AffRESTError Int
saveContactHyperdata session id = put session (Routes.NodeAPI Node (Just id) "")
...
...
@@ -218,9 +214,17 @@ saveUserInfo session id ui = do
ga (Just val) = ArgR val
getToken (Session { token }) = token
type AnnuaireLayoutProps = ( annuaireId :: Int, session :: Session | ReloadProps )
type AnnuaireLayoutProps =
( annuaireId :: Int
, session :: Session
| ReloadProps
)
type AnnuaireKeyLayoutProps = ( annuaireId :: Int | KeyLayoutProps )
type AnnuaireKeyLayoutProps =
( annuaireId :: Int
, key :: String
| LayoutProps
)
contactLayout :: R2.Component AnnuaireLayoutProps
contactLayout = R.createElement contactLayoutCpt
...
...
src/Gargantext/Components/Nodes/Lists.purs
View file @
ca3e15c8
...
...
@@ -45,13 +45,9 @@ listsLayoutCpt = here.component "listsLayout" cpt where
let sid = sessionId session
pure $ listsLayoutWithKey (Record.merge props { key: show sid <> "-" <> show nodeId }) []
type KeyProps =
( key :: String
| Props )
listsLayoutWithKey :: R2.Component KeyProps
listsLayoutWithKey :: R2.Component ( key :: String | Props )
listsLayoutWithKey = R.createElement listsLayoutWithKeyCpt
listsLayoutWithKeyCpt :: R.Component
KeyProps
listsLayoutWithKeyCpt :: R.Component
( key :: String | Props )
listsLayoutWithKeyCpt = here.component "listsLayoutWithKey" cpt where
cpt { boxes: boxes@{ reloadMainPage }
, nodeId
...
...
src/Gargantext/Components/Nodes/Lists/Tabs.purs
View file @
ca3e15c8
...
...
@@ -38,11 +38,9 @@ type Props = (
, session :: Session
)
type PropsWithKey = ( key :: String | Props )
tabs :: Record PropsWithKey -> R.Element
tabs :: Record ( key :: String | Props ) -> R.Element
tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component
PropsWithKey
tabsCpt :: R.Component
( key :: String | Props )
tabsCpt = here.component "tabs" cpt where
cpt props@{ activeTab } _ = do
pure $ Tab.tabs { activeTab
...
...
src/Gargantext/Components/Score.purs
View file @
ca3e15c8
...
...
@@ -23,9 +23,8 @@ type DocID = Int
thisModule :: String
thisModule = "Gargantext.Components.Score"
type Props = (
docId ::DocID
, key :: String
type Props =
( docId ::DocID
, nodeId :: GT.NodeID
, score :: Maybe Score
, session :: Session
...
...
@@ -34,9 +33,9 @@ type Props = (
type Choice = Maybe Score
scoreEl :: R2.Component
Props
scoreEl :: R2.Component
( key :: String | Props )
scoreEl = R.createElement scoreElCpt
scoreElCpt :: R.Component
Props
scoreElCpt :: R.Component
( key :: String | Props )
scoreElCpt = R.hooksComponentWithModule thisModule "scoreEl" cpt
where
cpt { docId, nodeId, score, session, tableReload } _ = do
...
...
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