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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
d954aec0
Commit
d954aec0
authored
Jul 15, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[visio] add simple visio component
parent
b2e22224
Pipeline
#1593
canceled with stage
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
167 additions
and
93 deletions
+167
-93
default.nix
default.nix
+22
-0
packages.dhall
packages.dhall
+5
-0
spago.dhall
spago.dhall
+1
-0
Frame.purs
src/Gargantext/Components/Nodes/Frame.purs
+61
-15
yarn.lock
yarn.lock
+78
-78
No files found.
default.nix
0 → 100644
View file @
d954aec0
with
(
import
<
nixpkgs
>
{});
let
nodejs-with-packages
=
with
nodePackages
;
[
bower
yarn
];
in
stdenv
.
mkDerivation
rec
{
name
=
"env"
;
env
=
buildEnv
{
name
=
name
;
paths
=
buildInputs
;
};
buildInputs
=
[
nodejs-with-packages
yarn
yarn2nix
];
builder
=
builtins
.
toFile
"builder.sh"
''
source $stdenv/setup
touch $out
''
;
}
packages.dhall
View file @
d954aec0
...
@@ -170,6 +170,11 @@ let additions =
...
@@ -170,6 +170,11 @@ let additions =
, repo = "https://github.com/alpacaaa/purescript-simplecrypto"
, repo = "https://github.com/alpacaaa/purescript-simplecrypto"
, version = "v1.0.1"
, version = "v1.0.1"
}
}
, web-url =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/mjepronk/purescript-web-url"
, version = "v1.0.2"
}
}
}
let localPackages = {
let localPackages = {
...
...
spago.dhall
View file @
d954aec0
...
@@ -91,6 +91,7 @@ to generate this file without the comments in this block.
...
@@ -91,6 +91,7 @@ to generate this file without the comments in this block.
, "web-file"
, "web-file"
, "web-html"
, "web-html"
, "web-storage"
, "web-storage"
, "web-url"
, "web-xhr"
, "web-xhr"
]
]
, packages = ./packages.dhall
, packages = ./packages.dhall
...
...
src/Gargantext/Components/Nodes/Frame.purs
View file @
d954aec0
...
@@ -8,12 +8,15 @@ import Data.Eq.Generic (genericEq)
...
@@ -8,12 +8,15 @@ import Data.Eq.Generic (genericEq)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Data.Newtype (class Newtype)
import Data.Nullable (Nullable, null)
import Data.Show.Generic (genericShow)
import Data.Show.Generic (genericShow)
import DOM.Simple as DOM
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Simple.JSON as JSON
import Simple.JSON as JSON
import Toestand as T
import Toestand as T
import Web.URL as WURL
import Gargantext.Components.FolderView as FV
import Gargantext.Components.FolderView as FV
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Node (NodePoly(..))
...
@@ -49,7 +52,6 @@ type KeyProps =
...
@@ -49,7 +52,6 @@ type KeyProps =
frameLayout :: R2.Leaf Props
frameLayout :: R2.Leaf Props
frameLayout props = R.createElement frameLayoutCpt props []
frameLayout props = R.createElement frameLayoutCpt props []
frameLayoutCpt :: R.Component Props
frameLayoutCpt :: R.Component Props
frameLayoutCpt = here.component "frameLayout" cpt where
frameLayoutCpt = here.component "frameLayout" cpt where
cpt { nodeId, nodeType, session } _ = do
cpt { nodeId, nodeType, session } _ = do
...
@@ -59,7 +61,6 @@ frameLayoutCpt = here.component "frameLayout" cpt where
...
@@ -59,7 +61,6 @@ frameLayoutCpt = here.component "frameLayout" cpt where
frameLayoutWithKey :: R2.Leaf KeyProps
frameLayoutWithKey :: R2.Leaf KeyProps
frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props []
frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props []
frameLayoutWithKeyCpt :: R.Component KeyProps
frameLayoutWithKeyCpt :: R.Component KeyProps
frameLayoutWithKeyCpt = here.component "frameLayoutWithKey" cpt where
frameLayoutWithKeyCpt = here.component "frameLayoutWithKey" cpt where
cpt { nodeId, session, nodeType} _ = do
cpt { nodeId, session, nodeType} _ = do
...
@@ -86,29 +87,74 @@ hframeUrl NodeFrameCalc base frame_id = base <> "/" <> frame_id
...
@@ -86,29 +87,74 @@ hframeUrl NodeFrameCalc base frame_id = base <> "/" <> frame_id
hframeUrl NodeFrameVisio base frame_id = base <> "/" <> frame_id
hframeUrl NodeFrameVisio base frame_id = base <> "/" <> frame_id
hframeUrl _ base frame_id = base <> "/" <> frame_id <> "?view" -- "?both"
hframeUrl _ base frame_id = base <> "/" <> frame_id <> "?view" -- "?both"
frameLayoutView :: Record ViewProps -> R.Element
frameLayoutView :: R2.Leaf ViewProps
frameLayoutView props = R.createElement frameLayoutViewCpt props []
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: Hyperdata { base, frame_id }}
, nodeId
, nodeId
, nodeType
, nodeType
, reload
, reload
, session } _ =
, session } _ = do
pure $ H.div{} [
case nodeType of
FV.backButton
NodeFrameVisio ->
, FV.homeButton
case WURL.fromAbsolute base of
, H.div { className : "frame"
Nothing -> pure $ H.div {} [ H.text $ "Wrong base url: " <> base ]
, rows: "100%,*" }
Just url -> pure $ nodeFrameVisio { frame_id, reload, url }
_ ->
pure $ H.div{} [
FV.backButton
, FV.homeButton
, H.div { className : "frame"
, rows: "100%,*" }
[ -- H.script { src: "https://visio.gargantext.org/external_api.js"} [],
[ -- H.script { src: "https://visio.gargantext.org/external_api.js"} [],
H.iframe { src: hframeUrl nodeType base frame_id
H.iframe { src: hframeUrl nodeType base frame_id
, width: "100%"
, width: "100%"
, height: "100%"
, height: "100%"
} []
} []
]
]
]
]
type NodeFrameVisioProps =
( frame_id :: String
, reload :: T2.ReloadS
, url :: WURL.URL
)
nodeFrameVisio :: R2.Leaf NodeFrameVisioProps
nodeFrameVisio props = R.createElement nodeFrameVisioCpt props []
nodeFrameVisioCpt :: R.Component NodeFrameVisioProps
nodeFrameVisioCpt = here.component "nodeFrameVisio" cpt
where
cpt { frame_id
, reload
, url } _ = do
-- api = new JitsiMeetExternalAPI("visio.gargantext.org", {roomName: frame_id})
ref <- R.useRef (null :: Nullable DOM.Element)
R.useEffect' $ do
here.log2 "[nodeFrameVisio] ref" $ R.readRef ref
pure $ H.div { ref } [ nodeFrameVisioPlaceholder { frame_id, ref, reload, url } ]
type NodeFrameVisioPlaceholderProps =
( ref :: R.Ref (Nullable DOM.Element)
| NodeFrameVisioProps
)
nodeFrameVisioPlaceholder :: R2.Leaf NodeFrameVisioPlaceholderProps
nodeFrameVisioPlaceholder props = R.createElement nodeFrameVisioPlaceholderCpt props []
nodeFrameVisioPlaceholder :: R.Component NodeFrameVisioPlaceholderProps
nodeFrameVisioPlaceholder = here.component "nodeFrameVisioPlaceholder" cpt
where
cpt { frame_id
, ref
, url } _ = do
R.useEffect' $ do
here.log2 "[nodeFrameVisioPlaceholder] ref" $ R.readRef ref
pure $ H.text $ WURL.host url
type LoadProps = ( nodeId :: Int
type LoadProps = ( nodeId :: Int
, session :: Session )
, session :: Session )
...
...
yarn.lock
View file @
d954aec0
This diff is collapsed.
Click to expand it.
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