Commit 90e9cdf2 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-forgot-password

parents c7205fd3 d0508d8e
## Version 0.0.5.8.9.2
* [FEAT] Lost Password
* [Phylo] More Data in API
## Version 0.0.5.8.9.1
* [FE] [DESIGN] NoteBook, UI/UX Improvements
* [FE] [FEAT] Automatic Sync when adding a new ngrams
......
......@@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: gargantext
version: 0.0.5.8.9.1
version: 0.0.5.8.9.2
synopsis: Search, map, share
description: Please see README.md
category: Data
......
......@@ -6,7 +6,7 @@ name: gargantext
# | | | +----- Layers * : New versions with API additions
# | | | | +--- Layers * : New versions without API breaking changes
# | | | | |
version: '0.0.5.8.9.1'
version: '0.0.5.8.9.2'
synopsis: Search, map, share
description: Please see README.md
category: Data
......
......@@ -44,6 +44,7 @@ import Gargantext.Core.Types (NodeTableResult)
import Gargantext.Core.Types.Main hiding (Limit, Offset)
import Gargantext.Core.Viz.Graph hiding (Node, Version)
import Gargantext.Core.Viz.Graph.API
import Gargantext.Core.Viz.Phylo.API (PhyloData)
import Gargantext.Core.Viz.Types
import Gargantext.Database.Admin.Types.Metrics
import Gargantext.Database.Admin.Types.Hyperdata
......@@ -58,7 +59,6 @@ import Servant.Job.Core
import Servant.Job.Types
import System.Metrics.Json (Sample, Value)
import qualified Data.Aeson as Aeson
-- * version API
getBackendVersion :: ClientM Text
......@@ -143,7 +143,7 @@ getNodePieHash :: Token -> NodeId -> Maybe NodeId -> TabType -> ClientM Text
getNodeTree :: Token -> NodeId -> Maybe UTCTime -> Maybe UTCTime -> Maybe NodeId -> TabType -> ListType -> ClientM (HashedResponse (ChartMetrics (Vector NgramsTree)))
postNodeTreeUpdate :: Token -> NodeId -> Maybe NodeId -> TabType -> ListType -> ClientM ()
getNodeTreeHash :: Token -> NodeId -> Maybe NodeId -> TabType -> ListType -> ClientM Text
getNodePhylo :: Token -> NodeId -> Maybe NodeId -> Maybe Int -> Maybe Int -> ClientM Aeson.Value
getNodePhylo :: Token -> NodeId -> Maybe NodeId -> Maybe Int -> Maybe Int -> ClientM PhyloData
putNodePhylo :: Token -> NodeId -> Maybe NodeId -> ClientM NodeId
putNodeMove :: Token -> NodeId -> ParentId -> ClientM [Int]
......@@ -232,7 +232,7 @@ getCorpusPieHash :: Token -> CorpusId -> Maybe NodeId -> TabType -> ClientM Text
getCorpusTree :: Token -> CorpusId -> Maybe UTCTime -> Maybe UTCTime -> Maybe NodeId -> TabType -> ListType -> ClientM (HashedResponse (ChartMetrics (Vector NgramsTree)))
postCorpusTreeUpdate :: Token -> CorpusId -> Maybe NodeId -> TabType -> ListType -> ClientM ()
getCorpusTreeHash :: Token -> CorpusId -> Maybe NodeId -> TabType -> ListType -> ClientM Text
getCorpusPhylo :: Token -> CorpusId -> Maybe NodeId -> Maybe Int -> Maybe Int -> ClientM Aeson.Value
getCorpusPhylo :: Token -> CorpusId -> Maybe NodeId -> Maybe Int -> Maybe Int -> ClientM PhyloData
putCorpusPhylo :: Token -> CorpusId -> Maybe NodeId -> ClientM NodeId
putCorpusMove :: Token -> CorpusId -> ParentId -> ClientM [Int]
......@@ -326,7 +326,7 @@ getAnnuairePieHash :: Token -> AnnuaireId -> Maybe NodeId -> TabType -> ClientM
getAnnuaireTree :: Token -> AnnuaireId -> Maybe UTCTime -> Maybe UTCTime -> Maybe NodeId -> TabType -> ListType -> ClientM (HashedResponse (ChartMetrics (Vector NgramsTree)))
postAnnuaireTreeUpdate :: Token -> AnnuaireId -> Maybe NodeId -> TabType -> ListType -> ClientM ()
getAnnuaireTreeHash :: Token -> AnnuaireId -> Maybe NodeId -> TabType -> ListType -> ClientM Text
getAnnuairePhylo :: Token -> AnnuaireId -> Maybe NodeId -> Maybe Int -> Maybe Int -> ClientM Aeson.Value
getAnnuairePhylo :: Token -> AnnuaireId -> Maybe NodeId -> Maybe Int -> Maybe Int -> ClientM PhyloData
putAnnuairePhylo :: Token -> AnnuaireId -> Maybe NodeId -> ClientM NodeId
putAnnuaireMove :: Token -> AnnuaireId -> ParentId -> ClientM [Int]
......
......@@ -17,6 +17,7 @@ Portability : POSIX
module Gargantext.Core.Viz.Phylo.API
where
import GHC.Generics (Generic)
import Data.Aeson
import Data.Either
import Data.Maybe (fromMaybe)
......@@ -30,7 +31,7 @@ import Gargantext.Core.Viz.Phylo.Example (phyloExample)
import Gargantext.Core.Viz.Phylo.Legacy.LegacyMain
import Gargantext.Database.Admin.Types.Hyperdata
import Gargantext.Database.Admin.Types.Node -- (PhyloId, ListId, CorpusId, UserId, NodeId(..))
import Gargantext.Database.Query.Table.Node (getClosestParentIdByType)
import Gargantext.Database.Query.Table.Node (getClosestParentIdByType, defaultList)
import Gargantext.Database.Query.Table.Node.UpdateOpaleye (updateHyperdata)
import Gargantext.Prelude
import Network.HTTP.Media ((//), (/:))
......@@ -66,6 +67,17 @@ instance ToSchema SVG where declareNamedSchema _ = declareNamedSchema (Proxy ::
instance ToSchema Value where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy TODO)
------------------------------------------------------------------------
data PhyloData = PhyloData { pd_corpusId :: NodeId
, pd_listId :: NodeId
, pd_data :: Value
}
deriving (Generic)
instance FromJSON PhyloData
instance ToJSON PhyloData
instance ToSchema PhyloData
type GetPhylo = QueryParam "listId" ListId
:> QueryParam "level" Level
:> QueryParam "minSizeBranch" MinSizeBranch
......@@ -84,17 +96,25 @@ type GetPhylo = QueryParam "listId" ListId
:> QueryParam "verbose" Bool
-}
-- :> Get '[SVG] SVG
:> Get '[JSON] Value
:> Get '[JSON] PhyloData
-- | TODO
-- Add real text processing
-- Fix Filter parameters
-- TODO fix parameters to default config that should be in Node
getPhylo :: PhyloId -> GargServer GetPhylo
getPhylo phyloId _lId _level _minSizeBranch = do
getPhylo phyloId lId _level _minSizeBranch = do
corpusId <- fromMaybe (panic $ "[G.C.V.Phylo.API] no parent for NodeId " <> (cs $ show phyloId))
<$> getClosestParentIdByType phyloId NodeCorpus
listId <- case lId of
Nothing -> defaultList corpusId
Just ld -> pure ld
theData <- getPhyloDataJson phyloId
-- printDebug "getPhylo" theData
pure theData
pure $ PhyloData corpusId listId theData
getPhyloDataJson :: PhyloId -> GargNoServer Value
getPhyloDataJson phyloId = do
......
......@@ -17,7 +17,7 @@ vim CHANGELOG.md < /dev/tty
YAML="package.yaml"
CABL="gargantext.cabal"
sed -i "s/version:.*/version: \'$VERSION\'/" $YAML
sed -i "s/version:.*/version: $VERSION/" $CABL
sed -i "s/^version:.*/version: $VERSION/" $CABL
git add -u
git commit -m "[VERSION] +1 to ${VERSION}"
git tag $VERSION
......
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