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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
19dc7dd2
Commit
19dc7dd2
authored
May 20, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dashboard] fix for the parentId decoding
parent
da2abe0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
Dashboard.purs
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
+1
-1
Types.purs
src/Gargantext/Components/Nodes/Dashboard/Types.purs
+23
-5
No files found.
src/Gargantext/Components/Nodes/Corpus/Dashboard.purs
View file @
19dc7dd2
...
...
@@ -56,7 +56,7 @@ dashboardLayoutWithKeyCpt = here.component "dashboardLayoutWithKey" cpt
reload' <- T.useLive T.unequal reload
useLoader {nodeId, reload: reload', session} DT.loadDashboardWithReload $
\
dashboardData@{hyperdata: DT.Hyperdata h, parentId}
-> do
\
(DT.DashboardData dashboardData@{hyperdata: DT.Hyperdata h, parentId})
-> do
let { charts, fields } = h
dashboardLayoutLoaded { charts
, corpusId: parentId
...
...
src/Gargantext/Components/Nodes/Dashboard/Types.purs
View file @
19dc7dd2
...
...
@@ -56,8 +56,26 @@ saveDashboard {hyperdata, nodeId, session} = do
id_ <- (put session (NodeAPI Node (Just nodeId) "") hyperdata) :: Aff Int
pure unit
type DashboardData =
newtype DashboardData =
DashboardData
{ id :: Int
, hyperdata :: Hyperdata
, parentId :: Int
}
derive instance genericDashboardData :: Generic DashboardData _
instance eqDashboardData :: Eq DashboardData where
eq = genericEq
instance decodeDashboardData :: DecodeJson DashboardData where
decodeJson json = do
obj <- decodeJson json
id <- obj .: "id"
hyperdata <- obj .: "hyperdata"
parentId <- obj .: "parent_id"
pure $ DashboardData { id, hyperdata, parentId }
instance encodeDashboardData :: EncodeJson DashboardData where
encodeJson (DashboardData { id, hyperdata, parentId }) = do
"id" := id
~> "hyperdata" := hyperdata
~> "parent_id" := parentId
~> jsonEmptyObject
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