Page MenuHomeIn-Portal Phabricator

INP-1791 - Add "picker" control type for configuration settings
ClosedPublic

Authored by alex on Dec 9 2020, 7:40 AM.

Details

Test Plan
  1. login to Admin Console
  2. go to {Configuration > Website > General} section
  3. click Edit link next to Website name setting
  4. change Input Type field value to Picker
  5. specify 1=+one||2=+two||3=+three in the List of Values field
  6. save changes
  7. confirm, that the Selected Items list is empty and 3 configured above items (one, two and three) are shown in the Available Items list
  8. move any 1 or 2 items from Available Items to Selected Items list and save changes
  9. confirm, that items stayed in Available Items and Selected Items lists (as they were moved) after the page is reloaded
  10. move all items from the Selected Items list into the Available Items list and save changes
  11. confirm, that items stayed in Available Items and Selected Items lists (as they were moved) after the page is reloaded
  12. confirm, that items adding items to a list would sort that list alphabetically

v1.1:

  • replaced Checkboxes with Picker in item 4 of the test plan

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.3.x
Lint
Lint ErrorsExcuse: Not fixing code, that wasn't added in this task.
SeverityLocationCodeMessage
Errorcore/kernel/db/db_tag_processor.php:2185PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace
Errorcore/kernel/db/db_tag_processor.php:2185PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace
Unit
No Unit Test Coverage
Build Status
Buildable 961
Build 961: arc lint + arc unit

Event Timeline

alex created this revision.Dec 9 2020, 7:40 AM
alex requested review of this revision.Dec 9 2020, 7:40 AM
alex updated this revision to Diff 940.Dec 9 2020, 7:57 AM

Added missing option/phrase for configuration editor screen.

alex edited the test plan for this revision. (Show Details)Dec 9 2020, 8:10 AM
alex added a project: Restricted Project.
erik requested changes to this revision.Jul 15 2022, 12:48 PM
  1. In the test plan part 4 need "Picker" value, not "Checkboxes"
  2. However, if "Checkboxes" selected, looks incorrect - shown only one checkbox, not multiple checkboxes with one-two-three labels.
  3. Items alphabetical sorting is not applied on page load, so after save/on page reload options order may change.
This revision now requires changes to proceed.Jul 15 2022, 12:48 PM
alex edited the test plan for this revision. (Show Details)Jul 19 2022, 4:54 AM
alex edited the test plan for this revision. (Show Details)
alex added a comment.Jul 19 2022, 5:15 AM

In the test plan part 4 need "Picker" value, not "Checkboxes"

Fixed.

However, if "Checkboxes" selected, looks incorrect - shown only one checkbox, not multiple checkboxes with one-two-three labels.

This is a known issue. In the database, the value is checkbox, but the phrase is translated as Checkboxes instead of a Checkbox.

Items alphabetical sorting is not applied on page load, so after save/on page reload options order may change.

It's a fascinating observation (seriously). I've also noticed, that the same problem would happen in all places, that use the select_sort JavaScript function (e.g. payment type user group editor). Not sure if it's worth fixing, because the order of elements doesn't affect the usage of the system setting with the Picker element type.


Verdict: it's OK to approve now.

alex requested review of this revision.Jul 19 2022, 5:16 AM
erik accepted this revision.Jul 19 2022, 7:58 AM
This revision is now accepted and ready to land.Jul 19 2022, 7:58 AM
This revision was landed with ongoing or failed builds.Jul 20 2022, 2:09 AM
This revision was automatically updated to reflect the committed changes.