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
c6a6d9a4
Commit
c6a6d9a4
authored
Sep 08, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[list selection] define JSON serialization
parent
e6c86289
Pipeline
#1774
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
Types.purs
src/Gargantext/Components/ListSelection/Types.purs
+7
-0
No files found.
src/Gargantext/Components/ListSelection/Types.purs
View file @
c6a6d9a4
...
...
@@ -21,6 +21,10 @@ instance Read Selection where
read "Other lists first" = Just OtherListsFirst
read "Selected lists" = Just $ SelectedLists []
read _ = Nothing
instance JSON.WriteForeign Selection where
writeImpl MyListsFirst = JSON.writeImpl { "type": "MyListsFirst" }
writeImpl OtherListsFirst = JSON.writeImpl { "type": "OtherListsFirst" }
writeImpl (SelectedLists ids) = JSON.writeImpl { "type": "SelectedLists", value: ids }
selectedListIds :: Selection -> Array ListId
selectedListIds (SelectedLists ids) = ids
...
...
@@ -30,6 +34,9 @@ selectedListIds _ = []
----------------------
-- TODO Make a separate endpoint on the backend for fetching the whole
-- tree with NodeSimple results?
-- A simplified data structure (we don't want the full-blown (NodePoly
-- a), we care only about Corpus and NodeList node types, with id,
-- name and that's all).
...
...
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