Skip to content

clone stacks - #1777

Closed
jakobroehrl wants to merge 10 commits into
masterfrom
enh/cloneStack
Closed

clone stacks#1777
jakobroehrl wants to merge 10 commits into
masterfrom
enh/cloneStack

Conversation

@jakobroehrl

@jakobroehrljakobroehrl commented Apr 29, 2020

Copy link
Copy Markdown
Contributor

Signed-off-by: Jakob Röhrl jakob.roehrl@web.de

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
Copy Markdown
ContributorAuthor

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

@stefan-niedermann

stefan-niedermann commented May 9, 2020

Copy link
Copy Markdown
Member

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)

Comment threadlib/Service/StackService.php
Comment threadlib/Service/StackService.php
Comment threadlib/Service/StackService.php Outdated
$newStack = new Stack();
$newStack->setTitle($stack->getTitle() . ' (' . $this->l10n->t('copy') . ')');
$newStack->setBoardId($boardId);
$newStack->setOrder($stack->getOrder() +1);

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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.

Comment threadlib/Service/StackService.php Outdated
Comment threadsrc/components/board/Stack.vue Outdated
Comment threadlib/Service/StackService.php Outdated
Comment threadlib/Service/StackService.php Outdated
Comment threadlib/Service/StackService.php
@jakobroehrl
jakobroehrlforce-pushed the enh/cloneStack branch 2 times, most recently from ee0d103 to 7c00309CompareMay 15, 2020 07:14
@jakobroehrl
jakobroehrlforce-pushed the enh/cloneStack branch 5 times, most recently from 0dd38f5 to 1dce89eCompareMay 19, 2020 06:09
Comment threadlib/Db/AssignedLabelsMapper.php Outdated

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

Comment threadlib/Service/StackService.php Outdated
Comment threadlib/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.

Comment threadlib/Service/StackService.php Outdated
Comment threadlib/Service/StackService.php Outdated
Comment threadlib/Service/StackService.php Outdated
Comment threadlib/Service/StackService.php Outdated
Comment threadlib/Service/StackService.php Outdated
Comment threadsrc/components/board/Stack.vue Outdated
Comment threadsrc/store/stack.js Outdated
* @return array|Entity
*/
public function find($cardId) {
$sql = 'SELECT * from `*PREFIX*deck_assigned_labels` where `card_id` = ?';

Copy link
Copy Markdown
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
Copy Markdown
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 <jakob.roehrl@web.de>
Comment threaddocs/API.md Outdated
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
@juliusknorr

Copy link
Copy Markdown
Member

Tests fail 😉

@jakobroehrl
jakobroehrlforce-pushed the enh/cloneStack branch 3 times, most recently from 4a23abb to 2a8841fCompareSeptember 16, 2020 07:03
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
@juliusknorrjuliusknorr mentioned this pull request Sep 17, 2020
@juliusknorrjuliusknorr modified the milestones: ⭐ 1.1.0, 💥 1.2.0Oct 2, 2020
Comment threaddocs/API.md Outdated
Comment threadlib/Service/StackService.php
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
@juliusknorrjuliusknorr modified the milestones: 1.2.0, 1.3.0Nov 10, 2020
@juliusknorrjuliusknorr removed this from the 1.3.0 milestone Dec 29, 2020
@doodhout

Copy link
Copy Markdown

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
Copy Markdown

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

@juliusknorr ?

Sign up for freeto 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

6 participants

@jakobroehrl@stefan-niedermann@ricstg@juliusknorr@doodhout@agautheron