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
Show 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)
...
@@ -43,6 +43,7 @@ import Gargantext.Utils (sortWith)
import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.QueryString (joinQueryStrings, mQueryParam, mQueryParamS, queryParam, queryParamS)
import Gargantext.Utils.QueryString (joinQueryStrings, mQueryParam, mQueryParamS, queryParam, queryParamS)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as GUT
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Simple.JSON as JSON
import Simple.JSON as JSON
...
@@ -407,17 +408,14 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
...
@@ -407,17 +408,14 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
(\val -> maybe Nothing (\sp -> Just $ sp { mCurrentDocId = val })) sidePanel
(\val -> maybe Nothing (\sp -> Just $ sp { mCurrentDocId = val })) sidePanel
mCurrentDocId' <- T.useLive T.unequal mCurrentDocId
mCurrentDocId' <- T.useLive T.unequal mCurrentDocId
<<<<<<< HEAD
reload <- T.useBox GUT.newReload
reload <- GUR.new
=======
localCategories' <- T.useLive T.unequal localCategories
localCategories' <- T.useLive T.unequal localCategories
>>>>>>> dev
pure $ TT.table
pure $ TT.table
{ colNames
{ colNames
, container: TT.defaultContainer
, container: TT.defaultContainer
, params
, params
, rows: rows localCategories' mCurrentDocId'
, rows: rows
reload
localCategories' mCurrentDocId'
, syncResetButton : [ H.div {} [] ]
, syncResetButton : [ H.div {} [] ]
, totalRecords
, totalRecords
, wrapColElts
, wrapColElts
...
@@ -432,19 +430,10 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
...
@@ -432,19 +430,10 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
| otherwise = Routes.Document sid listId
| otherwise = Routes.Document sid listId
colNames = TT.ColumnName <$> [ "Show", "Tag", "Date", "Title", "Source", "Score" ]
colNames = TT.ColumnName <$> [ "Show", "Tag", "Date", "Title", "Source", "Score" ]
wrapColElts = const identity
wrapColElts = const identity
rows
localCategories' mCurrentDocId' = row
<$> A.toUnfoldable documents
rows
reload localCategories' mCurrentDocId' = row reload
<$> A.toUnfoldable documents
where
where
row dv@(DocumentsView r@{ _id, category }) =
row
reload
dv@(DocumentsView r@{ _id, category }) =
{ row:
{ 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} } [] ]
TT.makeRow [ -- H.div {} [ H.a { className, style, on: {click: click Favorite} } [] ]
H.div { className: "" }
H.div { className: "" }
[ docChooser { boxes
[ docChooser { boxes
...
@@ -460,7 +449,6 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
...
@@ -460,7 +449,6 @@ pagePaintRawCpt = here.component "pagePaintRawCpt" cpt where
, score: cat
, score: cat
, setLocalCategories: \lc -> T.modify_ lc localCategories
, setLocalCategories: \lc -> T.modify_ lc localCategories
, session } [] ]
, session } [] ]
>>>>>>> dev
--, H.input { type: "checkbox", defaultValue: checked, on: {click: click Trash} }
--, H.input { type: "checkbox", defaultValue: checked, on: {click: click Trash} }
-- TODO show date: Year-Month-Day only
-- TODO show date: Year-Month-Day only
, H.div { className: tClassName } [ R2.showText r.date ]
, 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
...
@@ -2,21 +2,24 @@ module Gargantext.Components.Score where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>), encodeJson)
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>), encodeJson)
import Data.Int (fromString)
import Data.Int (fromString)
import Data.Either (Either)
import Data.Maybe (Maybe(..), maybe)
import Data.Maybe (Maybe(..), maybe)
import DOM.Simple.Console (log2)
import DOM.Simple.Console (log2)
import Effect.Aff (Aff, launchAff_)
import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Simple.JSON as JSON
import Gargantext.Prelude
import Gargantext.Prelude
import Gargantext.Config.REST (RESTError)
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, sessionId, get, delete, put)
import Gargantext.Sessions (Session, sessionId, get, delete, put)
import Gargantext.Types as GT
import Gargantext.Types as GT
import Gargantext.Utils.Array as GUA
import Gargantext.Utils.Array as GUA
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.
Reload as GUR
import Gargantext.Utils.
Toestand as GUT
type Score = Int
type Score = Int
type DocID = Int
type DocID = Int
...
@@ -30,7 +33,7 @@ type Props = (
...
@@ -30,7 +33,7 @@ type Props = (
, nodeId :: GT.NodeID
, nodeId :: GT.NodeID
, score :: Maybe Score
, score :: Maybe Score
, session :: Session
, session :: Session
, tableReload :: GU
R
.ReloadS
, tableReload :: GU
T
.ReloadS
)
)
type Choice = Maybe Score
type Choice = Maybe Score
...
@@ -53,7 +56,7 @@ scoreElCpt = R.hooksComponentWithModule thisModule "scoreEl" cpt
...
@@ -53,7 +56,7 @@ scoreElCpt = R.hooksComponentWithModule thisModule "scoreEl" cpt
, score: readChoice $ R.unsafeEventValue e }
, score: readChoice $ R.unsafeEventValue e }
launchAff_ $ do
launchAff_ $ do
_ <- putScore session nodeId query
_ <- putScore session nodeId query
liftEffect $ GU
R.bump
reloadS
liftEffect $ GU
T.reload
reloadS
option :: Choice -> R.Element
option :: Choice -> R.Element
option c = H.option { value: showChoice c } [ H.text $ showChoice c ]
option c = H.option { value: showChoice c } [ H.text $ showChoice c ]
...
@@ -72,13 +75,11 @@ newtype ScoreQuery =
...
@@ -72,13 +75,11 @@ newtype ScoreQuery =
, score :: Choice
, score :: Choice
}
}
instance encodeJsonScoreQuery :: EncodeJson ScoreQuery where
instance JSON.WriteForeign ScoreQuery where
encodeJson (ScoreQuery post) =
writeImpl (ScoreQuery post) = JSON.writeImpl { nts_nodesId: post.nodeIds
"nts_nodesId" := post.nodeIds
, nts_score: post.score }
~> "nts_score" := encodeJson post.score
~> jsonEmptyObject
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
putScore session nodeId = put session $ scoreRoute nodeId
where
where
scoreRoute :: GT.NodeID -> SessionRoute
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