-
Notifications
You must be signed in to change notification settings - Fork 309
clone stacks #1777
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 stacks #1777
Conversation
|
@juliushaertl |
|
Please have a look at #1832 before you make exact clones of the cards @jakobroehrl (Not sure if this affects this issue, sorry for spam if not) |
lib/Service/StackService.php
Outdated
| $newStack = new Stack(); | ||
| $newStack->setTitle($stack->getTitle() . ' (' . $this->l10n->t('copy') . ')'); | ||
| $newStack->setBoardId($boardId); | ||
| $newStack->setOrder($stack->getOrder() +1); |
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.
Ideally we get the number of stacks in total for the board and move it to the end.
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.
OK. This way I'll get the corresponding board:
$board = $this->boardMapper->find($boardId);
How can I get the stack number of this board?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
ee0d103 to
7c00309
Compare
0dd38f5 to
1dce89e
Compare
lib/Db/AssignedLabelsMapper.php
Outdated
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.
No need for that, you should be able to just remove the whole insert method and it will use the parent one then.
This comment has been minimized.
This comment has been minimized.
4eb7333 to
d6af11e
Compare
|
Works great! |
lib/Service/StackService.php
Outdated
| $newStack = new Stack(); | ||
| $newStack->setTitle($stack->getTitle() . ' (' . $this->l10n->t('copy') . ')'); | ||
| $newStack->setBoardId($boardId); | ||
| $newStack->setOrder($stack->getOrder() +1); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| * @return array|Entity | ||
| */ | ||
| public function find($cardId) { | ||
| $sql = 'SELECT * from `*PREFIX*deck_assigned_labels` where `card_id` = ?'; |
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.
Could be switched to QBMapper right away to get rid of the deprecated DeckMapper. See https://docs.nextcloud.com/server/18/developer_manual/app/storage/database.html?highlight=querybuilder#mappers for an example
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.
Feel free to do that in a follow up, but it would be good to not introduce new code that uses legacy functions right away 😉
Signed-off-by: Jakob Röhrl <[email protected]>
Signed-off-by: Jakob Röhrl <[email protected]>
|
Tests fail 😉 |
4a23abb to
2a8841f
Compare
Signed-off-by: Jakob Röhrl <[email protected]>
2a8841f to
24f83b8
Compare
Signed-off-by: Jakob Röhrl <[email protected]>
Signed-off-by: Jakob Röhrl <[email protected]>
|
There was no reason given why this was never merged and then closed. Is it possible to pick this up again, by the original committer or by someone else? |
|
Is it possible to pick this up again, by the original committer or by someone else? |
Signed-off-by: Jakob Röhrl [email protected]
Todo / to clarify
https://github.com/nextcloud/deck/blob/0dd38f5f2e067ef78aa7dbf3cfc8cb61c6d2d6ca/lib/Service/StackService.php#L451-L455