-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clone cards together with the board #3430
base: main
Are you sure you want to change the base?
Conversation
|
Restoring archived cards would in no way be an edge case! |
a0182bc
to
e53f9f4
Compare
Hello @bahuma20. I'm very sorry for the long delay on the feedback of this one, we'll have a look into it soonish to get this merged. |
@@ -419,6 +419,25 @@ A 403 response might be returned if the users ability to create new boards has b | |||
|
|||
##### 200 Success | |||
|
|||
### POST /boards/{boardId}/clone - Clone a board |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to have this available through the API the required routes would also need to be handled for the BoardApiController similar to https://github.com/nextcloud/deck/pull/3430/files#diff-f126d1440653a8583122ad9fa4e49497074f2eabe1c511d76288a547ab8f1575
lib/Service/BoardService.php
Outdated
@@ -80,11 +85,13 @@ class BoardService { | |||
public function __construct( | |||
BoardMapper $boardMapper, | |||
StackMapper $stackMapper, | |||
CardMapper $cardMapper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 2 injections of CardMapper
, see below at line 97.
@@ -662,6 +672,16 @@ public function clone($id, $userId) { | |||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can separate the board cloning logics in a different class - The BoardMapper or the Service.
lib/Service/BoardService.php
Outdated
return $newBoard; | ||
} | ||
|
||
private function cloneCards(Board $board, Board $newBoard, $withAssignments = false, $withLabels = false, $withDueDate = false, $moveCardsToLeftStack = false, $restoreArchivedCards = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can put this Card cloning logic into the CardMapper
class by creating a static method.
name="notification" | ||
icon="icon-sound" | ||
:disabled="updateDueSetting" | ||
:class="{ 'forced-active': board.settings['notify-due'] === 'all' }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd better put this expression as a computed value.
@@ -103,11 +107,13 @@ public function setUp(): void { | |||
$this->service = new BoardService( | |||
$this->boardMapper, | |||
$this->stackMapper, | |||
$this->cardMapper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two CardMapper usages in the BoardService constructor.
Agree with @stefan-niedermann – we should use |
Yes but I'd say that |
This would be nice to have merged. This would solve a problem for a few projects where they have asked for this type of feature. |
8b4176a
to
1b87aed
Compare
I rebased this as there were quite some conflicting changes. Will have a look what is missing to get this in. |
88dda3b
to
eac0400
Compare
eac0400
to
b627884
Compare
// TODO: Undelete cards | ||
// TODO: Copy attachments (or not?) | ||
// TODO: Copy comments (or not?) | ||
// TODO: Move to specific column |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove those from the code and track as enhancement follow up issues.
lib/Service/BoardService.php
Outdated
usort($stacks, function (Stack $a, Stack $b) { | ||
return $a->getOrder() - $b->getOrder(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting the same as above twice?
Signed-off-by: Max Bachhuber <[email protected]>
Signed-off-by: Max Bachhuber <[email protected]>
…ore to support clone options Signed-off-by: Max Bachhuber <[email protected]>
Signed-off-by: Max Bachhuber <[email protected]>
Signed-off-by: Max Bachhuber <[email protected]>
Signed-off-by: Max Bachhuber <[email protected]>
Signed-off-by: Max Bachhuber <[email protected]>
Signed-off-by: Max Bachhuber <[email protected]>
Signed-off-by: Max Bachhuber <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
c0d6d4f
to
4ce2d79
Compare
make error message clear SPDX Header BoardCloneModal.vue Signed-off-by: grnd-alt <[email protected]>
4ce2d79
to
0473133
Compare
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_CARD, $card, ActivityManager::SUBJECT_CARD_CREATE); | ||
$this->changeHelper->cardChanged($card->getId(), false); | ||
$this->eventDispatcher->dispatchTyped(new CardCreatedEvent($card)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$card
should be replaced by $newCard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think cypress tests should be added.
We would also be very interested in this feature. |
I would also be very interested in this feature. Why it has not been merged yet? |
Summary
Add the possibility to clone cards together with the board.
Also allow customizations when cloning.
In advanced options, cards can be moved to the first list and archived cards can be restored.
Follow Up
TODO
Checklist