86723[BUGFIX] Make `GridEditor.writeConfig` update content area as intended
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Andreas Kienast +1
-
Verified V +2 Done
- Benni Mack +2
- Andreas Kienast +1
- core-ci +1 CI
Issues 2
Files 3
Review log 1826
Show 1 earlier messages
-
Ayke Halder uploaded patch set 1 10/23/24, 20:46
-
core-ci voted on patch set 1 V -1 10/23/24, 20:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68486
-
Ayke Halder uploaded patch set 2
V -110/23/24, 21:22 -
core-ci voted on patch set 2 V +1 10/23/24, 21:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68487
-
Ayke Halder uploaded patch set 3
V +110/23/24, 22:09 -
core-ci voted on patch set 3 V +1 10/23/24, 22:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68488
-
Andreas Kienast commented on patch set 3 11/15/24, 10:59
grid-editor.ts:472What kind of syntax is this? -
Andreas Kienast commented on patch set 3 11/15/24, 11:00
grid-editor.ts:472ReplyDo I understand this correctly, that `codemirror.setContent` might be undefined? When is this the case? -
Ayke Halder commented on patch set 3 11/15/24, 13:45
grid-editor.ts:466ReplyIMO this can not be shortened. ``` previewArea.value = ''; if (previewArea && previewArea.value !== undefined) { /* This IS executed. */ } if (previewArea?.value) { /* This is NOT executed. */ } ```grid-editor.ts:472ReplyYup, `setContent` might not exist until the object, which the reference points to, becomes properly initialized. We might instead implement some other check to ensure that `coedmirror` is really a properly initialized and fully working `CodeMirroElement`-object. Technically this is somehow about how `Ref` works - also see commit message: > As LitElement `Ref`-objects are in use, first there is a check for > initialization of the `Ref.value` and then an extra check if the > property/function of the actual object is ready-to-use. -
Andreas Kienast commented on patch set 3 11/18/24, 09:57
grid-editor.ts:466ReplyI think you misunderstood me. My remark was related to the condition branch I've marked, not the whole condition. `if (previewArea?.value !== undefined) {` has IMO the same effect, `?.` evaluates to `undefined` if `previewArea` is not available. -
Ayke Halder uploaded patch set 4
V +111/18/24, 11:04 -
core-ci voted on patch set 4 V -1 11/18/24, 11:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69588
-
Ayke Halder uploaded patch set 5
V -111/18/24, 11:20 -
core-ci voted on patch set 5 V -1 11/18/24, 11:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69589
-
Ayke Halder uploaded patch set 6
V -111/18/24, 12:55 -
core-ci voted on patch set 6 V -1 11/18/24, 13:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69593
-
Ayke Halder uploaded patch set 7
V -111/18/24, 17:24 -
core-ci voted on patch set 7 V -1 11/18/24, 17:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69613
-
Ayke Halder uploaded patch set 8
V -111/18/24, 20:14 -
core-ci voted on patch set 8 V +1 11/18/24, 20:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69623
-
Ayke Halder commented on patch set 8 11/18/24, 20:32
grid-editor.ts:466ReplyThanks, now I see. Your point is valid! But I implemented a check using `instanceof` now.grid-editor.ts:472ReplyI implemented a proper check for the `Ref.value`-construct now: ```js const codemirror: CodeMirrorElement | undefined = this.codeMirrorRef.value; if (codemirror instanceof CodeMirrorElement) { codemirror.setContent(content); } . ``` My implementation before worked, but did not show the intention: ```js const codemirror: CodeMirrorElement | undefined = this.codeMirrorRef.value; codemirror?.setContent?(content); . ``` ---- Just for completeness, **the following code does not work**: See patchset 5 https://review.typo3.org/c/Packages/TYPO3.CMS/+/86723/5 ```js const codemirror: CodeMirrorElement | undefined = this.codeMirrorRef.value; if (codemirror) { codemirror.setContent(content); } . ``` ``` 1) ElementsBasicInputSimpleCest: Simple input fields | "input_1","This is a demo text","This is a demo text","This is a demo text","This is a demo text","" Test Acceptance/Application/FormEngine/ElementsBasicInputSimpleCest.php:simpleInputFields Found following JavaScript errors in the browser console: 11:23:55.554 SEVERE - http://web/_assets/081fa96a07de1dccb64a8a83e1567439/JavaScript/grid-editor.js?bust=82b918eaa2754c05b9ef3bb302d2fbd62938c405 122:429 Uncaught TypeError: i.setContent is not a function . ``` -
Ayke Halder commented on patch set 8 11/18/24, 20:35
This also fixes web-test-runner import-map paths, as otherwise the tests fail. See patchset 6: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86723/6 ``` Sources/TypeScript/backend/tests/grid-editor-test.ts: 🚧 Browser logs: TypeError: Failed to fetch dynamically imported module: http://localhost:8000/Build/Sources/TypeScript/backend/tests/grid-editor-test.ts?wtr-session-id=z-gGdUtIfXE8hWzy3-YBi&wds-import-map=0&wds-import-map=0 ❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information. . ``` -
Andreas Kienast voted on patch set 8 CR +1 V +1 12/11/24, 09:24
-
Benni Mack voted on patch set 8 CR +1 V +1 12/13/24, 13:58
-
Benni Mack voted on patch set 8 CR +2 V +2 12/13/24, 14:23
-
Benni Mack merged patch set 9 12/13/24, 14:23
grid-editor.ts:466