Commit e3fd9e58 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-fix-node-update-endpoint

parents c45199f7 2f8e3065
...@@ -6,10 +6,10 @@ DATE="2018-03-08 07:18:18" ...@@ -6,10 +6,10 @@ DATE="2018-03-08 07:18:18"
# use tutoriel code # use tutoriel code
#tmux -d video #tmux -d video
xterm -e "tutoriel" #xterm -e "tutoriel"
gource --start-date $DATE ../gargantext-hs & gource --start-date $DATE ../gargantext-hs &
gource --start-date $DATE gargantext-hs/purescript-gargantext gource --start-date $DATE ../gargantext-hs/purescript-gargantext
#tmux -a video #tmux -a video
# Share video ? # Share video ?
......
#!/bin/bash #!/bin/bash
stack install --profile --test --fast # --haddock stack install --nix --profile --test --fast # --haddock
## ##
## GargantText serveur configuration
## Authors: team@gargantext.org
## Licence CNRS/AGPLv3-MIT/CECILL-INRIA
#
# Fee free to improve it
# Thanks for sharing to all community
# Specific NGINX informations
#
# You should look at the following URL's in order to grasp a solid understanding # You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx. # of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls # http://wiki.nginx.org/Pitfalls
...@@ -43,8 +33,8 @@ server { ...@@ -43,8 +33,8 @@ server {
# Comment this for maintenance only # Comment this for maintenance only
server { server {
#server_name v4.gargantext.org; server_name v4.gargantext.org;
server_name maintenanceOnly.gargantext.org; #server_name maintenanceOnly.gargantext.org;
add_header Cache-Control "no-cache"; add_header Cache-Control "no-cache";
......
name: gargantext name: gargantext
version: '0.0.3.3' version: '0.0.3.9'
synopsis: Search, map, share synopsis: Search, map, share
description: Please see README.md description: Please see README.md
category: Data category: Data
...@@ -10,8 +10,6 @@ copyright: ...@@ -10,8 +10,6 @@ copyright:
license: AGPL-3 license: AGPL-3
homepage: https://gargantext.org homepage: https://gargantext.org
ghc-options: -Wall ghc-options: -Wall
extra-libraries:
- gfortran
dependencies: dependencies:
- extra - extra
- text - text
......
...@@ -239,11 +239,11 @@ type GraphVersionsAPI = Summary "Graph versions" ...@@ -239,11 +239,11 @@ type GraphVersionsAPI = Summary "Graph versions"
graphVersionsAPI :: UserId -> NodeId -> GargServer GraphVersionsAPI graphVersionsAPI :: UserId -> NodeId -> GargServer GraphVersionsAPI
graphVersionsAPI u n = graphVersionsAPI u n =
graphVersions n graphVersions 0 n
:<|> recomputeVersions u n :<|> recomputeVersions u n
graphVersions :: NodeId -> GargNoServer GraphVersions graphVersions :: Int -> NodeId -> GargNoServer GraphVersions
graphVersions nId = do graphVersions n nId = do
nodeGraph <- getNodeWith nId (Proxy :: Proxy HyperdataGraph) nodeGraph <- getNodeWith nId (Proxy :: Proxy HyperdataGraph)
let let
graph = nodeGraph graph = nodeGraph
...@@ -257,16 +257,22 @@ graphVersions nId = do ...@@ -257,16 +257,22 @@ graphVersions nId = do
. gm_list . gm_list
. lfg_version . lfg_version
cId = maybe (panic "[G.V.G.API] Node has no parent") mcId <- getClosestParentIdByType nId NodeCorpus
identity let cId = maybe (panic "[G.V.G.API] Node has no parent") identity mcId
$ nodeGraph ^. node_parent_id
listId <- defaultList cId maybeListId <- defaultListMaybe cId
repo <- getRepo' [listId] case maybeListId of
let v = repo ^. unNodeStory . at listId . _Just . a_version Nothing -> if n <= 2
then graphVersions (n+1) cId
else panic "[G.V.G.API] list not found after iterations"
Just listId -> do
repo <- getRepo' [listId]
let v = repo ^. unNodeStory . at listId . _Just . a_version
printDebug "graphVersions" v
pure $ GraphVersions { gv_graph = listVersion pure $ GraphVersions { gv_graph = listVersion
, gv_repo = v } , gv_repo = v }
recomputeVersions :: UserId -> NodeId -> GargNoServer Graph recomputeVersions :: UserId -> NodeId -> GargNoServer Graph
recomputeVersions uId nId = recomputeGraph uId nId Nothing recomputeVersions uId nId = recomputeGraph uId nId Nothing
......
...@@ -336,6 +336,9 @@ defaultList :: (HasNodeError err, HasDBid NodeType) => CorpusId -> Cmd err ListI ...@@ -336,6 +336,9 @@ defaultList :: (HasNodeError err, HasDBid NodeType) => CorpusId -> Cmd err ListI
defaultList cId = defaultList cId =
maybe (nodeError NoListFound) (pure . view node_id) . headMay =<< getListsWithParentId cId maybe (nodeError NoListFound) (pure . view node_id) . headMay =<< getListsWithParentId cId
defaultListMaybe :: (HasNodeError err, HasDBid NodeType) => CorpusId -> Cmd err (Maybe NodeId)
defaultListMaybe cId = headMay <$> map (view node_id ) <$> getListsWithParentId cId
getListsWithParentId :: HasDBid NodeType => NodeId -> Cmd err [Node HyperdataList] getListsWithParentId :: HasDBid NodeType => NodeId -> Cmd err [Node HyperdataList]
getListsWithParentId n = runOpaQuery $ selectNodesWith' n (Just NodeList) getListsWithParentId n = runOpaQuery $ selectNodesWith' n (Just NodeList)
......
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