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
6e088030
Commit
6e088030
authored
Nov 15, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP] [Flow] add some EtherCalc CSV code
parent
59f1c078
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
Frame.purs
src/Gargantext/Components/Nodes/Frame.purs
+31
-3
No files found.
src/Gargantext/Components/Nodes/Frame.purs
View file @
6e088030
...
@@ -16,8 +16,11 @@ import Gargantext.Components.Node (NodePoly(..))
...
@@ -16,8 +16,11 @@ import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Config.REST (RESTError, logRESTError)
import Gargantext.Config.REST (RESTError, logRESTError)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes as GR
import Gargantext.Sessions (Session, get, sessionId)
import Gargantext.Sessions (Session, get, sessionId)
import Gargantext.Types (NodeType(..))
import Gargantext.Types (NodeType(..))
import Gargantext.Types as GT
import Gargantext.Utils.EtherCalc as EC
import Gargantext.Utils.JitsiMeet as JM
import Gargantext.Utils.JitsiMeet as JM
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Gargantext.Utils.Toestand as T2
...
@@ -95,7 +98,8 @@ frameLayoutView props = R.createElement frameLayoutViewCpt props []
...
@@ -95,7 +98,8 @@ frameLayoutView props = R.createElement frameLayoutViewCpt props []
frameLayoutViewCpt :: R.Component ViewProps
frameLayoutViewCpt :: R.Component ViewProps
frameLayoutViewCpt = here.component "frameLayoutView" cpt
frameLayoutViewCpt = here.component "frameLayoutView" cpt
where
where
cpt { frame: NodePoly { hyperdata: Hyperdata { base, frame_id }}
cpt { frame: NodePoly { hyperdata: h@(Hyperdata { base, frame_id }) }
, nodeId
, nodeType
, nodeType
, reload } _ = do
, reload } _ = do
case nodeType of
case nodeType of
...
@@ -104,8 +108,9 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
...
@@ -104,8 +108,9 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
Nothing -> pure $ H.div {} [ H.text $ "Wrong base url: " <> base ]
Nothing -> pure $ H.div {} [ H.text $ "Wrong base url: " <> base ]
Just url -> pure $ nodeFrameVisio { frame_id, reload, url }
Just url -> pure $ nodeFrameVisio { frame_id, reload, url }
_ ->
_ ->
pure $ H.div{} [
pure $ H.div{}
FV.backButton {} []
[ FV.backButton {} []
, importIntoListButton { hyperdata: h, nodeId } []
, H.div { className : "frame"
, H.div { className : "frame"
, rows: "100%,*" }
, rows: "100%,*" }
[ -- H.script { src: "https://visio.gargantext.org/external_api.js"} [],
[ -- H.script { src: "https://visio.gargantext.org/external_api.js"} [],
...
@@ -116,6 +121,29 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
...
@@ -116,6 +121,29 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
]
]
]
]
type ImportIntoListButtonProps =
( hyperdata :: Hyperdata
, nodeId :: Int )
importIntoListButton :: R2.Component ImportIntoListButtonProps
importIntoListButton = R.createElement importIntoListButtonCpt
importIntoListButtonCpt :: R.Component ImportIntoListButtonProps
importIntoListButtonCpt = here.component "importIntoListButton" cpt where
cpt { hyperdata: Hyperdata { base, frame_id }
, nodeId } _ = do
pure $ H.div { className: "btn btn-default"
, on: { click: onClick } }
[ H.text $ "Import into list" ]
where
onClick _ = do
let url = base <> "/" <> frame_id
--task = GT.AsyncTaskWithType { task, typ: GT.ListCSVUpload }
uploadPath = GR.NodeAPI NodeList (Just id) $ GT.asyncTaskTypePath GT.ListCSVUpload
csv <- EC.downloadCSV base frame_id
here.log2 "[importIntoListButton] CSV: " csv
--eTask <- postWwwUrlencoded session uploadPath body
pure unit
type NodeFrameVisioProps =
type NodeFrameVisioProps =
( frame_id :: String
( frame_id :: String
, reload :: T2.ReloadS
, reload :: T2.ReloadS
...
...
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