Commit 62fd836e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-graphql

parents 4aeb7376 887d03a2
...@@ -10,6 +10,7 @@ RUN apt-get update && apt-get install -y yarn ...@@ -10,6 +10,7 @@ RUN apt-get update && apt-get install -y yarn
RUN curl -L https://github.com/coot/zephyr/releases/download/v0.3.2/Linux.tar.gz | tar zx -C /usr/bin --strip-components=1 zephyr/zephyr RUN curl -L https://github.com/coot/zephyr/releases/download/v0.3.2/Linux.tar.gz | tar zx -C /usr/bin --strip-components=1 zephyr/zephyr
RUN curl -L https://github.com/dhall-lang/dhall-haskell/releases/download/1.38.1/dhall-json-1.7.6-x86_64-linux.tar.bz2 | tar jx -C /usr/bin --strip-components=2 ./bin/dhall-to-json RUN curl -L https://github.com/dhall-lang/dhall-haskell/releases/download/1.38.1/dhall-json-1.7.6-x86_64-linux.tar.bz2 | tar jx -C /usr/bin --strip-components=2 ./bin/dhall-to-json
RUN yarn global add purescript spago pulp
WORKDIR /opt/app WORKDIR /opt/app
EXPOSE 5000/tcp EXPOSE 5000/tcp
......
...@@ -144,11 +144,10 @@ the docker container. ...@@ -144,11 +144,10 @@ the docker container.
### Basic tasks ### Basic tasks
Now we must install our javascript and purescript dependencies: Now we must install our javascript and purescript dependencies:
*Note: if you're installing manually you might also need to manually install [psc-package](https://github.com/purescript/psc-package)*
```shell ```shell
darn install -D && darn install-ps # for docker setup darn install -D # for docker setup
yarn install -D && yarn install-ps # for manual setup yarn install -D # for manual setup
``` ```
You will likely want to check your work in a browser. We provide a You will likely want to check your work in a browser. We provide a
...@@ -166,13 +165,6 @@ darn build # for docker setup ...@@ -166,13 +165,6 @@ darn build # for docker setup
yarn build # for manual setup yarn build # for manual setup
``` ```
If you are rapidly iterating and just want to type check your code:
```shell
darn compile # for docker setup
yarn compile # for manual setup
```
You may access a purescript repl if you want to explore: You may access a purescript repl if you want to explore:
```shell ```shell
......
{ {
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.4.6", "version": "0.0.4.7",
"scripts": { "scripts": {
"generate-purs-packages-nix": "./nix/generate-purs-packages.nix", "generate-purs-packages-nix": "./nix/generate-purs-packages.nix",
"generate-psc-packages-nix": "./nix/generate-packages-json.bash", "generate-psc-packages-nix": "./nix/generate-packages-json.bash",
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"clean-js": "rm -Rf node_modules", "clean-js": "rm -Rf node_modules",
"clean-ps": "rm -Rf output", "clean-ps": "rm -Rf output",
"server": "serve dist", "server": "serve dist",
"build": "spago build && pulp browserify --skip-compile -t dist/bundle.js --src-path output",
"prod": "yarn prod:compile && yarn prod:dce && yarn prod:bundle && yarn prod:pack", "prod": "yarn prod:compile && yarn prod:dce && yarn prod:bundle && yarn prod:pack",
"prod:compile": "pulp build -- -g corefn", "prod:compile": "pulp build -- -g corefn",
"prod:dce": "zephyr -f Main.main", "prod:dce": "zephyr -f Main.main",
......
...@@ -41,10 +41,10 @@ update = R.createElement updateCpt ...@@ -41,10 +41,10 @@ update = R.createElement updateCpt
updateCpt :: R.Component UpdateProps updateCpt :: R.Component UpdateProps
updateCpt = here.component "update" cpt where updateCpt = here.component "update" cpt where
cpt props@{ nodeType: Dashboard } _ = pure $ updateDashboard props [] cpt props@{ nodeType: Dashboard } _ = pure $ updateDashboard props []
cpt props@{ nodeType: Graph } _ = pure $ updateGraph props [] cpt props@{ nodeType: Graph } _ = pure $ updateGraph props []
cpt props@{ nodeType: NodeList } _ = pure $ updateNodeList props [] cpt props@{ nodeType: NodeList } _ = pure $ updateNodeList props []
cpt props@{ nodeType: Texts } _ = pure $ updateTexts props [] cpt props@{ nodeType: NodeTexts } _ = pure $ updateTexts props []
cpt props@{ nodeType: _ } _ = pure $ updateOther props [] cpt props@{ nodeType: _ } _ = pure $ updateOther props []
updateDashboard :: R2.Component UpdateProps updateDashboard :: R2.Component UpdateProps
updateDashboard = R.createElement updateDashboardCpt updateDashboard = R.createElement updateDashboardCpt
......
...@@ -181,7 +181,8 @@ settingsBox Corpus = ...@@ -181,7 +181,8 @@ settingsBox Corpus =
, SearchBox , SearchBox
, Download , Download
--, Clone --, Clone
, Add [ NodeList , Add [ NodeTexts
, NodeList
, Graph , Graph
, Dashboard , Dashboard
, NodeFrameWrite , NodeFrameWrite
...@@ -195,10 +196,10 @@ settingsBox Corpus = ...@@ -195,10 +196,10 @@ settingsBox Corpus =
] ]
} }
settingsBox Texts = settingsBox NodeTexts =
SettingsBox { show : true SettingsBox { show : true
, edit : false , edit : false
, doc : Documentation Texts , doc : Documentation NodeTexts
, buttons : [ Refresh , buttons : [ Refresh
, Upload , Upload
, Download , Download
......
...@@ -13,8 +13,8 @@ hasStatus _ Refresh = Dev ...@@ -13,8 +13,8 @@ hasStatus _ Refresh = Dev
hasStatus _ Config = Dev hasStatus _ Config = Dev
hasStatus _ (Merge _) = Dev hasStatus _ (Merge _) = Dev
hasStatus _ (Documentation _) = Dev hasStatus _ (Documentation _) = Dev
hasStatus Annuaire Upload = Dev hasStatus Annuaire Upload = Dev
hasStatus Texts Upload = Dev hasStatus NodeTexts Upload = Dev
hasStatus Corpus (Add _) = Dev hasStatus Corpus (Add _) = Dev
hasStatus _ _ = Stable hasStatus _ _ = Stable
...@@ -20,7 +20,7 @@ import Gargantext.Components.Graph as Graph ...@@ -20,7 +20,7 @@ import Gargantext.Components.Graph as Graph
import Gargantext.Components.GraphExplorer.Button (centerButton, cameraButton) import Gargantext.Components.GraphExplorer.Button (centerButton, cameraButton)
import Gargantext.Components.GraphExplorer.RangeControl (edgeConfluenceControl, edgeWeightControl, nodeSizeControl) import Gargantext.Components.GraphExplorer.RangeControl (edgeConfluenceControl, edgeWeightControl, nodeSizeControl)
import Gargantext.Components.GraphExplorer.SlideButton (labelSizeButton, mouseSelectorSizeButton) import Gargantext.Components.GraphExplorer.SlideButton (labelSizeButton, mouseSelectorSizeButton)
import Gargantext.Components.GraphExplorer.ToggleButton (multiSelectEnabledButton, edgesToggleButton, louvainToggleButton, pauseForceAtlasButton, resetForceAtlasButton) import Gargantext.Components.GraphExplorer.ToggleButton (multiSelectEnabledButton, edgesToggleButton, louvainToggleButton, pauseForceAtlasButton{-, resetForceAtlasButton-})
import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST import Gargantext.Components.GraphExplorer.Sidebar.Types as GEST
import Gargantext.Components.GraphExplorer.Types as GET import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Hooks.Sigmax as Sigmax import Gargantext.Hooks.Sigmax as Sigmax
......
...@@ -220,6 +220,12 @@ selectedNodesCpt = here.component "selectedNodes" cpt ...@@ -220,6 +220,12 @@ selectedNodesCpt = here.component "selectedNodes" cpt
where where
commonProps = RX.pick props :: Record Common commonProps = RX.pick props :: Record Common
data TagCloudState = Folded | Unfolded
derive instance Eq TagCloudState
flipFold :: TagCloudState -> TagCloudState
flipFold Folded = Unfolded
flipFold Unfolded = Folded
neighborhood :: R2.Component Props neighborhood :: R2.Component Props
neighborhood = R.createElement neighborhoodCpt neighborhood = R.createElement neighborhoodCpt
neighborhoodCpt :: R.Component Props neighborhoodCpt :: R.Component Props
...@@ -230,10 +236,21 @@ neighborhoodCpt = here.component "neighborhood" cpt ...@@ -230,10 +236,21 @@ neighborhoodCpt = here.component "neighborhood" cpt
} _ = do } _ = do
{ selectedNodeIds } <- GEST.focusedSidePanel sidePanelGraph { selectedNodeIds } <- GEST.focusedSidePanel sidePanelGraph
selectedNodeIds' <- T.useLive T.unequal selectedNodeIds selectedNodeIds' <- T.useLive T.unequal selectedNodeIds
state <- T.useBox Folded
state' <- T.useLive T.unequal state
let badges' = neighbourBadges graph selectedNodeIds' let numberOfBadgesToShowWhenFolded = 5
badges' = neighbourBadges graph selectedNodeIds'
minSize = F.foldl Math.min 0.0 (Seq.map _.size (SigmaxT.graphNodes graph)) minSize = F.foldl Math.min 0.0 (Seq.map _.size (SigmaxT.graphNodes graph))
maxSize = F.foldl Math.max 0.0 (Seq.map _.size (SigmaxT.graphNodes graph)) maxSize = F.foldl Math.max 0.0 (Seq.map _.size (SigmaxT.graphNodes graph))
orderedBadges = A.sortWith (\n -> -n.size) $ Seq.toUnfoldable badges' -- reverse sort (largest size first)
displayBadges = case state' of
Folded -> A.take numberOfBadgesToShowWhenFolded orderedBadges
Unfolded -> orderedBadges
stateText = case state' of
Folded -> "Show more"
Unfolded -> "Show less"
showFoldedTooltip = A.length orderedBadges > numberOfBadgesToShowWhenFolded
pure $ RH.div { className: "tab-content", id: "myTabContent" } pure $ RH.div { className: "tab-content", id: "myTabContent" }
[ RH.div { -- className: "flex-space-around d-flex justify-content-center" [ RH.div { -- className: "flex-space-around d-flex justify-content-center"
...@@ -241,8 +258,12 @@ neighborhoodCpt = here.component "neighborhood" cpt ...@@ -241,8 +258,12 @@ neighborhoodCpt = here.component "neighborhood" cpt
, id: "home" , id: "home"
, role: "tabpanel" , role: "tabpanel"
} }
(Seq.toUnfoldable $ Seq.map (\node -> badge { maxSize, minSize, node, selectedNodeIds }) badges') ((\node -> badge { maxSize, minSize, node, selectedNodeIds }) <$> displayBadges) <>
RH.a { className: "" -- with empty class name, bootstrap renders this blue
, on: { click: toggleUnfold state} } [ RH.text stateText ]
] ]
where
toggleUnfold state = T.modify_ flipFold state
type UpdateTermButtonProps = ( type UpdateTermButtonProps = (
......
...@@ -155,11 +155,11 @@ pauseForceAtlasButtonCpt = here.component "forceAtlasToggleButton" cpt ...@@ -155,11 +155,11 @@ pauseForceAtlasButtonCpt = here.component "forceAtlasToggleButton" cpt
cls SigmaxTypes.Running = "active" cls SigmaxTypes.Running = "active"
cls _ = "" cls _ = ""
text SigmaxTypes.InitialRunning = "Pause Force Atlas" text SigmaxTypes.InitialRunning = "Pause"
text SigmaxTypes.InitialStopped = "Start Force Atlas" text SigmaxTypes.InitialStopped = "Start"
text SigmaxTypes.Running = "Pause Force Atlas" text SigmaxTypes.Running = "Pause"
text SigmaxTypes.Paused = "Start Force Atlas" text SigmaxTypes.Paused = "Start"
text SigmaxTypes.Killed = "Start Force Atlas" text SigmaxTypes.Killed = "Start"
onClick state _ = T.modify_ SigmaxTypes.toggleForceAtlasState state onClick state _ = T.modify_ SigmaxTypes.toggleForceAtlasState state
......
...@@ -267,7 +267,7 @@ renderRouteCpt = here.component "renderRoute" cpt where ...@@ -267,7 +267,7 @@ renderRouteCpt = here.component "renderRoute" cpt where
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.RouteFrameVisio s n -> routeFrame (Record.merge { nodeType: NodeFrameVisio } $ 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.NodeTexts s n -> texts (sessionNodeProps s n) []
GR.UserPage s n -> user (sessionNodeProps s n) [] GR.UserPage s n -> user (sessionNodeProps s n) []
] ]
...@@ -328,7 +328,7 @@ openedSidePanelCpt = here.component "openedSidePanel" cpt where ...@@ -328,7 +328,7 @@ openedSidePanelCpt = here.component "openedSidePanel" cpt where
, metaData , metaData
, session , session
} [] ] } [] ]
GR.Texts _s _n -> do GR.NodeTexts _s _n -> do
pure $ wrapper pure $ wrapper
[ Texts.textsSidePanel { boxes [ Texts.textsSidePanel { boxes
, session , session
......
...@@ -26,7 +26,7 @@ router = oneOf ...@@ -26,7 +26,7 @@ router = oneOf
, Dashboard <$> (route "dashboard" *> sid) <*> int , Dashboard <$> (route "dashboard" *> sid) <*> int
, PGraphExplorer <$> (route "graph" *> sid) <*> int , PGraphExplorer <$> (route "graph" *> sid) <*> int
, PhyloExplorer <$> (route "phylo" *> sid) <*> int , PhyloExplorer <$> (route "phylo" *> sid) <*> int
, Texts <$> (route "texts" *> sid) <*> int , NodeTexts <$> (route "texts" *> sid) <*> int
, Lists <$> (route "lists" *> sid) <*> int , Lists <$> (route "lists" *> sid) <*> int
, ContactPage <$> (route "annuaire" *> sid) <*> int , ContactPage <$> (route "annuaire" *> sid) <*> int
<*> (lit "contact" *> int) <*> (lit "contact" *> int)
......
...@@ -30,7 +30,7 @@ data AppRoute ...@@ -30,7 +30,7 @@ data AppRoute
| RouteFrameWrite SessionId Int | RouteFrameWrite SessionId Int
| RouteFrameVisio SessionId Int | RouteFrameVisio SessionId Int
| Team SessionId Int | Team SessionId Int
| Texts SessionId Int | NodeTexts SessionId Int
| UserPage SessionId Int | UserPage SessionId Int
...@@ -74,7 +74,7 @@ instance Show AppRoute where ...@@ -74,7 +74,7 @@ instance Show AppRoute where
show (PGraphExplorer s i) = "graphExplorer" <> show i <> " (" <> show s <> ")" show (PGraphExplorer s i) = "graphExplorer" <> show i <> " (" <> show s <> ")"
show (PhyloExplorer s i) = "phyloExplorer" <> show i <> " (" <> show s <> ")" show (PhyloExplorer s i) = "phyloExplorer" <> show i <> " (" <> show s <> ")"
show (Dashboard s i) = "Dashboard" <> show i <> " (" <> show s <> ")" show (Dashboard s i) = "Dashboard" <> show i <> " (" <> show s <> ")"
show (Texts s i) = "texts" <> show i <> " (" <> show s <> ")" show (NodeTexts s i) = "texts" <> show i <> " (" <> show s <> ")"
show (Lists s i) = "lists" <> show i <> " (" <> show s <> ")" show (Lists s i) = "lists" <> show i <> " (" <> show s <> ")"
show (Annuaire s i) = "Annuaire" <> show i <> " (" <> show s <> ")" show (Annuaire s i) = "Annuaire" <> show i <> " (" <> show s <> ")"
show (UserPage s i) = "User" <> show i <> " (" <> show s <> ")" show (UserPage s i) = "User" <> show i <> " (" <> show s <> ")"
...@@ -101,7 +101,7 @@ appPath (Document s l i) = "list/" <> show s <> "/" <> show l <> " ...@@ -101,7 +101,7 @@ appPath (Document s l i) = "list/" <> show s <> "/" <> show l <> "
appPath (Dashboard s i) = "dashboard/" <> show s <> "/" <> show i appPath (Dashboard s i) = "dashboard/" <> show s <> "/" <> show i
appPath (PGraphExplorer s i) = "graph/" <> show s <> "/" <> show i appPath (PGraphExplorer s i) = "graph/" <> show s <> "/" <> show i
appPath (PhyloExplorer s i) = "phylo/" <> show s <> "/" <> show i appPath (PhyloExplorer s i) = "phylo/" <> show s <> "/" <> show i
appPath (Texts s i) = "texts/" <> show s <> "/" <> show i appPath (NodeTexts s i) = "texts/" <> show s <> "/" <> show i
appPath (Lists s i) = "lists/" <> show s <> "/" <> show i appPath (Lists s i) = "lists/" <> show s <> "/" <> show i
appPath (Annuaire s i) = "annuaire/" <> show s <> "/" <> show i appPath (Annuaire s i) = "annuaire/" <> show s <> "/" <> show i
appPath (UserPage s i) = "user/" <> show s <> "/" <> show i appPath (UserPage s i) = "user/" <> show s <> "/" <> show i
...@@ -127,7 +127,7 @@ nodeTypeAppRoute GT.NodeFile s i = Just $ RouteFile s i ...@@ -127,7 +127,7 @@ nodeTypeAppRoute GT.NodeFile s i = Just $ RouteFile s i
nodeTypeAppRoute GT.NodeList s i = Just $ Lists s i nodeTypeAppRoute GT.NodeList s i = Just $ Lists s i
nodeTypeAppRoute GT.NodeUser s i = Just $ UserPage s i nodeTypeAppRoute GT.NodeUser s i = Just $ UserPage s i
nodeTypeAppRoute GT.Team s i = Just $ Team s i nodeTypeAppRoute GT.Team s i = Just $ Team s i
nodeTypeAppRoute GT.Texts s i = Just $ Texts s i nodeTypeAppRoute GT.NodeTexts s i = Just $ NodeTexts 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 GT.NodeFrameVisio s i = Just $ RouteFrameVisio s i
......
...@@ -148,7 +148,7 @@ data NodeType = Annuaire ...@@ -148,7 +148,7 @@ data NodeType = Annuaire
| Nodes | Nodes
| Phylo | Phylo
| Team | Team
| Texts | NodeTexts
| Tree | Tree
| Url_Document | Url_Document
-- TODO Optional Nodes -- TODO Optional Nodes
...@@ -190,7 +190,7 @@ instance Show NodeType where ...@@ -190,7 +190,7 @@ instance Show NodeType where
show Tree = "NodeTree" show Tree = "NodeTree"
show Team = "NodeTeam" show Team = "NodeTeam"
show NodeList = "NodeList" show NodeList = "NodeList"
show Texts = "NodeDocs" show NodeTexts = "NodeTexts"
show NodeFrameWrite = "NodeFrameWrite" show NodeFrameWrite = "NodeFrameWrite"
show NodeFrameCalc = "NodeFrameCalc" show NodeFrameCalc = "NodeFrameCalc"
show NodeFrameNotebook = "NodeFrameNotebook" show NodeFrameNotebook = "NodeFrameNotebook"
...@@ -218,7 +218,7 @@ instance Read NodeType where ...@@ -218,7 +218,7 @@ instance Read NodeType where
read "Tree" = Just Tree read "Tree" = Just Tree
read "NodeTeam" = Just Team read "NodeTeam" = Just Team
read "NodeList" = Just NodeList read "NodeList" = Just NodeList
read "NodeTexts" = Just Texts read "NodeTexts" = Just NodeTexts
read "Annuaire" = Just Annuaire read "Annuaire" = Just Annuaire
read "NodeFrameWrite" = Just NodeFrameWrite read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc read "NodeFrameCalc" = Just NodeFrameCalc
...@@ -254,7 +254,7 @@ translateFR = case _ of ...@@ -254,7 +254,7 @@ translateFR = case _ of
Nodes -> "Nœuds" Nodes -> "Nœuds"
Phylo -> "Phylo" Phylo -> "Phylo"
Team -> "Équipe" Team -> "Équipe"
Texts -> "Textes" NodeTexts -> "Docs"
Tree -> "Arbre" Tree -> "Arbre"
Url_Document -> "Document URL" Url_Document -> "Document URL"
-- --
...@@ -284,7 +284,7 @@ translateEN = case _ of ...@@ -284,7 +284,7 @@ translateEN = case _ of
Nodes -> "Nodes" Nodes -> "Nodes"
Phylo -> "Phylo" Phylo -> "Phylo"
Team -> "Team" Team -> "Team"
Texts -> "Texts" NodeTexts -> "Docs"
Tree -> "Tree" Tree -> "Tree"
Url_Document -> "URL document" Url_Document -> "URL document"
-- --
...@@ -322,7 +322,7 @@ getIcon Corpus false = "book-circle" ...@@ -322,7 +322,7 @@ getIcon Corpus false = "book-circle"
getIcon Phylo _ = "code-fork" getIcon Phylo _ = "code-fork"
getIcon Graph _ = "hubzilla" getIcon Graph _ = "hubzilla"
getIcon Texts _ = "newspaper-o" getIcon NodeTexts _ = "newspaper-o"
getIcon Dashboard _ = "signal" getIcon Dashboard _ = "signal"
getIcon NodeList _ = "list" getIcon NodeList _ = "list"
getIcon NodeFile _ = "file" -- TODO depending on mime type we can use fa-file-image etc getIcon NodeFile _ = "file" -- TODO depending on mime type we can use fa-file-image etc
...@@ -397,7 +397,7 @@ nodeTypePath NodeUser = "user" ...@@ -397,7 +397,7 @@ nodeTypePath NodeUser = "user"
nodeTypePath NodeContact = "contact" nodeTypePath NodeContact = "contact"
nodeTypePath Tree = "tree" nodeTypePath Tree = "tree"
nodeTypePath NodeList = "lists" nodeTypePath NodeList = "lists"
nodeTypePath Texts = "texts" nodeTypePath NodeTexts = "texts"
nodeTypePath Team = "team" nodeTypePath Team = "team"
nodeTypePath NodeFrameWrite = "write" nodeTypePath NodeFrameWrite = "write"
nodeTypePath NodeFrameCalc = "calc" nodeTypePath NodeFrameCalc = "calc"
......
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