[nodes] fix node naming to be consistent with the backend

parent 26cb04b3
Pipeline #5864 failed with stage
in 0 seconds
......@@ -6,7 +6,6 @@ import DOM.Simple as DOM
import Effect (Effect)
import Gargantext.Components.Bootstrap as B
import Gargantext.Components.Bootstrap.Types (Elevation(..))
import Gargantext.Components.Forest.Tree.Node.Tools (prettyNodeType)
import Gargantext.Types (ID, Name)
import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2
......@@ -57,7 +56,7 @@ nodePopupViewCpt = here.component "nodePopupView" cpt where
[
H.span { className: GT.fldr nodeType true} [] -- TODO fix names
,
B.span' { className: "ml-1 h5" } $ prettyNodeType nodeType
B.span' { className: "ml-1 h5" } $ GT.prettyNodeType nodeType
]
,
B.wad
......
......@@ -405,9 +405,3 @@ checkboxesListGroupCpt = here.component "checkboxesListGroup" cpt
]
pure $ R.fragment $ map one $ Set.toUnfoldable options'
prettyNodeType :: GT.NodeType -> String
prettyNodeType
= S.replace (S.Pattern "Node") (S.Replacement " ")
<<< S.replace (S.Pattern "Folder") (S.Replacement " ")
<<< show
......@@ -205,6 +205,37 @@ instance Show NodeType where
show NodeFile = "NodeFile"
prettyNodeType :: NodeType -> String
prettyNodeType (NodePublic nt) = "Public " <> prettyNodeType nt
prettyNodeType Annuaire = "Annuaire"
prettyNodeType Calc = "Calc"
prettyNodeType Context = "Context"
prettyNodeType Corpus = "Corpus"
prettyNodeType Dashboard = "Dashboard"
prettyNodeType Error = "Error"
prettyNodeType Folder = "Folder"
prettyNodeType FolderPrivate = "Private folder"
prettyNodeType FolderPublic = "Public folder"
prettyNodeType FolderShared = "Shared folder"
prettyNodeType Graph = "Graph"
prettyNodeType Individu = "Individu"
prettyNodeType Node = "Node"
prettyNodeType NodeContact = "Contact"
prettyNodeType NodeFile = "File"
prettyNodeType NodeFrameNotebook = "Notebook"
prettyNodeType NodeFrameVisio = "Visio"
prettyNodeType NodeList = "Terms"
prettyNodeType NodeTexts = "Docs"
prettyNodeType NodeUser = "User"
prettyNodeType Nodes = "Nodes"
prettyNodeType Notes = "Notes"
prettyNodeType Phylo = "Phylo"
prettyNodeType Team = "Team"
prettyNodeType Tree = "Tree"
prettyNodeType Url_Document = "Document"
instance Read NodeType where
read "NodeUser" = Just NodeUser
read "NodeFolder" = Just Folder
......@@ -298,7 +329,7 @@ translateEN = case _ of
Url_Document -> "URL document"
--
NodeFile -> "File"
Calc -> "Calc"
Calc -> "Calc"
NodeFrameNotebook -> "Notebook"
Notes -> "Notes"
NodeFrameVisio -> "Visio"
......@@ -789,11 +820,6 @@ progressPercent (AsyncProgress { log }) = perc
---------------------------------------------------------------------------
-- | GarganText Internal Sugar
prettyNodeType :: NodeType -> String
prettyNodeType nt = S.replace (S.Pattern "Node") (S.Replacement " ")
$ S.replace (S.Pattern "Folder") (S.Replacement " ")
$ show nt
---------------------------------------------------------------------------
data SidePanelState = InitialClosed | Opened | Closed
......
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