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
Grégoire Locqueville
purescript-gargantext
Commits
61907ea6
Commit
61907ea6
authored
Oct 04, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docstable, score] fix various merge issues
parent
3ea34423
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
26 deletions
+15
-26
DocsTable.purs
src/Gargantext/Components/DocsTable.purs
+5
-17
Score.purs
src/Gargantext/Components/Score.purs
+10
-9
No files found.
src/Gargantext/Components/DocsTable.purs
View file @
61907ea6
...
...
@@ -43,6 +43,7 @@ import Gargantext.Utils (sortWith)
import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.QueryString (joinQueryStrings, mQueryParam, mQueryParamS, queryParam, queryParamS)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as GUT
import Reactix as R
import Reactix.DOM.HTML as H
import Simple.JSON as JSON
...
...
@@ -407,17 +408,14 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
(\val -> maybe Nothing (\sp -> Just $ sp { mCurrentDocId = val })) sidePanel
mCurrentDocId' <- T.useLive T.unequal mCurrentDocId
<<<<<<< HEAD
reload <- GUR.new
=======
reload <- T.useBox GUT.newReload
localCategories' <- T.useLive T.unequal localCategories
>>>>>>> dev
pure $ TT.table
{ colNames
, container: TT.defaultContainer
, params
, rows: rows localCategories' mCurrentDocId'
, rows: rows
reload
localCategories' mCurrentDocId'
, syncResetButton : [ H.div {} [] ]
, totalRecords
, wrapColElts
...
...
@@ -432,19 +430,10 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
| otherwise = Routes.Document sid listId
colNames = TT.ColumnName <$> [ "Show", "Tag", "Date", "Title", "Source", "Score" ]
wrapColElts = const identity
rows
localCategories' mCurrentDocId' = row
<$> A.toUnfoldable documents
rows
reload localCategories' mCurrentDocId' = row reload
<$> A.toUnfoldable documents
where
row dv@(DocumentsView r@{ _id, category }) =
row
reload
dv@(DocumentsView r@{ _id, category }) =
{ row:
<<<<<<< HEAD
T.makeRow [ -- H.div {} [ H.a { className, style, on: {click: click Favorite} } [] ]
H.div { className: "" }
[ docChooser { listId, mCorpusId, nodeId: r._id, selected, sidePanelTriggers, tableReload: reload } []
]
--, H.div { className: "column-tag flex" } [ caroussel { category: cat, nodeId, row: dv, session, setLocalCategories } [] ]
, H.div { className: "column-tag flex" }
[ rating { score: cat, nodeId, row: dv, session, setLocalCategories } [] ]
=======
TT.makeRow [ -- H.div {} [ H.a { className, style, on: {click: click Favorite} } [] ]
H.div { className: "" }
[ docChooser { boxes
...
...
@@ -460,7 +449,6 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
, score: cat
, setLocalCategories: \lc -> T.modify_ lc localCategories
, session } [] ]
>>>>>>> dev
--, H.input { type: "checkbox", defaultValue: checked, on: {click: click Trash} }
-- TODO show date: Year-Month-Day only
, H.div { className: tClassName } [ R2.showText r.date ]
...
...
src/Gargantext/Components/Score.purs
View file @
61907ea6
...
...
@@ -2,21 +2,24 @@ module Gargantext.Components.Score where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>), encodeJson)
import Data.Int (fromString)
import Data.Either (Either)
import Data.Maybe (Maybe(..), maybe)
import DOM.Simple.Console (log2)
import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Reactix as R
import Reactix.DOM.HTML as H
import Simple.JSON as JSON
import Gargantext.Prelude
import Gargantext.Config.REST (RESTError)
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, sessionId, get, delete, put)
import Gargantext.Types as GT
import Gargantext.Utils.Array as GUA
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.
Reload as GUR
import Gargantext.Utils.
Toestand as GUT
type Score = Int
type DocID = Int
...
...
@@ -30,7 +33,7 @@ type Props = (
, nodeId :: GT.NodeID
, score :: Maybe Score
, session :: Session
, tableReload :: GU
R
.ReloadS
, tableReload :: GU
T
.ReloadS
)
type Choice = Maybe Score
...
...
@@ -53,7 +56,7 @@ scoreElCpt = R.hooksComponentWithModule thisModule "scoreEl" cpt
, score: readChoice $ R.unsafeEventValue e }
launchAff_ $ do
_ <- putScore session nodeId query
liftEffect $ GU
R.bump
reloadS
liftEffect $ GU
T.reload
reloadS
option :: Choice -> R.Element
option c = H.option { value: showChoice c } [ H.text $ showChoice c ]
...
...
@@ -72,13 +75,11 @@ newtype ScoreQuery =
, score :: Choice
}
instance encodeJsonScoreQuery :: EncodeJson ScoreQuery where
encodeJson (ScoreQuery post) =
"nts_nodesId" := post.nodeIds
~> "nts_score" := encodeJson post.score
~> jsonEmptyObject
instance JSON.WriteForeign ScoreQuery where
writeImpl (ScoreQuery post) = JSON.writeImpl { nts_nodesId: post.nodeIds
, nts_score: post.score }
putScore :: Session -> GT.NodeID -> ScoreQuery -> Aff (
Array Int
)
putScore :: Session -> GT.NodeID -> ScoreQuery -> Aff (
Either RESTError (Array Int)
)
putScore session nodeId = put session $ scoreRoute nodeId
where
scoreRoute :: GT.NodeID -> SessionRoute
...
...
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