75259[TASK] Revamp Template Object Browser
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
- Nikita Hovratov +1
- Oliver Hader +1
-
Verified V +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
- Nikita Hovratov +1
- core-ci +1 CI
Issues 2
Files 30
- Build/Sources/TypeScript/tstemplate/typo-script-object-browser.ts+1 −5
- typo3/sysext/core/Classes/TypoScript/AST/CurrentObjectPath/CurrentObjectPath.php8+26 −0
- typo3/sysext/core/Classes/TypoScript/Parser/ConstantConfigurationParser.php+2 −0
- typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php+0 −93
- typo3/sysext/core/Classes/TypoScript/TemplateService.php+0 −1
- typo3/sysext/core/Tests/Acceptance/Application/Template/TemplateCest.php+11 −11
- typo3/sysext/core/Tests/Unit/TypoScript/AST/CurrentObjectPath/CurrentObjectPathTest.php11new+149 −0
- typo3/sysext/tstemplate/Classes/Controller/ObjectBrowserController.php+473 −279
- typo3/sysext/tstemplate/Classes/TypoScript/AST/Visitor/AstExpandStateVisitor.phpnew+86 −0
- typo3/sysext/tstemplate/Classes/TypoScript/AST/Visitor/AstSearchVisitor.phpnew+107 −0
- typo3/sysext/tstemplate/Classes/ViewHelpers/If/IsInstanceOfViewHelper.phpdeleted+0 −40
- typo3/sysext/tstemplate/Classes/ViewHelpers/AstCurrentObjectPathAppendViewHelper.phpnew+53 −0
- typo3/sysext/tstemplate/Classes/ViewHelpers/AstCurrentObjectPathAsJsonViewHelper.phpnew+50 −0
- typo3/sysext/tstemplate/Classes/ViewHelpers/AstCurrentObjectPathRemoveLastViewHelper.phpnew+48 −0
- typo3/sysext/tstemplate/Classes/ViewHelpers/TrimViewHelper.phpnew+37 −0
- typo3/sysext/tstemplate/Configuration/Backend/Modules.php+8 −6
- typo3/sysext/tstemplate/Resources/Private/Language/locallang_objbrowser.xlf+42 −90
- typo3/sysext/tstemplate/Resources/Private/Partials/AnalyzerConditions.html+1 −1
- typo3/sysext/tstemplate/Resources/Private/Partials/AnalyzerOptions.html+6 −6
- typo3/sysext/tstemplate/Resources/Private/Partials/AnalyzerTree.html+4 −4
Show 10 more files
- typo3/sysext/tstemplate/Resources/Private/Partials/ObjectBrowserConditions.htmlnew+72 −0
- typo3/sysext/tstemplate/Resources/Private/Partials/ObjectBrowserEdit.htmldeleted+0 −97
- typo3/sysext/tstemplate/Resources/Private/Partials/ObjectBrowserOptions.htmlnew+111 −0
- typo3/sysext/tstemplate/Resources/Private/Partials/ObjectBrowserTree.html4+78 −135
- typo3/sysext/tstemplate/Resources/Private/Partials/ObjectBrowserTreePanel.htmlnew+35 −0
- typo3/sysext/tstemplate/Resources/Private/Templates/ObjectBrowser.htmldeleted+0 −57
- typo3/sysext/tstemplate/Resources/Private/Templates/ObjectBrowserEdit.htmlnew+107 −0
- typo3/sysext/tstemplate/Resources/Private/Templates/ObjectBrowserMain.htmlnew+109 −0
- typo3/sysext/tstemplate/Resources/Public/JavaScript/typo-script-object-browser.js+1 −1
- typo3/sysext/tstemplate/Tests/Unit/Controller/TypoScriptObjectBrowserControllerTest.phpdeleted+0 −176
Review log 4565
Show 2740 earlier messages
-
Christian Kuhn uploaded patch set 1 07/22/22, 11:27
-
core-ci voted on patch set 1 V -1 07/22/22, 11:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29421
-
Christian Kuhn uploaded patch set 2 07/22/22, 18:59
-
core-ci voted on patch set 2 V -1 07/22/22, 19:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29435
-
Christian Kuhn uploaded patch set 3 07/23/22, 11:04
-
Oliver Klee commented on patch set 3 07/23/22, 11:11
-
core-ci voted on patch set 3 V -1 07/23/22, 11:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29448
-
Christian Kuhn uploaded patch set 4 07/23/22, 11:59
-
Christian Kuhn uploaded patch set 5 07/23/22, 12:05
-
core-ci voted on patch set 4 V -1 07/23/22, 12:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29450
-
core-ci voted on patch set 5 V -1 07/23/22, 12:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29451
-
Christian Kuhn commented on patch set 5 07/23/22, 12:23
CurrentObjectPath.php:68Replyyou're right. great catch! fixed with set 5->6 -
Christian Kuhn uploaded patch set 6 07/23/22, 12:24
-
Oliver Klee commented on patch set 6 07/23/22, 12:26
CurrentObjectPath.php:68Thinking … Would it make sense to change this check and the exception so that instead the node constructor expects a non-empty string as name (annotated as @param non-empty-string) and throws an InvalidArgumentException if the name is empty? -
Oliver Klee commented on patch set 6 07/23/22, 12:28
CurrentObjectPath.php:68ReplyThanks! In general, empty() often behaves in mysterious and rather unexpected ways. That why the strict PHPStan ruleset complains about its use (IIRC). :-) -
Christian Kuhn commented on patch set 6 07/23/22, 12:28
CurrentObjectPath.php:68Replyyeah. might be do-able. will try. -
Christian Kuhn commented on patch set 6 07/23/22, 12:29
CurrentObjectPath.php:68Replyi'm aware of empty() shenanigans and try to use it with care / when it makes sense. -
core-ci voted on patch set 6 V -1 07/23/22, 12:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29452
-
Christian Kuhn commented on patch set 6 07/23/22, 12:39
CurrentObjectPath.php:68ReplyNot possible since RootNode has name 'null': A nullable node-name can be added. -
Christian Kuhn commented on patch set 6 07/23/22, 12:51
CurrentObjectPath.php:68Replyit's just "if it's a string, it must be non empty". I'd like to keep that check "lazy" in usages and not in constructor since this object is a heavy-used one during ast-building, so an if in __construct() would result in lot's of if's that aren't needed in most cases during ast-building. doing that check late in thise less-often used method is more performant. -
Christian Kuhn uploaded patch set 7 07/24/22, 06:35
-
core-ci voted on patch set 7 V +1 07/24/22, 06:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29460
-
Christian Kuhn uploaded patch set 8 07/24/22, 08:51
-
core-ci voted on patch set 8 V -1 07/24/22, 08:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29461
-
Christian Kuhn uploaded patch set 9 07/24/22, 10:28
-
core-ci voted on patch set 9 V -1 07/24/22, 10:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29462
-
Christian Kuhn updated the commit message in patch set 10 07/24/22, 10:50
-
Christian Kuhn uploaded patch set 11 07/24/22, 10:57
-
core-ci voted on patch set 10 V -1 07/24/22, 10:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29463
-
core-ci voted on patch set 11 V +1 07/24/22, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29464
-
Christian Kuhn uploaded patch set 12 07/24/22, 11:18
-
core-ci voted on patch set 12 V +1 07/24/22, 11:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29465
-
Oliver Klee commented on patch set 12 07/24/22, 12:32
Added a few thoughts.CurrentObjectPathTest.php:80The assertion here is never executed due to the exception being throw. So the getPathAsString call should suffice.CurrentObjectPathTest.php:86Won't this in all practical scenarios always be the root node, i.e., should we rename the tested method to getRootNode?CurrentObjectPathTest.php:114We also should have a test for scenarios where there is only one node (the root node).ObjectBrowserTree.html:66I'd recommend us not to have instanceof checks in Fluid templates - they rely on the classes/class names and not on certain properties. Also, they won't get updated if the class is renamed/moved using the automated refactoring in PhpStorm. Instead, I propose we add some has*/is*/can* methods to our node classes with hardcoded boolean return values. What do you think? -
Stefan Bürk commented on patch set 12 07/24/22, 12:53
CurrentObjectPathTest.php:80ReplyAck here.CurrentObjectPathTest.php:86ReplyrootNode is something different then the first node in the path. So test method naming is correct. (root nodes do not have a name and are class RootNode, not ChildNode. So using getRootNode... here would be technical wrong.CurrentObjectPathTest.php:114ReplySee above. RootNode and first node are not the same. -
Christian Kuhn commented on patch set 12 07/24/22, 13:51
CurrentObjectPathTest.php:80Replytrue. should be removed.CurrentObjectPathTest.php:86Replyyes. but does not matter. i wanted to test with an identifiable node here.CurrentObjectPathTest.php:114Replybut good idea to test for "there's only one node". will do.ObjectBrowserTree.html:66Replyyeah. it's a bit funny. we're using that in template analyzer with success already and i don't want to add further sub-class specific clutter to nodeinterface. i'd like to keep it for now. -
Christian Kuhn commented on patch set 12 07/24/22, 13:54
CurrentObjectPathTest.php:80ReplyDoneCurrentObjectPathTest.php:114ReplyDone -
Christian Kuhn uploaded patch set 13 07/24/22, 13:55
-
core-ci voted on patch set 13 V +1 07/24/22, 14:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29467
-
Oliver Klee commented on patch set 13 07/24/22, 14:02
ObjectBrowserTree.html:66ReplyMy main concern is the thing about PhpStorm not recognizing that the class is used, which breaks the rename (and the "search for usage") features. How should we solve that? And in general, from an architectural standpoint, I think one thing that classes are is "concepts with behavior, not concepts by name". So a class having a certain behavior (and providing information about that) would be cleaner, I think. (I also don't consider this to be clutter. The term "clutter" implies that it's not useful, with which I disagree.) -
Stefan Bürk voted on patch set 13 V +1 CR +1 07/24/22, 14:04
-
Christian Kuhn commented on patch set 13 07/24/22, 14:33
ObjectBrowserTree.html:66Replyi understand your concern. however i'll not change this now. i'll think about this ugly isinstanceof VH in the next iteration to see if we could come up with something better. -
Christian Kuhn rebased onto patch set 14 07/24/22, 18:02
-
core-ci voted on patch set 14 V +1 07/24/22, 18:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29477
-
Stefan Bürk voted on patch set 14 V +1 CR +1 07/24/22, 18:38
-
Christian Kuhn commented on patch set 14 CR -1 07/25/22, 10:07
will drop isInstanceOf VH. -
Christian Kuhn uploaded patch set 15 07/25/22, 10:20
-
core-ci voted on patch set 15 V +1 07/25/22, 10:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29490
-
Nikita Hovratov uploaded patch set 16 07/25/22, 11:13
-
core-ci voted on patch set 16 V +1 07/25/22, 11:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29495
-
Nikita Hovratov uploaded patch set 17 07/25/22, 12:15
-
Nikita Hovratov voted on patch set 17 V +1 07/25/22, 12:15
-
Stefan Bürk voted on patch set 17 V +1 CR +1 07/25/22, 12:19
-
core-ci voted on patch set 17 V +1 07/25/22, 12:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29496
-
Nikita Hovratov uploaded patch set 18 07/25/22, 13:13
-
core-ci voted on patch set 18 V +1 07/25/22, 13:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29499
-
Oliver Hader voted on patch set 18 CR +1 07/25/22, 13:30
-
Nikita Hovratov uploaded patch set 19 07/25/22, 13:32
-
Nikita Hovratov uploaded patch set 20 07/25/22, 13:37
-
Nikita Hovratov voted on patch set 20 V +1 CR +1 07/25/22, 13:37
-
core-ci voted on patch set 19 V +1 07/25/22, 13:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29501
-
Stefan Bürk voted on patch set 20 V +1 CR +1 07/25/22, 13:42
-
core-ci voted on patch set 20 V +1 07/25/22, 13:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29502
-
Oliver Hader voted on patch set 20 CR +1 07/25/22, 13:46
-
Christian Kuhn commented on patch set 20 V +2 CR +2 07/25/22, 13:48
thank you for working on it an reviews! -
Christian Kuhn merged patch set 21 07/25/22, 13:48
CurrentObjectPath.php:68