Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christian Merten
purescript-gargantext
Commits
8c3900e4
Commit
8c3900e4
authored
Sep 04, 2024
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Doc view] Mark document as read when clicking on the link
parent
409ace3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+13
-4
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
8c3900e4
...
@@ -38,6 +38,7 @@ import Gargantext.Components.Table.Types as TT
...
@@ -38,6 +38,7 @@ import Gargantext.Components.Table.Types as TT
import Gargantext.Config.REST (AffRESTError)
import Gargantext.Config.REST (AffRESTError)
import Gargantext.Config.Utils (handleRESTError)
import Gargantext.Config.Utils (handleRESTError)
import Gargantext.Ends (Frontends, url)
import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.LinkHandler (useLinkHandler)
import Gargantext.Hooks.Loader (useLoader, useLoaderWithCacheAPI, HashedResponse(..))
import Gargantext.Hooks.Loader (useLoader, useLoaderWithCacheAPI, HashedResponse(..))
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes as Routes
import Gargantext.Routes as Routes
...
@@ -603,6 +604,8 @@ tableRowCpt = here.component "tableRow" cpt where
...
@@ -603,6 +604,8 @@ tableRowCpt = here.component "tableRow" cpt where
, session } _ = do
, session } _ = do
mCurrentDocId' <- T.useLive T.unequal mCurrentDocId
mCurrentDocId' <- T.useLive T.unequal mCurrentDocId
{ goToURL } <- useLinkHandler
let cat :: Category
let cat :: Category
cat = fromMaybe category (localCategories ^. at _id)
cat = fromMaybe category (localCategories ^. at _id)
selected = mCurrentDocId' == Just r._id
selected = mCurrentDocId' == Just r._id
...
@@ -648,10 +651,16 @@ tableRowCpt = here.component "tableRow" cpt where
...
@@ -648,10 +651,16 @@ tableRowCpt = here.component "tableRow" cpt where
H.div
H.div
{ className: tClassName }
{ className: tClassName }
[
[
H.a
H.button
{ href: url frontends $ corpusDocument r._id
{ on: { click: \_ -> do
, target: "_blank"
let categoryMarked = markCategoryChecked categoryS'
, className: "text-primary"
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.text r.title
, H.i { className: "fa fa-external-link mx-1 small" } []
, H.i { className: "fa fa-external-link mx-1 small" } []
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment