From b002b07b31dd0ca89e189e47d6c7e23bca67b84a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexandre=20Delano=C3=AB?= <devel+git@delanoe.org>
Date: Fri, 2 Jun 2023 11:09:47 +0200
Subject: [PATCH] [DOC] NodeFrameWrite -> Notes

---
 gargantext.cabal                                     |  2 +-
 src/Gargantext/API/Node/DocumentsFromWriteNodes.hs   |  2 +-
 src/Gargantext/Database/Action/Node.hs               | 12 ++++++------
 src/Gargantext/Database/Admin/Config.hs              |  2 +-
 .../Database/Admin/Types/Hyperdata/Default.hs        |  2 +-
 src/Gargantext/Database/Admin/Types/Node.hs          |  5 +++--
 6 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/gargantext.cabal b/gargantext.cabal
index 0ab8da3df..3edfffd0b 100644
--- a/gargantext.cabal
+++ b/gargantext.cabal
@@ -5,7 +5,7 @@ cabal-version: 1.12
 -- see: https://github.com/sol/hpack
 
 name:           gargantext
-version: 0.0.6.9.9.5.6
+version:        0.0.6.9.9.5.6
 synopsis:       Search, map, share
 description:    Please see README.md
 category:       Data
diff --git a/src/Gargantext/API/Node/DocumentsFromWriteNodes.hs b/src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
index ca4598ad1..ed3497039 100644
--- a/src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
+++ b/src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
@@ -90,7 +90,7 @@ documentsFromWriteNodes uId nId Params { selection, lang, paragraphs } jobHandle
       markFailed (Just msg) jobHandle
       panic msg
 
-  frameWriteIds <- getChildrenByType nId NodeFrameWrite
+  frameWriteIds <- getChildrenByType nId Notes
 
   -- https://write.frame.gargantext.org/<frame_id>/download
   frameWrites <- mapM (\id -> getNodeWith id (Proxy :: Proxy HyperdataFrame)) frameWriteIds
diff --git a/src/Gargantext/Database/Action/Node.hs b/src/Gargantext/Database/Action/Node.hs
index 92e1d93c3..2c6fb186d 100644
--- a/src/Gargantext/Database/Action/Node.hs
+++ b/src/Gargantext/Database/Action/Node.hs
@@ -51,8 +51,8 @@ mkNodeWithParent NodeUser Nothing uId name =
 
 mkNodeWithParent _ Nothing _ _ = nodeError HasParent
 ------------------------------------------------------------------------
-mkNodeWithParent NodeFrameWrite i u n =
-  mkNodeWithParent_ConfigureHyperdata NodeFrameWrite i u n
+mkNodeWithParent Notes i u n =
+  mkNodeWithParent_ConfigureHyperdata Notes i u n
 
 mkNodeWithParent NodeFrameCalc i u n =
   mkNodeWithParent_ConfigureHyperdata NodeFrameCalc i u n
@@ -76,8 +76,8 @@ mkNodeWithParent_ConfigureHyperdata :: (HasNodeError err, HasDBid NodeType)
                                     -> UserId
                                     -> Name
                                     -> Cmd err [NodeId]
-mkNodeWithParent_ConfigureHyperdata NodeFrameWrite (Just i) uId name =
-  mkNodeWithParent_ConfigureHyperdata' NodeFrameWrite (Just i) uId name
+mkNodeWithParent_ConfigureHyperdata Notes (Just i) uId name =
+  mkNodeWithParent_ConfigureHyperdata' Notes (Just i) uId name
 
 mkNodeWithParent_ConfigureHyperdata NodeFrameCalc (Just i) uId name =
   mkNodeWithParent_ConfigureHyperdata' NodeFrameCalc (Just i) uId name
@@ -102,7 +102,7 @@ mkNodeWithParent_ConfigureHyperdata' :: (HasNodeError err, HasDBid NodeType)
                                     -> Cmd err [NodeId]
 mkNodeWithParent_ConfigureHyperdata' nt (Just i) uId name = do
   maybeNodeId <- case nt of
-     NodeFrameWrite -> insertNode NodeFrameWrite (Just name)   Nothing i uId
+     Notes -> insertNode Notes (Just name)   Nothing i uId
      NodeFrameCalc  -> insertNode NodeFrameCalc  (Just name)   Nothing i uId
      NodeFrameVisio -> insertNode NodeFrameVisio (Just name)   Nothing i uId
      _              -> nodeError NeedsConfiguration
@@ -112,7 +112,7 @@ mkNodeWithParent_ConfigureHyperdata' nt (Just i) uId name = do
     [n] -> do
       cfg <- view hasConfig
       u <- case nt of
-            NodeFrameWrite -> pure $ _gc_frame_write_url cfg
+            Notes -> pure $ _gc_frame_write_url cfg
             NodeFrameCalc  -> pure $ _gc_frame_calc_url  cfg
             NodeFrameVisio -> pure $ _gc_frame_visio_url  cfg
             _              -> nodeError NeedsConfiguration
diff --git a/src/Gargantext/Database/Admin/Config.hs b/src/Gargantext/Database/Admin/Config.hs
index d1b9c61a1..bd30b636f 100644
--- a/src/Gargantext/Database/Admin/Config.hs
+++ b/src/Gargantext/Database/Admin/Config.hs
@@ -76,7 +76,7 @@ nodeTypeId n =
 
     NodeFile        -> 101
 
-    NodeFrameWrite    -> 991
+    Notes    -> 991
     NodeFrameCalc     -> 992
     NodeFrameNotebook -> 993
     NodeFrameVisio    -> 994
diff --git a/src/Gargantext/Database/Admin/Types/Hyperdata/Default.hs b/src/Gargantext/Database/Admin/Types/Hyperdata/Default.hs
index b34bce4f3..e314e44d2 100644
--- a/src/Gargantext/Database/Admin/Types/Hyperdata/Default.hs
+++ b/src/Gargantext/Database/Admin/Types/Hyperdata/Default.hs
@@ -115,7 +115,7 @@ defaultHyperdata NodeGraph          = DefaultGraph     defaultHyperdataGraph
 defaultHyperdata NodePhylo          = DefaultPhylo     defaultHyperdataPhylo
 defaultHyperdata NodeDashboard      = DefaultDashboard defaultHyperdataDashboard
 
-defaultHyperdata NodeFrameWrite     = DefaultFrameWrite defaultHyperdataFrame
+defaultHyperdata Notes     = DefaultFrameWrite defaultHyperdataFrame
 defaultHyperdata NodeFrameCalc      = DefaultFrameCalc  defaultHyperdataFrame
 defaultHyperdata NodeFrameVisio     = DefaultFrameVisio defaultHyperdataFrame
 defaultHyperdata NodeFrameNotebook      = DefaultFrameCalc  defaultHyperdataFrame
diff --git a/src/Gargantext/Database/Admin/Types/Node.hs b/src/Gargantext/Database/Admin/Types/Node.hs
index 1fe7dd223..83c6e8219 100644
--- a/src/Gargantext/Database/Admin/Types/Node.hs
+++ b/src/Gargantext/Database/Admin/Types/Node.hs
@@ -355,11 +355,12 @@ data NodeType = NodeUser
 -}
 
               -- Optional Nodes
-              | NodeFrameWrite | NodeFrameCalc | NodeFrameVisio | NodeFrameNotebook
+              | Notes | NodeFrameCalc | NodeFrameVisio | NodeFrameNotebook
               | NodeFile
 
   deriving (Show, Read, Eq, Generic, Bounded, Enum)
 
+
 instance GQLType NodeType
 instance FromJSON NodeType
 instance ToJSON NodeType
@@ -404,7 +405,7 @@ defaultName NodeDashboard     = "Board"
 defaultName NodeGraph         = "Graph"
 defaultName NodePhylo         = "Phylo"
 
-defaultName NodeFrameWrite    = "Note"
+defaultName Notes    = "Note"
 defaultName NodeFrameCalc     = "Calc"
 defaultName NodeFrameVisio    = "Visio"
 defaultName NodeFrameNotebook = "Code"
-- 
GitLab