Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
haskell-gargantext
Commits
e8a369f0
Commit
e8a369f0
authored
Nov 21, 2024
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/adinapoli/issue-426' into dev
parents
afd11132
f46a1ba7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
Update.hs
src/Gargantext/Database/Query/Table/Node/Update.hs
+3
-2
NodeNode.hs
src/Gargantext/Database/Schema/NodeNode.hs
+1
-1
No files found.
src/Gargantext/Database/Query/Table/Node/Update.hs
View file @
e8a369f0
...
...
@@ -73,7 +73,8 @@ update loggedInUserId (Move sourceId targetId) = do
->
-- both are not read-only, normal move
move_db_update
sourceId
targetId
(
False
,
True
)
->
(
:
[]
)
<$>
publish_node
(
SourceId
sourceId
)
(
TargetId
targetId
)
NPP_publish_no_edits_allowed
->
do
void
$
publish_node
(
SourceId
sourceId
)
(
TargetId
targetId
)
NPP_publish_no_edits_allowed
move_db_update
sourceId
targetId
(
True
,
False
)
->
-- the source is read only. If we are the owner we allow unpublishing.
-- FIXME(adn) is this check enough?
...
...
@@ -82,7 +83,7 @@ update loggedInUserId (Move sourceId targetId) = do
True
->
do
userPublicFolderNode
<-
getUserRootPublicNode
loggedInUserId
unpublishNode
(
SourceId
$
sourceId
)
(
TargetId
$
_node_id
userPublicFolderNode
)
pure
[
_NodeId
$
sourceId
]
move_db_update
sourceId
targetId
False
->
nodeError
(
NodeIsReadOnly
targetId
"logged user is not allowed to move/unpublish a read-only node"
)
(
True
,
True
)
->
-- this case is not allowed.
...
...
src/Gargantext/Database/Schema/NodeNode.hs
View file @
e8a369f0
...
...
@@ -76,7 +76,7 @@ instance HasDBid NodeNodeCategory where
NNC_publish
<$>
lookupDBid
x
instance
DefaultFromField
SqlInt4
(
Maybe
NodeNodeCategory
)
where
defaultFromField
=
lookupDBid
<$>
fromPGSFromField
defaultFromField
=
(
lookupDBid
=<<
)
<$>
fromPGSFromField
type
NodeNode
=
NodeNodePoly
NodeId
NodeId
(
Maybe
Double
)
(
Maybe
NodeNodeCategory
)
...
...
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