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
f55bac99
Commit
f55bac99
authored
Jan 24, 2024
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
url share
parent
729b0a4b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
9 deletions
+30
-9
Share.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
+18
-5
Router.purs
src/Gargantext/Components/Router.purs
+9
-4
Ends.purs
src/Gargantext/Ends.purs
+1
-0
Router.purs
src/Gargantext/Router.purs
+1
-0
Routes.purs
src/Gargantext/Routes.purs
+1
-0
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Share.purs
View file @
f55bac99
...
...
@@ -18,8 +18,7 @@ import Gargantext.Config.REST (AffRESTError, logRESTError)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, get, post)
import Gargantext.Sessions.Types (sessionUrl)
import Gargantext.Types (ID, NodeType)
import Gargantext.Types (ID, NodeID, NodeType)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.SimpleJSON as GUSJ
...
...
@@ -145,7 +144,21 @@ shareURL = R.createElement shareURLcpt
shareURLcpt :: R.Component ShareURL
shareURLcpt = here.component "shareURL" cpt
where
cpt { nodeType, id, session } _ = do
pure $ Tools.panel [ H.div {} [ H.text url ] ] ( H.div {} [] )
cpt {nodeType, id, session} _ = do
useLoader { errorHandler
, loader: loadUrl
, path: {nodeType, id, session}
, render: \url -> shareURLInner {url} [] }
errorHandler err = here.warn2 "[ShareURL] RESTError" err
shareURLInner :: R2.Component ( url :: String )
shareURLInner = R.createElement shareURLInnercpt
shareURLInnercpt :: R.Component ( url :: String )
shareURLInnercpt = here.component "shareURLInner" cpt
where
url = sessionUrl session $ "share/" <> (show nodeType) <> "/" <> (show id)
cpt { url } _ = do
pure $ Tools.panel [ H.div {} [ H.text url ] ] ( H.div {} [] )
loadUrl :: { session :: Session, id :: NodeID, nodeType :: NodeType } -> AffRESTError String
loadUrl { session, id, nodeType } = get session $ GR.ShareURL id nodeType
src/Gargantext/Components/Router.purs
View file @
f55bac99
module Gargantext.Components.Router (router) where
module Gargantext.Components.Router
( router
, shareCpt
)
where
import Gargantext.Prelude
...
...
@@ -11,6 +15,7 @@ import Data.Maybe (Maybe(..), fromMaybe, maybe)
import Data.UUID (UUID)
import Data.UUID as UUID
import Effect (Effect)
import Effect.Class (liftEffect)
import Gargantext.Components.App.Store (Boxes)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.ErrorsView as ErrorsView
...
...
@@ -796,9 +801,9 @@ shareCpt = here.component "share" cpt where
case unSessions sessions' of
[] -> do
R.useEffect' $ goToRoute Login
pure $ H.
div {} []
pure $ H.
text "no session"
s -> case head s of
Just s' -> do
R.useEffect' $ goToRoute $ fromMaybe Login $ GR.nodeTypeAppRoute (fromMaybe Node $ read nodeType) (sessionId s') nodeId
pure $ H.
div {} []
pure $ H.
text $ "session route: " <> (show $ fromMaybe Login $ GR.nodeTypeAppRoute (fromMaybe Node $ read nodeType) (sessionId s') nodeId)
Nothing -> pure $ H.div {} []
\ No newline at end of file
src/Gargantext/Ends.purs
View file @
f55bac99
...
...
@@ -219,6 +219,7 @@ sessionPath (R.ChartHash { chartType, listId, tabType } i) =
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
sessionPath (R.PhyloAPI nId) = "node/" <> show nId <> "/phylo"
sessionPath R.Members = "members"
sessionPath (R.ShareURL i t) = "shareurl?type=" <> show t <> "&id=" <> show i
------- misc routing stuff
...
...
src/Gargantext/Router.purs
View file @
f55bac99
...
...
@@ -39,6 +39,7 @@ router = oneOf
, RouteFrameCode <$> (route "code" *> sid) <*> int
, RouteFrameVisio <$> (route "visio" *> sid) <*> int
, RouteFile <$> (route "file" *> sid) <*> int
, Share <$> (route "share" *> str) <*> int
, Home <$ lit ""
]
where
...
...
src/Gargantext/Routes.purs
View file @
f55bac99
...
...
@@ -144,6 +144,7 @@ data SessionRoute
-- | AnnuaireContact AnnuaireId DocId
| PhyloAPI Id
| Members
| ShareURL Id NodeType
------------------------------------------------------
...
...
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