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
95650e89
Commit
95650e89
authored
Oct 09, 2018
by
Mael NICOLAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgraded mapMyMap, need to change HyperData type
parent
63c4610a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
91 deletions
+13
-91
Renders.purs
src/Gargantext/Pages/Annuaire/User/Users/Specs/Renders.purs
+13
-8
Actions.purs
src/Gargantext/Pages/Corpus/User/Users/Actions.purs
+0
-41
States.purs
src/Gargantext/Pages/Corpus/User/Users/States.purs
+0
-42
No files found.
src/Gargantext/Pages/Annuaire/User/Users/Specs/Renders.purs
View file @
95650e89
...
...
@@ -3,11 +3,13 @@ module Gargantext.Pages.Annuaire.User.Users.Specs.Renders
import Gargantext.Pages.Annuaire.User.Users.Types
import Data.List (List, toUnfoldable, zip)
import Data.Map (Map, empty, keys, values)
import Data.List (List, zipWith, catMaybes, toUnfoldable)
import Data.Unfoldable (class Unfoldable)
import Data.Map (Map, empty, keys, values, lookup)
import Data.Set (toUnfoldable) as S
import Data.Maybe (Maybe(..))
import Data.Tuple (Tuple(..), uncurry)
import Prelude (($), (<<<), (<$>))
import Prelude (($), (<<<), (<$>)
, flip, class Ord
)
import React (ReactElement)
import React.DOM (div, h3, img, li, span, text, ul)
import React.DOM.Props (_id, className, src)
...
...
@@ -37,15 +39,18 @@ display title elems =
[ div [className "col-md-2"]
[ img [src "/images/Gargantextuel-212x300.jpg"] ]
, div [className "col-md-1"] []
, div [className "col-md-8"] elems
, div [className "col-md
Data.Unfoldable
-8"] elems
]
]
]
]
]
mapMyMap :: forall k v x. (k -> v -> x) -> Map k v -> Array x
mapMyMap f m = toUnfoldable $ uncurry f <$> zip (keys m) (values m)
mapMyMap :: forall k v x f. Ord k => Unfoldable f => (k -> v -> x) -> Map k v -> f x
mapMyMap f m = toUnfoldable
$ zipWith f mapKeys
(catMaybes $ flip lookup m <$> mapKeys)
where mapKeys = S.toUnfoldable $ keys m
infixl 4 mapMyMap as <.~$>
...
...
@@ -57,8 +62,8 @@ userInfos hyperdata =
checkMaybe (Nothing) = empty
checkMaybe (Just (HyperData a)) = a
listInfo ::
String ->
String -> ReactElement
listInfo s
ss = listElement $ infoRender s s
s
listInfo ::
Tuple String
String -> ReactElement
listInfo s
= listElement $ infoRender
s
listElement :: Array ReactElement -> ReactElement
listElement = li [className "list-group-item justify-content-between"]
...
...
src/Gargantext/Pages/Corpus/User/Users/Actions.purs
deleted
100644 → 0
View file @
63c4610a
module Gargantext.Pages.Corpus.User.Users.Actions where
import Gargantext.Pages.Folder as PS
import Gargantext.Pages.Corpus.Doc.Facets.Documents as P
import Gargantext.Components.Tab as Tab
data Action
= NoOp
| PublicationA P.Action
| BrevetsA B.Action
| ProjectsA PS.Action
| TabA Tab.Action
| FetchUser Int
----------------------------------------------
_tabAction :: Prism' Action Tab.Action
_tabAction = prism TabA \ action ->
case action of
TabA laction -> Right laction
_-> Left action
_pubAction :: Prism' Action P.Action
_pubAction = prism PublicationA \ action ->
case action of
PublicationA laction -> Right laction
_-> Left action
_brevetsAction :: Prism' Action B.Action
_brevetsAction = prism BrevetsA \ action ->
case action of
BrevetsA laction -> Right laction
_-> Left action
_projectsAction :: Prism' Action PS.Action
_projectsAction = prism ProjectsA \ action ->
case action of
ProjectsA laction -> Right laction
_-> Left action
src/Gargantext/Pages/Corpus/User/Users/States.purs
deleted
100644 → 0
View file @
63c4610a
module Gargantext.Pages.Corpus.User.Users.States where
import Gargantext.Pages.Corpus.User.Brevets as B
import Data.Maybe (Maybe(..))
import Gargantext.Pages.Corpus.User.Users.Types.Types (User)
import Gargantext.Pages.Folder as PS
import Gargantext.Pages.Corpus.Doc.Facets.Documents as P
import Gargantext.Components.Tab as Tab
type State =
{ activeTab :: Int
, publications :: P.State
, brevets :: B.State
, projects :: PS.State
, user :: Maybe User
}
initialState :: State
initialState =
{ activeTab : 0
, publications : P.initialState
, brevets : B.initialState
, projects : PS.initialState
, user: Nothing
}
------------------------------------------------------
_tablens :: Lens' State Tab.State
_tablens = lens (\s -> s.activeTab) (\s ss -> s {activeTab = ss})
_publens :: Lens' State P.State
_publens = lens (\s -> s.publications) (\s ss -> s { publications= ss})
_brevetslens :: Lens' State B.State
_brevetslens = lens (\s -> s.brevets) (\s ss -> s {brevets = ss})
_projectslens :: Lens' State PS.State
_projectslens = lens (\s -> s.projects) (\s ss -> s {projects = ss})
_user :: Lens' State (Maybe User)
_user = lens (\s -> s.user) (\s ss -> s{user = ss})
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