Commit c5017917 authored by Alexandre Delanoë's avatar Alexandre Delanoë

merge, tested: ok

parents 4d011052 b689fd11
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
'';
}
...@@ -14,6 +14,5 @@ ...@@ -14,6 +14,5 @@
<div id="app" class ="container-fluid"></div> <div id="app" class ="container-fluid"></div>
<div id="portal"></div> <div id="portal"></div>
<script src="bundle.js"></script> <script src="bundle.js"></script>
<script src='https://visio.gargantext.org/external_api.js'></script> <!-- FIXME to be removed -->
</body> </body>
</html> </html>
...@@ -180,6 +180,11 @@ let additions = ...@@ -180,6 +180,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 = {
......
...@@ -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
......
...@@ -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, toMaybe)
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(..))
...@@ -21,6 +24,7 @@ import Gargantext.Hooks.Loader (useLoader) ...@@ -21,6 +24,7 @@ import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(NodeAPI)) import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, get, sessionId) import Gargantext.Sessions (Session, get, sessionId)
import Gargantext.Types (NodeType(..)) import Gargantext.Types (NodeType(..))
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
...@@ -48,7 +52,6 @@ type KeyProps = ...@@ -48,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
...@@ -58,7 +61,6 @@ frameLayoutCpt = here.component "frameLayout" cpt where ...@@ -58,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
...@@ -85,29 +87,63 @@ hframeUrl NodeFrameCalc base frame_id = base <> "/" <> frame_id ...@@ -85,29 +87,63 @@ 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})
api <- T.useBox (Nothing :: Maybe JM.JitsiMeet)
ref <- R.useRef (null :: Nullable DOM.Element)
R.useEffect' $ do
here.log2 "[nodeFrameVisio] ref" $ R.readRef ref
here.log2 "[nodeFrameVisio] JM.api" JM._api
case toMaybe (R.readRef ref) of
Nothing -> pure unit
Just r -> do
api <- JM.jitsiMeetAPI (WURL.host url) { parentNode: r, roomName: frame_id }
here.log2 "[nodeFrameVisio] api" api
pure $ H.div { ref } [ H.text $ WURL.host url ]
type LoadProps = ( nodeId :: Int type LoadProps = ( nodeId :: Int
, session :: Session ) , session :: Session )
......
'use strict';
var API = require('../../src/external-deps/JitsiMeetAPI.js');
console.log('API', API);
exports._api = API;
exports._jitsiMeetAPI = function(host, options) {
return new API(host, options);
};
module Gargantext.Utils.JitsiMeet where
import Data.Function.Uncurried (Fn2, runFn2)
import DOM.Simple as DOM
import Effect (Effect)
import Effect.Uncurried (EffectFn2, runEffectFn2)
foreign import data JitsiMeet :: Type
type Jitsi =
{ parentNode :: DOM.Element
, roomName :: String }
foreign import _api :: JitsiMeet
foreign import _jitsiMeetAPI :: EffectFn2 String Jitsi JitsiMeet
jitsiMeetAPI :: String -> Jitsi -> Effect JitsiMeet
jitsiMeetAPI = runEffectFn2 _jitsiMeetAPI
--jitsiMeetAPIFn :: String -> Jitsi -> JitsiMeet
--jitsiMeetAPIFn = runFn2 _jitsiMeetAPI
This diff is collapsed.
...@@ -1975,7 +1975,11 @@ bootstrap-dark@^1.0.3: ...@@ -1975,7 +1975,11 @@ bootstrap-dark@^1.0.3:
dependencies: dependencies:
bootstrap ">=4.3" bootstrap ">=4.3"
<<<<<<< HEAD
bootstrap@>=4.3, bootstrap@^5.0.2: bootstrap@>=4.3, bootstrap@^5.0.2:
=======
bootstrap@>=4.3, bootstrap@^5.0.1:
>>>>>>> b689fd11ba983d8a687df733a5dde6e37e42fa93
version "5.0.2" version "5.0.2"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.0.2.tgz#aff23d5e0e03c31255ad437530ee6556e78e728e" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.0.2.tgz#aff23d5e0e03c31255ad437530ee6556e78e728e"
integrity sha512-1Ge963tyEQWJJ+8qtXFU6wgmAVj9gweEjibUdbmcCEYsn38tVwRk8107rk2vzt6cfQcRr3SlZ8aQBqaD8aqf+Q== integrity sha512-1Ge963tyEQWJJ+8qtXFU6wgmAVj9gweEjibUdbmcCEYsn38tVwRk8107rk2vzt6cfQcRr3SlZ8aQBqaD8aqf+Q==
...@@ -2986,9 +2990,15 @@ ejs@^2.6.1: ...@@ -2986,9 +2990,15 @@ ejs@^2.6.1:
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
electron-to-chromium@^1.3.723: electron-to-chromium@^1.3.723:
<<<<<<< HEAD
version "1.3.778" version "1.3.778"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.778.tgz#bf01048736c95b78f2988e88005e0ebb385942a4" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.778.tgz#bf01048736c95b78f2988e88005e0ebb385942a4"
integrity sha512-Lw04qJaPtWdq0d7qKHJTgkam+FhFi3hm/scf1EyqJWdjO3ZIGUJhNmZJRXWb7yb/bRYXQyVGSpa9RqVpjjWMQw== integrity sha512-Lw04qJaPtWdq0d7qKHJTgkam+FhFi3hm/scf1EyqJWdjO3ZIGUJhNmZJRXWb7yb/bRYXQyVGSpa9RqVpjjWMQw==
=======
version "1.3.775"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.775.tgz#046517d1f2cea753e06fff549995b9dc45e20082"
integrity sha512-EGuiJW4yBPOTj2NtWGZcX93ZE8IGj33HJAx4d3ouE2zOfW2trbWU+t1e0yzLr1qQIw81++txbM3BH52QwSRE6Q==
>>>>>>> b689fd11ba983d8a687df733a5dde6e37e42fa93
elliptic@^6.5.2, elliptic@^6.5.3: elliptic@^6.5.2, elliptic@^6.5.3:
version "6.5.4" version "6.5.4"
...@@ -3251,6 +3261,14 @@ fast-levenshtein@~2.0.6: ...@@ -3251,6 +3261,14 @@ fast-levenshtein@~2.0.6:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
<<<<<<< HEAD
=======
fast-safe-stringify@^2.0.7:
version "2.0.8"
resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz#dc2af48c46cf712b683e849b2bbd446b32de936f"
integrity sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==
>>>>>>> b689fd11ba983d8a687df733a5dde6e37e42fa93
fast-url-parser@1.1.3: fast-url-parser@1.1.3:
version "1.1.3" version "1.1.3"
resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d" resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d"
...@@ -3708,7 +3726,11 @@ immer@^8.0.1: ...@@ -3708,7 +3726,11 @@ immer@^8.0.1:
resolved "https://registry.yarnpkg.com/immer/-/immer-8.0.4.tgz#3a21605a4e2dded852fb2afd208ad50969737b7a" resolved "https://registry.yarnpkg.com/immer/-/immer-8.0.4.tgz#3a21605a4e2dded852fb2afd208ad50969737b7a"
integrity sha512-jMfL18P+/6P6epANRvRk6q8t+3gGhqsJ9EuJ25AXE+9bNTYtssvzeYbEd0mXRYWCmmXSIbnlpz6vd6iJlmGGGQ== integrity sha512-jMfL18P+/6P6epANRvRk6q8t+3gGhqsJ9EuJ25AXE+9bNTYtssvzeYbEd0mXRYWCmmXSIbnlpz6vd6iJlmGGGQ==
<<<<<<< HEAD
immer@^9.0.5: immer@^9.0.5:
=======
immer@^9.0.3:
>>>>>>> b689fd11ba983d8a687df733a5dde6e37e42fa93
version "9.0.5" version "9.0.5"
resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.5.tgz#a7154f34fe7064f15f00554cc94c66cc0bf453ec" resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.5.tgz#a7154f34fe7064f15f00554cc94c66cc0bf453ec"
integrity sha512-2WuIehr2y4lmYz9gaQzetPR2ECniCifk4ORaQbU3g5EalLt+0IVTosEPJ5BoYl/75ky2mivzdRzV8wWgQGOSYQ== integrity sha512-2WuIehr2y4lmYz9gaQzetPR2ECniCifk4ORaQbU3g5EalLt+0IVTosEPJ5BoYl/75ky2mivzdRzV8wWgQGOSYQ==
...@@ -5351,6 +5373,16 @@ purescript-language-server@^0.15.2: ...@@ -5351,6 +5373,16 @@ purescript-language-server@^0.15.2:
vscode-uri "^2.1.1" vscode-uri "^2.1.1"
which "^2.0.2" which "^2.0.2"
<<<<<<< HEAD
=======
purescript@^0.14.2:
version "0.14.3"
resolved "https://registry.yarnpkg.com/purescript/-/purescript-0.14.3.tgz#8a725c5dc640afeebb1fe9e2512477827ca05ee8"
integrity sha512-lAzHU/tcmxF4n3YUwUTwG/sIwHzjUq1zsIOBNmaVpbm7hxM+RhOTKMJdwdbTeCjxlilyVPWOLUQ6Exll4DYuMA==
dependencies:
purescript-installer "^0.2.0"
>>>>>>> b689fd11ba983d8a687df733a5dde6e37e42fa93
purgecss@^2.3.0: purgecss@^2.3.0:
version "2.3.0" version "2.3.0"
resolved "https://registry.yarnpkg.com/purgecss/-/purgecss-2.3.0.tgz#5327587abf5795e6541517af8b190a6fb5488bb3" resolved "https://registry.yarnpkg.com/purgecss/-/purgecss-2.3.0.tgz#5327587abf5795e6541517af8b190a6fb5488bb3"
...@@ -5781,7 +5813,21 @@ safe-regex@^1.1.0: ...@@ -5781,7 +5813,21 @@ safe-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
<<<<<<< HEAD
sass@^1.35.2: sass@^1.35.2:
=======
sander@^0.5.0:
version "0.5.1"
resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad"
integrity sha1-dB4kXiMfB8r7b98PEzrfohalAq0=
dependencies:
es6-promise "^3.1.2"
graceful-fs "^4.1.3"
mkdirp "^0.5.1"
rimraf "^2.5.2"
sass@^1.23.7:
>>>>>>> b689fd11ba983d8a687df733a5dde6e37e42fa93
version "1.35.2" version "1.35.2"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.35.2.tgz#b732314fcdaf7ef8d0f1698698adc378043cb821" resolved "https://registry.yarnpkg.com/sass/-/sass-1.35.2.tgz#b732314fcdaf7ef8d0f1698698adc378043cb821"
integrity sha512-jhO5KAR+AMxCEwIH3v+4zbB2WB0z67V1X0jbapfVwQQdjHZUGUyukpnoM6+iCMfsIUC016w9OPKQ5jrNOS9uXw== integrity sha512-jhO5KAR+AMxCEwIH3v+4zbB2WB0z67V1X0jbapfVwQQdjHZUGUyukpnoM6+iCMfsIUC016w9OPKQ5jrNOS9uXw==
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment