Commit graph

57 commits

Author SHA1 Message Date
Jeremy Benoist 6aca334d53
Move to controller as a service
Mostly using autowiring to inject deps.
The only tricky part was for import because all producer use the same class and have a different alias. So we must write them down in the service definition, autowiring doesn't work in that case.

Usually:
- if a controller has a constructor, it means injected services are at least re-used once in actions
- otherwise, service are injected per action
2022-12-19 10:38:08 +01:00
Jeremy Benoist b7dba18cb2
Cleanup 2022-11-23 15:51:33 +01:00
Yassine Guedidi d1d56fbe25 Import used classes 2022-09-01 19:21:45 +02:00
Yassine Guedidi eb43c78720 Use FQCN instead of service alias 2022-09-01 09:07:19 +02:00
Yassine Guedidi 9549a90e76 Migrate first level template references to new notation 2022-08-25 21:09:26 +02:00
Yassine Guedidi 0f9c359476 Use FQCN as service name for repositories 2022-08-24 23:24:25 +02:00
Yassine Guedidi 844e8e9d22 Use FQCN as service name for helper services 2022-08-24 23:24:24 +02:00
Nicolas Lœuillet 086b3dda88
Fixed cs 2022-06-15 16:18:12 +02:00
Nicolas Lœuillet 4feca1ccd5
Added tag deletion from tags list
Fixed #2952
2022-06-15 16:18:11 +02:00
Jeremy Benoist 9f6414785c
Fix tests 2022-04-20 23:13:17 +02:00
Nicolas Lœuillet 5077c46e4e
Added action to tag search results 2022-04-20 22:57:25 +02:00
Kevin Decherf 48f9a9632d TagController: support merging labels when renaming one with label of another
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2020-04-18 18:12:33 +02:00
Kevin Decherf a19caf8a37 TagController: prevent tag deletion when renaming a tag with the same label
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2020-04-18 18:09:07 +02:00
Kevin Decherf 39133eb796 TagController: fix duplicated tags when renaming them
The fix relies on a workaround available on TagsAssigner, see the
AssignTagsToEntry() signature for detail.

I replaced the findOneByLabel in the corresponding test to assert that
there is no duplicate.

Fixes #4216

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2020-04-18 18:09:07 +02:00
Jeremy Benoist 8d4ed0df06
Update deps
Also CS (because cs-fixer got an update)

Package operations: 0 installs, 26 updates, 0 removals
  - Updating twig/twig (v2.12.1 => v2.12.2)
  - Updating symfony/symfony (v3.4.33 => v3.4.34)
  - Updating doctrine/event-manager (v1.0.0 => 1.1.0)
  - Updating doctrine/collections (v1.6.2 => 1.6.3)
  - Updating doctrine/cache (v1.8.1 => 1.9.0)
  - Updating doctrine/persistence (1.1.1 => 1.2.0)
  - Updating doctrine/inflector (v1.3.0 => 1.3.1)
  - Updating symfony/mime (v4.3.5 => v4.3.7)
  - Updating swiftmailer/swiftmailer (v6.2.1 => v6.2.3)
  - Updating symfony/swiftmailer-bundle (v3.3.0 => v3.3.1)
  - Updating doctrine/dbal (v2.9.2 => v2.9.3)
  - Updating doctrine/instantiator (1.2.0 => 1.3.0)
  - Updating j0k3r/graby-site-config (1.0.93 => 1.0.94)
  - Updating phpoption/phpoption (1.5.0 => 1.5.2)
  - Updating symfony/http-client-contracts (v1.1.7 => v1.1.8)
  - Updating symfony/http-client (v4.3.5 => v4.3.7)
  - Updating sensiolabs/security-checker (v6.0.2 => v6.0.3)
  - Updating paragonie/constant_time_encoding (v2.2.3 => v2.3.0)
  - Updating scheb/two-factor-bundle (v4.7.1 => v4.8.0)
  - Updating symfony/phpunit-bridge (v4.3.6 => v4.3.7)
  - Updating composer/xdebug-handler (1.3.3 => 1.4.0)
  - Updating friendsofphp/php-cs-fixer (v2.15.3 => v2.16.0)
  - Updating doctrine/data-fixtures (v1.3.2 => 1.3.3)
  - Updating nette/schema (v1.0.0 => v1.0.1)
  - Updating nikic/php-parser (v4.2.4 => v4.3.0)
  - Updating sentry/sentry (2.2.2 => 2.2.4)
