Review main Merged

69037[FEATURE] Add support of readOnly in t3editor

Christian Kuhn CR +2 V +2 Normal +50 −3 updated 05/19/21, 14:20

Commit message

This allows to disable editing of text in FormEngine
t3editor, while syntax highlighting is still applied.

ext:styleguide master brings the t3editor_2 field as example.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2027

Show 12 earlier messages
  1. Christian Kuhn uploaded patch set 1 05/05/21, 14:07

  2. core-ci voted on patch set 1 V +1 05/05/21, 14:17 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11213

  1. Christian Kuhn uploaded patch set 2 05/06/21, 15:09

  2. core-ci voted on patch set 2 V +1 05/06/21, 15:20 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11266

  3. Christian Kuhn uploaded patch set 3 05/06/21, 15:58

  4. core-ci voted on patch set 3 V +1 05/06/21, 16:09 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11267

  5. Benni Mack voted on patch set 3 V +1 CR +1 05/06/21, 18:52

  6. Benjamin Franzke commented on patch set 3 CR -1 05/06/21, 19:23

    CodeMirrorElement.ts:148

    Please provide scrollto and marktext as properties (see @property() in the top of the class) of the CodeMirrorElement. Configuration options for the editor are better placed on the <typo3-t3editor-codemirror> element instead of <textarea> (textarea is the primitive that hols the data, <typo3-t3editor-codemirror> holds settings and config).

    T3editorElement.php:222

    Do these properties really need to be <textarea> attributes? Seems to me they could be added to $settings (which is passed to <typo3-t3editor-codemirror options="…">). I guess the same applies to the new attributes in render().
  7. Benjamin Franzke uploaded patch set 4 05/06/21, 20:48

  8. Benjamin Franzke commented on patch set 4 05/06/21, 20:48

    CodeMirrorElement.ts:140 Unresolved

    Is this change related? Did we have a visual bug here?

    CodeMirrorElement.ts:148 Reply

    Done

    T3editorElement.php:222 Reply

    Done
  9. Benjamin Franzke commented on patch set 4 CR -1 05/06/21, 20:58

    I have to say I do not understand what (static) TCA properties codeMirrorMarkText and codeMirrorScrollTo are good for. I mean, they are not applied conditionally. Marking text or scrolling to a text does only makes sense when you know the text. The RST states: These options are probably used rather seldom in casual TCA, but if needed, they're nice to have. To extend on that. scrollTo and markText and codemirror methods (not options), so they are really not designed to be static values. We at least need to find a reason why we provide these as properties(?), or we should drop that.

    FormEngine.js:351

    Unrelated change? Which bug does this fix? Preparation for using FormEngine.js somewhere different?
  10. core-ci voted on patch set 4 V +1 05/06/21, 21:01 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11272

  11. Andreas Kienast commented on patch set 4 05/09/21, 09:17

    FormEngine.js:351 Reply Unresolved

  12. Christian Kuhn commented on patch set 4 05/12/21, 13:09

    Reply

    In FormEngine context, these properties are not static. The input TCA undergoes a lot of processing hrough the DataProviders - for instance select items from DB relations are put into the initial TCA. Patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/68496 that makes use of these render options uses the 'render' part of FormEngine only. A custom usage within EditDocumentController would probably also add a DataProvider to determine the settings and make them 'dynamic'.
  13. Christian Kuhn uploaded patch set 5 05/12/21, 13:09

  14. core-ci voted on patch set 5 V +1 05/12/21, 13:23 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11437

  15. Benni Mack commented on patch set 5 V +1 CR +1 05/12/21, 15:29

    In general I guess a web component for rendering Textareas with CodeMirror (outside of FormEngine) might be a better fit in the long run, but I think the change is OK for now.
  16. Benjamin Franzke commented on patch set 5 CR -1 05/13/21, 00:09

    Reply Unresolved

    IMHO "A custom usage within EditDocumentController would probably…" is too vague to justify adding this as API. It really sounds like these options should not be API but rather *internal*, if we really, really need these. (but) I actually think the Fake-FormEngine approach, for non-Form views, is really a ugly hack as this is by no means a "Form". I mean, if we couldn't do better, I would probably be fine, but… a) …we need more codemirror + tca adaptions to make this properly usable in the patch you linked: * We need to use a custom line-formatter in order for line-numbers to align across the multiple editors * We need to disable IntersectionObserver (no lazy loading), otherwise auto-scroll does not work * We need to adapt for autoheight using codeMirrors `viewportMargin` setting, see https://codemirror.net/demo/resize.html – this is to be set by javascript via the `Infinity` special value (so not doable via plain TCA codemirror options) * We should show the codemirror panel above instead of below b) …we can do better via direct usage of our codemirror webcomponent: I've worked on a demo based on your Fake-FormEngine approach but with webcomponents instead, link is here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69139 So I think this new "feature" isn't "enough" for the Follow-up change. Therefore I'm against merging this.
  17. Christian Kuhn commented on patch set 5 CR -1 05/13/21, 12:50

    Aligned with benjamin on this: we'll hack that patch into pieces and will solve some parts differently, result will be significantly smaller.
  18. Christian Kuhn uploaded patch set 6 05/19/21, 11:19

  19. core-ci voted on patch set 6 V +1 05/19/21, 11:30 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11669

  20. Oli Bartsch uploaded patch set 7 05/19/21, 11:49

  21. Oli Bartsch voted on patch set 7 V +1 CR +1 05/19/21, 11:50

  22. core-ci voted on patch set 7 V +1 05/19/21, 11:58 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11672

  23. Benjamin Franzke voted on patch set 7 CR +1 05/19/21, 14:15

  24. Benjamin Franzke voted on patch set 7 V +2 CR +2 05/19/21, 14:19

  25. Benjamin Franzke merged patch set 8 05/19/21, 14:20