Skip to content

Conversation

@jakobroehrl
Copy link
Contributor

@jakobroehrl jakobroehrl commented Apr 29, 2020

Signed-off-by: Jakob Röhrl [email protected]

Todo / to clarify

  • Ideally we get the number of stacks in total for the board and move it to the end.
  • We could use the card clone implementation and use it here, too: Clone / Copy boards [$150] #119 (comment)
  • labels and assigned users clone
  • I think it should also work to just operate on $card directly so you just overwrite the properties that need to be changed and then passed to insert afterwards.

  1. Labels are only shown after page reload
  2. User assignment doesn't work: "The user is not part of the board"
    https://github.com/nextcloud/deck/blob/0dd38f5f2e067ef78aa7dbf3cfc8cb61c6d2d6ca/lib/Service/StackService.php#L451-L455

@jakobroehrl
Copy link
Contributor Author

@juliushaertl
We could use the card clone implementation and use it here, too: #119 (comment)
What do you think?

@stefan-niedermann
Copy link
Member

stefan-niedermann commented May 9, 2020

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)

$newStack = new Stack();
$newStack->setTitle($stack->getTitle() . ' (' . $this->l10n->t('copy') . ')');
$newStack->setBoardId($boardId);
$newStack->setOrder($stack->getOrder() +1);
Copy link
Member

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.

Copy link
Contributor Author

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.

@jakobroehrl jakobroehrl force-pushed the enh/cloneStack branch 2 times, most recently from ee0d103 to 7c00309 Compare May 15, 2020 07:14
@jakobroehrl jakobroehrl requested a review from juliusknorr May 15, 2020 07:17
@jakobroehrl jakobroehrl force-pushed the enh/cloneStack branch 5 times, most recently from 0dd38f5 to 1dce89e Compare May 19, 2020 06:09
Copy link
Member

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.

@ricstg

This comment has been minimized.

@jakobroehrl
Copy link
Contributor Author

Works great!
Let's merge this in, so I can work on the board clone and card clone topics:

$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.

* @return array|Entity
*/
public function find($cardId) {
$sql = 'SELECT * from `*PREFIX*deck_assigned_labels` where `card_id` = ?';
Copy link
Member

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

Copy link
Member

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]>
@juliusknorr
Copy link
Member

Tests fail 😉

@jakobroehrl jakobroehrl force-pushed the enh/cloneStack branch 3 times, most recently from 4a23abb to 2a8841f Compare September 16, 2020 07:03
Signed-off-by: Jakob Röhrl <[email protected]>
@juliusknorr juliusknorr mentioned this pull request Sep 17, 2020
@juliusknorr juliusknorr modified the milestones: ⭐ 1.1.0, 💥 1.2.0 Oct 2, 2020
Signed-off-by: Jakob Röhrl <[email protected]>
Signed-off-by: Jakob Röhrl <[email protected]>
@juliusknorr juliusknorr modified the milestones: 1.2.0, 1.3.0 Nov 10, 2020
@juliusknorr juliusknorr removed this from the 1.3.0 milestone Dec 29, 2020
@doodhout
Copy link

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?

@agautheron
Copy link

Is it possible to pick this up again, by the original committer or by someone else?

@juliusknorr ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clone a stack

7 participants