83743[FEATURE] Combine be_groups table permission read & write UI
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Georg Ringer +1
- Marcin Sągol +1
- Christian Kuhn +1
-
Verified V +2 Done
- Oli Bartsch +2
- Georg Ringer +1
- Marcin Sągol +1
- Christian Kuhn +1
- core-ci +1 CI
Issues 1
Files 13
- Build/Sources/Sass/component/_table.scss2+2 −1
- Build/Sources/TypeScript/backend/form-engine/element/table-permission-element.ts2new+99 −0
- typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php13new+270 −0
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaTablePermission.php2new+55 −0
- typo3/sysext/backend/Classes/Form/NodeFactory.php+1 −0
- typo3/sysext/backend/Resources/Public/Css/backend.css+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine/element/table-permission-element.jsnew+13 −0
- typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaTablePermissionTest.phpnew+204 −0
- typo3/sysext/core/Configuration/TCA/be_groups.php22+5 −16
- typo3/sysext/core/Configuration/DefaultConfiguration.php4+12 −2
- typo3/sysext/core/Documentation/Changelog/13.3/Feature-103521-ChangeTableRestrictionsUiToCombineReadAndWritePermissions.rstnew+65 −0
- typo3/sysext/core/Resources/Private/Language/locallang_tca.xlf+13 −7
- typo3/sysext/core/ext_tables.sql2+5 −0
Review log 215291
Show 192266 earlier messages
-
Marcin Sągol uploaded patch set 1 04/11/24, 10:50
-
core-ci voted on patch set 1 V -1 04/11/24, 10:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55754
-
Marcin Sągol uploaded patch set 2
V -104/11/24, 11:05 -
core-ci voted on patch set 2 V +1 04/11/24, 11:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55758
-
Georg Ringer commented on patch set 2 04/11/24, 11:58
this would be really a feature and needs a rst as it is a bit breaking because in list view now the "table_select" is not possible to show anymore. don't get me wrong, this is not a -1 but should still be told and this is a so important feature that it really deserves a feature!! -
Ayke Halder commented on patch set 2 04/11/24, 12:35
select-check-box-table-permissions-element.ts:86In case you start with state: [select: **checked** | modify: not checked] Now you do: 1. Click `modify` to allow [select: checked & disabled | modify: checked] 2. Click `modify` again to revert [select: **not checked** | modify: not checked] So this is not the best. In this case we must have the state from the beginning: [select: **checked** | modify: not checked] Disabling the `select`-checkbox on `modify` checked is okay. We might change the visual representation of the disabled `select`-checkbox to a visual style 'disabled & checked`. But don't change the internal state of the `select`-checkbox. -
Mathias Brodala commented on patch set 2 04/15/24, 05:53
IMO this is not the best UX. Especially if there is no clear indication why the 1st checkbox is suddenly disabled and not ready for interaction anymore. If we have a setup like this where one selection implies another one, maybe a different UI element should be chosen instead. A custom 3-step switch element would be a better choice since one can see at a glimpse what actions are possible and only have a single object (the knob) to interact with. The closest native alternative would be a HTML "slider" element: > <input type="range" min="0" max="2" step="1" value="0"> -
Ayke Halder commented on patch set 2 04/15/24, 15:14
Reply
There is a discussion on Slack: https://typo3.slack.com/archives/C03AM9R17/p1712832846227209 My opinion: * For UX use simple radio buttons to implement a 3-state-input element. But radio buttons are not trivial to implement here, as the input spans over multiple rows and is finally merged into the two database fields `tables_select` and `tables_modify`. * For easy implementation use a two checkbox solution with two-way coupling. Never deactivate (gray out) any of these boxes: * Click on unchecked modify-box does check both boxes. * Click on checked select-box does uncheck both boxes. -
Mathias Brodala commented on patch set 2 04/16/24, 05:22
Reply
Yeah, this could also work. With this variant the user can at least always interact with all objects and will quickly grasp the indicated behavior. -
Marcin Sągol uploaded patch set 3
V +106/05/24, 09:15 -
Marcin Sągol commented on patch set 3 06/05/24, 09:19
Reply
I have discussed this with UI/UX team and from their perspective it is ok to have the first checkbox disabled. Do you think that we need a better indicator why those checkboxes are disabled, than the current description of this section: Tables chosen for modification automatically receive read access permissions. Therefore, there's no need to select them again for listing. -
core-ci voted on patch set 3 V -1 06/05/24, 09:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58732
-
Ayke Halder uploaded patch set 4
V -106/05/24, 15:22 -
Ayke Halder commented on patch set 4 06/05/24, 15:24
This refactors the code to split up: - preparation of a config array for the checkboxes - rendering of the checkboxes -
Ayke Halder uploaded patch set 5 06/05/24, 15:27
-
core-ci voted on patch set 4 V -1 06/05/24, 15:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58759
-
Ayke Halder commented on patch set 5 06/05/24, 15:28
SelectCheckBoxTablePermissionsElement.php:126This fixes a logic error which was already present in the code from patchset 3. -
core-ci voted on patch set 5 V +1 06/05/24, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58760
-
Ayke Halder uploaded patch set 6 06/05/24, 15:33
Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**") -
core-ci voted on patch set 6 V +1 06/05/24, 15:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58761
-
Ayke Halder uploaded patch set 7
V +106/05/24, 17:24 -
core-ci voted on patch set 7 V +1 06/05/24, 17:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58762
-
Ayke Halder uploaded patch set 8
V +106/05/24, 19:51 -
core-ci voted on patch set 8 V +1 06/05/24, 19:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58763
-
Marcin Sągol uploaded patch set 9
V +106/06/24, 10:35 -
Ayke Halder commented on patch set 9 06/06/24, 10:40
SelectCheckBoxTablePermissionsElement.php:184There is a logic error. This must be: ```php if ($readOnly || ($type === 'select' && $item['modify']['checked'])) { $inputElementAttrs['disabled'] = 'disabled'; } if (!$readOnly) { $inputElementAttrs = array_merge( $inputElementAttrs, str_replace('tables_modify', 'tables_' . $type, $this->getOnFieldChangeAttrs('click', $parameterArray['fieldChangeFunc'] ?? [])) ); } ``` -
core-ci voted on patch set 9 V +1 06/06/24, 10:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58792
-
Marcin Sągol uploaded patch set 10
V +106/06/24, 11:15 -
Marcin Sągol commented on patch set 10 06/06/24, 11:15
SelectCheckBoxTablePermissionsElement.php:184ReplyFixed. -
core-ci voted on patch set 10 V +1 06/06/24, 11:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58794
-
Marcin Sągol commented on patch set 10 06/06/24, 11:27
Reply
@mbrodala@pagemachine.de @mail@ayke-halder.de is it ok for you to close this discussion for now? -
Ayke Halder commented on patch set 9 06/06/24, 11:41
Some suggestions to make the code more readable and maintainable for the future. Also see https://review.typo3.org/c/Packages/TYPO3.CMS/+/83743/5..7SelectCheckBoxTablePermissionsElement.php:30The strings `tables_select`and `tables_modify` are used everywhere in the code as they are the names of the table-fields. Maybe introduce constants and use them: ```php private const FIELD_MODIFY = 'tables_modify'; private const FIELD_SELECT = 'tables_select'; ```SelectCheckBoxTablePermissionsElement.php:31In TS we have some constants: ```TS enum RestrictionType { select = 'select', modify = 'modify', } ``` Maybe also introduce them here and use them in the code: ```php private const RESTRICTION_TYPES = [ SELF::FIELD_MODIFY => 'modify', SELF::FIELD_SELECT => 'select', ]; ```SelectCheckBoxTablePermissionsElement.php:91The values `0` and `1` are only used as boolean and never become part of the html-output. Maybe use boolean `false` and `true` instead.SelectCheckBoxTablePermissionsElement.php:109This very same string replace is used 3 times in the code. Maybe refactor it as an own function: ```php /** * Replace the field tables_modify by the field tables_select * * @param string|string[] $subject * @return string|string[] */ private static function replaceFieldModifyByFieldSelect(array|string $subject): array|string { return str_replace( search: self::FIELD_MODIFY, replace: self::FIELD_SELECT, subject: $subject ); } ```SelectCheckBoxTablePermissionsElement.php:136This very same string replace is used 3 times in the code. See comment above.SelectCheckBoxTablePermissionsElement.php:164Here we are in rendering context of the function. But the following code logic does define all the attributes for the 'select'- and 'modify'-checkbox. Maybe move this logic up to the part where the checkboxes are first defined: ```php // Build item array $groups[$currentGroup]['items'][] = [ 'id' => $elementId . '-item-', … 'select' => […], 'modify' => […], ] ``` Then this part of the function just need to do the rendering - see below: ``` $tableRows[] = '<input ' . GeneralUtility::implodeAttributes($inputElementAttrs, true, true) . '>'; ```SelectCheckBoxTablePermissionsElement.php:171Maybe use constant here as this must be the same string as in the javascript-code. ```php 'data-restriction-type' => self::RESTRICTION_TYPES[$type], ```SelectCheckBoxTablePermissionsElement.php:182This very same string replace is used 3 times in the code. See comment above. Additionaly this replace is only neccessary for `$type === 'select'`. For `$type === 'modify'` it becomes `str_replace('tables_modify', 'tables_modify', …)`. Maybe put the replace inside an `if ($type === 'select') {…}` -
Ayke Halder commented on patch set 10 06/06/24, 11:47
Reply
As you have discussed with UI/UX team, this is the how it will be for now. We might introduce the suggested behaviour in the future by an extra patch like this: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83743/7..8 Who from UI/UX team may I contact on this topic? -
Ayke Halder commented on patch set 10 06/06/24, 13:29
Please have a look at the Commit Message rules: https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/Appendix/CommitMessage.html#commitmessageBullet points should look like: ```md * Bullet points are okay, too * An asterisk (`*`) is used for the bullet, it can be followed by a single space. This format is rendered correctly by Forge (redmine) * Use a hanging indent ```This line is to long, just wrap it to 72 characters. -
Ayke Halder commented on patch set 10 CR -1 06/06/24, 14:15
Impact of missing ARIA labels: * Before this patch: You can click on the title (`<label>`-tag) to change the checkbox value. * With this patch: The title can not be associtated with one specific checkbox, thereby you can not click anmyore on the title to change the checkbox. So you must click directly on the checkbox now. --- Besides the missing feature above, the ARIA label connection to the checkboxes is broken right now and must be fixed: Sorry, this would take to much effort to comment each line of the code which needs to be changed. So here is a suggested patch: ```diff diff --git a/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php b/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php --- a/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php (revision 42751e8d70c3ccca2f34d21af96561085c4a72f1) +++ b/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php (date 1717682144845) @@ -100,7 +100,7 @@ // Build item array $groups[$currentGroup]['items'][] = [ - 'id' => $elementId . '-item-', + 'id' => $elementId . '-item-' . $counter, 'value' => $item['value'], 'icon' => FormEngineUtility::getIconHtml(!empty($item['icon']) ? $item['icon'] : 'empty-empty'), 'title' => $item['label'], @@ -158,14 +158,15 @@ $tableRows = []; // Render rows - foreach ($group['items'] as $itemNumber => $item) { + foreach ($group['items'] as $item) { $tableRows[] = '<tr>'; foreach (['select', 'modify'] as $type) { $inputElementAttrs = [ 'type' => 'checkbox', 'class' => 't3js-checkbox', - 'id' => $item['id'] . $itemNumber . '-tables_' . $type, + 'id' => $item['id'] . '-tables_' . $type, + 'aria-labelledby' => $item['id'] . '-label', 'name' => $item[$type]['name'], 'value' => $item['value'], 'data-restriction-type' => $type, @@ -190,7 +191,7 @@ } $tableRows[] = '<td class="col-title">'; - $tableRows[] = '<label class="label-block nowrap-disabled" for="' . $item['id'] . '">'; + $tableRows[] = '<label class="label-block nowrap-disabled" id="' . $item['id'] . '-label">'; $tableRows[] = '<span class="inline-icon">' . $item['icon'] . '</span>'; $tableRows[] = htmlspecialchars($this->appendValueToLabelInDebugMode($item['title'], $item['value']), ENT_COMPAT, 'UTF-8', false); $tableRows[] = '</label>'; ```SelectCheckBoxTablePermissionsElement.php:193This ARIA label to checkbox connection is broken. ```html <tr> <td class="col-checkbox"> <input type="checkbox" id="formengine-select-checkbox-666198c06f8d7177057673-item-0-tables_select" …> </td> <td class="col-checkbox"> <input type="checkbox" id="formengine-select-checkbox-666198c06f8d7177057673-item-0-tables_modify" …> </td> <td class="col-title"> <label … for="formengine-select-checkbox-666198c06f8d7177057673-item-"> … Page </label> </td> <td class="text-end"></td> </tr> ``` -
Ayke Halder commented on patch set 10 06/06/24, 14:26
Suggestion on missing click on title/label functionality: See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby > Note that while using aria-labelledby is similar in this situation to using an HTML <label> element with the for attribute, there are some very important differences. The aria-labelledby attribute only defines the accessible name. It doesn't provide any of <label>'s other functionality, such as making clicking on the labeling element activate the input it is associated with. That has to be added back in with JavaScript. Add a JS-action for click on title which circles through this 3 states: * O select / O modify * X select / O modify * X select / X modify -
Michael Telgkamp commented on patch set 10 V -1 06/07/24, 05:30
Some additional remarks from accessibility point of view: - Having one checkbox change content/states BEFORE the checkbox itself is unwanted, would it be possible to switch positions of the checkboxes? If Write access is the first column, the second checkbox with read access comes afterwards and is not announced again when the "write" is checked already. - The table header for the second column should not be colspan="2" because this would have the header logically connected to the name column. Please add an additional header for this column. - The labelling of the checkboxes is not sufficient. An alternative to the suggestions already mentioned would be to use the text content of the table headers for labelling by adding them as additional value in the `aria-labelledby` attribute. For this the table header elements containing "Read" and "Write" needs to have an `id` and the `aria-labelledby` would then be something like `aria-labelledby="formengine-select-header-read-SOMEUID formengine-select-checkbox-666198c06f8d7177057673-item-0-label"` There are more accessibility issues with this table, but I addressed the ones introduced by this patch. -
Marcin Sągol uploaded patch set 11
CR -1V +106/08/24, 13:30 -
Marcin Sągol commented on patch set 10 06/08/24, 13:30
Reply
I usually talk with @rfoucard@w-seils.com and @erredeco@gmail.comSelectCheckBoxTablePermissionsElement.php:30ReplyDoneSelectCheckBoxTablePermissionsElement.php:31ReplyDoneSelectCheckBoxTablePermissionsElement.php:91ReplyDoneSelectCheckBoxTablePermissionsElement.php:109ReplyDoneSelectCheckBoxTablePermissionsElement.php:136ReplyDoneSelectCheckBoxTablePermissionsElement.php:171ReplyI think just $type can be used as now we iterate over and constant array: foreach (self::RESTRICTION_TYPES as $type) { ... }SelectCheckBoxTablePermissionsElement.php:182ReplyDone -
core-ci voted on patch set 11 V -1 06/08/24, 13:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58914
-
Marcin Sągol uploaded patch set 12
V -106/08/24, 14:50 -
Marcin Sągol commented on patch set 11 06/08/24, 14:51
SelectCheckBoxTablePermissionsElement.php:164ReplyI have changed the code, to define whole checkbox element (modify and select) in one place, than just render both checkboxes with GeneralUtility::implodeAttributes(). -
Marcin Sągol updated the commit message in patch set 13 06/08/24, 14:53
-
core-ci voted on patch set 12 V +1 06/08/24, 14:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58915
-
core-ci voted on patch set 13 V +1 06/08/24, 15:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58916
-
Marcin Sągol uploaded patch set 14
V +106/08/24, 17:37 -
core-ci voted on patch set 14 V +1 06/08/24, 17:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58924
-
Marcin Sągol commented on patch set 13 06/08/24, 17:42
Reply
I have implemented this solution. So now the aria-labelledby value is a concatenation of a column header Read/Write + table name which comes from column with table title value.SelectCheckBoxTablePermissionsElement.php:193ReplyI have implemented solution proposed by @michael.telgkamp@mindscreen.de. The column header + field title is used to have the aria-labelledby value defined. -
Marcin Sągol commented on patch set 14 06/08/24, 17:44
select-check-box-table-permissions-element.ts:86ReplyThey should not be changed now. -
Simon Schaufelberger updated the commit message in patch set 15
V +106/08/24, 19:36 -
core-ci voted on patch set 15 V +1 06/08/24, 19:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58927
-
Marcin Sągol uploaded patch set 16
V +106/08/24, 20:10 -
core-ci voted on patch set 16 V +1 06/08/24, 20:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58928
-
Georg Ringer voted on patch set 16 CR +1 V +1 06/09/24, 08:18
-
Ayke Halder commented on patch set 16 CR -1 06/10/24, 07:57
Please have a look at ARIA labeling.SelectCheckBoxTablePermissionsElement.php:33Comment not needed anymore - order is set below.SelectCheckBoxTablePermissionsElement.php:145About comment above: order is set here.SelectCheckBoxTablePermissionsElement.php:146No use of constants here but use of constants below.SelectCheckBoxTablePermissionsElement.php:200Use of constant here but no use of constant above.SelectCheckBoxTablePermissionsElement.php:202A11y: This is not the label for the checkbox anymore. The new label is already the table column-header. Defined via `aria-labelledby`-attribute of the checkbox. -
Marcin Sągol uploaded patch set 17
CR +1V +106/10/24, 08:48 -
Marcin Sągol commented on patch set 16 06/10/24, 08:48
SelectCheckBoxTablePermissionsElement.php:33ReplyDoneSelectCheckBoxTablePermissionsElement.php:145ReplyDoneSelectCheckBoxTablePermissionsElement.php:146ReplyDoneSelectCheckBoxTablePermissionsElement.php:200ReplyDoneSelectCheckBoxTablePermissionsElement.php:202ReplyDone -
Marcin Sągol uploaded patch set 18 06/10/24, 08:53
-
core-ci voted on patch set 17 V -1 06/10/24, 08:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58984
-
core-ci voted on patch set 18 V +1 06/10/24, 08:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58985
-
Marcin Sągol rebased onto patch set 19
V +106/10/24, 09:01 -
core-ci voted on patch set 19 V +1 06/10/24, 09:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58986
-
Michael Telgkamp commented on patch set 19 CR -1 06/10/24, 09:44
We are on the sprint in DUS and plan to have a deeper look into it. Also some consolidation with the layout other table views is planned. Probably there will also be some connected additional tickets for more improvements. -
Ayke Halder commented on patch set 19 06/10/24, 10:21
Reply
May we get this here merged without fixing the a11y implications of the table header? The table header-columns on all these permission/data-record tables are a11y-broken right now. The header-columns are used for this checkbox "toggle/select all" and therefor they actually do not associate correctly with the colums of the table. Also see: https://typo3.slack.com/archives/C027S88NY/p1718013691585059?thread_ts=1718012218.748539&cid=C027S88NY I think we can fix these header-columns after merging this one here. -
Marcin Sągol uploaded patch set 20
CR -1V +106/10/24, 10:25 -
core-ci voted on patch set 20 V +1 06/10/24, 10:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58989
-
Ayke Halder commented on patch set 19 06/10/24, 10:39
The functionality is working perfectly! Just some minor nitpick: Boolean HTML attributes need the correct string values: Right now `true` typecasts to string "1". `$tableModifyElement['checked'] = true;` results in `<input checked="1">` For `true` it should be either an empty string `<input checked="">` or the attribute name repeated `<input checked="checked">` (The third option to use an attribute without a value at all like `<input checked>` is not possible by using `GeneralUtility::implodeAttributes()`.) Same for the `disabled`-attribute. See https://developer.mozilla.org/en-US/docs/Glossary/Boolean/HTML > Note: The strings "true" and "false" are invalid values. To set the attribute to false, the attribute should not be present in the element tag. Though modern browsers treat any string value as true, you should not rely on that behavior. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#checked https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabledSelectCheckBoxTablePermissionsElement.php:115Should be either `$tableModifyElement['checked'] = "";` or `$tableModifyElement['checked'] = "checked";`SelectCheckBoxTablePermissionsElement.php:118Should be either `$tableModifyElement['disabled'] = "";` or `$tableModifyElement['disabled'] = "disabled";`SelectCheckBoxTablePermissionsElement.php:128See above.SelectCheckBoxTablePermissionsElement.php:131See above. -
Michael Telgkamp commented on patch set 20 CR -1 06/10/24, 10:39
I found a mixup of the IDs used. This needs to be fixed.SelectCheckBoxTablePermissionsElement.php:111Table modify element is for Modification / Write access. Thus the $writeColumnId needs to be used here.SelectCheckBoxTablePermissionsElement.php:125Here the $readColumnId needs to be used -
Marcin Sągol uploaded patch set 21
CR -1V +106/10/24, 11:39 -
Marcin Sągol commented on patch set 20 06/10/24, 11:39
SelectCheckBoxTablePermissionsElement.php:115ReplyDoneSelectCheckBoxTablePermissionsElement.php:118ReplyDoneSelectCheckBoxTablePermissionsElement.php:128ReplyDoneSelectCheckBoxTablePermissionsElement.php:131ReplyDone -
Marcin Sągol uploaded patch set 22 06/10/24, 11:42
-
Marcin Sągol commented on patch set 21 06/10/24, 11:42
SelectCheckBoxTablePermissionsElement.php:111ReplyDoneSelectCheckBoxTablePermissionsElement.php:125ReplyDone -
core-ci voted on patch set 21 V +1 06/10/24, 11:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58998
-
core-ci voted on patch set 22 V +1 06/10/24, 11:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58999
-
Michael Telgkamp commented on patch set 22 CR +1 V +1 06/10/24, 12:12
Reply
The problem I see here is, that the text is no longer the (only part of the) label. Implementing this additional behavior would not be expected, as toggling multiple checkboxes with one part of a label is not intuitive, and keyboard interactivity for the "label" would also be required. Having a third interactive element for each row would not be helpful.Reply
I would not like to have this change in the patch (as explained in the other comment). -
Ayke Halder commented on patch set 22 CR -1 06/10/24, 12:53
A11y: make screenreaders read the row-title after the checkbox-label See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/rowheader_role By adding `role="rowheader"` to the title column, we get a pretty nice screenreader readout. Without this: * "Checkbox Read not checked" -> [Tab] * "Checkbox Write not checked" -> [Tab] * "Checkbox Read not checked" -> [Tab] * "Checkbox Write not checked" -> [Tab] * "Checkbox Read not checked" -> [Tab] * "Checkbox Write not checked" -> [Tab] With `role="rowheader"` set: * "Checkbox Read Page not checked" -> [Tab] * "Checkbox Write Page not checked" -> [Tab] * "Checkbox Read Category not checked" -> [Tab] * "Checkbox Write Category not checked" -> [Tab] * "Checkbox Read File not checked" -> [Tab] * "Checkbox Write File not checked" -> [Tab]SelectCheckBoxTablePermissionsElement.php:200Change `<td class="col-title">` to `<td class="col-title" role="rowheader">` -
Ayke Halder commented on patch set 22 CR +1 V +1 06/10/24, 13:01
All and everything looks perfect now! Great job on this!Reply
Actually also works without setting `role="rowheader"` - no need to add this.SelectCheckBoxTablePermissionsElement.php:200ReplyActually also works without setting `role="rowheader"` - no need to add this. -
Georg Ringer commented on patch set 22 CR +1 V +1 06/10/24, 13:19
can you please provide a feature.rst and change back to FEATURE? for integrators this is a sooooo nice feature which should really not get lost!!! -
Andreas Kienast commented on patch set 22 CR -1 06/10/24, 13:26
SelectCheckBoxTablePermissionsElement.php:2declare(strict_types=1) is missing -
Ayke Halder commented on patch set 22 V 0 CR -1 06/10/24, 14:00
SelectCheckBoxTablePermissionsElement.php:101We can't have any attribute here, which must not become part of the HTML code. So we might need to reintroduce the use of the item-object for these attributes: * `$item['icon']` * `$item['title']` * `$item['help']` Current-state: ```html <td class="col-checkbox"> <input type="checkbox" class="t3js-checkbox" id="formengine-select-checkbox-666702aea43a9867435772-item-1-tables_select" value="sys_category" name="data[be_groups][2][tables_select][1]" data-restriction-type="select" aria-labelledby="formengine-select-header-read-666702aea439f540540775 formengine-select-checkbox-666702aea43a9867435772-item-1-tables_select" checked="checked" data-formengine-field-change-event="click" data-formengine-field-change-items="[{"name":"typo3-backend-form-update-value","data":{"tableName":"be_groups","identifier":"2","fieldName":"tables_select","elementName":"data[be_groups][2][tables_select]"}}] <!-- these attributes must be removed --> icon="<span class="t3js-icon icon icon-size-small icon-state-default icon-mimetypes-x-sys_category" data-identifier="mimetypes-x-sys_category" aria-hidden="true"> <span class="icon-markup"> <svg class="icon-color"><use xlink:href="/typo3/sysext/core/Resources/Public/Icons/T3Icons/sprites/mimetypes.svg#mimetypes-x-sys_category" /></svg> </span> </span>" title="Category" help=""> </td> ``` -
Marcin Sągol uploaded patch set 23
CR +1V +106/10/24, 14:03 -
Marcin Sągol commented on patch set 23 06/10/24, 14:04
SelectCheckBoxTablePermissionsElement.php:2ReplyDone -
Marcin Sągol commented on patch set 23 06/10/24, 14:07
SelectCheckBoxTablePermissionsElement.php:101ReplyWould it be ok if we filter them out from $tableModifyElement before rendering attributes? -
core-ci voted on patch set 23 V +1 06/10/24, 14:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59015
-
Marcin Sągol uploaded patch set 24
V +106/10/24, 14:23 -
Marcin Sągol commented on patch set 23 06/10/24, 14:25
SelectCheckBoxTablePermissionsElement.php:101ReplyTo distinguish the attributes form the other settings, I have put them (attributes) inside the separate array. -
core-ci voted on patch set 24 V +1 06/10/24, 14:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59016
-
Ayke Halder commented on patch set 23 06/10/24, 14:31
SelectCheckBoxTablePermissionsElement.php:101ReplyTo go with the idea of having no item-object: ```php $groups[$currentGroup]['items'][] = [ self::RESTRICTION_TYPES[self::FIELD_SELECT] => $tableSelectElement, self::RESTRICTION_TYPES[self::FIELD_MODIFY] => $tableModifyElement, 'config' => [ 'title' => …, 'icon' => …, 'value' => …, 'help' => …, ] ]; ``` May we add a title-element like this there? With: ```php foreach ($group['items'] as $modifySelectElements) { $tableRows[] = '<tr>' // TODO: re-add comment about order to self::RESTRICTION_TYPES foreach (self::RESTRICTION_TYPES as $type) { $tableRows[] = '<td class="col-checkbox">'; $tableRows[] = '<input ' . GeneralUtility::implodeAttributes($modifySelectElements[$type], true, true) . '>'; $tableRows[] = '</td>'; } $tableRows[] = '<td class="col-title">'; $tableRows[] = '<span class="inline-icon">' . $$modifySelectElements['config']['icon'] . '</span>'; $tableRows[] = htmlspecialchars($this->appendValueToLabelInDebugMode($modifySelectElements['config']['title'], $modifySelectElements['config']['value']), ENT_COMPAT, 'UTF-8', false); $tableRows[] = '</td>'; $tableRows[] = '<td class="text-end">' . $modifySelectElements['config']['help'] . '</td>'; $tableRows[] = '</tr>'; ``` And we actually need to keep the 'title' attribute for the checkboxes or otherwise change `aria-labelledby="$writeColumnId . ' ' . $titleLabelId"` - and add this id to the title-label. -
Ayke Halder commented on patch set 24 06/10/24, 15:09
SelectCheckBoxTablePermissionsElement.php:101ReplyAbout this added sub-key 'attributes' - this results in this data structure: ``` php $groups[$currentGroup]['items'][] = [ 'select' => [ 'attributes' => [ // <-- used for select-checkbox only 'type' => …, 'class' => …, 'id' => …, 'value' => …, 'name' => …, 'data-restriction-type' => …, 'aria-labelledby' => …, ], 'icon' => …, // <-- not used anywhere 'title' => …, // <-- not used anywhere 'help' => …, // <-- not used anywhere ], 'modify' => [ 'attributes' => [ // <-- used for modify-checkbox and partly for col-label 'type' => …, 'class' => …, 'id' => …, 'value' => …, // <-- used for modify-checkbox and also for col-label 'name' => …, 'data-restriction-type' => …, 'aria-labelledby' => …, ], 'icon' => …, // <-- only used for col-label 'title' => …, // <-- only used for col-label 'help' => …, // <-- only used for col-help ], ]; ``` ---- IMHO would rather go for a data-structure similar to this: ```php $groups[$currentGroup]['items'][] = [ 'select' => [ // <-- used for select-checkbox only 'type' => …, 'class' => …, 'id' => …, 'value' => …, 'name' => …, 'data-restriction-type' => …, 'aria-labelledby' => …, ], 'modify' => [ // <-- used for modify-checkbox only 'type' => …, 'class' => …, 'id' => …, 'value' => …, 'name' => …, 'data-restriction-type' => …, 'aria-labelledby' => …, ], 'label' => [ // <-- used for col-label only 'value' => …, 'icon' => …, 'title' => …, ], 'help' => …, // <-- used for col-help only ]; ``` -
Marcin Sągol uploaded patch set 25
V +106/10/24, 15:34 -
Marcin Sągol commented on patch set 24 06/10/24, 15:36
SelectCheckBoxTablePermissionsElement.php:101ReplyI have used the second approach, so for each item we now have an array with select, modify, label and help keys. -
core-ci voted on patch set 25 V +1 06/10/24, 15:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59041
-
Ayke Halder commented on patch set 25 06/10/24, 17:09
We need to fix the attribute `aria-labelledby` for the checkboxes as the checkboxes do not have the attribute `title` anymore. Maybe re-introduce the `label`-tag in the label-column and reference to this. Thereby the `id`-attributes of the checkboxes become obsolete. ```patch diff --git a/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php b/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php --- a/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php (revision 90ca01e48c8ccf9bc1dd574295442a36bfc0cd2d) +++ b/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php (date 1718039000405) @@ -67,7 +67,7 @@ $currentGroup = 0; $counter = 0; // Those ids are needed to generate combined aria-labelledby attribute for the checkboxes. - // The aria-labelledby value will be a concatenation of this id field and the field label itself. + // The aria-labelledby value will be a concatenation of this id field and the elements label id. $readColumnId = StringUtility::getUniqueId('formengine-select-header-read-'); $writeColumnId = StringUtility::getUniqueId('formengine-select-header-write-'); $elementIdPrefix = StringUtility::getUniqueId('formengine-select-checkbox-'); @@ -86,6 +86,8 @@ continue; } + $labelId = $elementIdPrefix . '-item-' . $counter . '-label'; + // Help text is expected to be an associative array with two keys: "title" and "description". // For the sake of backwards compatibility, we test if the help text is a string and use it // as a description (this could happen if items are modified with an itemProcFunc) @@ -98,16 +100,14 @@ $checkedForModify = isset($itemArrayModify[$item['value']]); $checkedForSelect = $checkedForModify || isset($itemArraySelect[$item['value']]); - $checkboxModifyId = $elementIdPrefix . '-item-' . $counter . '-' . self::FIELD_MODIFY; // Build configuration array for related checkboxes elements (the table_modify and table_select fields) $tableModifyElementAttrs = [ 'type' => 'checkbox', 'class' => 't3js-checkbox', - 'id' => $checkboxModifyId, 'value' => $item['value'], 'name' => $parameterArray['itemFormElName'] . '[' . $counter . ']', 'data-restriction-type' => self::RESTRICTION_TYPES[self::FIELD_MODIFY], - 'aria-labelledby' => $writeColumnId . ' ' . $checkboxModifyId, + 'aria-labelledby' => $writeColumnId . ' ' . $labelId, ]; if ($checkedForModify) { @@ -118,10 +118,9 @@ } $tableSelectElementAttrs = $tableModifyElementAttrs; - $tableSelectElementAttrs['id'] = self::replaceFieldModifyByFieldSelect($tableSelectElementAttrs['id']); $tableSelectElementAttrs['name'] = self::replaceFieldModifyByFieldSelect($parameterArray['itemFormElName'] . '[' . $counter . ']'); $tableSelectElementAttrs['data-restriction-type'] = self::RESTRICTION_TYPES[self::FIELD_SELECT]; - $tableSelectElementAttrs['aria-labelledby'] = $readColumnId . ' ' . self::replaceFieldModifyByFieldSelect($tableSelectElementAttrs['id']); + $tableSelectElementAttrs['aria-labelledby'] = $readColumnId . ' ' . $labelId; if ($checkedForSelect) { $tableSelectElementAttrs['checked'] = 'checked'; @@ -143,6 +142,7 @@ self::RESTRICTION_TYPES[self::FIELD_SELECT] => $tableSelectElementAttrs, self::RESTRICTION_TYPES[self::FIELD_MODIFY] => $tableModifyElementAttrs, 'label' => [ + 'id' => $labelId, 'icon' => FormEngineUtility::getIconHtml(!empty($item['icon']) ? $item['icon'] : 'empty-empty'), 'title' => $item['label'], 'value' => $item['value'], @@ -201,10 +201,11 @@ $tableRows[] = '<input ' . GeneralUtility::implodeAttributes($modifySelectElements[$restrictionType], true, true) . '>'; $tableRows[] = '</td>'; } - $modifyElementConfig = $modifySelectElements[self::RESTRICTION_TYPES[self::FIELD_MODIFY]]; $tableRows[] = '<td class="col-title">'; - $tableRows[] = '<span class="inline-icon">' . $modifySelectElements['label']['icon'] . '</span>'; - $tableRows[] = htmlspecialchars($this->appendValueToLabelInDebugMode($modifySelectElements['label']['title'], $modifySelectElements['label']['value']), ENT_COMPAT, 'UTF-8', false); + $tableRows[] = '<label class="label-block nowrap-disabled" id="' . $modifySelectElements['label']['id'] . '">'; + $tableRows[] = '<span class="inline-icon">' . $modifySelectElements['label']['icon'] . '</span>'; + $tableRows[] = htmlspecialchars($this->appendValueToLabelInDebugMode($modifySelectElements['label']['title'], $modifySelectElements['label']['value']), ENT_COMPAT, 'UTF-8', false); + $tableRows[] = '</label>'; $tableRows[] = '</td>'; $tableRows[] = '<td class="text-end">' . $modifySelectElements['help'] . '</td>'; $tableRows[] = '</tr>'; ```SelectCheckBoxTablePermissionsElement.php:204`$modifyElementConfig = $modifySelectElements[…];` can be removed. -
Marcin Sągol uploaded patch set 26
V +106/10/24, 17:46 -
Marcin Sągol commented on patch set 25 06/10/24, 17:46
SelectCheckBoxTablePermissionsElement.php:204ReplyDone -
core-ci voted on patch set 26 V +1 06/10/24, 17:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59063
-
Ayke Halder commented on patch set 26 CR +1 V +1 06/10/24, 18:06
All and everything really looks perfect now! Again, great job! 🎉 Everyone - please review. -
Michael Telgkamp commented on patch set 26 CR +1 V +1 06/10/24, 19:11
Thank you for the patch and the good additional improvements! -
Michael Telgkamp commented on patch set 26 CR -1 06/11/24, 07:46
I will adjust the title of the feature to make it more clear. -
Michael Telgkamp uploaded patch set 27
CR +1V +106/11/24, 07:54 -
Michael Telgkamp commented on patch set 27 CR +1 V +1 06/11/24, 07:55
Only adjusted title of patch and inside rst -
Ayke Halder commented on patch set 27 CR -1 06/11/24, 08:00
Reply
Should the title not be more clear about the fact that this is an UI change only and does not change anything about the underlying implementation of the permission table? E.g. "[FEATURE] Change table restrictions UI to combine read and write permissions" -
Ayke Halder commented on patch set 27 CR +1 V +1 06/11/24, 08:09
Reply
Resolved: The title as-is is percieved as sufficient. -
core-ci voted on patch set 27 V +1 06/11/24, 08:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59125
-
Andreas Kienast commented on patch set 27 06/11/24, 10:02
I personally do not like that when I accidentally click "write" for the wrong table, I have to uncheck two checkboxes now. This feels cumbersome and that's nothing I'd expect. -
Georg Ringer commented on patch set 27 06/11/24, 20:01
Reply
I really like it but understand that there is now more to click to get rid of it. as suggestion: what about if the read is not disabled and if it is checked and it is clicked, it unchecks both checkboxes? so just like with write -
Ayke Halder commented on patch set 27 06/11/24, 21:32
Reply
@a.fernandez@scripting-base.de On the idea of clicking the "write" checkbox on accident, click again and then also revert the "read" checkbox state to the old state, please also have a look at these comments: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83743/comment/1a237347_20b5023a/ > [The checkboxes] should not be changed now. ---- @georg.ringer@gmail.com On the idea of clicking the disabled read checkbox to uncheck both checkboxes, please also have a look at these comments: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83743/comment/6a914294_68b55be2/ > I have discussed this with UI/UX team and from their perspective it is ok to have the first checkbox disabled. > [It has been] discussed [internaly] with UI/UX team, this is the how it will be for now. > We might introduce the suggested behaviour in the future by an extra patch like this: > https://review.typo3.org/c/Packages/TYPO3.CMS/+/83743/7..8 -
Jasmina Ließmann rebased onto patch set 28
CR +1V +106/12/24, 09:52 -
Jasmina Ließmann commented on patch set 28 V -1 06/12/24, 09:56
The multi record selection has been updated (please see https://review.typo3.org/c/Packages/TYPO3.CMS/+/84602). This patch uses the old implementation in 'selectCheckBoxTablePermissions' and needs to be adapted. -
Jasmina Ließmann commented on patch set 28 06/12/24, 09:59
Reply
I accidentally marked the answer as "solved". But it is unsolved. -
core-ci voted on patch set 28 V +1 06/12/24, 09:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59304
-
Marcin Sągol commented on patch set 28 06/12/24, 10:09
Reply
I will take a look and update it. -
Marcin Sągol commented on patch set 28 06/12/24, 13:52
Reply
How should those checkboxes behave when the Toggle Selection option is clicked? We now have 3 possible states/combinations for Read and Write checkbox pair: 1. Checked + Disabled / Checked 2. Checked / Not Checked 3. Not Checked / Not Checked Now if we click the Toggle Selection option, we will have: 1. Not Checked / Not Checked 2. Checked + Disabled / Checked 3. Checked + Disabled / Checked Next Toggle Selection click and we will end up with: 1. Checked + Disabled / Checked 2. Not Checked / Not Checked 3. Not Checked / Not Checked And from now on if we do not change anything manually but click the Toggle Selection, the states will be toggled the same way as the logic forces that if the Write checkbox gets selected, the previous one also will be selected (and disabled). So for example for a current state: Checked / Not Checked we will never go back to it after first click on Toggle Selection. It will be: Checked / Not Checked -> Checked + Disabled / Checked -> Not Checked / Not Checked -> Checked + Disabled / Checked ... -
Marcin Sągol uploaded patch set 29
V +106/12/24, 14:30 -
Rachel Foucard commented on patch set 28 06/12/24, 14:33
Reply
I don't think that a toggle option is relevant in this situation: It is possible to toggle something that has only 2 possible states not 3. even if we propose checkboxes in the UI, the reality is that we ask for 3 possible choices: - no permission - read only - write Even if a select box or a radio button would better fit for the logic, I prefer the checkboxes because they are easier to handle than the select box, and they use less space than 3 radio buttons. However, a toggle is not logical when we have 3 possible choices. -
core-ci voted on patch set 29 V -1 06/12/24, 14:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59338
-
Michael Telgkamp commented on patch set 29 06/12/24, 14:37
Reply
I have added a new UI suggestion in http://forge.typo3.org/issues/103521#note-35. Having this we could have a new "toggle" selector with the options "No for all", "Read for all" and "Read & write for all". -
Ayke Halder commented on patch set 29 CR -1 06/12/24, 18:34
If we implement multi-record-select like it is now, all the checkboxes belong to one group. That is not how we need it. E.g. multi-select via * "click" on first "read"-checkbox * then `[Shift]` + "click" on another "read"-checkbox further down This results in also selecting the "write"-checkboxes. But it should only select the "read"-checkboxes. ---- As we have two groups of checkboxes - `select` and `modify` - we need to introduce two groups and add each checkbox to the correct group. Then also add two "toggle-all"-action-checkboxes to the header. TODO: unchecking all "read"-checkboxes via "toggle-all" does not uncheck the "write"-checkboxes. Now there is need for a 2-way-coupling of the checkboxes. ``` diff --git a/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php b/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php --- a/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php (revision c9dc8981d07e377674ff4d4b18390eaf3486f15a) +++ b/typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxTablePermissionsElement.php (date 1718216256912) @@ -178,7 +178,7 @@ $hasGroupHeader = is_array($group['header'] ?? false); - $html[] = '<div id="' . $groupId . '" class="panel panel-default" data-multi-record-selection-identifier="' . $groupId . '">'; + $html[] = '<div id="' . $groupId . '" class="panel panel-default">'; if ($hasGroupHeader) { $html[] = '<div class="panel-heading">'; $html[] = '<a data-bs-toggle="collapse" href="#' . $groupCollapsibleId . '" aria-expanded="false" aria-controls="' . $groupCollapsibleId . '">'; @@ -194,9 +194,9 @@ // with two keys: 'modify' and 'select' containing the configuration for the // table_modify and table_select HTML checkbox elements foreach ($group['items'] as $modifySelectElements) { - $tableRows[] = '<tr data-multi-record-selection-element="true">'; + $tableRows[] = '<tr>'; foreach (self::RESTRICTION_TYPES as $restrictionType) { - $tableRows[] = '<td class="col-checkbox">'; + $tableRows[] = '<td class="col-checkbox" data-multi-record-selection-identifier="' . $groupId . '-' . $restrictionType . '" data-multi-record-selection-element="true">'; $tableRows[] = '<span class="form-check form-check-type-toggle">'; $tableRows[] = '<input ' . GeneralUtility::implodeAttributes($modifySelectElements[$restrictionType], true, true) . '>'; $tableRows[] = '</span>'; @@ -226,13 +226,15 @@ // Add table header with actions, in case the element is not readOnly $html[] = '<thead>'; $html[] = '<tr role="none">'; - $html[] = '<th class="col-checkbox" colspan="2">' . $this->getRecordSelectionCheckActions() . '</th>'; - $html[] = '<th class="col-title" colspan="2">' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.th.name')) . '</th>'; + foreach (self::RESTRICTION_TYPES as $restrictionType) { + $html[] = '<th class="col-checkbox" data-multi-record-selection-identifier="' . $groupId . '-' . $restrictionType . '">' . $this->getRecordSelectionCheckActions() . '</th>'; + } + $html[] = '<th colspan="2"></th>'; $html[] = '</tr>'; $html[] = '<tr>'; $html[] = '<th id="' . $readColumnId . '">' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.tables.read')) . '</th>'; $html[] = '<th id="' . $writeColumnId . '">' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.tables.write')) . '</th>'; - $html[] = '<th></th>'; + $html[] = '<th class="col-title">' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.th.name')) . '</th>'; $html[] = '<th></th>'; $html[] = '</tr>'; $html[] = '</thead>'; ``` -
Michael Telgkamp commented on patch set 29 06/12/24, 19:08
We had a longer discussion on how we could implement the behavior with checkboxes in a way that allows users to use it in a good way. I want to present a new idea adding onto the previous ideas: No checkbox should be disabled. Here are the options available - nothing selected - read is clicked, result: read is selected - write is clicked, result: both are selected - read is selected - read is clicked, result: nothing selected - write is clicked, result: both are selected - read and write are selected - read is clicked, result: nothing selected - write is clicked, result: read is selected In this way every state change is possible with one click. -
Ayke Halder commented on patch set 29 06/12/24, 19:20
Reply
Sounds perfect! So we just need to: * Remove all code which un-/sets the `disabled`-attribute. * Make it 2-way-coupling: click on already checked "read" -> unchecks "read" and must also uncheck "write". -
Marcin Sągol uploaded patch set 30
CR -1V -106/13/24, 08:22 -
core-ci voted on patch set 30 V -1 06/13/24, 08:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59425
-
Marcin Sągol uploaded patch set 31
V -106/13/24, 08:40 -
core-ci voted on patch set 31 V +1 06/13/24, 08:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59428
-
Michael Telgkamp commented on patch set 31 CR -1 V -1 06/13/24, 09:18
I get `Cannot read properties of undefined` errors when using the checkboxes and the combined toggeling does not work in Chrome based browsers.select-check-box-table-permissions-element.ts:57`explicitOriginalTarget` is non standard and only available in Firefox according to https://developer.mozilla.org/en-US/docs/Web/API/Event/explicitOriginalTarget Please use the `target` or `currentTarget` property. -
Michael Telgkamp commented on patch set 31 06/13/24, 09:54
To ensure accessibility there needs to be a live region that announces the additional (unexpected) changes done by JS. So actually when selecting a write field with an unselected read field it needs to be announced "Read and write field checked". The other announcement would be when both are selected and read is toggled, the announcement would be "Read and write field not checked". More information on live regions: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions If further information is needed feel free to get in contact with me. -
Ayke Halder commented on patch set 31 06/13/24, 10:01
select-check-box-table-permissions-element.ts:45May we just add _one_ event-listener in total for all the checkboxes. Right now there is one event-listener for each checkbox registered, resulting in many event listeners. See docs on "Bind to multiple elements" https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Events/JavaScript/Index.html#bind-to-multiple-elements E.g. look into `multi-record-selection.ts`: ```ts private registerDispatchCheckboxStateChangedEvent(): void { new RegularEvent('change', (e: Event, target: HTMLInputElement): void => { target.dispatchEvent(new CustomEvent('multiRecordSelection:checkbox:state:changed',{ detail: { identifier: MultiRecordSelection.getIdentifier(target) }, bubbles: true, cancelable: false })); }).delegateTo(document, MultiRecordSelectionSelectors.checkboxSelector); } ``` So maybe here we might add the event-listener somehow to `this.table` - untested pseudo-code: ```ts import RegularEvent from '@typo3/core/event/regular-event'; new RegularEvent('multiRecordSelection:checkbox:state:changed', (e: CustomEvent): void => { this.handleSingleItemChange(e as CustomEvent & { explicitOriginalTarget?: any }); }).delegateTo(this.table, Identifier.singleItem); ```SelectCheckBoxTablePermissionsElement.php:133In this block we set field-change-attributes for both "modify" and "select". Setting the "checked" and "disabled" attributes for "modify" and "select" is split up. May we combine them in one place? Maybe like this: ``` if ($checkedForModify) { $tableModifyElementAttrs['checked'] = 'checked'; } if ($checkedForSelect) { $tableSelectElementAttrs['checked'] = 'checked'; } if ($readOnly) { $tableModifyElementAttrs['disabled'] = 'disabled'; $tableSelectElementAttrs['disabled'] = 'disabled'; } ```SelectCheckBoxTablePermissionsElement.php:227This one header-row with the checkbox-toggle-menus must not be shown in `$readOnly` state. -
Marcin Sągol uploaded patch set 32
CR -1V +106/13/24, 11:43 -
Marcin Sągol commented on patch set 31 06/13/24, 11:43
Reply
Fixed.select-check-box-table-permissions-element.ts:45ReplyDoneselect-check-box-table-permissions-element.ts:57ReplyDoneSelectCheckBoxTablePermissionsElement.php:133ReplyDoneSelectCheckBoxTablePermissionsElement.php:227ReplyDone -
Marcin Sągol commented on patch set 32 06/13/24, 11:44
Reply
@michael.telgkamp@mindscreen.de is the current implementation with 2 checkboxes ok for you?Reply
Done -
core-ci voted on patch set 32 V -1 06/13/24, 11:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59472
-
Marcin Sągol uploaded patch set 33
V -106/13/24, 11:52 -
core-ci voted on patch set 33 V +1 06/13/24, 11:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59475
-
Marcin Sągol uploaded patch set 34
V +106/13/24, 12:05 -
Jasmina Ließmann wrote 06/13/24, 12:06
Removed reviewer Jasmina Ließmann. -
core-ci voted on patch set 34 V +1 06/13/24, 12:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59477
-
Ayke Halder commented on patch set 34 06/13/24, 12:22
SelectCheckBoxTablePermissionsElement.php:219This `<thead>` must always be there - please move it up and outside `if (!$readonly) {…}` -
Marcin Sągol uploaded patch set 35
V +106/13/24, 12:30 -
Marcin Sągol commented on patch set 34 06/13/24, 12:30
SelectCheckBoxTablePermissionsElement.php:219ReplyDone -
core-ci voted on patch set 35 V +1 06/13/24, 12:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59480
-
Michael Telgkamp commented on patch set 35 CR +1 V +1 06/14/24, 08:24
Reply
DoneReply
Created issue https://forge.typo3.org/issues/104106 for this. -
Georg Ringer voted on patch set 35 CR +1 V +1 06/14/24, 08:26
-
Oli Bartsch commented on patch set 35 CR -2 06/17/24, 08:43
select-check-box-table-permissions-element.ts:24This should be a webcomponentSelectCheckBoxTablePermissionsElement.php:30Form elements should not extend other form elements but always extend from AbstractFormElement.SelectCheckBoxTablePermissionsElement.php:62We might want to add a dedicated DataProvider instead of using two different sources for the current data.SelectCheckBoxTablePermissionsElement.php:123This currently does not prevent the checkbox from being changed. However, could also be a bug in multi record selection.SelectCheckBoxTablePermissionsElement.php:286Any reason for using a private static function instead of "just" a protected one?be_groups.php:134Actually we are about to replace renderType's with dedicated TCA types. Adding another renderType, which additionally is utilizing two different TCA columns does not comply with this strategy.be_groups.php:144`passthrough` is no valid renderType for TCA type select. "passthrough" should be used as TCA type. -
Oli Bartsch commented on patch set 35 06/17/24, 08:56
thebehaviour` missingLet's use ` here as wellit if wasn't beforeLet's use ` here as wellform the first columns `tables_select`, both will be unchecked.SelectCheckBoxTablePermissionsElement.php:288Also not sure whether this might lead to problems in case $subject somehow contains self::FIELD_MODIFY multiple times. -
Marcin Sągol updated the commit message in patch set 36
CR +1V +106/17/24, 13:58Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 35 06/17/24, 13:58
Reply
DoneReply
DoneReply
DoneReply
DoneReply
DoneReply
DoneReply
Done -
Marcin Sągol updated the commit message in patch set 37 06/17/24, 13:59
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 36 V +1 06/17/24, 14:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59732
-
core-ci voted on patch set 37 V +1 06/17/24, 14:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59733
-
Marcin Sągol commented on patch set 37 06/17/24, 14:13
SelectCheckBoxTablePermissionsElement.php:62ReplyWhat kind of data provider? At this stage we have access to the `$this->data['databaseRow']` which contains whole `be_grops` record data.SelectCheckBoxTablePermissionsElement.php:123ReplyWhen i have tested it, if the checkbox was disabled but we clicked outside it, indeed it was changed - but all of them bahave the same (from other elements). I asked about it on slack, but had no response if it is bug (I think it is). Yet if we post the changes, the data won't change even if you was able to check/uncheck disabled checkbox.SelectCheckBoxTablePermissionsElement.php:286ReplyIt was suggested by reviewer here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83743/comment/c94e9a5e_a43db83b/ I can make it just protected or even private as this class won't be extended.SelectCheckBoxTablePermissionsElement.php:288ReplyIt could if you will use this functionbe_groups.php:134ReplyWhat approach do you suggest here?be_groups.php:144ReplyRight, so if we set type to `passthrough` then resoved data type in the `$this->data['databaseRow']` will be different for the `tables_modify` (an array) and `tables_select` (string). Across the T3 code the `tables_select` is just use to check permissions through `$backendUser->check('tables_select', $this->table)` so this shouldn't break anything, but still there be some inconsistency of data type as I have mentioned. Should the be some different approach for this? -
Ayke Halder commented on patch set 37 06/17/24, 16:03
SelectCheckBoxTablePermissionsElement.php:30ReplyCan we then declare this class as `final`? And maybe use `private` over `protected` on any property or function that is not `public` here?SelectCheckBoxTablePermissionsElement.php:123ReplyThis is a bug in `data-multi-record-selection` as it became the new UI for `SelectCheckBoxElement`. See https://forge.typo3.org/issues/104133SelectCheckBoxTablePermissionsElement.php:286ReplyThis is just a helper-function to not repeat the identical `str_replace()` - which is also `static` - multiple times. It is `private` so it still can be totally changed with no further notice in the future. So it should never be used in context of another class or anywhere else. It is `static` as it does not change the state of the object.SelectCheckBoxTablePermissionsElement.php:288ReplyIf `$subject` contains `self::FIELD_MODIFY` multiple times, this function does indeed replace `self::FIELD_MODIFY` multiple times. And that is what we like the function to do. E.g. some pseudo `id`-attribute like `formengine-select-checkbox-<UID>-group-table_modify-item-6-table_modify` should become `formengine-select-checkbox-<UID>-group-table_select-item-6-table_select` As this function is `private` it will only be used in context of this class and nowhere else. So I think this would not lead to problems. -
Marcin Sągol uploaded patch set 38
V +106/17/24, 16:25Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 37 06/17/24, 16:26
SelectCheckBoxTablePermissionsElement.php:30ReplyI can make it final, but i can't/don't want to make all the properties private as i would have to change definition in the `AbstractNode` wchich will require chnages in all form elements. I do not want to do this in this patch. Lets follow current definitions in this patch and after merge there can be separate task to modify defionitions in the abstract classess and implementations. -
core-ci voted on patch set 38 V -1 06/17/24, 16:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59748
-
Marcin Sągol uploaded patch set 39
V -106/17/24, 16:40Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 39 V +1 06/17/24, 16:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59749
-
Marcin Sągol commented on patch set 39 06/17/24, 17:06
select-check-box-table-permissions-element.ts:24ReplySo you would like to have here whole element rendering? Is yes, can we postpone this as a next step and have it merged as it is now (this task is part of community budget for Q2 and we are reaching end date and this task is taking changes since several days already - i want to avoid situation when we won't be able to finish it on time due to constant changes after reviews). -
Georg Ringer voted on patch set 39 CR +1 V +1 06/17/24, 19:41
-
Ayke Halder commented on patch set 39 CR +1 V +1 06/19/24, 07:22
Looks good and works perfectly! -
Oli Bartsch commented on patch set 39 CR -2 06/21/24, 15:21
select-check-box-table-permissions-element.ts:24ReplyIt's more about best practice for the JS part of new from engine elements. Making a web component shouldn't be to time consuimg. have a look at related patch for select-check-box: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84749SelectCheckBoxElement.php:67Please do not change this as it's unrelated to the patch.SelectCheckBoxTablePermissionsElement.php:57I think we don't need any wizard here, especially no localization related wizards since be_groups is not translateable.SelectCheckBoxTablePermissionsElement.php:62ReplyA FormEngine DataProvider, see e.g. https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/FormEngine/DataCompiling/Index.html#data-groups-and-providers. However, we would also resolve this easily by having just one field with the corresponding configuration.SelectCheckBoxTablePermissionsElement.php:111Please stick to either the "select" / "modify" or to the "read" / "write" naming consistently.SelectCheckBoxTablePermissionsElement.php:116The whole group header functionality can be omitted for this specific element. Thats also the reason, why I suggest to have a dedicated TCA type. We would not need the itemsProcFunc in the TCA but could call corresponding logic in a DataProvider or directly in the element here.SelectCheckBoxTablePermissionsElement.php:123ReplyThis has been fixed.SelectCheckBoxTablePermissionsElement.php:135IMO also not relevant for this elementSelectCheckBoxTablePermissionsElement.php:170I suggest to drop this "feature" for this element.be_groups.php:140We might want to remove this from showitem.be_groups.php:144ReplyActually what we IMO should do is to combine those fields (e.g. `table_permissions`) and store the configuration as JSON in the database. We can then either have a new TCA type or use type=user with corresponding renderType just for this new single field. Manually combining those fields in the new FormEngine Element by setting one of the fields to the invalid "passthrough" renderType seems to be just an intermediate solution.Feature-103521-CombineReadAndWritePermissionsForTableRestrictions.rst:16Are there cases when they do not list the same items?Feature-103521-CombineReadAndWritePermissionsForTableRestrictions.rst:23Actually this is just done visually. -
Oli Bartsch commented on patch set 39 06/22/24, 07:32
be_groups.php:134ReplyI suggest to combine the fields and introduce one new Element (either as dedicated TCA type or as a renderType of TCA type user). -
Marcin Sągol commented on patch set 39 06/25/24, 08:00
be_groups.php:134Reply@bo@cedev.de by `combine` you mean change how the permissions are stored and processed in TYPO3? So not 2 separate fields but a single one that stores information about tables read/write permissions? -
Oli Bartsch commented on patch set 39 06/25/24, 08:17
be_groups.php:134ReplyYes exactly. That would IMO be the best solution, since it's actually what you want to achieve in the end. Having those fields combined. Visually and also data-wise. -
Ayke Halder commented on patch set 39 06/25/24, 09:24
be_groups.php:134ReplyI think combining these two fields in the database is a very big change. TYPO3 handles permissions since the beginning by using two fields.be_groups.php:144ReplyIf this data is combined as JSON in one db-field. How will TYPO3s data-model use this new permission data-structure? Does this new permission data-structure get mapped to `tables_select`/`tables_modify` so that these permission checks are handled like before? `$this->getBackendUserAuthentication()->check('tables_select', 'pages')`Feature-103521-CombineReadAndWritePermissionsForTableRestrictions.rst:23ReplyAlso bringing up this old one again - which was already decided on a sprint: Should the title not be more clear about the fact that this is an UI change only and does not change anything about the underlying implementation of the permission table As-is: [FEATURE] Combine read and write permissions for table restrictions Suggestion: [FEATURE] Change table restrictions UI to combine read and write permissions Also see https://review.typo3.org/c/Packages/TYPO3.CMS/+/83743/comments/6a7c0354_d15f58d6 -
Oli Bartsch commented on patch set 39 06/25/24, 10:46
be_groups.php:134ReplyYes sure. Nevertheless, I think the benefits are totally worth the effort.be_groups.php:144ReplyYes, this is something which needs to be defined. I've not done any conceptual work on this topic yet. However, API functionality like `$this->getBackendUserAuthentication()->check('tables_select', 'pages')` needs to be preserved for sure.Feature-103521-CombineReadAndWritePermissionsForTableRestrictions.rst:23ReplySure, if this is the intention of the patch, this should be changed as you suggested. Anyways, I still tend to block this patch until my remarks regarding invalid renderType usages, JS component etc. are resolved. Because even if we only make visual changes - not migrating the fields to - this should be done on a basis, which will allow as to do so afterwards. -
Marcin Sągol uploaded patch set 40
CR +1V +106/25/24, 11:06Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 40 V +1 06/25/24, 11:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60283
-
Marcin Sągol uploaded patch set 41
V +106/25/24, 12:23Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 40 06/25/24, 12:23
SelectCheckBoxElement.php:67ReplyDoneSelectCheckBoxTablePermissionsElement.php:57ReplyDoneSelectCheckBoxTablePermissionsElement.php:111ReplyI will use "select" / "modify" name sin the code as they will align with the real DB column names. The only usage of "Read" and "Write" will be for column titles.SelectCheckBoxTablePermissionsElement.php:116ReplyDoneSelectCheckBoxTablePermissionsElement.php:135ReplyDoneSelectCheckBoxTablePermissionsElement.php:170ReplyDoneFeature-103521-CombineReadAndWritePermissionsForTableRestrictions.rst:16ReplyNot that i know of. Removin it.Feature-103521-CombineReadAndWritePermissionsForTableRestrictions.rst:23ReplyUpdated/fixed. -
core-ci voted on patch set 41 V -1 06/25/24, 12:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60292
-
Marcin Sągol uploaded patch set 42
V -106/26/24, 09:02Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 42 06/26/24, 09:05
SelectCheckBoxTablePermissionsElement.php:62ReplyDonebe_groups.php:134ReplyFor now as suggested, we have a new data provider for this field, which combines the select and modify pemrissions. -
core-ci voted on patch set 42 V -1 06/26/24, 09:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60362
-
Marcin Sągol uploaded patch set 43
V -106/26/24, 09:10Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 43 V -1 06/26/24, 09:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60363
-
Ayke Halder commented on patch set 43 06/26/24, 09:17
TablePermissionsElement.php:71Maybe rename `$selectItmes` to `$permissionItems` or something else. ``` $fieldConfig['config']['items'] = $this->getAvailableTables(); ``` -
Ayke Halder commented on patch set 43 06/26/24, 09:32
be_groups.php:142Do we still need to call this itemsProcFunc here? -
Marcin Sągol uploaded patch set 44
V -106/26/24, 09:33Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 44 06/26/24, 09:38
TablePermissionsElement.php:71ReplyCould be renamed, indeed. Since items stores/provides just database table names, maybe just use related name like `tables` || `dbTableNames` || `tableNames`?be_groups.php:142ReplyThe reason I have left it, is that maybe someone can have some custom code where this is needed, and since with this patch we do not remove the filed, i think keeping it unchanged will be the best solution (until we move for a single filed to handle tables permissions).be_groups.php:144ReplyFor this task, can we agree that we do not use the `passthrough` as `renderType` and keep the filed configuation unchanged, but we remove it from the showitems? -
core-ci voted on patch set 44 V -1 06/26/24, 09:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60365
-
Ayke Halder commented on patch set 44 06/26/24, 09:55
TcaTablePermissions.php:45This could be reduced to: ``` private function combineTablesPermissions(array $databaseRow, string $fieldName, string $selectField): array { return [ 'modify' => array_values(array_unique($this->processDatabaseFieldValue($databaseRow, $fieldName))), 'select' => array_values(array_unique($this->processDatabaseFieldValue($databaseRow, $selectField))), ]; } ``` -
Marcin Sągol uploaded patch set 45
V -106/26/24, 09:57Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 45 V +1 06/26/24, 10:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60366
-
Marcin Sągol uploaded patch set 46
V +106/26/24, 10:12Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 45 06/26/24, 10:12
TablePermissionsElement.php:71ReplyDoneTcaTablePermissions.php:45ReplyDone -
Marcin Sągol commented on patch set 46 06/26/24, 10:13
be_groups.php:140ReplyDone -
core-ci voted on patch set 46 V +1 06/26/24, 10:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60367
-
Marcin Sągol uploaded patch set 47
V +106/26/24, 10:35Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 46 06/26/24, 10:36
select-check-box-table-permissions-element.ts:24ReplyDone -
core-ci voted on patch set 47 V -1 06/26/24, 10:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60370
-
Marcin Sągol uploaded patch set 48
V -106/26/24, 10:43Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 48 V -1 06/26/24, 10:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60372
-
Marcin Sągol uploaded patch set 49
V -106/26/24, 11:00Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 49 V -1 06/26/24, 11:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60373
-
Marcin Sągol uploaded patch set 50
V -106/26/24, 11:43Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol uploaded patch set 51 06/26/24, 11:46
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 50 V -1 06/26/24, 11:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60379
-
core-ci voted on patch set 51 V -1 06/26/24, 11:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60380
-
Marcin Sągol rebased onto patch set 52
V -106/26/24, 12:24Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol uploaded patch set 53 06/26/24, 12:26
Copied Votes: * Code-Review-2 (copy condition: "**changekind:NO_CHANGE** OR **is:MIN**") -
core-ci voted on patch set 52 V +1 06/26/24, 12:31 Copied votes on follow-up patch sets have been updated: * Verified+1 has been copied to patch set 53 (copy condition: "changekind:NO_CHANGE"). Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60384
-
core-ci voted on patch set 53 V +1 06/26/24, 12:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60385
-
Oli Bartsch uploaded patch set 54
V +106/27/24, 10:12Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Oli Bartsch uploaded patch set 55 06/27/24, 10:14
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 54 V -1 06/27/24, 10:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60444
-
core-ci voted on patch set 55 V -1 06/27/24, 10:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60445
-
Oli Bartsch uploaded patch set 56
V -106/27/24, 10:32Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 56 V +1 06/27/24, 10:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60448
-
Oli Bartsch uploaded patch set 57
V +106/27/24, 11:06Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 57 V -1 06/27/24, 11:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60450
-
Oli Bartsch uploaded patch set 58
V -106/27/24, 11:21Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 58 V +1 06/27/24, 11:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60452
-
Oli Bartsch commented on patch set 57 CR -2 06/27/24, 11:28
Hi Marcin, I just updated the patch. Should be fine now from my side. Could you please update the RST and the commit message? Additionally, please also add some tests for the new Element and the new DataProvider. You can have a look at e.g. those patches as reference: * https://review.typo3.org/c/Packages/TYPO3.CMS/+/77798 * https://review.typo3.org/c/Packages/TYPO3.CMS/+/76891SelectCheckBoxTablePermissionsElement.php:286ReplyDoneSelectCheckBoxTablePermissionsElement.php:288ReplyDonebe_groups.php:142ReplyIMO this is no public API. For consistency, we should drop it all together.be_groups.php:144ReplyJust removing the field from showitem isn't sufficient. We need to use `passthrough` to also hide the column e.g. from the "Show Columns" selection etc. -
Ayke Halder commented on patch set 58 CR -1 06/27/24, 12:25
BackendUtility.php:1717We must not remove elements from the view that are in the database. Especially if they should not be in the database in the first place, they must stay visible here to be recognizable.DataHandler.php:2407If this is not an array the field-value is invalid, isn't it? Then we should drop it.DataHandler.php:2408Here we must ensure that all the table-names are allowed to be stored in the db-record. Implement the filter function for "allowed table names" which currently is implemented in `BackendUtility:: getProcessedValue`.FormatTableSelectPermissions.php:34Same here as for `DataHandler::checkvalueForTablePermission`: * If this is not an array the field-value is invalid, isn't it? Then we should drop it. * Here we must ensure that all the table-names are allowed to be stored in the db-record. Implement the filter function for "allowed table names" which currently is implemented in BackendUtility. -
Marcin Sągol uploaded patch set 59
CR -1V +106/27/24, 12:53Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Ayke Halder voted on patch set 59 CR -1 06/27/24, 12:55
-
core-ci voted on patch set 59 V -1 06/27/24, 12:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60457
-
Marcin Sągol uploaded patch set 60
CR -1V -106/27/24, 13:20Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 60 V +1 06/27/24, 13:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60460
-
Ayke Halder commented on patch set 60 CR -1 06/27/24, 13:34
Filtering of "allowed table names" should be implemented - see unresolved comments. -
Oli Bartsch commented on patch set 60 CR -2 06/27/24, 14:16
DataHandler.php:2407ReplyMight be an empty string when all tables are unselect or for new records, not having any table selected. -
Marcin Sągol uploaded patch set 61
CR -1V +106/27/24, 15:10Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 60 06/27/24, 15:11
Reply
Please check if not it is ok. -
core-ci voted on patch set 61 V -1 06/27/24, 15:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60472
-
Marcin Sągol uploaded patch set 62
V -106/27/24, 15:28Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol updated the commit message in patch set 63 06/27/24, 15:31
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 62 V +1 06/27/24, 15:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60474
-
core-ci voted on patch set 63 V +1 06/27/24, 15:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60475
-
Marcin Sągol uploaded patch set 64
V +106/27/24, 15:39Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 64 06/27/24, 15:40
BackendUtility.php:1717Reply@bo@cedev.de do you agree on this? -
core-ci voted on patch set 64 V +1 06/27/24, 15:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60477
-
Ayke Halder commented on patch set 64 CR -1 06/27/24, 17:42
Still about BackendUtility: We must not hide any value that is already stored in the db - they must all be visible in the backend. And wrong values coming from the backend-form (e.g. an arbitrary manipulated string) must be removed by DataHandler and must not be stored in db.DataHandler.php:2407ReplyThen we can just return an empty string for any non-array value: ``` public function checkValueForTablePermission(string|array $value): array { if (!is_array($value)) { return ['value' => '']; } // Filter array for allowed table-names and implode it around a comma: $value = array_filter($value, static function ($tableName) { return isset($GLOBALS['TCA'][$tableName]) && !($GLOBALS['TCA'][$tableName]['ctrl']['adminOnly'] ?? false); }); $value = implode(',', $value); return ['value' => $value]; } ```DataHandler.php:2408ReplyDoneFormatTableSelectPermissions.php:34ReplyWe might declare `DataHandler::checkvalueForTablePermission` as public and re-use it here: ``` public function processDatamap_preProcessFieldArray(&$incomingFieldArray, $table, $id, DataHandler $dataHandler) { if ($table !== 'be_groups' || !isset($incomingFieldArray['tables_select'])) { return; } $incomingFieldArray['tables_select'] = $dataHandler->checkValueForTablePermission($incomingFieldArray['tables_select'])['value'] ?? ''; } ```be_groups.php:142ReplyDone -
Ayke Halder commented on patch set 64 06/27/24, 18:05
Still about BackendUtility: We must not hide any value that is already stored in the db - they must all be visible in the backend. And wrong values coming from the backend-form (e.g. an arbitrary manipulated string) must be cleaned by DataHandler.DataHandler.php:2407ReplyWe have to account for copying be_group-records: In that case `$value` is a non-empty string that contains comma-separated table-names from the original record. ``` public function checkValueForTablePermission(string|array $value): array { if (is_string($value)) { $value = GeneralUtility::trimExplode(',', $value, true); } // Filter array for allowed table-names and implode it around a comma: $value = array_filter($value, static function ($tableName) { return isset($GLOBALS['TCA'][$tableName]) && !($GLOBALS['TCA'][$tableName]['ctrl']['adminOnly'] ?? false); }); $value = implode(',', $value); return ['value' => $value]; } ``` -
Marcin Sągol uploaded patch set 65
CR -1V +106/27/24, 18:58Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 65 06/27/24, 19:00
Reply
Is it ok now?DataHandler.php:2407ReplyDone, please check. -
Marcin Sągol updated the commit message in patch set 66 06/27/24, 19:01
Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 65 V +1 06/27/24, 19:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60484
-
core-ci voted on patch set 66 V +1 06/27/24, 19:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60485
-
Ayke Halder commented on patch set 66 CR -1 06/28/24, 05:28
Reply
DoneReply
DonePlease decide if we can re-use `DataHandler::checkvalueForTablePermission` in `Hooks/FormatTableSelectPermissions` Or copy-paste the newly implemented features from `DataHandler::checkvalueForTablePermission` into `Hooks/FormatTableSelectPermissions`.BackendUtility.php:1717ReplyDoneDataHandler.php:2407ReplyDoneFormatTableSelectPermissions.php:34ReplyHere we either call `DataHandler::checkvalueForTablePermission` or always copy-paste all the same features from `DataHandler::checkvalueForTablePermission`. Right now the string comma-explode is missing: ``` if (is_string($value)) { $value = GeneralUtility::trimExplode(',', $value, true); } ``` -
Marcin Sągol uploaded patch set 67
CR -1V +106/28/24, 09:34Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Marcin Sągol commented on patch set 66 06/28/24, 09:36
Reply
For now i copied the code part. The function `DataHandler::checkvalueForTablePermission` is protected as other with similar role in the `DH` so lets keep it. The hook will be removed anyway when there will be only single field for storing the table permissions.FormatTableSelectPermissions.php:34ReplyPlease check now. -
core-ci voted on patch set 67 V -1 06/28/24, 09:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60543
-
Marcin Sągol uploaded patch set 68
V -106/28/24, 09:49Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 68 V +1 06/28/24, 09:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60544
-
Marcin Sągol commented on patch set 68 06/28/24, 09:57
Reply
I have added simple unit tests. -
Ayke Halder commented on patch set 68 06/28/24, 14:13
Reply
Looks good now!From my side the open unresolved issues are solved! Yesterday there was a merge of some TCA-feature: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75486 Maybe we need some more refactoring now.FormatTableSelectPermissions.php:34ReplyDonebe_groups.php:144ReplySome patchset introduced `passthrough` here - so this is solved. -
Oli Bartsch uploaded patch set 69
V +107/03/24, 09:16Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 69 V +1 07/03/24, 09:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60897
-
Ayke Halder commented on patch set 69 07/03/24, 18:53
We should not change the db structure of `tables_select`.ext_tables.sql:28To keep this identical as before it must be: `tables_select longtext` Also no trailing commata needed here, as this is the last/only column. -
Oli Bartsch uploaded patch set 70
V +107/04/24, 10:08Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 70 V +1 07/04/24, 10:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60959
-
Oli Bartsch uploaded patch set 71
V +107/04/24, 10:21Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Oli Bartsch commented on patch set 71 CR 0 07/04/24, 10:21
Reply
Acknowledgedext_tables.sql:28ReplyDone -
core-ci voted on patch set 71 V -1 07/04/24, 10:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60960
-
Oli Bartsch uploaded patch set 72
V -107/04/24, 10:32 -
core-ci voted on patch set 72 V +1 07/04/24, 10:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60961
-
Oli Bartsch uploaded patch set 73
V +107/04/24, 11:44 -
core-ci voted on patch set 73 V +1 07/04/24, 11:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60965
-
Ayke Halder commented on patch set 73 CR -1 07/04/24, 15:20
Maybe use enum instead of array._table.scss:145Do not use a 'fixed' `min-width`. Languages other than english easily break this limit. Suggestion: remove `min-width` and do not wrap whitespaces instead: ```css .col-radiogroup { white-space: nowrap; } ```table-permission-element.ts:68Nice state-machine here - I really like this!TablePermissionElement.php:34How about the use of `enum`? An `array` does not fulfill checks for array-key-exists. Then instead of having this array we could go back to directly use strings (<-- I do not recommend this.) E.g. ```php // This runs but not as expected if ($permission === self::Permissions['none-with-typo']) {} $foo = '<input name="' . self::Permissions['none-with-typo'] . '">'; // vs // This will fail: if ($permission === Permission::noneWithTypo) {} $foo = '<input name="' . Permission::noneWithTypo->value . '">'; ``` ---- This should implement working enumeration: ```patch Index: typo3/sysext/backend/Classes/Form/Element/TablePermissionType.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/typo3/sysext/backend/Classes/Form/Element/TablePermissionType.php b/typo3/sysext/backend/Classes/Form/Element/TablePermissionType.php new file mode 100644 --- /dev/null (date 1720102679417) +++ b/typo3/sysext/backend/Classes/Form/Element/TablePermissionType.php (date 1720102679417) @@ -0,0 +1,10 @@ +<?php + +namespace TYPO3\CMS\Backend\Form\Element; + +enum TablePermissionType: string +{ + case none = 'none'; + case select = 'select'; + case modify = 'modify'; +} Index: typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php b/typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php --- a/typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php (revision 6038fdcaabb995d4dcf348b5d011d607e45687df) +++ b/typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php (date 1720105198533) @@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Form\Element; +use TYPO3\CMS\Backend\Form\Element\TablePermissionType as Permission; use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Imaging\IconSize; @@ -31,12 +32,6 @@ */ final class TablePermissionElement extends AbstractFormElement { - private const Permissions = [ - 'none' => 'none', - 'select' => 'select', - 'modify' => 'modify', - ]; - /** * Default field information enabled for this element. * @@ -59,11 +54,11 @@ $parameterArray = $this->data['parameterArray']; $config = $parameterArray['fieldConf']['config']; $elementFieldName = $parameterArray['itemFormElName']; - $currentValue = ['modify' => [], 'select' => []]; - if (is_array($parameterArray['itemFormElValue'] ?? null) - && array_key_exists('modify', $parameterArray['itemFormElValue']) - && array_key_exists('select', $parameterArray['itemFormElValue']) - ) { + $currentValue = [Permission::modify->value => [], Permission::select->value => []]; + if (isset( + $parameterArray['itemFormElValue'][Permission::modify->value], + $parameterArray['itemFormElValue'][Permission::select->value] + )) { $currentValue = $parameterArray['itemFormElValue']; } $readOnly = (bool)($config['readOnly'] ?? false); @@ -76,36 +71,38 @@ $tablesConfiguration = []; $lang = $this->getLanguageService(); - $itemArrayModify = array_flip($currentValue['modify']); - $itemArraySelect = array_flip($currentValue['select']); + $itemArrayModify = array_flip($currentValue[Permission::modify->value]); + $itemArraySelect = array_flip($currentValue[Permission::select->value]); $elementId = StringUtility::getUniqueId('formengine-table-permission-'); foreach ($availableTables as $table) { $permissions = []; - foreach (self::Permissions as $permission) { - $permissions[$permission] = [ - 'label' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.tables_modify.permissions.' . $permission), + foreach (Permission::cases() as $permission) { + $permissions[$permission->value] = [ + 'label' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.tables_modify.permissions.' . $permission->value), 'attributes' => [ 'type' => 'radio', 'class' => 'form-check-input t3js-table-permissions-item t3js-multi-record-selection-check', - 'value' => $permission, + 'value' => $permission->value, 'name' => $elementId . '[' . $table['value'] . ']', - 'id' => $elementId . '[' . $table['value'] . '][' . $permission . ']', + 'id' => $elementId . '[' . $table['value'] . '][' . $permission->value . ']', 'data-table' => $table['value'], ], ]; } if (isset($itemArrayModify[$table['value']])) { - $permissions[self::Permissions['modify']]['attributes']['checked'] = 'checked'; + $permissions[Permission::modify->value]['attributes']['checked'] = 'checked'; } elseif (isset($itemArraySelect[$table['value']])) { - $permissions[self::Permissions['select']]['attributes']['checked'] = 'checked'; + $permissions[Permission::select->value]['attributes']['checked'] = 'checked'; } else { - $permissions[self::Permissions['none']]['attributes']['checked'] = 'checked'; + $permissions[Permission::none->value]['attributes']['checked'] = 'checked'; } if ($readOnly) { - $permissions[self::Permissions['none']]['attributes']['disabled'] = $permissions[self::Permissions['select']]['attributes']['disabled'] = $permissions[self::Permissions['modify']]['attributes']['disabled'] = 'disabled'; + foreach (Permission::cases() as $permission) { + $permissions[$permission->value]['attributes']['disabled'] = 'disabled'; + } } $tablesConfiguration[] = [ @@ -130,8 +127,8 @@ $html[] = $fieldInformationHtml; if (!$readOnly) { - $html[] = '<input type="hidden" name="' . $modifyStateFieldName . '" value="' . implode(',', $currentValue['modify']) . '">'; - $html[] = '<input type="hidden" name="' . $selectStateFieldName . '" value="' . implode(',', $currentValue['select']) . '">'; + $html[] = '<input type="hidden" name="' . $modifyStateFieldName . '" value="' . implode(',', $currentValue[Permission::modify->value]) . '">'; + $html[] = '<input type="hidden" name="' . $selectStateFieldName . '" value="' . implode(',', $currentValue[Permission::select->value]) . '">'; } $html[] = '<div id="' . $elementId . '" class="panel panel-default">'; @@ -139,11 +136,11 @@ $tableRows = []; foreach ($tablesConfiguration as $tableConfiguration) { $tableRows[] = '<tr>'; - foreach ($tableConfiguration['permissions'] as $key => $permission) { + foreach ($tableConfiguration['permissions'] as $key => $permissionConf) { $tableRows[] = '<td class="col-radiogroup">'; $tableRows[] = '<div class="form-check form-check-inline" data-multi-record-selection-identifier="' . $elementId . '-' . $key . '" data-multi-record-selection-element="true">'; - $tableRows[] = '<input ' . GeneralUtility::implodeAttributes($permission['attributes'], true, true) . '>'; - $tableRows[] = '<label class="form-check-label" for="' . $permission['attributes']['id'] . '">' . htmlspecialchars($permission['label']) . '</label>'; + $tableRows[] = '<input ' . GeneralUtility::implodeAttributes($permissionConf['attributes'], true, true) . '>'; + $tableRows[] = '<label class="form-check-label" for="' . $permissionConf['attributes']['id'] . '">' . htmlspecialchars($permissionConf['label']) . '</label>'; $tableRows[] = '</div>'; $tableRows[] = '</td>'; } @@ -160,9 +157,9 @@ $html[] = '<table class="table table-transparent table-hover">'; $html[] = '<thead>'; $html[] = '<tr>'; - foreach (self::Permissions as $permission) { - $html[] = '<th data-multi-record-selection-identifier="' . $elementId . '-' . $permission . '">'; - $html[] = $this->getRecordSelectionCheckActions($permission === self::Permissions['none'] ? ['all'] : ['all', 'none', 'toggle'], $readOnly); + foreach (Permission::cases() as $permission) { + $html[] = '<th data-multi-record-selection-identifier="' . $elementId . '-' . $permission->value . '">'; + $html[] = $this->getRecordSelectionCheckActions($permission === Permission::none ? ['all'] : ['all', 'none', 'toggle'], $readOnly); $html[] = '</th>'; } $html[] = '<th class="col-title col-border-left">' . htmlspecialchars($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.th.name')) . '</th>'; ``` -
Oli Bartsch uploaded patch set 74
CR -1V +107/04/24, 15:54 -
Oli Bartsch commented on patch set 74 07/04/24, 15:56
Reply
Actually I wanted to keep thne patch as simple as possible. Adding an enum (additional class) which is only used in this element seems a bit to much IMO._table.scss:145ReplyDonetable-permission-element.ts:68ReplyAcknowledged -
core-ci voted on patch set 74 V +1 07/04/24, 15:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60979
-
Ayke Halder commented on patch set 74 CR -1 07/04/24, 16:06
For A11y the 3 radio-buttons of a table row must become part of one radio-group.TablePermissionElement.php:141For A11y these 3 radio-buttons must become part of one radio-group. Maybe set `role="radiogroup" aria-labelledby="id-of-ctable-label"`to this table row. Then we must check if this works as expected or if we need to replicate the keyboard navigation in JS like it would natively work for this struct: ```html <fieldset> <legend>Which is the best color?</legend> <p> <input name="colorOption" type="radio" id="purple" /> <label for="purple">Purple</label> </p> <p> <input name="colorOption" type="radio" id="aubergine" /> <label for="aubergine">Aubergine</label> </p> <p> <input name="colorOption" type="radio" id="magenta" /> <label for="magenta">Magenta</label> </p> </fieldset> ``` Also see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/radiogroup_role#keyboard_interactions -
Oli Bartsch uploaded patch set 75
CR -1V +107/04/24, 16:16
-
Oli Bartsch commented on patch set 74 07/04/24, 16:17
Reply
DoneTablePermissionElement.php:141ReplyDone -
Ayke Halder commented on patch set 74 CR -1 07/04/24, 16:17
Reply
Maybe then just use some const instead: ```php private const PERMISSION_NONE = 'none'; private const PERMISSION_SELECT = 'select'; private const PERMISSION_MODIFY = 'modify'; private const PERMISSIONS = [ self::PERMISSION_NONE, self::PERMISSION_SELECT, self::PERMISSION_MODIFY ]; $itemArrayModify = array_flip($currentValue[self::PERMISSION_MODIFY]); foreach (self::PERMISSIONS as $permission) {} ``` -
core-ci voted on patch set 75 V +1 07/04/24, 16:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60981
-
Ayke Halder commented on patch set 75 CR -1 07/04/24, 16:49
Please check TCA element dependencies - I'm not sure about them.TcaTablePermission.php:47Here is the other location where we might have used an enum for `select`/`modify`.DefaultConfiguration.php:678I'm not sure if the dependency here is in the right direction: Does `TcaInlineConfiguration::class` depend on `TcaTablePermission::class`? Or should this just be `TcaCategory::class` as before this patch?DefaultConfiguration.php:1014Same here - I'm not sure if the dependency here is in the right direction: Does `TcaInlineConfiguration::class` depend on `TcaTablePermission::class`? Or should this just be `TcaCategory::class` as before this patch? -
Ayke Halder commented on patch set 75 07/04/24, 16:54
It is now possible to add arbitrary values into table `be_groups` field `tables_select` by manipulating the checkbox-value in the BE. There is no filtering of allowed table-names for the field `tables_select` anymore. Of course an admin account is needed to add arbitrary values, as other users do not have read/write permission for the table `be_groups`. -
Georg Ringer voted on patch set 75 CR +1 V +1 07/04/24, 20:57
-
Oli Bartsch commented on patch set 75 07/04/24, 21:36
Reply
This is possible already and is possible for both `tables_modify` and `tables_select`. The reason is, DataHandler does not validate items from itemsProcFunc. This won't be changed with this patch as it's out of scope. We agreed on only do UI improvements - with necessary functional changed. Additionally, there is no point in adding invalid data to the DB as this won't have any implications.Reply
They are correct. See given explanation on the other comment.TcaTablePermission.php:47ReplyThose are just array keys. I see no benefit in introducing enums just to replace those keys.DefaultConfiguration.php:678ReplyThe data provider as all of the "TCA*" providers do not depend on each other. However wem once agreed when adding new providers to always use the provider before as dependency to keep the order comprehensible. Therefore, it's correct that `TcaInlineConfiguration` depends on `TcaTablePermission`, since it's the next provider after `TcaTablePermission`.DefaultConfiguration.php:1014ReplySame reason as above. -
Oli Bartsch commented on patch set 75 07/04/24, 21:44
Reply
It might even be a bigger change in behaviour when sanitizing the tables. Please keep in mind that there might be situations when tables are gone temporarily, e.g. because an extension has been deactivated. Removing those tables from the DB might not be the desired behaviour and as mentioned we won't change such behaviour in this UX related patch. -
Christian Kuhn commented on patch set 75 CR -1 07/04/24, 23:12
will review asap. -
Marcin Sągol voted on patch set 75 V +1 07/05/24, 09:23
-
Ayke Halder commented on patch set 75 CR 0 07/05/24, 09:24
Reply
Thanks for looking into this: As you already mentioned the behaviour did not change with this patch. It was possible before this change to add arbitrary values to `tables_select` and `tables_modify`. For the situation where 'tables are gone temporarily': In that case if you edit a `be_group` record, the tables that are gone are also removed from the record. But also no change here, as this is behaving like before this change.TablePermissionElement.php:63This condition could be simplified to: ```php if (isset( $parameterArray['itemFormElValue']['modify'], $parameterArray['itemFormElValue']['select'] )) {} ```TablePermissionElement.php:108Maybe also use a loop here: ```php foreach (self::Permissions as $permission) { $permissions[$permission]['attributes']['disabled'] = 'disabled'; } ``` -
Ayke Halder commented on patch set 75 07/05/24, 13:27
UI: big radio buttons with no label See https://typo3.slack.com/archives/C027S88NY/p1720185843029429?thread_ts=1720101232.399569&cid=C027S88NY This patch changes the look of the radio buttons and removes the label. There is still need to re-add a table-header with the labels. ```patch Index: Build/Sources/Sass/component/_table.scss IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/Build/Sources/Sass/component/_table.scss b/Build/Sources/Sass/component/_table.scss --- a/Build/Sources/Sass/component/_table.scss (revision 3ac0543b639b200bdb5456bc5e16e6bdbfa072c0) +++ b/Build/Sources/Sass/component/_table.scss (date 1720184190184) @@ -62,6 +62,7 @@ .col-icon, .col-checkbox, + .col-radio, .col-avatar { padding-inline-end: 0; } @@ -76,6 +77,7 @@ } .col-checkbox, + .col-radio, .col-icon { width: 16px; min-width: 16px; Index: Build/Sources/Sass/component/_checkbox.scss IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/Build/Sources/Sass/component/_checkbox.scss b/Build/Sources/Sass/component/_checkbox.scss --- a/Build/Sources/Sass/component/_checkbox.scss (revision 3ac0543b639b200bdb5456bc5e16e6bdbfa072c0) +++ b/Build/Sources/Sass/component/_checkbox.scss (date 1720185257013) @@ -229,6 +229,43 @@ } } +// +// Radio +// A radio button. +// +// Markup: +// <div class="form-check form-check-type-radio"> +// <input +// type="radio" +// class="form-check-input" +// value="1" +// id="radio-button" +// > +// </div> +// +// Styleguide component.checkbox.4 +// +$form-radio-checked-color: $component-active-color !default; + +.form-check.form-check-type-radio { + display: inline-block; + padding-inline-start: 0; + margin: 0; + gap: .5em; + + .form-check-input[type="radio"] { + margin: 0; + margin-top: 1px; + float: none; + width: calc(16 / 12 * 1em); + height: calc(16 / 12 * 1em); + + &:active { + filter: brightness(100%); + } + } +} + // // Utility // Index: typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php b/typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php --- a/typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php (revision 3ac0543b639b200bdb5456bc5e16e6bdbfa072c0) +++ b/typo3/sysext/backend/Classes/Form/Element/TablePermissionElement.php (date 1720185528289) @@ -84,8 +84,8 @@ $permissions = []; foreach (self::Permissions as $permission) { $permissions[$permission] = [ - 'label' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.tables_modify.permissions.' . $permission), 'attributes' => [ + 'aria-label' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups.tables_modify.permissions.' . $permission), 'type' => 'radio', 'class' => 'form-check-input t3js-table-permissions-item t3js-multi-record-selection-check', 'value' => $permission, @@ -141,10 +141,9 @@ foreach ($tablesConfiguration as $tableConfiguration) { $tableRows[] = '<tr role="radiogroup" aria-labelledby="' . $tableConfiguration['label']['id'] . '">'; foreach ($tableConfiguration['permissions'] as $key => $permission) { - $tableRows[] = '<td class="col-radiogroup">'; - $tableRows[] = '<div class="form-check form-check-inline" data-multi-record-selection-identifier="' . $elementId . '-' . $key . '" data-multi-record-selection-element="true">'; + $tableRows[] = '<td class="col-radio">'; + $tableRows[] = '<div class="form-check form-check-type-radio" data-multi-record-selection-identifier="' . $elementId . '-' . $key . '" data-multi-record-selection-element="true">'; $tableRows[] = '<input ' . GeneralUtility::implodeAttributes($permission['attributes'], true, true) . '>'; - $tableRows[] = '<label class="form-check-label" for="' . $permission['attributes']['id'] . '">' . htmlspecialchars($permission['label']) . '</label>'; $tableRows[] = '</div>'; $tableRows[] = '</td>'; } ``` -
Christian Kuhn commented on patch set 75 07/06/24, 09:02
Reply
We'll keep the solution as is: the proposed constant solution is easy to grasp and internal, no need to abstract further.Reply
Ayke. This patch went through 3 major refactorings already. We're aiming for a merge now, finally. Your proposal changes checkbox.css which has potentially more impact than the current patch. I suggest to push such a change as dedicated patch to have after this is merged to have a dedicated look at it in a new patch review loop.TablePermissionElement.php:34Replyturning this private const into an enum class is over-abstraction and not needed here.TablePermissionElement.php:63ReplyDoneTablePermissionElement.php:108ReplyDone -
Christian Kuhn commented on patch set 75 07/06/24, 09:06
TablePermissionElement.php:63Replyactually, there is a subtle difference when the value is null. we'll keep the array_key_exists() solution. -
Christian Kuhn uploaded patch set 76
CR +1V +107/06/24, 09:20 -
Christian Kuhn voted on patch set 76 CR +1 V +1 07/06/24, 09:20
-
core-ci voted on patch set 76 V +1 07/06/24, 09:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61093
-
Marcin Sągol voted on patch set 76 CR +1 V +1 07/06/24, 10:11
-
Ayke Halder commented on patch set 76 07/06/24, 10:50
TablePermissionElement.php:34Constants are usually written all upper-case. Just wondering why there is no PHP CS Fixer rule for this. -
Christian Kuhn commented on patch set 76 07/06/24, 11:05
TablePermissionElement.php:34Replyrejected. there is no hard rule and this is everything but important for a private constant that is strictly bound to this class. -
Georg Ringer voted on patch set 76 CR +1 V +1 07/06/24, 11:09
-
Ayke Halder commented on patch set 76 07/06/24, 11:35
To follow PSR-1/PSR-12/PER-CS2.0 constants must be all upper case. No need to discuss this here. I opened an issue for this: https://github.com/TYPO3/coding-standards/issues/138TablePermissionElement.php:34ReplyThere are no hard rules but TYPO3 follows coding standards. --- ### PSR-1: Basic Coding Standard https://www.php-fig.org/psr/psr-1/#1-overview > * Class constants MUST be declared in all upper case with underscore separators. --- ### PSR-12: Extended Coding Style & PER Coding Style 2.0 https://www.php-fig.org/psr/psr-12/#21-basic-coding-standard https://www.php-fig.org/per/coding-style/#2-general > #### 2.1 Basic Coding Standard > Code MUST follow all rules outlined in PSR-1. -
Christian Kuhn commented on patch set 76 07/06/24, 12:06
Reply
core itself does not use this repo.TablePermissionElement.php:34Replythis patch is not the right place to discuss general CGL topics. -
Oli Bartsch commented on patch set 76 CR +2 V +2 07/06/24, 17:25
Thanks to all involved. Now, after three rounds of rework and a lot of discussions, the patch is now in a state where we should get it in as it's main goal, to combine those two fields UX-wise, is achieved. All further topics, e.g. change of labels, radio size / color, etc. should be handled in separate patches. -
Oli Bartsch merged patch set 77 07/06/24, 17:26