-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix "jumping" taxons while moving up or down #15272
Conversation
Bunnyshell Preview Environment deletedAvailable commands:
|
24492dd
to
5edffa1
Compare
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.
Changes passed QA check
src/Sylius/Bundle/TaxonomyBundle/Doctrine/ORM/TaxonRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/TaxonomyBundle/Doctrine/ORM/TaxonRepository.php
Outdated
Show resolved
Hide resolved
5edffa1
to
105dc5f
Compare
Thanks for the fixes, @jakubtobiasz :) |
Hi guys, |
Hi @ehibes 👋🏼, |
Thanks for leaving the review @igormukhingmailcom 😅 |
src/Sylius/Bundle/AdminBundle/Resources/config/routing/ajax/taxon.yml
Outdated
Show resolved
Hide resolved
src/Sylius/Component/Taxonomy/spec/Positioner/TaxonPositionerSpec.php
Outdated
Show resolved
Hide resolved
src/Sylius/Component/Taxonomy/spec/Positioner/TaxonPositionerSpec.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/TaxonomyBundle/Controller/TaxonPositionController.php
Outdated
Show resolved
Hide resolved
->andWhere('o.position < :taxonPosition') | ||
->setParameter('taxonPosition', $taxon->getPosition()) | ||
->addOrderBy('o.position', 'DESC') | ||
->setMaxResults(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.
Is it necessary in presence of getOneOrNullResult
? Which will throw exception like so
if (count($result) > 1) {
throw new NonUniqueResultException();
}
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 wanted to eliminate a need to handle the exception.
->andWhere('o.position > :taxonPosition') | ||
->setParameter('taxonPosition', $taxon->getPosition()) | ||
->addOrderBy('o.position', 'ASC') | ||
->setMaxResults(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.
Same question
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 wanted to eliminate a need to handle the exception.
src/Sylius/Bundle/TaxonomyBundle/Controller/TaxonPositionController.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/TaxonomyBundle/Controller/TaxonPositionController.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/TaxonomyBundle/Doctrine/ORM/TaxonRepository.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/TaxonomyBundle/Doctrine/ORM/TaxonRepository.php
Outdated
Show resolved
Hide resolved
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.
New repository methods are unused anywhere in the codebase
7c8ffe1
to
c7e2392
Compare
src/Sylius/Bundle/TaxonomyBundle/Controller/TaxonPositionController.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/TaxonomyBundle/Controller/TaxonPositionController.php
Outdated
Show resolved
Hide resolved
src/Sylius/Bundle/AdminBundle/Resources/views/Taxon/_treeWithButtons.html.twig
Show resolved
Hide resolved
Is this works?
It just doing the same |
@igormukhingmailcom |
c7e2392
to
47d5cf0
Compare
47d5cf0
to
b4bfdf3
Compare
When I want to see all taxons in store | ||
And I move up "T-Shirts" taxon | ||
Then I should see 4 taxons on the list | ||
And the first taxon on the list should be "T-Shirts" |
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.
And the first taxon on the list should be "T-Shirts" | |
And the first taxon on the list should still be "T-Shirts" |
This would describe the behaviour even better, the same in the below scenario
Thank you, Jacob! 🥇 |
Basing on #11905 I removed the "feature" part, to merge the "bug-fixing" part into
1.12
. We'll consider later adding "Move top" and "Move end" features, but probably it'll be considered in terms of2.0
with the new Admin Panel.Thanks @igormukhingmailcom for your work! I'm happy we're finally going to merge your commits :).
Previously:
Now: