Review main Merged

74067[FEATURE] Introduce TCA type "number"

Nikita Hovratov CR +2 V +2 Expert +1053 −294 updated 04/05/22, 15:25

Commit message

The new type "number" is a replacement for type
"input" with "eval=int" or "eval=double2" set.

With this, the type "input" field is now always a
html "text" field and type "number" is always a
html "number" field.

With the new TCA option "format", a number type can
be defined. Values can be either "integer" (default)
or "decimal". The decimal format replaces the former
"double2" eval value.

In the future, a new option for precision might be
added, in order to dynamically define how many
decimal places should be possible.

The valueSlider has been moved from InputTextElement
to NumberElement, as it makes only sense with a type
number field. Additionally, the JS module is migrated
to a custom element.

Note: There is still the eval="num" option for type
"input" fields. This is solely for the purpose to
ensure only numeric characters are used. Therefore,
this option does not qualify anymore for the "range"
option. The "range" option is now removed altogether
for simple type "input" fields, as it now purely
handles text values.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 38

Show 18 more files

Review log 3247

Show 1222 earlier messages
  1. Nikita Hovratov uploaded patch set 1 03/28/22, 11:07

  2. Nikita Hovratov marked it work in progress 03/28/22, 11:10

  3. core-ci voted on patch set 1 V -1 03/28/22, 11:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25210

  4. Nikita Hovratov uploaded patch set 2 03/30/22, 09:44

  5. core-ci voted on patch set 2 V -1 03/30/22, 09:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25282

  6. Nikita Hovratov uploaded patch set 3 03/30/22, 10:11

  7. core-ci voted on patch set 3 V -1 03/30/22, 10:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25283

  8. Nikita Hovratov uploaded patch set 4 03/30/22, 10:43

  9. core-ci voted on patch set 4 V -1 03/30/22, 10:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25285

  10. Nikita Hovratov uploaded patch set 5 03/30/22, 11:30

  11. core-ci voted on patch set 5 V -1 03/30/22, 11:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25286

  12. Nikita Hovratov uploaded patch set 6 03/30/22, 12:23

  13. core-ci voted on patch set 6 V -1 03/30/22, 12:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25287

  14. Nikita Hovratov uploaded patch set 7 03/30/22, 14:57

  15. core-ci voted on patch set 7 V -1 03/30/22, 15:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25289

  16. Nikita Hovratov uploaded patch set 8 03/30/22, 16:10

  17. core-ci voted on patch set 8 V -1 03/30/22, 16:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25291

  18. Nikita Hovratov uploaded patch set 9 03/30/22, 16:31

  19. core-ci voted on patch set 9 V -1 03/30/22, 16:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25293

  20. Nikita Hovratov uploaded patch set 10 03/30/22, 16:53

  21. core-ci voted on patch set 10 V +1 03/30/22, 17:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25294

  22. Nikita Hovratov commented on patch set 10 03/30/22, 17:03

    This change is ready for review.
  1. Benni Mack commented on patch set 10 03/30/22, 20:49

    QueryGenerator.php:992

    looks like ... doubled? if $fields['type'] == number then $fields['type'] = number
  2. Oli Bartsch uploaded patch set 11 04/01/22, 13:27

  3. core-ci voted on patch set 11 V +1 04/01/22, 13:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25354

  4. Nikita Hovratov commented on patch set 11 04/03/22, 19:42

    QueryGenerator.php:992 Reply

    Technically yes, but it's the same name by coincidence. We need at least the break statement, or it will fall back to "text". So I would say, we write it this way to be more explicit.
  5. Andreas Kienast commented on patch set 11 04/04/22, 10:33

    QueryGenerator.php:992 Reply

    I think you can just drop the assignment here and leave the break as is, with a comment
  6. Andreas Kienast commented on patch set 11 04/04/22, 10:43

    NumberElement.php:127

    [EA] Please consider taking advantage of JSON_THROW_ON_ERROR flag for this call options.
  7. Andreas Kienast commented on patch set 11 CR -1 04/04/22, 10:48

    on it
  8. Andreas Kienast uploaded patch set 12 04/04/22, 10:56

  9. Andreas Kienast voted on patch set 12 V +1 CR +1 04/04/22, 10:57

  10. core-ci voted on patch set 12 V +1 04/04/22, 11:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25394

  11. Oli Bartsch commented on patch set 12 CR -1 04/04/22, 13:50

    On it
  12. Oli Bartsch uploaded patch set 13 04/04/22, 22:10

  13. Oli Bartsch commented on patch set 13 CR -1 04/04/22, 22:10

    Still on it
  14. core-ci voted on patch set 13 V -1 04/04/22, 22:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25460

  15. Oli Bartsch uploaded patch set 14 04/05/22, 12:02

  16. Oli Bartsch commented on patch set 14 04/05/22, 12:05

    NumberElement.php:127 Reply

    Done

    QueryGenerator.php:992 Reply

    Done
  17. Benni Mack commented on patch set 14 04/05/22, 12:07

    sys_workspace.php:118

    I mean, do we need this size field? Imagine a size=50, doesn't seem like a "useful" option for people to configure.
  18. Benni Mack commented on patch set 14 04/05/22, 12:12

    sys_workspace.php:118 Reply

    OK. Let's leave it as is for the time being (just like with the other new types)
  19. core-ci voted on patch set 14 V +1 04/05/22, 12:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25503

  20. Nikita Hovratov uploaded patch set 15 04/05/22, 14:21

  21. Nikita Hovratov commented on patch set 15 V +1 CR +1 04/05/22, 14:25

    Thanks a lot Oli!
  22. core-ci voted on patch set 15 V +1 04/05/22, 14:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25513

  23. Oli Bartsch commented on patch set 15 04/05/22, 14:43

    Corresponding styleguide change https://github.com/TYPO3/styleguide/pull/316
  24. Andreas Kienast voted on patch set 15 V +2 CR +2 04/05/22, 15:25

  25. Andreas Kienast merged patch set 16 04/05/22, 15:25