Commit 7545f83f authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/687-dev-document-star' into dev

parents d7508602 8c3900e4
......@@ -38,6 +38,7 @@ import Gargantext.Components.Table.Types as TT
import Gargantext.Config.REST (AffRESTError)
import Gargantext.Config.Utils (handleRESTError)
import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.LinkHandler (useLinkHandler)
import Gargantext.Hooks.Loader (useLoader, useLoaderWithCacheAPI, HashedResponse(..))
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes as Routes
......@@ -603,6 +604,8 @@ tableRowCpt = here.component "tableRow" cpt where
, session } _ = do
mCurrentDocId' <- T.useLive T.unequal mCurrentDocId
{ goToURL } <- useLinkHandler
let cat :: Category
cat = fromMaybe category (localCategories ^. at _id)
selected = mCurrentDocId' == Just r._id
......@@ -648,10 +651,16 @@ tableRowCpt = here.component "tableRow" cpt where
H.div
{ className: tClassName }
[
H.a
{ href: url frontends $ corpusDocument r._id
, target: "_blank"
, className: "text-primary"
H.button
{ on: { click: \_ -> do
let categoryMarked = markCategoryChecked categoryS'
launchAff_ $ do
_ <- updateNodeContextCategory session r._id (fromMaybe 0 mCorpusId) $ cat2score categoryMarked
pure unit
T.write_ categoryMarked categoryS
goToURL $ url frontends $ corpusDocument r._id }
, className: "btn btn-link text-primary"
, type: "Button"
}
[ H.text r.title
, H.i { className: "fa fa-external-link mx-1 small" } []
......
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