Review main Merged

67675[TASK] Add <typo3-backend-icon> component

Benjamin Franzke CR +2 V +2 Expert +1337 −114 updated 03/01/21, 10:35

Commit message

The component is provided as replacement for the
current lit-helper `icon()` which cannot provide
support for icon usage inside shadow dom elements.

The component renders all icons as inline SVGs.
FontawesomeIconProvider is therefore adapted
to provide inline rendered SVGs for font-awesome
icons. Not that these inline font-awesome SVGs
will also be used in areas where 'inline' icons are
requested (like information toolbar) but the
fallback to 'default' was used before.

The component supports all properties of the
Icon API via HTML attributes.
Colors and custom sizes can be applied to the
component via CSS color/font-size property:

typo3-backend-icon[identifier=status-dialog-information] {
  color:#6daae0;
  /* An explicit font-size will be used as icon width & height */
  font-size: 1.2em;
}

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Richard Haeser +1
  • Verified V +2 Done
    • Benni Mack +2
    • Richard Haeser +1
    • TYPO3com +1 CI
    • core-ci +1 CI

Issues 1

Files 22

Show 2 more files

Review log 2039

Show 714 earlier messages
  1. Benjamin Franzke uploaded patch set 1 02/09/21, 12:43

  2. TYPO3com voted on patch set 1 V -1 02/09/21, 12:55 Completed build in 11m 26s on Tue, 9 Feb, 12:55 PM Test Summary: 72 of 32838 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9386

  3. core-ci voted on patch set 1 V -1 02/09/21, 12:59 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/524

  4. Benjamin Franzke uploaded patch set 2 02/09/21, 13:52

  5. Benjamin Franzke commented on patch set 2 02/09/21, 13:52

    IconElement.ts:163

    I'm going to drop the font-based rendering fallback. I want to go all-in with SVG icons. Thanks to the added SVG support in FontawesomeIconProvider that is possible without being breaking.

    IconEnums.ts:1 Reply

    Thank you, adapted to the Path you used in your patch. (And added one missing enum, "Sizes.mega")
  6. TYPO3com voted on patch set 2 V -1 02/09/21, 14:00 Completed build in 08m 04s on Tue, 9 Feb, 02:00 PM Test Summary: 48 of 32838 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9394

  7. Benjamin Franzke uploaded patch set 3 02/09/21, 14:01

  8. core-ci voted on patch set 2 V -1 02/09/21, 14:06 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/532

  9. TYPO3com voted on patch set 3 V +1 02/09/21, 14:11 Completed build in 09m 52s on Tue, 9 Feb, 02:11 PM Test Summary: 32597 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9395

  10. core-ci voted on patch set 3 V +1 02/09/21, 14:13 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/533

  11. Benjamin Franzke commented on patch set 3 CR -1 02/09/21, 14:46

    still on it
  12. Benjamin Franzke uploaded patch set 4 02/09/21, 15:01

    Ready for review
  13. TYPO3com voted on patch set 4 V +1 02/09/21, 15:09 Completed build in 08m 14s on Tue, 9 Feb, 03:09 PM Test Summary: 32597 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9399

  1. core-ci voted on patch set 4 V +1 02/09/21, 15:12 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/536

  2. Benjamin Franzke wrote 02/09/21, 16:21

    Topic set to lit
  3. Benjamin Franzke uploaded patch set 5 02/09/21, 20:02

  4. TYPO3com voted on patch set 5 V +1 02/09/21, 20:11 Completed build in 08m 49s on Tue, 9 Feb, 08:11 PM Test Summary: 32597 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9410

  5. core-ci voted on patch set 5 V +1 02/09/21, 20:13 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/548

  6. Benjamin Franzke uploaded patch set 6 02/10/21, 15:24

    Rebase
  7. TYPO3com voted on patch set 6 V +1 02/10/21, 15:33 Completed build in 09m 20s on Wed, 10 Feb, 03:33 PM Test Summary: 32600 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9440

  8. core-ci voted on patch set 6 V +1 02/10/21, 15:42 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/584

  9. Benjamin Franzke uploaded patch set 7 02/10/21, 20:02

    Resolve Merge Conflict
  10. TYPO3com voted on patch set 7 V +1 02/10/21, 20:10 Completed build in 08m 04s on Wed, 10 Feb, 08:10 PM Test Summary: 32600 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9448

  11. core-ci voted on patch set 7 V +1 02/10/21, 20:13 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/605

  12. Oliver Hader commented on patch set 7 02/22/21, 16:32

    IconElement.ts:142

    Where is this used currently? Maybe there should be a comment, how it's used and why it's not a security vulnerability...
  13. Benjamin Franzke commented on patch set 7 CR -1 02/22/21, 18:33

    Will adapt documentation for the `raw` attribute to stress security implications.

    IconElement.ts:142 Reply

    Yea, good point. Should probably document in https://review.typo3.org/c/Packages/TYPO3.CMS/+/67675/7/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Element/IconElement.ts#38 that this has to be used with caution for security reasons and that it is only to be used in order to preserve backwards compatibility, not for "new" code. (marked it internal for that reason, but better to be explicit there) It is used by the upcoming (see relation chain) patch for the ContextMenu where I wanted to use this for "traditional" context menu providers that deliver that icon as raw html within the json response: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67180/8/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/ContextMenu.ts#394 I (also) consider that bad practice, and therefore adapted the core (in that mentioned patch) to deliver only the name of the icon as `iconIdentifier` instead, but in order to ensure backwards compatbility I wanted to provide support for the "old" `icon` html via this raw attribute.
  14. Benjamin Franzke uploaded patch set 8 02/23/21, 20:54

  15. Benjamin Franzke commented on patch set 8 02/23/21, 20:54

    IconElement.ts:142 Reply

    Added information about security implication to the docblock of the `raw` attribute.
  16. TYPO3com voted on patch set 8 V +1 02/23/21, 21:01 Completed build in 07m 18s on Tue, 23 Feb, 09:01 PM Test Summary: 32686 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9683

  17. core-ci voted on patch set 8 V +1 02/23/21, 21:05 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/932

  18. Benni Mack voted on patch set 8 V +1 CR +1 02/25/21, 11:43

  19. Richard Haeser uploaded patch set 9 02/28/21, 10:06

  20. Richard Haeser voted on patch set 9 V +1 CR +1 02/28/21, 10:08

  21. TYPO3com voted on patch set 9 V -1 02/28/21, 10:13 Completed build in 06m 53s on Sun, 28 Feb, 10:13 AM Test Summary: 1 of 32967 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9760

  22. core-ci voted on patch set 9 V +1 02/28/21, 10:18 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1063

  23. TYPO3com voted on patch set 9 V +1 02/28/21, 10:29 Completed build in 06m 05s on Sun, 28 Feb, 10:29 AM Test Summary: 32726 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9762

  24. Benni Mack voted on patch set 9 V +2 CR +2 03/01/21, 10:35

  25. Benni Mack merged patch set 10 03/01/21, 10:35