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
a65a8805
Commit
a65a8805
authored
Jul 24, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[forest] add key to user page, to refresh it
Also, key is generated based on session id and node id.
parent
50bd539c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
34 deletions
+51
-34
App.purs
src/Gargantext/Components/App.purs
+43
-31
Contacts.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
+6
-1
Version.purs
src/Gargantext/Version.purs
+2
-2
No files found.
src/Gargantext/Components/App.purs
View file @
a65a8805
...
...
@@ -4,6 +4,10 @@ import Data.Array (fromFoldable)
import Data.Foldable (intercalate)
import Data.Maybe (Maybe(..), maybe')
import Data.Tuple (fst, snd)
import Prelude
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Components.Forest (forest)
import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.Lang (LandingLang(..))
...
...
@@ -26,9 +30,6 @@ import Gargantext.Routes (AppRoute(..))
import Gargantext.Sessions (Sessions, useSessions)
import Gargantext.Sessions as Sessions
import Gargantext.Utils.Reactix as R2
import Prelude
import Reactix as R
import Reactix.DOM.HTML as H
-- TODO (what does this mean?)
-- tree changes endConfig state => trigger endConfig change in outerLayout, layoutFooter etc
...
...
@@ -48,6 +49,8 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
treeReload <- R.useState' 0
let backends = fromFoldable defaultBackends
let ff f session = R.fragment [ f session, footer { session } ]
let forested child = forestLayout { child
, frontends
, reload: treeReload
...
...
@@ -55,32 +58,30 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
, sessions: fst sessions
, showLogin: snd showLogin }
let mCurrentRoute = fst route
let backends = fromFoldable defaultBackends
let ff f session = R.fragment [ f session, footer { session } ]
let mkKey sid nodeId = show sid <> "-" <> show nodeId
let withSession sid f =
maybe' (const $ forested $ homeLayout LL_EN) (ff f) $ Sessions.lookup sid (fst sessions)
pure $ case fst showLogin of
true -> forested $ login {
sessions, backend
s, visible: showLogin }
true -> forested $ login {
backends, session
s, visible: showLogin }
false ->
case fst route of
Home -> forested $ homeLayout LL_EN
Login -> login { sessions, backends, visible: showLogin }
--Folder sid _ -> withSession sid $ \_ -> forested (folder {})
Folder sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
FolderPrivate sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
FolderPublic sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
FolderShared sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
Team sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
RouteFrameWrite sid nodeId -> withSession sid $ \session -> forested $ frameLayout { key: show nodeId, nodeId, session }
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested $ frameLayout { key: show nodeId, nodeId, session }
Corpus sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
Login -> login { backends, sessions, visible: showLogin }
Folder sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: mkKey sid nodeId, nodeId, session }
FolderPrivate sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: mkKey sid nodeId, nodeId, session }
FolderPublic sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: mkKey sid nodeId, nodeId, session }
FolderShared sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: mkKey sid nodeId, nodeId, session }
Team sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: mkKey sid nodeId, nodeId, session }
RouteFrameWrite sid nodeId -> withSession sid $ \session -> forested $ frameLayout { key: mkKey sid nodeId, nodeId, session }
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested $ frameLayout { key: mkKey sid nodeId, nodeId, session }
Corpus sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: mkKey sid nodeId, nodeId, session }
Texts sid nodeId -> withSession sid $ \session -> forested $ textsLayout { nodeId, session, frontends }
Lists sid nodeId -> withSession sid $ \session -> forested $ listsLayout { nodeId, session }
Dashboard sid nodeId -> withSession sid $ \session -> forested $ dashboardLayout { nodeId, session }
Annuaire sid nodeId -> withSession sid $ \session -> forested $ annuaireLayout { frontends, nodeId, session }
UserPage sid nodeId -> withSession sid $ \session -> forested $ userLayout { frontends, nodeId, session }
ContactPage sid aId nodeId -> withSession sid $ \session -> forested $ annuaireUserLayout { annuaireId: aId, frontends, nodeId, session }
UserPage sid nodeId -> withSession sid $ \session -> forested $ userLayout { frontends,
key: mkKey sid nodeId,
nodeId, session }
ContactPage sid aId nodeId -> withSession sid $ \session -> forested $ annuaireUserLayout { annuaireId: aId, frontends,
key: mkKey sid nodeId,
nodeId, session }
CorpusDocument sid corpusId listId nodeId -> withSession sid $ \session -> forested $ documentLayout { nodeId, listId, session, corpusId: Just corpusId }
Document sid listId nodeId ->
withSession sid $
...
...
@@ -107,12 +108,23 @@ type ForestLayoutProps =
)
forestLayout :: Record ForestLayoutProps -> R.Element
forestLayout { child, frontends, reload, route, sessions, showLogin } = do
R.fragment [ topBar {}, R2.row [main] ]
forestLayout props = R.createElement forestLayoutCpt props []
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R.hooksComponent "G.C.A.forestLayout" cpt
where
cpt props _ = do
pure $ R.fragment [ topBar {}, forestLayoutMain props ]
forestLayoutMain :: Record ForestLayoutProps -> R.Element
forestLayoutMain props = R.createElement forestLayoutMainCpt props []
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponent "G.C.A.forestLayoutMain" cpt
where
main =
R.fragment
[ H.div {className: "col-md-2", style: {paddingTop: "60px"}
}
cpt { child, frontends, reload, route, sessions, showLogin } _ = do
pure $ R2.row [
H.div { className: "col-md-2", style: { paddingTop: "60px" }
}
[ forest { frontends, reload, route, sessions, showLogin } ]
, mainPage child
]
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contacts.purs
View file @
a65a8805
...
...
@@ -135,7 +135,12 @@ infoRender (Tuple title content) =
[ H.span { className: "badge badge-default badge-pill"} [ H.text title ]
, H.span {} [H.text content] ]
type LayoutProps = ( frontends :: Frontends, nodeId :: Int, session :: Session )
type LayoutProps = (
frontends :: Frontends
, key :: String
, nodeId :: Int
, session :: Session
)
userLayout :: Record LayoutProps -> R.Element
userLayout props = R.createElement userLayoutCpt props []
...
...
src/Gargantext/Version.purs
View file @
a65a8805
...
...
@@ -41,7 +41,7 @@ versionCpt = R.hooksComponent "G.C.A.version" cpt
pure $ case version == versionBack of
true -> H.a { className: "fa fa-check-circle-o"
,
"text-decoration"
: "none"
,
textDecoration
: "none"
, title: "Versions match: frontend ("
<> version
<> "), backend ("
...
...
@@ -49,7 +49,7 @@ versionCpt = R.hooksComponent "G.C.A.version" cpt
<> ")"
} []
false -> H.a { className: "fa fa-exclamation-triangle"
,
"text-decoration"
: "none"
,
textDecoration
: "none"
, title: "Versions mismatch: frontend ("
<> version
<> "), backend ("
...
...
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