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
5529935a
Commit
5529935a
authored
Jan 28, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Contact Page (WIP)
parent
9ca4f84b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
386 deletions
+116
-386
App.purs
src/Gargantext/Components/App.purs
+18
-12
Contacts.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
+0
-343
Tabs.purs
...gantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
+2
-2
Types.purs
...antext/Components/Nodes/Annuaire/User/Contacts/Types.purs
+96
-29
No files found.
src/Gargantext/Components/App.purs
View file @
5529935a
...
@@ -13,7 +13,8 @@ import Gargantext.Components.GraphExplorer (explorerLayout)
...
@@ -13,7 +13,8 @@ import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Lang (LandingLang(..))
import Gargantext.Components.Login (login)
import Gargantext.Components.Login (login)
import Gargantext.Components.Nodes.Annuaire (annuaireLayout)
import Gargantext.Components.Nodes.Annuaire (annuaireLayout)
import Gargantext.Components.Nodes.Annuaire.User.Contacts (annuaireUserLayout, userLayout)
import Gargantext.Components.Nodes.Annuaire.User (userLayout)
import Gargantext.Components.Nodes.Annuaire.User.Contact (contactLayout)
import Gargantext.Components.Nodes.Corpus (corpusLayout)
import Gargantext.Components.Nodes.Corpus (corpusLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Dashboard (dashboardLayout)
import Gargantext.Components.Nodes.Corpus.Document (documentMainLayout)
import Gargantext.Components.Nodes.Corpus.Document (documentMainLayout)
...
@@ -101,17 +102,6 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
...
@@ -101,17 +102,6 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
Annuaire sid nodeId -> withSession sid $ \session -> forested [
Annuaire sid nodeId -> withSession sid $ \session -> forested [
annuaireLayout { frontends, nodeId, session }
annuaireLayout { frontends, nodeId, session }
]
]
ContactPage sid aId nodeId -> withSession sid $ \session -> forested [
annuaireUserLayout {
annuaireId: aId
, appReload
, asyncTasksRef
, frontends
, nodeId
, session
, treeReloadRef
}
]
Corpus sid nodeId -> withSession sid $ \session -> forested [
Corpus sid nodeId -> withSession sid $ \session -> forested [
corpusLayout { nodeId, session }
corpusLayout { nodeId, session }
]
]
...
@@ -204,6 +194,8 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
...
@@ -204,6 +194,8 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
, sessionUpdate
, sessionUpdate
}
}
} []
} []
----------------------------------------------------------------------------------------
-- | TODO refact UserPage and ContactPage
UserPage sid nodeId -> withSession sid $ \session -> forested [
UserPage sid nodeId -> withSession sid $ \session -> forested [
userLayout {
userLayout {
appReload
appReload
...
@@ -214,3 +206,17 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
...
@@ -214,3 +206,17 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
, treeReloadRef
, treeReloadRef
}
}
]
]
ContactPage sid aId nodeId -> withSession sid $ \session -> forested [
contactLayout {
annuaireId: aId
, appReload
, asyncTasksRef
, frontends
, nodeId
, session
, treeReloadRef
}
]
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
deleted
100644 → 0
View file @
9ca4f84b
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Nodes/Annuaire/User/Contacts/Tabs.purs
View file @
5529935a
...
@@ -15,7 +15,7 @@ import Gargantext.Components.DocsTable as DT
...
@@ -15,7 +15,7 @@ import Gargantext.Components.DocsTable as DT
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.NgramsTable.Core as NTC
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Tab as Tab
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (ContactData)
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (ContactData
'
)
import Gargantext.Components.Nodes.Lists.Types as LTypes
import Gargantext.Components.Nodes.Lists.Types as LTypes
import Gargantext.Components.Nodes.Texts.Types as TTypes
import Gargantext.Components.Nodes.Texts.Types as TTypes
import Gargantext.Ends (Frontends)
import Gargantext.Ends (Frontends)
...
@@ -52,7 +52,7 @@ type TabsProps = (
...
@@ -52,7 +52,7 @@ type TabsProps = (
appReload :: GUR.ReloadS
appReload :: GUR.ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, cacheState :: R.State LTypes.CacheState
, cacheState :: R.State LTypes.CacheState
, contactData :: ContactData
, contactData :: ContactData
'
, frontends :: Frontends
, frontends :: Frontends
, nodeId :: Int
, nodeId :: Int
, session :: Session
, session :: Session
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts/Types.purs
View file @
5529935a
...
@@ -23,14 +23,14 @@ newtype NodeContact =
...
@@ -23,14 +23,14 @@ newtype NodeContact =
instance decodeNodeContact :: DecodeJson NodeContact where
instance decodeNodeContact :: DecodeJson NodeContact where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj
<- decodeJson json
date <- obj .?| "date"
date
<- obj .?| "date"
hyperdata <- obj .: "hyperdata"
hyperdata <- obj .: "hyperdata"
id <- obj .: "id"
id
<- obj .: "id"
name <- obj .:! "name"
name
<- obj .:! "name"
parentId <- obj .?| "parentId"
parentId
<- obj .?| "parentId"
typename <- obj .?| "typename"
typename
<- obj .?| "typename"
userId <- obj .:! "userId"
userId
<- obj .:! "userId"
pure $ NodeContact { id
pure $ NodeContact { id
, date
, date
...
@@ -43,6 +43,40 @@ instance decodeNodeContact :: DecodeJson NodeContact where
...
@@ -43,6 +43,40 @@ instance decodeNodeContact :: DecodeJson NodeContact where
derive instance newtypeNodeContact :: Newtype NodeContact _
derive instance newtypeNodeContact :: Newtype NodeContact _
----------------------------------------------------------------------------
newtype Contact' =
Contact'
{ id :: Int
, date :: Maybe String
, hyperdata :: HyperdataContact
, name :: Maybe String
, parentId :: Maybe Int
, typename :: Maybe Int
, userId :: Maybe Int
}
instance decodeContact' :: DecodeJson Contact' where
decodeJson json = do
obj <- decodeJson json
date <- obj .?| "date"
hyperdata <- obj .: "hyperdata"
id <- obj .: "id"
name <- obj .:! "name"
parentId <- obj .?| "parentId"
typename <- obj .?| "typename"
userId <- obj .:! "userId"
pure $ Contact' { id
, date
, hyperdata
, name
, parentId
, typename
, userId
}
newtype Contact =
newtype Contact =
...
@@ -57,17 +91,16 @@ newtype Contact =
...
@@ -57,17 +91,16 @@ newtype Contact =
}
}
instance decodeContact :: DecodeJson Contact where
instance decodeUser :: DecodeJson Contact where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj
<- decodeJson json
date <- obj .?| "date"
date
<- obj .?| "date"
hyperdata <- obj .: "hyperdata"
hyperdata <- obj .: "hyperdata"
id <- obj .: "id"
id
<- obj .: "id"
name <- obj .:! "name"
name
<- obj .:! "name"
parentId <- obj .?| "parentId"
parentId
<- obj .?| "parentId"
typename <- obj .?| "typename"
typename
<- obj .?| "typename"
userId <- obj .:! "userId"
userId
<- obj .:! "userId"
pure $ Contact { id
pure $ Contact { id
, date
, date
...
@@ -78,7 +111,40 @@ instance decodeUser :: DecodeJson Contact where
...
@@ -78,7 +111,40 @@ instance decodeUser :: DecodeJson Contact where
, userId
, userId
}
}
derive instance newtypeContact :: Newtype Contact _
----------------------------------------------------------------------------
newtype User =
User
{ id :: Int
, date :: Maybe String
, hyperdata :: HyperdataUser
, name :: Maybe String
, parentId :: Maybe Int
, typename :: Maybe Int
, userId :: Maybe Int
}
instance decodeUser :: DecodeJson User where
decodeJson json = do
obj <- decodeJson json
date <- obj .?| "date"
hyperdata <- obj .: "hyperdata"
id <- obj .: "id"
name <- obj .:! "name"
parentId <- obj .?| "parentId"
typename <- obj .?| "typename"
userId <- obj .:! "userId"
pure $ User { id
, date
, hyperdata
, name
, parentId
, typename
, userId
}
newtype ContactWho =
newtype ContactWho =
ContactWho
ContactWho
...
@@ -130,15 +196,15 @@ newtype ContactWhere =
...
@@ -130,15 +196,15 @@ newtype ContactWhere =
ContactWhere
ContactWhere
{ organization :: (Array String)
{ organization :: (Array String)
, labTeamDepts :: (Array String)
, labTeamDepts :: (Array String)
, role :: Maybe String
, role :: Maybe String
, office :: Maybe String
, office :: Maybe String
, country :: Maybe String
, country :: Maybe String
, city :: Maybe String
, city :: Maybe String
, touch :: Maybe ContactTouch
, touch :: Maybe ContactTouch
, entry :: Maybe String
, entry :: Maybe String
, exit :: Maybe String }
, exit :: Maybe String }
...
@@ -226,15 +292,15 @@ defaultContactTouch =
...
@@ -226,15 +292,15 @@ defaultContactTouch =
newtype HyperdataContact =
newtype HyperdataContact =
HyperdataContact { bdd :: Maybe String
HyperdataContact { bdd
:: Maybe String
, lastValidation :: Maybe String
, lastValidation :: Maybe String
, ou :: (Array ContactWhere)
, ou
:: (Array ContactWhere)
, source :: Maybe String
, source
:: Maybe String
, title :: Maybe String
, title
:: Maybe String
, uniqId :: Maybe String
, uniqId
:: Maybe String
, uniqIdBdd :: Maybe String
, uniqIdBdd
:: Maybe String
, who :: Maybe ContactWho
, who
:: Maybe ContactWho
}
}
derive instance newtypeHyperdataContact :: Newtype HyperdataContact _
derive instance newtypeHyperdataContact :: Newtype HyperdataContact _
instance decodeHyperdataContact :: DecodeJson HyperdataContact
instance decodeHyperdataContact :: DecodeJson HyperdataContact
...
@@ -321,6 +387,7 @@ defaultHyperdataUser =
...
@@ -321,6 +387,7 @@ defaultHyperdataUser =
-- pure $ HyperData {common, shared, specific}
-- pure $ HyperData {common, shared, specific}
type ContactData = {contactNode :: Contact, defaultListId :: Int}
type ContactData = {contactNode :: Contact, defaultListId :: Int}
type ContactData' = {contactNode :: Contact', defaultListId :: Int}
_shared :: Lens' HyperdataUser HyperdataContact
_shared :: Lens' HyperdataUser HyperdataContact
_shared = lens getter setter
_shared = lens getter setter
...
...
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