2019-11-12 14:18:58 +01:00
Jeremy Benoist 35c7819cb6
Remove link when there are no untagged articles 2019-06-06 13:34:20 +02:00
Jeremy Benoist 0f2d24feb4
Fix typo & CS 2019-06-05 17:09:05 +02:00
Kevin Decherf ad51743e8b
Show untagged entries count on tag list
Closes #3235

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-06-05 17:03:51 +02:00
Jérémy Benoist e673b54f70
Merge pull request #3574 from shulard/feature/rename-tags
Allow to rename tags from the web interface.
2018-10-15 08:32:59 +00:00
Jeremy Benoist 115de64e5b
Jump to Symfony 3.4
Thanks to the BC compatibility, almost nothing have to be changed.
All changes are related to new bundle version of:
- SensioFrameworkExtraBundle
- DoctrineFixturesBundle
2018-10-04 14:11:57 +02:00
Stéphane HULARD b846c1e4d0
Add RenameForm as tag list view parameters.
This will help handling the CSRF protection token and use symfony HTML generation layer.
Also a FormView instance is generated for each tag because we need to render a form for each tag and FormView are not reusable.
2018-09-25 10:18:08 +02:00
Stéphane HULARD be326a22f9
Create a new Tag action to rename tags.
The current tag is removed from all the current logged user entries. Then the new one is created and attached.
2018-09-25 10:18:08 +02:00
Kevin Decherf 2a1ceb67b4 php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 14:25:32 +02:00
Jeremy Benoist 3ef055ced3
CS 2017-10-09 16:47:15 +02:00
Nicolas Hart 935e9fffb4 Reduce number of queries on tag list 2017-08-06 23:02:32 +02:00
Jeremy Benoist f808b01692
Add a real configuration for CS-Fixer 2017-07-01 09:52:38 +02:00
Thomas Citharel bd40f1af88
Add all entries RSS feed and put links on tag page itself and baggy too
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2017-06-21 12:02:04 +02:00
Jeremy Benoist 25203e5081
User existing service instead of getDoctrine 2017-06-21 11:44:35 +02:00
Jeremy Benoist 53da8ad844
Page parameter was never used in the function
It could have been used if we set the current page inside PreparePagerForEntries.
But we did that in each controller because we can have an OutOfRangeCurrentPageException
2017-06-01 09:29:18 +02:00
Kevin Decherf 5dbf3f2326 TagController: ignore ActionMarkAsRead when removing tag from entry
Fixes #2835

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-05-31 00:36:46 +02:00
Thomas Citharel 6bc6fb1f60 Move Tags assigner to a separate file
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2017-05-27 22:08:14 +02:00
Nicolas Lœuillet c8de7ab94c
Fixed export by tags with a tag which contains space 2016-12-27 21:26:53 +01:00
Jeremy Benoist 21e7ccef3d
Fix tests & deprecation notice 2016-12-15 21:38:16 +01:00
Jeremy Benoist 5a619812ca
Merge remote-tracking branch 'origin/master' into 2.2 2016-11-03 16:41:29 +01:00
Nicolas Lœuillet 7a5043f187
Added tag label in the page title
Fix #2472
2016-10-26 13:53:23 +02:00
Jeremy Benoist b0de88f75d
Use statements & update translation 2016-10-22 13:13:07 +02:00
Jeremy Benoist 28bb48905a
Optimize the way tag list is rendered
Instead of retrieve all informations about entries of a tag to just count them, we’ll count them before with a fastest query.

Also change the layout of the tag list in material design
2016-10-09 18:55:22 +02:00
Jeremy Benoist ac8cf632bb
Ensure orphan tag are remove in API
When the association between a tag and an entry is removed, if the tag doesn’t have other entries, we can remove it.

Also add more tests for that part and ensure TagControllerTest is isolated from the rest of the test suite (finally!)
2016-10-07 23:31:53 +02:00
Jeremy Benoist 82fc3290d4
CS 2016-09-25 12:03:49 +02:00
Jeremy Benoist faa86e06ba
Fix tags count in menu
Move enable cache for Tag in the Entity because function `find*` should return result and not a Query
2016-09-25 12:03:49 +02:00
Nicolas Lœuillet 429d86f388
Added tags counter in sidebar (material theme) 2016-09-04 20:53:28 +02:00
Nicolas Lœuillet 267e8d6361
Add tests for tag list routes 2016-08-23 07:26:18 +02:00
Nicolas Lœuillet 891456ba9a
Links on each tag in Tags view 2016-08-23 07:24:42 +02:00
Nicolas Lœuillet 2a007fe43d
Fix tags listing
Fix #1994
* Remove unused method in tag repository
2016-05-02 21:32:47 +02:00
Nicolas Lœuillet af497a641c
Redirect to homepage if referer is null
Fix #1924
2016-04-15 07:58:01 +02:00
Jeremy Benoist 4094ea4771 Convert array + phpDoc
Thanks for https://github.com/thomasbachem/php-short-array-syntax-converter
2016-04-12 12:25:29 +02:00
Jeremy Benoist 2baca964f3 Simplify tag creation from entry
Testing that a tag exist or is assigned to the current entry isn't important in the tag controler since the `assignTagsToEntry` is already doing that job.
So it simplify the controller.
2016-03-27 17:09:33 +02:00
Nicolas Loeuillet 5a4ee4ae0f Split tags with commas from UI 2016-03-21 14:06:07 +01:00
Jeremy Benoist 4204a06b77 Add flashes messages 2016-03-20 21:12:22 +01:00
Thomas Citharel 567421af50 remove tag from entry #1377 2016-02-10 17:41:28 +01:00