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 }
initialDeletions :: Deletions
initialDeletions = { pending: mempty, deleted: mempty }
newtype Pair = Pair { id :: Int, label :: String }
newtype Pair =
Pair { id :: Int
, label :: String
}
derive instance genericPair :: Generic Pair _
......@@ -119,9 +122,9 @@ newtype Hyperdata = Hyperdata
{ authors :: String
, title :: String
, source :: String
, publication_year :: Int
, publication_year :: Int
, publication_month :: Int
, publication_day :: Int
, publication_day :: Int
}
--instance decodeHyperdata :: DecodeJson Hyperdata where
......@@ -249,9 +252,19 @@ docViewGraphCpt = R.hooksComponent "FacetsDocViewGraph" cpt
, H.button { style: buttonStyle, on: { click: performClick } }
[ H.i { className: "glyphitem glyphicon glyphicon-trash"
, 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, nodeId, listId, query} = {session, nodeId, listId, query, params: T.initialParams}
......@@ -287,12 +300,12 @@ loadPage {session, nodeId, listId, query, params: {limit, offset, orderBy}} = do
convOrderBy _ = DateAsc -- TODO
type PageLayoutProps =
( frontends :: Frontends
( frontends :: Frontends
, totalRecords :: Int
, deletions :: R.State Deletions
, container :: Record T.TableContainerProps -> R.Element
, session :: Session
, path :: R.State PagePath
, deletions :: R.State Deletions
, container :: Record T.TableContainerProps -> R.Element
, session :: Session
, path :: R.State PagePath
)
type PageProps = ( documents :: Array DocumentsView | PageLayoutProps )
......
......@@ -24,7 +24,7 @@ newtype RenameValue = RenameValue
instance encodeJsonRenameValue :: EncodeJson RenameValue where
encodeJson (RenameValue {text})
= "r_name" := text
= "name" := text
~> jsonEmptyObject
------------------------------------------------------------------------
......@@ -149,11 +149,18 @@ sideTab (Opened SideTabData) props =
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 {} []
-------------------------------------------
badge :: R.State SigmaxT.NodeIds -> Record SigmaxT.Node -> R.Element
badge (_ /\ setNodeIds) {id, label} =
......@@ -192,7 +199,11 @@ deleteNodes { graphId, metaData, nodes, session, termList, treeReload } = do
Just (NTC.Versioned patch) -> do
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
where
nodeId :: Int
......@@ -222,7 +233,12 @@ deleteNode termList session (GET.MetaData metaData) node = NTC.putNgramsPatches
patch_list :: NTC.Replace TermList
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 frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _) =
query' (head metaData.corpusId)
......@@ -255,5 +271,3 @@ query frontends (GET.MetaData metaData) session nodesMap (selectedNodeIds /\ _)
]
-}
......@@ -13,9 +13,9 @@ import Gargantext.Sessions (Session)
type Props =
( frontends :: Frontends
, query :: TextQuery
, session :: Session
, sides :: Array GraphSideCorpus
, query :: TextQuery
, session :: Session
, sides :: Array GraphSideCorpus
)
tabs :: Record Props -> R.Element
......
......@@ -40,13 +40,13 @@ data SessionRoute
| GetNgramsTableVersion { listId :: ListId, tabType :: TabType } (Maybe Id)
| PutNgrams TabType (Maybe ListId) (Maybe TermList) (Maybe Id)
-- ^ This name is not good. In particular this URL is used both in PUT and POST.
| RecomputeNgrams (TabSubType CTabNgramType) Id ListId
| RecomputeListChart ChartType CTabNgramType Id ListId
| NodeAPI NodeType (Maybe Id) String
| GraphAPI Id String
| ListsRoute ListId
| RecomputeNgrams (TabSubType CTabNgramType) Id ListId
| RecomputeListChart ChartType CTabNgramType Id ListId
| NodeAPI NodeType (Maybe Id) String
| GraphAPI Id String
| ListsRoute ListId
| ListDocument (Maybe ListId) (Maybe Id)
| Search SearchOpts (Maybe Id)
| Search SearchOpts (Maybe Id)
| CorpusMetrics CorpusMetricOpts (Maybe Id)
| CorpusMetricsHash { listId :: ListId, tabType :: TabType } (Maybe Id)
| Chart ChartOpts (Maybe Id)
......
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