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
122
Issues
122
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
gargantext
purescript-gargantext
Commits
ddb99dd0
Commit
ddb99dd0
authored
Jan 26, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Annuaire User Layout (WIP)
parent
8ed698b7
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
184 additions
and
93 deletions
+184
-93
FacetsTable.purs
src/Gargantext/Components/FacetsTable.purs
+93
-55
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar.purs
+5
-8
Contacts.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
+64
-10
Search.purs
src/Gargantext/Components/Search.purs
+3
-3
Ends.purs
src/Gargantext/Ends.purs
+1
-0
Routes.purs
src/Gargantext/Routes.purs
+13
-15
Types.purs
src/Gargantext/Types.purs
+5
-2
No files found.
src/Gargantext/Components/FacetsTable.purs
View file @
ddb99dd0
...
@@ -13,6 +13,7 @@ import Data.Sequence (Seq)
...
@@ -13,6 +13,7 @@ import Data.Sequence (Seq)
import Data.Sequence as Seq
import Data.Sequence as Seq
import Data.Set (Set)
import Data.Set (Set)
import Data.Set as Set
import Data.Set as Set
import Data.String (Pattern(..), split)
import Data.String as String
import Data.String as String
import Data.Tuple (fst, snd)
import Data.Tuple (fst, snd)
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
...
@@ -59,6 +60,7 @@ type Deletions = { pending :: Set Int
...
@@ -59,6 +60,7 @@ type Deletions = { pending :: Set Int
initialDeletions :: Deletions
initialDeletions :: Deletions
initialDeletions = { pending: mempty, deleted: mempty }
initialDeletions = { pending: mempty, deleted: mempty }
----------------------------------------------------------------------
newtype Pair =
newtype Pair =
Pair { id :: Int
Pair { id :: Int
, label :: String
, label :: String
...
@@ -69,6 +71,7 @@ derive instance genericPair :: Generic Pair _
...
@@ -69,6 +71,7 @@ derive instance genericPair :: Generic Pair _
instance showPair :: Show Pair where
instance showPair :: Show Pair where
show = genericShow
show = genericShow
----------------------------------------------------------------------
newtype DocumentsView =
newtype DocumentsView =
DocumentsView
DocumentsView
{ id :: Int
{ id :: Int
...
@@ -85,15 +88,32 @@ newtype DocumentsView =
...
@@ -85,15 +88,32 @@ newtype DocumentsView =
, publication_day :: Int
, publication_day :: Int
}
}
publicationDate :: DocumentsView -> String
publicationDate (DocumentsView {publication_year, publication_month, publication_day}) =
(zeroPad 2 publication_year) <> "-" <> (zeroPad 2 publication_month) <> "-" <> (zeroPad 2 publication_day)
derive instance genericDocumentsView :: Generic DocumentsView _
derive instance genericDocumentsView :: Generic DocumentsView _
instance showDocumentsView :: Show DocumentsView where
instance showDocumentsView :: Show DocumentsView where
show = genericShow
show = genericShow
----------------------------------------------------------------------
newtype ContactsView =
ContactsView
{ id :: Int
, hyperdata :: HyperdataRowContact
, score :: Int
, annuaireId :: Int
, delete :: Boolean
}
derive instance genericContactsView :: Generic ContactsView _
instance showContactsView :: Show ContactsView where
show = genericShow
----------------------------------------------------------------------
data Rows = Docs { docs :: Seq DocumentsView }
| Contacts { contacts :: Seq ContactsView }
----------------------------------------------------------------------
-- | Main layout of the Documents Tab of a Corpus
-- | Main layout of the Documents Tab of a Corpus
docView :: Record Props -> R.Element
docView :: Record Props -> R.Element
docView props = R.createElement docViewCpt props []
docView props = R.createElement docViewCpt props []
...
@@ -190,7 +210,7 @@ type PagePath = { nodeId :: Int
...
@@ -190,7 +210,7 @@ type PagePath = { nodeId :: Int
initialPagePath :: {session :: Session, nodeId :: Int, listId :: Int, query :: SearchQuery} -> PagePath
initialPagePath :: {session :: Session, nodeId :: Int, listId :: Int, query :: SearchQuery} -> PagePath
initialPagePath {session, nodeId, listId, query} = {session, nodeId, listId, query, params: T.initialParams}
initialPagePath {session, nodeId, listId, query} = {session, nodeId, listId, query, params: T.initialParams}
loadPage :: PagePath -> Aff
(Seq DocumentsView)
loadPage :: PagePath -> Aff
Rows
loadPage {session, nodeId, listId, query, params: {limit, offset, orderBy, searchType}} = do
loadPage {session, nodeId, listId, query, params: {limit, offset, orderBy, searchType}} = do
let
let
convOrderBy (T.ASC (T.ColumnName "Date")) = DateAsc
convOrderBy (T.ASC (T.ColumnName "Date")) = DateAsc
...
@@ -206,10 +226,10 @@ loadPage {session, nodeId, listId, query, params: {limit, offset, orderBy, searc
...
@@ -206,10 +226,10 @@ loadPage {session, nodeId, listId, query, params: {limit, offset, orderBy, searc
--SearchResult {result} <- post session p $ SearchQuery {query: concat query, expected:searchType}
--SearchResult {result} <- post session p $ SearchQuery {query: concat query, expected:searchType}
SearchResult {result} <- post session p query
SearchResult {result} <- post session p query
-- $ SearchQuery {query: concat query, expected: SearchDoc}
-- $ SearchQuery {query: concat query, expected: SearchDoc}
pure case result of
pure
$
case result of
SearchResultDoc {docs} ->
doc2view <$> Seq.fromFoldable docs
SearchResultDoc {docs} ->
Docs {docs: doc2view <$> Seq.fromFoldable docs}
SearchResultContact {contacts} ->
contact2view <$> Seq.fromFoldable contacts
SearchResultContact {contacts} ->
Contacts {contacts: contact2view <$> Seq.fromFoldable contacts}
errMessage ->
pure $ err2view errMessage
errMessage ->
Docs {docs: Seq.fromFoldable [err2view errMessage]} -- TODO better error view
doc2view :: Document -> DocumentsView
doc2view :: Document -> DocumentsView
doc2view ( Document { id
doc2view ( Document { id
...
@@ -238,27 +258,18 @@ doc2view ( Document { id
...
@@ -238,27 +258,18 @@ doc2view ( Document { id
, publication_day : fromMaybe 1 publication_day
, publication_day : fromMaybe 1 publication_day
}
}
contact2view :: Contact ->
Documen
tsView
contact2view :: Contact ->
Contac
tsView
contact2view (Contact { c_id
contact2view (Contact { c_id
, c_created: date
, c_created: date
, c_hyperdata: HyperdataRowContact { firstname
, c_hyperdata
, lastname
, c_annuaireId
, labs
}
, c_score
, c_score
}
}
) = DocumentsView { id: c_id
) = ContactsView { id: c_id
, date: ""
, hyperdata: c_hyperdata
, title : firstname <> " " <> lastname
, source: labs
, score: c_score
, score: c_score
, authors: labs
, annuaireId : c_annuaireId
, category: decodeCategory 1
, pairs: []
, delete: false
, delete: false
, publication_year: 2020
, publication_month: 10
, publication_day: 1
}
}
err2view message =
err2view message =
...
@@ -276,9 +287,6 @@ err2view message =
...
@@ -276,9 +287,6 @@ err2view message =
, publication_day: 1
, publication_day: 1
}
}
type PageLayoutProps =
type PageLayoutProps =
( frontends :: Frontends
( frontends :: Frontends
, totalRecords :: Int
, totalRecords :: Int
...
@@ -288,7 +296,7 @@ type PageLayoutProps =
...
@@ -288,7 +296,7 @@ type PageLayoutProps =
, path :: R.State PagePath
, path :: R.State PagePath
)
)
type PageProps = (
documents :: Seq DocumentsView
| PageLayoutProps )
type PageProps = (
rowsLoaded :: Rows
| PageLayoutProps )
-- | Loads and renders a page
-- | Loads and renders a page
pageLayout :: Record PageLayoutProps -> R.Element
pageLayout :: Record PageLayoutProps -> R.Element
...
@@ -298,8 +306,8 @@ pageLayoutCpt :: R.Component PageLayoutProps
...
@@ -298,8 +306,8 @@ pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt
pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt
where
where
cpt {frontends, totalRecords, deletions, container, session, path} _ = do
cpt {frontends, totalRecords, deletions, container, session, path} _ = do
useLoader (fst path) loadPage $ \
documents
->
useLoader (fst path) loadPage $ \
rowsLoaded
->
page {frontends, totalRecords, deletions, container, session, path,
documents
}
page {frontends, totalRecords, deletions, container, session, path,
rowsLoaded
}
page :: Record PageProps -> R.Element
page :: Record PageProps -> R.Element
page props = R.createElement pageCpt props []
page props = R.createElement pageCpt props []
...
@@ -307,7 +315,7 @@ page props = R.createElement pageCpt props []
...
@@ -307,7 +315,7 @@ page props = R.createElement pageCpt props []
pageCpt :: R.Component PageProps
pageCpt :: R.Component PageProps
pageCpt = R.hooksComponentWithModule thisModule "page" cpt
pageCpt = R.hooksComponentWithModule thisModule "page" cpt
where
where
cpt {frontends, totalRecords, container, deletions,
documents
, session, path: path@({nodeId, listId, query} /\ setPath)} _ = do
cpt {frontends, totalRecords, container, deletions,
rowsLoaded
, session, path: path@({nodeId, listId, query} /\ setPath)} _ = do
pure $ T.table { syncResetButton : [ H.div {} [] ]
pure $ T.table { syncResetButton : [ H.div {} [] ]
, rows, container, colNames
, rows, container, colNames
, totalRecords, params, wrapColElts
, totalRecords, params, wrapColElts
...
@@ -316,27 +324,49 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt
...
@@ -316,27 +324,49 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt
setParams f = setPath $ \p@{params: ps} -> p {params = f ps}
setParams f = setPath $ \p@{params: ps} -> p {params = f ps}
params = (fst path).params /\ setParams
params = (fst path).params /\ setParams
-- colNames = T.ColumnName <$> [ "", "Date", "Title", "Source", "Authors", "Delete" ]
-- colNames = T.ColumnName <$> [ "", "Date", "Title", "Source", "Authors", "Delete" ]
colNames = T.ColumnName <$> [ "", "Search", "Result", "", "", "" ]
colNames = case rowsLoaded of
Docs _ -> T.ColumnName <$> [ "", "Date", "Title", "Journal", "", "" ]
Contacts _ -> T.ColumnName <$> [ "", "Contact", "Organization", "", "", "" ]
wrapColElts = const identity
wrapColElts = const identity
-- TODO: how to interprete other scores?
-- TODO: how to interprete other scores?
gi
Favorite
= "fa fa-star-empty"
gi
Trash
= "fa fa-star-empty"
gi _ = "fa fa-star"
gi _ = "fa fa-star"
isChecked id = Set.member id (fst deletions).pending
isChecked id = Set.member id (fst deletions).pending
isDeleted (DocumentsView {id}) = Set.member id (fst deletions).deleted
isDeleted (DocumentsView {id}) = Set.member id (fst deletions).deleted
pairUrl (Pair {id,label})
pairUrl (Pair {id,label})
| id > 1 = H.a { href, target: "blank" } [ H.text label ]
| id > 1 = H.a { href, target: "blank" } [ H.text label ]
where href = url session $ NodePath (sessionId session) NodeContact (Just id)
where href = url session $ NodePath (sessionId session) NodeContact (Just id)
| otherwise = H.text label
| otherwise = H.text label
documentUrl id =
documentUrl id =
url frontends $ Routes.CorpusDocument (sessionId session) nodeId listId id
url frontends $ Routes.CorpusDocument (sessionId session) nodeId listId id
comma = H.span {} [ H.text ", " ]
rows = row <$> Seq.filter (not <<< isDeleted) documents
rows = case rowsLoaded of
row dv@(DocumentsView {id, score, title, source, authors, pairs, delete, category}) =
Docs {docs} -> docRow <$> Seq.filter (not <<< isDeleted) docs
Contacts {contacts} -> contactRow <$> contacts
contactRow (ContactsView { id, hyperdata: HyperdataRowContact { firstname, lastname, labs}
, score, annuaireId, delete
}) =
{ row:
{ row:
T.makeRow [
T.makeRow [ H.div {} [ H.a { className: gi Favorite, on: {click: markClick} } [] ]
H.div {} [ H.a { className: gi category, on: {click: markClick} } [] ]
, maybeStricken delete [ H.a {target: "_blank", href: contactUrl annuaireId id}
-- TODO show date: Year-Month-Day only
[ H.text $ firstname <> " " <> lastname ]
-- , maybeStricken delete [ H.text $ publicationDate dv ]
]
, maybeStricken delete [ H.text labs ]
]
, delete: true
}
where
markClick _ = markCategory session nodeId Favorite [id]
contactUrl aId id = url frontends $ Routes.ContactPage (sessionId session) annuaireId id
docRow dv@(DocumentsView {id, score, title, source, authors, pairs, delete, category}) =
{ row:
T.makeRow [ H.div {} [ H.a { className: gi category, on: {click: markClick} } [] ]
, maybeStricken delete [ H.text $ publicationDate dv ]
, maybeStricken delete [ H.a {target: "_blank", href: documentUrl id} [ H.text title ] ]
, maybeStricken delete [ H.a {target: "_blank", href: documentUrl id} [ H.text title ] ]
, maybeStricken delete [ H.text source ]
, maybeStricken delete [ H.text source ]
-- , maybeStricken delete [ H.text authors ]
-- , maybeStricken delete [ H.text authors ]
...
@@ -351,10 +381,18 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt
...
@@ -351,10 +381,18 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt
where
where
markClick _ = markCategory session nodeId category [id]
markClick _ = markCategory session nodeId category [id]
toggleClick _ = togglePendingDeletion deletions id
toggleClick _ = togglePendingDeletion deletions id
-- comma = H.span {} [ H.text ", " ]
maybeStricken delete
maybeStricken delete
| delete = H.div { style: { textDecoration: "line-through" } }
| delete = H.div { style: { textDecoration: "line-through" } }
| otherwise = H.div {}
| otherwise = H.div {}
publicationDate :: DocumentsView -> String
publicationDate (DocumentsView {publication_year, publication_month, publication_day}) =
(zeroPad 2 publication_year) <> "-" <> (zeroPad 2 publication_month)
-- <> "-" <> (zeroPad 2 publication_day)
---------------------------------------------------------
---------------------------------------------------------
newtype DeleteDocumentQuery = DeleteDocumentQuery { documents :: Array Int }
newtype DeleteDocumentQuery = DeleteDocumentQuery { documents :: Array Int }
...
...
src/Gargantext/Components/GraphExplorer/Sidebar.purs
View file @
ddb99dd0
...
@@ -332,6 +332,3 @@ Global/local view:
...
@@ -332,6 +332,3 @@ Global/local view:
To explore the neighborhood of a selection click on the 'change level' button.
To explore the neighborhood of a selection click on the 'change level' button.
-}
-}
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
View file @
ddb99dd0
...
@@ -150,8 +150,8 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
...
@@ -150,8 +150,8 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
listElement :: Array R.Element -> R.Element
listElement :: Array R.Element -> R.Element
listElement = H.li { className: "list-group-item justify-content-between" }
listElement = H.li { className: "list-group-item justify-content-between" }
type LayoutProps =
(
type LayoutProps =
appReload :: GUR.ReloadS
(
appReload :: GUR.ReloadS
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, asyncTasksRef :: R.Ref (Maybe GAT.Reductor)
, frontends :: Frontends
, frontends :: Frontends
, nodeId :: Int
, nodeId :: Int
...
@@ -219,7 +219,7 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
...
@@ -219,7 +219,7 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
_ <- saveContactHyperdata session nodeId hd
_ <- saveContactHyperdata session nodeId hd
liftEffect $ GUR.bump reload
liftEffect $ GUR.bump reload
-- | toUrl to get data
-- | toUrl to get data
XXX
getContact :: Session -> Int -> Aff ContactData
getContact :: Session -> Int -> Aff ContactData
getContact session id = do
getContact session id = do
contactNode <- get session $ Routes.NodeAPI Node (Just id) ""
contactNode <- get session $ Routes.NodeAPI Node (Just id) ""
...
@@ -240,9 +240,8 @@ saveContactHyperdata session id h = do
...
@@ -240,9 +240,8 @@ saveContactHyperdata session id h = do
put session (Routes.NodeAPI Node (Just id) "") h
put session (Routes.NodeAPI Node (Just id) "") h
type AnnuaireLayoutProps = (
type AnnuaireLayoutProps = ( annuaireId :: Int | LayoutProps )
annuaireId :: Int
type AnnuaireKeyLayoutProps = ( key :: String | AnnuaireLayoutProps )
| LayoutProps )
annuaireUserLayout :: Record AnnuaireLayoutProps -> R.Element
annuaireUserLayout :: Record AnnuaireLayoutProps -> R.Element
...
@@ -251,6 +250,21 @@ annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props []
...
@@ -251,6 +250,21 @@ annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props []
annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps
annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps
annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayout" cpt
annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayout" cpt
where
where
cpt { annuaireId, appReload, asyncTasksRef, frontends, nodeId, session, treeReloadRef } _ = do
let sid = sessionId session
pure $ annuaireUserLayoutWithKey { annuaireId,
appReload
, asyncTasksRef
, frontends
, key: show sid <> "-" <> show nodeId
, nodeId
, session
, treeReloadRef
}
{-
cpt { annuaireId, appReload, asyncTasksRef, frontends, nodeId, session, treeReloadRef } _ = do
cpt { annuaireId, appReload, asyncTasksRef, frontends, nodeId, session, treeReloadRef } _ = do
cacheState <- R.useState' LT.CacheOn
cacheState <- R.useState' LT.CacheOn
...
@@ -260,8 +274,7 @@ annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayou
...
@@ -260,8 +274,7 @@ annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayou
\contactData@{contactNode: Contact {name, hyperdata}} ->
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
H.ul { className: "col-md-12 list-group" } [
display { title: fromMaybe "no name" name } (contactInfos hyperdata onUpdateHyperdata)
display { title: fromMaybe "no name" name } (contactInfos hyperdata onUpdateHyperdata)
, Tabs.tabs {
, Tabs.tabs { appReload
appReload
, asyncTasksRef
, asyncTasksRef
, cacheState
, cacheState
, contactData
, contactData
...
@@ -276,10 +289,51 @@ annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayou
...
@@ -276,10 +289,51 @@ annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayou
where
where
onUpdateHyperdata :: HyperdataUser -> Effect Unit
onUpdateHyperdata :: HyperdataUser -> Effect Unit
onUpdateHyperdata _ = pure unit
onUpdateHyperdata _ = pure unit
-}
annuaireUserLayoutWithKey :: Record AnnuaireKeyLayoutProps -> R.Element
annuaireUserLayoutWithKey props = R.createElement annuaireUserLayoutWithKeyCpt props []
annuaireUserLayoutWithKeyCpt :: R.Component AnnuaireKeyLayoutProps
annuaireUserLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "annuaireUserLayoutWithKey" cpt
where
cpt { annuaireId, appReload, asyncTasksRef, frontends, nodeId, session, treeReloadRef } _ = do
reload <- GUR.new
cacheState <- R.useState' LT.CacheOn
sidePanelTriggers <- LT.emptySidePanelTriggers
useLoader nodeId (getAnnuaireContact session annuaireId) $
\contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [
display { title: fromMaybe "no name" name } (contactInfos hyperdata (onUpdateHyperdata reload))
, Tabs.tabs {
appReload
, asyncTasksRef
, cacheState
, contactData
, frontends
, nodeId
, session
, sidePanelTriggers
, treeReloadRef
}
]
where
onUpdateHyperdata :: GUR.ReloadS -> HyperdataUser -> Effect Unit
onUpdateHyperdata reload hd = do
launchAff_ $ do
_ <- saveContactHyperdata session nodeId hd
liftEffect $ GUR.bump reload
getAnnuaireContact :: Session -> Int -> Int -> Aff ContactData
getAnnuaireContact :: Session -> Int -> Int -> Aff ContactData
getAnnuaireContact session annuaireId id = do
getAnnuaireContact session annuaireId id = do
contactNode <- get session $ Routes.NodeAPI Annuaire (Just annuaireId) $
"contact/" <> (show id)
contactNode <- get session $ Routes.NodeAPI Annuaire (Just annuaireId) $
show id
-- TODO: we need a default list for the pairings
-- TODO: we need a default list for the pairings
--defaultListIds <- get $ toUrl endConfigStateful Back (Children NodeList 0 1 Nothing) $ Just id
--defaultListIds <- get $ toUrl endConfigStateful Back (Children NodeList 0 1 Nothing) $ Just id
--case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
--case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
...
...
src/Gargantext/Components/Search.purs
View file @
ddb99dd0
...
@@ -58,8 +58,7 @@ instance encodeJsonSearchResult :: Argonaut.EncodeJson SearchResult where
...
@@ -58,8 +58,7 @@ instance encodeJsonSearchResult :: Argonaut.EncodeJson SearchResult where
------------------------------------------------------------------------
------------------------------------------------------------------------
data SearchResultTypes =
data SearchResultTypes = SearchResultDoc { docs :: Array Document}
SearchResultDoc { docs :: Array Document}
| SearchNoResult { message :: String }
| SearchNoResult { message :: String }
| SearchResultContact { contacts :: Array Contact }
| SearchResultContact { contacts :: Array Contact }
...
@@ -132,6 +131,7 @@ data Contact =
...
@@ -132,6 +131,7 @@ data Contact =
, c_created :: String
, c_created :: String
, c_hyperdata :: HyperdataRowContact
, c_hyperdata :: HyperdataRowContact
, c_score :: Int
, c_score :: Int
, c_annuaireId :: Int
}
}
derive instance eqContact :: Eq Contact
derive instance eqContact :: Eq Contact
...
...
src/Gargantext/Ends.purs
View file @
ddb99dd0
...
@@ -222,6 +222,7 @@ sessionPath (R.ChartHash { chartType, listId, tabType } i) =
...
@@ -222,6 +222,7 @@ sessionPath (R.ChartHash { chartType, listId, tabType } i) =
<> defaultListAddMaybe listId
<> defaultListAddMaybe listId
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
------- misc routing stuff
------- misc routing stuff
defaultList :: Int -> String
defaultList :: Int -> String
...
...
src/Gargantext/Routes.purs
View file @
ddb99dd0
...
@@ -5,7 +5,7 @@ import Prelude
...
@@ -5,7 +5,7 @@ import Prelude
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Gargantext.Types (ChartOpts, ChartType, CorpusMetricOpts, CTabNgramType, Id, Limit,
import Gargantext.Types (ChartOpts, ChartType, CorpusMetricOpts, CTabNgramType, Id, Limit,
ListId, NgramsGetOpts, NgramsGetTableAllOpts, NodeType,
ListId,
DocId, ContactId,
NgramsGetOpts, NgramsGetTableAllOpts, NodeType,
Offset, OrderBy, SearchOpts, SessionId, TabSubType, TabType, TermList)
Offset, OrderBy, SearchOpts, SessionId, TabSubType, TabType, TermList)
import Gargantext.Types as GT
import Gargantext.Types as GT
...
@@ -35,9 +35,6 @@ data AppRoute
...
@@ -35,9 +35,6 @@ data AppRoute
derive instance eqAppRoute :: Eq AppRoute
derive instance eqAppRoute :: Eq AppRoute
type AnnuaireId = Int
type ContactId = Int
data SessionRoute
data SessionRoute
= Tab TabType (Maybe Id)
= Tab TabType (Maybe Id)
| Children NodeType Offset Limit (Maybe OrderBy) (Maybe Id)
| Children NodeType Offset Limit (Maybe OrderBy) (Maybe Id)
...
@@ -53,12 +50,13 @@ data SessionRoute
...
@@ -53,12 +50,13 @@ data SessionRoute
| TreeFirstLevel (Maybe Id) String
| TreeFirstLevel (Maybe Id) String
| GraphAPI Id String
| GraphAPI Id String
| ListsRoute ListId
| ListsRoute ListId
| ListDocument (Maybe ListId) (Maybe Id)
| ListDocument (Maybe ListId) (Maybe
Doc
Id)
| Search SearchOpts (Maybe Id)
| Search SearchOpts (Maybe Id)
| CorpusMetrics CorpusMetricOpts (Maybe Id)
| CorpusMetrics CorpusMetricOpts (Maybe Id)
| CorpusMetricsHash { listId :: ListId, tabType :: TabType } (Maybe Id)
| CorpusMetricsHash { listId :: ListId, tabType :: TabType } (Maybe Id)
| Chart ChartOpts (Maybe Id)
| Chart ChartOpts (Maybe Id)
| ChartHash { chartType :: ChartType, listId :: Maybe ListId, tabType :: TabType } (Maybe Id)
| ChartHash { chartType :: ChartType, listId :: Maybe ListId, tabType :: TabType } (Maybe Id)
-- | AnnuaireContact AnnuaireId DocId
instance showAppRoute :: Show AppRoute where
instance showAppRoute :: Show AppRoute where
show Home = "Home"
show Home = "Home"
...
...
src/Gargantext/Types.purs
View file @
ddb99dd0
...
@@ -333,8 +333,11 @@ nodeTypePath (NodePublic nt) = nodeTypePath nt
...
@@ -333,8 +333,11 @@ nodeTypePath (NodePublic nt) = nodeTypePath nt
nodeTypePath NodeFile = "file"
nodeTypePath NodeFile = "file"
------------------------------------------------------------
------------------------------------------------------------
type CorpusId = Int
type DocId = Int
type ListId = Int
type ListId = Int
type AnnuaireId = Int
type ContactId = Int
data ScoreType = Occurrences
data ScoreType = Occurrences
...
...
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