Commit f1338ec8 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Json prefix rename

parent 45409b41
...@@ -72,7 +72,10 @@ type Deletions = { pending :: Set Int, deleted :: Set Int } ...@@ -72,7 +72,10 @@ type Deletions = { pending :: Set Int, deleted :: Set Int }
initialDeletions :: Deletions initialDeletions :: Deletions
initialDeletions = { pending: mempty, deleted: mempty } initialDeletions = { pending: mempty, deleted: mempty }
newtype Pair = Pair { id :: Int, label :: String } newtype Pair =
Pair { id :: Int
, label :: String
}
derive instance genericPair :: Generic Pair _ derive instance genericPair :: Generic Pair _
...@@ -249,9 +252,19 @@ docViewGraphCpt = R.hooksComponent "FacetsDocViewGraph" cpt ...@@ -249,9 +252,19 @@ docViewGraphCpt = R.hooksComponent "FacetsDocViewGraph" cpt
, H.button { style: buttonStyle, on: { click: performClick } } , H.button { style: buttonStyle, on: { click: performClick } }
[ H.i { className: "glyphitem glyphicon glyphicon-trash" [ H.i { className: "glyphitem glyphicon glyphicon-trash"
, style: { marginRight : "9px" } } [] , style: { marginRight : "9px" } } []
, H.text "Delete document!" ] ] ] ] ] , H.text "Delete document!"
]
]
]
]
]
type PagePath = {nodeId :: Int, listId :: Int, query :: TextQuery, params :: T.Params, session :: Session} type PagePath = { nodeId :: Int
, listId :: Int
, query :: TextQuery
, params :: T.Params
, session :: Session
}
initialPagePath :: {session :: Session, nodeId :: Int, listId :: Int, query :: TextQuery} -> PagePath initialPagePath :: {session :: Session, nodeId :: Int, listId :: Int, query :: TextQuery} -> PagePath
initialPagePath {session, nodeId, listId, query} = {session, nodeId, listId, query, params: T.initialParams} initialPagePath {session, nodeId, listId, query} = {session, nodeId, listId, query, params: T.initialParams}
......
...@@ -24,7 +24,7 @@ newtype RenameValue = RenameValue ...@@ -24,7 +24,7 @@ newtype RenameValue = RenameValue
instance encodeJsonRenameValue :: EncodeJson RenameValue where instance encodeJsonRenameValue :: EncodeJson RenameValue where
encodeJson (RenameValue {text}) encodeJson (RenameValue {text})
= "r_name" := text = "name" := text
~> jsonEmptyObject ~> jsonEmptyObject
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -149,11 +149,18 @@ sideTab (Opened SideTabData) props = ...@@ -149,11 +149,18 @@ sideTab (Opened SideTabData) props =
snd props'.selectedNodeIds $ const SigmaxT.emptyNodeIds snd props'.selectedNodeIds $ const SigmaxT.emptyNodeIds
sideTab (Opened SideTabCommunity) props =
RH.div { className: "col-md-12", id: "query" }
[ query props.frontends
props.metaData
props.session
(SigmaxT.nodesGraphMap props.graph)
props.selectedNodeIds
]
sideTab _ _ = H.div {} [] sideTab _ _ = H.div {} []
------------------------------------------- -------------------------------------------
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge (_ /\ setNodeIds) {id, label} = badge (_ /\ setNodeIds) {id, label} =
...@@ -192,7 +199,11 @@ deleteNodes { graphId, metaData, nodes, session, termList, treeReload } = do ...@@ -192,7 +199,11 @@ deleteNodes { graphId, metaData, nodes, session, termList, treeReload } = do
Just (NTC.Versioned patch) -> do Just (NTC.Versioned patch) -> do
liftEffect $ snd treeReload $ (+) 1 liftEffect $ snd treeReload $ (+) 1
deleteNode :: TermList -> Session -> GET.MetaData -> Record SigmaxT.Node -> Aff NTC.VersionedNgramsPatches deleteNode :: TermList
-> Session
-> GET.MetaData
-> Record SigmaxT.Node
-> Aff NTC.VersionedNgramsPatches
deleteNode termList session (GET.MetaData metaData) node = NTC.putNgramsPatches coreParams versioned deleteNode termList session (GET.MetaData metaData) node = NTC.putNgramsPatches coreParams versioned
where where
nodeId :: Int nodeId :: Int
...@@ -222,7 +233,12 @@ deleteNode termList session (GET.MetaData metaData) node = NTC.putNgramsPatches ...@@ -222,7 +233,12 @@ deleteNode termList session (GET.MetaData metaData) node = NTC.putNgramsPatches
patch_list :: NTC.Replace TermList patch_list :: NTC.Replace TermList
patch_list = NTC.Replace { new: termList, old: MapTerm } patch_list = NTC.Replace { new: termList, old: MapTerm }
query :: Frontends -> GET.MetaData -> Session -> SigmaxT.NodesMap -> R.State SigmaxT.NodeIds -> R.Element query :: Frontends
-> GET.MetaData
-> Session
-> SigmaxT.NodesMap
-> R.State SigmaxT.NodeIds
-> R.Element
query _ _ _ _ (selectedNodeIds /\ _) | Set.isEmpty selectedNodeIds = RH.div {} [] query _ _ _ _ (selectedNodeIds /\ _) | Set.isEmpty selectedNodeIds = RH.div {} []
query frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _) = query frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _) =
query' (head metaData.corpusId) query' (head metaData.corpusId)
...@@ -255,5 +271,3 @@ query frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _) ...@@ -255,5 +271,3 @@ query frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _)
] ]
-} -}
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