Commit e3fd9e58 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

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

parents c45199f7 2f8e3065
Pipeline #1884 passed with stage
in 37 minutes and 34 seconds
......@@ -6,10 +6,10 @@ DATE="2018-03-08 07:18:18"
# use tutoriel code
#tmux -d video
xterm -e "tutoriel"
#xterm -e "tutoriel"
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
# Share video ?
......
#!/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
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
......@@ -43,8 +33,8 @@ server {
# Comment this for maintenance only
server {
#server_name v4.gargantext.org;
server_name maintenanceOnly.gargantext.org;
server_name v4.gargantext.org;
#server_name maintenanceOnly.gargantext.org;
add_header Cache-Control "no-cache";
......
name: gargantext
version: '0.0.3.3'
version: '0.0.3.9'
synopsis: Search, map, share
description: Please see README.md
category: Data
......@@ -10,8 +10,6 @@ copyright:
license: AGPL-3
homepage: https://gargantext.org
ghc-options: -Wall
extra-libraries:
- gfortran
dependencies:
- extra
- text
......
......@@ -239,11 +239,11 @@ type GraphVersionsAPI = Summary "Graph versions"
graphVersionsAPI :: UserId -> NodeId -> GargServer GraphVersionsAPI
graphVersionsAPI u n =
graphVersions n
graphVersions 0 n
:<|> recomputeVersions u n
graphVersions :: NodeId -> GargNoServer GraphVersions
graphVersions nId = do
graphVersions :: Int -> NodeId -> GargNoServer GraphVersions
graphVersions n nId = do
nodeGraph <- getNodeWith nId (Proxy :: Proxy HyperdataGraph)
let
graph = nodeGraph
......@@ -257,16 +257,22 @@ graphVersions nId = do
. gm_list
. lfg_version
cId = maybe (panic "[G.V.G.API] Node has no parent")
identity
$ nodeGraph ^. node_parent_id
mcId <- getClosestParentIdByType nId NodeCorpus
let cId = maybe (panic "[G.V.G.API] Node has no parent") identity mcId
listId <- defaultList cId
repo <- getRepo' [listId]
let v = repo ^. unNodeStory . at listId . _Just . a_version
maybeListId <- defaultListMaybe cId
case maybeListId of
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
, gv_repo = v }
pure $ GraphVersions { gv_graph = listVersion
, gv_repo = v }
recomputeVersions :: UserId -> NodeId -> GargNoServer Graph
recomputeVersions uId nId = recomputeGraph uId nId Nothing
......
......@@ -336,6 +336,9 @@ defaultList :: (HasNodeError err, HasDBid NodeType) => CorpusId -> Cmd err ListI
defaultList 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 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