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

[FEAT] Aadding Visio micro-service (Jitsi)

First add New type NodeFrameVisio it this case:
	modified :         src/Gargantext/Types.purs
After this step, just follow the compiler errors to fix the instances.

Then adapt the routes:
	modified :         src/Gargantext/Router.purs
	modified :         src/Gargantext/Components/Router.purs
	modified :         src/Gargantext/Routes.purs

Finally fix the Node and its options:
	modified :         src/Gargantext/Components/Forest/Tree/Node/Settings.purs
	modified :         src/Gargantext/Components/Nodes/Frame.purs

	modifié :         dist/index.html
Some script have to be loaded (to be tested still)
parent fae5ebd9
...@@ -14,5 +14,6 @@ ...@@ -14,5 +14,6 @@
<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>
...@@ -133,6 +133,7 @@ settingsBox Team = ...@@ -133,6 +133,7 @@ settingsBox Team =
-- , NodeFrameNotebook -- , NodeFrameNotebook
, Team , Team
, FolderShared , FolderShared
, NodeFrameVisio
] ]
, Share , Share
, Delete , Delete
...@@ -338,6 +339,19 @@ settingsBox NodeFrameNotebook = ...@@ -338,6 +339,19 @@ settingsBox NodeFrameNotebook =
} }
settingsBox NodeFrameVisio =
SettingsBox { show : true
, edit : true
, doc : Documentation NodeFrameVisio
, buttons : [ Add [ NodeFrameVisio
, NodeFrameWrite
, NodeFrameCalc
]
, Delete
]
}
......
...@@ -90,6 +90,7 @@ type FrameId = String ...@@ -90,6 +90,7 @@ type FrameId = String
hframeUrl :: NodeType -> Base -> FrameId -> String hframeUrl :: NodeType -> Base -> FrameId -> String
hframeUrl NodeFrameNotebook _ frame_id = frame_id -- Temp fix : frame_id is currently the whole url created hframeUrl NodeFrameNotebook _ frame_id = frame_id -- Temp fix : frame_id is currently the whole url created
hframeUrl NodeFrameCalc base frame_id = base <> "/" <> frame_id hframeUrl NodeFrameCalc 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 :: Record ViewProps -> R.Element
...@@ -108,7 +109,8 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt ...@@ -108,7 +109,8 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
, FV.homeButton , FV.homeButton
, H.div { className : "frame" , H.div { className : "frame"
, rows: "100%,*" } , rows: "100%,*" }
[ H.iframe { src: hframeUrl nodeType base frame_id [ -- H.script { src: "https://visio.gargantext.org/external_api.js"} [],
H.iframe { src: hframeUrl nodeType base frame_id
, width: "100%" , width: "100%"
, height: "100%" , height: "100%"
} [] } []
......
...@@ -183,9 +183,10 @@ renderRouteCpt = here.component "renderRoute" cpt where ...@@ -183,9 +183,10 @@ renderRouteCpt = here.component "renderRoute" cpt where
GR.PGraphExplorer s g -> graphExplorer (sessionNodeProps s g) [] GR.PGraphExplorer s g -> graphExplorer (sessionNodeProps s g) []
GR.PhyloExplorer s g -> phyloExplorer (sessionNodeProps s g) [] GR.PhyloExplorer s g -> phyloExplorer (sessionNodeProps s g) []
GR.RouteFile s n -> routeFile (sessionNodeProps s n) [] GR.RouteFile s n -> routeFile (sessionNodeProps s n) []
GR.RouteFrameWrite s n -> routeFrame (Record.merge { nodeType: NodeFrameWrite } $ sessionNodeProps s n) []
GR.RouteFrameCalc s n -> routeFrame (Record.merge { nodeType: NodeFrameCalc } $ sessionNodeProps s n) [] GR.RouteFrameCalc s n -> routeFrame (Record.merge { nodeType: NodeFrameCalc } $ sessionNodeProps s n) []
GR.RouteFrameCode s n -> routeFrame (Record.merge { nodeType: NodeFrameNotebook } $ sessionNodeProps s n) [] GR.RouteFrameCode s n -> routeFrame (Record.merge { nodeType: NodeFrameNotebook } $ sessionNodeProps s n) []
GR.RouteFrameWrite s n -> routeFrame (Record.merge { nodeType: NodeFrameWrite } $ sessionNodeProps s n) [] GR.RouteFrameVisio s n -> routeFrame (Record.merge { nodeType: NodeFrameVisio } $ sessionNodeProps s n) []
GR.Team s n -> team (sessionNodeProps s n) [] GR.Team s n -> team (sessionNodeProps s n) []
GR.Texts s n -> texts (sessionNodeProps s n) [] GR.Texts s n -> texts (sessionNodeProps s n) []
GR.UserPage s n -> user (sessionNodeProps s n) [] GR.UserPage s n -> user (sessionNodeProps s n) []
......
...@@ -35,6 +35,7 @@ router = oneOf ...@@ -35,6 +35,7 @@ router = oneOf
, RouteFrameWrite <$> (route "write" *> sid) <*> int , RouteFrameWrite <$> (route "write" *> sid) <*> int
, RouteFrameCalc <$> (route "calc" *> sid) <*> int , RouteFrameCalc <$> (route "calc" *> sid) <*> int
, RouteFrameCode <$> (route "code" *> sid) <*> int , RouteFrameCode <$> (route "code" *> sid) <*> int
, RouteFrameVisio <$> (route "visio" *> sid) <*> int
, RouteFile <$> (route "file" *> sid) <*> int , RouteFile <$> (route "file" *> sid) <*> int
, Home <$ lit "" , Home <$ lit ""
] ]
......
...@@ -29,6 +29,7 @@ data AppRoute ...@@ -29,6 +29,7 @@ data AppRoute
| RouteFrameCalc SessionId Int | RouteFrameCalc SessionId Int
| RouteFrameCode SessionId Int | RouteFrameCode SessionId Int
| RouteFrameWrite SessionId Int | RouteFrameWrite SessionId Int
| RouteFrameVisio SessionId Int
| Team SessionId Int | Team SessionId Int
| Texts SessionId Int | Texts SessionId Int
| UserPage SessionId Int | UserPage SessionId Int
...@@ -81,6 +82,7 @@ instance showAppRoute :: Show AppRoute where ...@@ -81,6 +82,7 @@ instance showAppRoute :: Show AppRoute where
show (RouteFrameWrite s i) = "write" <> show i <> " (" <> show s <> ")" show (RouteFrameWrite s i) = "write" <> show i <> " (" <> show s <> ")"
show (RouteFrameCalc s i) = "calc" <> show i <> " (" <> show s <> ")" show (RouteFrameCalc s i) = "calc" <> show i <> " (" <> show s <> ")"
show (RouteFrameCode s i) = "code" <> show i <> " (" <> show s <> ")" show (RouteFrameCode s i) = "code" <> show i <> " (" <> show s <> ")"
show (RouteFrameVisio s i) = "visio" <> show i <> " (" <> show s <> ")"
show (RouteFile s i) = "file" <> show i <> " (" <> show s <> ")" show (RouteFile s i) = "file" <> show i <> " (" <> show s <> ")"
...@@ -106,6 +108,7 @@ appPath (ContactPage s a i) = "annuaire/" <> show s <> "/" <> show a <> " ...@@ -106,6 +108,7 @@ appPath (ContactPage s a i) = "annuaire/" <> show s <> "/" <> show a <> "
appPath (RouteFrameWrite s i) = "write/" <> show s <> "/" <> show i appPath (RouteFrameWrite s i) = "write/" <> show s <> "/" <> show i
appPath (RouteFrameCalc s i) = "calc/" <> show s <> "/" <> show i appPath (RouteFrameCalc s i) = "calc/" <> show s <> "/" <> show i
appPath (RouteFrameCode s i) = "code/" <> show s <> "/" <> show i appPath (RouteFrameCode s i) = "code/" <> show s <> "/" <> show i
appPath (RouteFrameVisio s i) = "visio/" <> show s <> "/" <> show i
appPath (RouteFile s i) = "file/" <> show s <> "/" <> show i appPath (RouteFile s i) = "file/" <> show s <> "/" <> show i
nodeTypeAppRoute :: NodeType -> SessionId -> Int -> Maybe AppRoute nodeTypeAppRoute :: NodeType -> SessionId -> Int -> Maybe AppRoute
...@@ -126,4 +129,5 @@ nodeTypeAppRoute GT.Team s i = Just $ Team s i ...@@ -126,4 +129,5 @@ nodeTypeAppRoute GT.Team s i = Just $ Team s i
nodeTypeAppRoute GT.Texts s i = Just $ Texts s i nodeTypeAppRoute GT.Texts s i = Just $ Texts s i
nodeTypeAppRoute GT.NodeFrameWrite s i = Just $ RouteFrameWrite s i nodeTypeAppRoute GT.NodeFrameWrite s i = Just $ RouteFrameWrite s i
nodeTypeAppRoute GT.NodeFrameCalc s i = Just $ RouteFrameCalc s i nodeTypeAppRoute GT.NodeFrameCalc s i = Just $ RouteFrameCalc s i
nodeTypeAppRoute GT.NodeFrameVisio s i = Just $ RouteFrameVisio s i
nodeTypeAppRoute _ _ _ = Nothing nodeTypeAppRoute _ _ _ = Nothing
...@@ -173,6 +173,7 @@ data NodeType = Annuaire ...@@ -173,6 +173,7 @@ data NodeType = Annuaire
| NodeFrameCalc | NodeFrameCalc
| NodeFrameNotebook | NodeFrameNotebook
| NodeFrameWrite | NodeFrameWrite
| NodeFrameVisio
| NodePublic NodeType | NodePublic NodeType
...@@ -204,6 +205,7 @@ instance showNodeType :: Show NodeType where ...@@ -204,6 +205,7 @@ instance showNodeType :: Show NodeType where
show NodeFrameWrite = "NodeFrameWrite" show NodeFrameWrite = "NodeFrameWrite"
show NodeFrameCalc = "NodeFrameCalc" show NodeFrameCalc = "NodeFrameCalc"
show NodeFrameNotebook = "NodeFrameNotebook" show NodeFrameNotebook = "NodeFrameNotebook"
show NodeFrameVisio = "NodeFrameVisio"
show (NodePublic nt) = "NodePublic" <> show nt show (NodePublic nt) = "NodePublic" <> show nt
show NodeFile = "NodeFile" show NodeFile = "NodeFile"
...@@ -232,6 +234,7 @@ instance readNodeType :: Read NodeType where ...@@ -232,6 +234,7 @@ instance readNodeType :: Read NodeType where
read "NodeFrameWrite" = Just NodeFrameWrite read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc read "NodeFrameCalc" = Just NodeFrameCalc
read "NodeFrameNotebook" = Just NodeFrameNotebook read "NodeFrameNotebook" = Just NodeFrameNotebook
read "NodeFrameVisio" = Just NodeFrameVisio
read "NodeFile" = Just NodeFile read "NodeFile" = Just NodeFile
-- TODO NodePublic read ? -- TODO NodePublic read ?
read _ = Nothing read _ = Nothing
...@@ -282,6 +285,10 @@ fldr NodeFrameCalc false = "fa fa-calculator" ...@@ -282,6 +285,10 @@ fldr NodeFrameCalc false = "fa fa-calculator"
fldr NodeFrameNotebook true = "fa fa-file-code-o" fldr NodeFrameNotebook true = "fa fa-file-code-o"
fldr NodeFrameNotebook false = "fa fa-code" fldr NodeFrameNotebook false = "fa fa-code"
fldr NodeFrameVisio true = "fa fa-video-camera"
fldr NodeFrameVisio false = "fa fa-video-camera"
fldr (NodePublic nt) b = fldr nt b fldr (NodePublic nt) b = fldr nt b
...@@ -339,6 +346,7 @@ nodeTypePath Team = "team" ...@@ -339,6 +346,7 @@ nodeTypePath Team = "team"
nodeTypePath NodeFrameWrite = "write" nodeTypePath NodeFrameWrite = "write"
nodeTypePath NodeFrameCalc = "calc" nodeTypePath NodeFrameCalc = "calc"
nodeTypePath NodeFrameNotebook = "code" nodeTypePath NodeFrameNotebook = "code"
nodeTypePath NodeFrameVisio = "visio"
nodeTypePath (NodePublic nt) = nodeTypePath nt nodeTypePath (NodePublic nt) = nodeTypePath nt
nodeTypePath NodeFile = "file" nodeTypePath NodeFile = "file"
......
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