Review main Merged

75491[TASK] Pass dataset to context menu actions and drop jQuery in them

Andreas Kienast CR +2 V +2 Hard +156 −160 updated 08/19/22, 09:20

Commit message

The context menu module now passes the dataset bound to a context menu
item to the respective callback action, excluding `callback-action` and
`callback-module`.

The context menu items bound to `this` in the respective callback actions
are not required anymore, allowing to ditch jQuery in the
`context-menu-actions` modules. For this reason, binding the context
menu item to `this` is deprecated, usages will trigger a deprecation log
entry in the browser's console.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Benjamin Franzke +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Benjamin Franzke +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 9

Review log 912

  1. Andreas Kienast uploaded patch set 1 08/18/22, 12:28

  2. core-ci voted on patch set 1 V +1 08/18/22, 12:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30270

  3. Andreas Kienast commented on patch set 1 CR -1 08/19/22, 06:13

    On it
  4. Andreas Kienast uploaded patch set 2 08/19/22, 06:27

  5. core-ci voted on patch set 2 V +1 08/19/22, 06:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30287

  6. Benjamin Franzke commented on patch set 2 CR -1 08/19/22, 07:12

    on it

    context-menu.ts:222

    Shouldn't we directly use event.currentTarget.dataset instead? I mean, jQuery .data() does a little more, like type covnersion (string to number), so it seems to be better to use vanilla dataset in order for code to be updated right now and be compatible with usage without jquery later on.

    context-menu.ts:225

    This warning will always be printed, regardless whether this is used or not. Maybe use a Proxy instead?
  7. Benjamin Franzke uploaded patch set 3 08/19/22, 07:20

  8. Benjamin Franzke commented on patch set 3 08/19/22, 07:20

    context-menu.ts:222 Reply

    Done, switched to .dataset. This way also DOMStringMap annotation on the callbacks is more safe. (as written, because .data() performs type conversions)

    context-menu.ts:225 Reply

    Done
  9. core-ci voted on patch set 3 V +1 08/19/22, 07:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30290

  10. Christian Kuhn voted on patch set 3 V +1 CR +1 08/19/22, 09:20

  11. Andreas Kienast voted on patch set 3 V +2 CR +2 08/19/22, 09:20

  12. Andreas Kienast merged patch set 4 08/19/22, 09:20