Ticket #6151 (closed Bug: fixed)

Opened 5 years ago

Last modified 3 years ago

Fix the Restrict Types page

Reported by: limi Owned by: seletz
Priority: major Milestone: 3.0b2
Component: Infrastructure Keywords: sprint
Cc:

Description

Current problems:

  • People forget to check the "Override settings"
  • The order of the two selection lists is opposite of what people expect

Attachments

bug_patch_constraintypes_6151 Download (399 bytes) - added by jonthomas1986 5 years ago.
bug_patch_test_constraintypes_6151 Download (1.1 KB) - added by jonthomas1986 5 years ago.
partial_fix_6151.diff Download (12.9 KB) - added by ramonski 5 years ago.
A partial fix for this bug. Needs review.
folder_constraintypes_form_redux.cpt Download (10.8 KB) - added by limi 5 years ago.
The much simplified version of the form ~limi

Change History

comment:1 Changed 5 years ago by limi

Ideally, something like this:

   ( ) Use defaults
 __(o) Specify manually_________________________
|                                               |
| Types in the menu                             |
| [x] Page     [ ] Folder    [ ] News Item      |
| [x] Event    [ ] Image     [ ] Collection     |
| [ ] File     [ ] Link                         |
|                                               |
|                                               |
| Additional available types                    |
|  x Page      [x] Folder    [ ] News Item      |
|  x Event     [x] Image     [ ] Collection     |
| [ ] File     [x] Link                         |
|_______________________________________________|


 [Save] [Cancel]


Legend:

[o] Radio button
[ ] Empty checkbox
[x] Selected checkbox
 x  Ghosted checkbox

Ideally, the fieldset is ghosted when Use Defaults is selected, and unghosted when you select Specify Manually, but that's something we need to solve generally in Plone too. We need that pattern in a lot of other locations too.

comment:2 Changed 5 years ago by limi

This might be useful (hiding the fieldset is also a way of doing it instead of ghosting):

 http://talk.quintagroup.com/blogs/myroslav/kss-opener/introduction

Changed 5 years ago by jonthomas1986

Changed 5 years ago by jonthomas1986

comment:3 Changed 5 years ago by jonthomas1986

Attached two patches to fix the first portion of this bug. One patch modifies the test_constraintypes file to add an additional test and correct another. The second patch modifies code within constraintypes to cause the list of defaultAddableTypes to come back sorted.

comment:4 Changed 5 years ago by hannosch

Sorting the values based on their title_or_id method doesn't make much sense. If we are to sort them, then we should sort them based on their translated title, to be consistent with the add-new-item dropdown.

comment:5 Changed 5 years ago by limi

  • Keywords sprint added
  • Milestone changed from UI Sprint (3.0) to 3.0

This is a good sprint task. :)

comment:6 Changed 5 years ago by seletz

  • Owner changed from alecm to seletz
  • Status changed from new to assigned

comment:7 Changed 5 years ago by seletz

  • Owner changed from seletz to ramonski
  • Status changed from assigned to new

comment:8 Changed 5 years ago by ramonski

  • Status changed from new to assigned

Changed 5 years ago by ramonski

A partial fix for this bug. Needs review.

comment:9 Changed 5 years ago by seletz

  • Owner changed from ramonski to limi
  • Status changed from assigned to new

Submitted further work on that one as r14090. UI is functional and usable, but maybe needs cleanup :)

comment:10 Changed 5 years ago by optilude

See also #5323.

comment:11 Changed 5 years ago by seletz

The javascript stuf is done. The checkboxes are greyed-out when clicking them is not allowed.

This IMHO has only plain HTML/CSS layout issues.

comment:12 Changed 5 years ago by limi

OK, I have tested the new implementation a bit, and it's a bit too easy to make the JS do things that are confusing and/or wrong. Part of the fault here lies with me, since I didn't do a good enough job in reducing this form to be as simple as it can possibly be.

I have attached a form (*_redux) that looks correct layout- and text-wise — so use that as your starting point — but it needs some changes to the JS since I haven't touched that.

It probably needs changes to the backend code too. I'm not sure how these variables are stored internally, but you might have to invert or move things from one variable to another when handling the form on submit. (Remember that changing how it is stored is not an option, since people have existing settings that need to work here :)

I'll try to explain the new approach below:

   ( ) Use defaults
 __(o) Specify manually_________________________
|                                               |
| Allowed types                                 |
| [x] Page     [ ] Folder    [ ] News Item      |
| [x] Event    [x] Image     [ ] Collection     |
| [ ] File     [ ] Link                         |
|                                               |
|                                               |
| Secondary types                               |
| [ ] Page      ·  Folder     ·  News Item      |
| [ ] Event    [x] Image      ·  Collection     |
|  ·  File      ·  Link                         |
|_______________________________________________|


 [Save] [Cancel]


Legend:

[o] Radio button
[ ] Empty checkbox
[x] Selected checkbox
 ·  Ghosted checkbox (unselected)

So, as you can see, it's close, but much simpler:

  • You first start with selecting what types should be allowed
  • Any types that *are* allowed are selectable in the Secondary types section
  • Any types that are *not* allowed have a ghosted checkbox in the Secondary types section
  • Any types selected in Secondary types will show up on the "More" menu

The above form in its current state would result in:

  • Page, Event, Image are all allowed in the folder
  • Page and Event show up in the menu
  • Image is available from the "More" menu

If you have time to look into this, I would be very grateful, and sorry for making the task so complex in the first place — I should have spent some more time thinking it through first.

Changed 5 years ago by limi

The much simplified version of the form ~limi

comment:13 Changed 5 years ago by seletz

  • Owner changed from limi to seletz
  • Status changed from new to assigned

Starting to work on that again. I'll have a look at limis form.

comment:14 Changed 5 years ago by seletz

  • Status changed from assigned to closed
  • Resolution set to fixed

Ok, this should be fixed now:

  • the form now works as prototyped by limi here
  • I added labels for the checkboxes
  • The checkboxes now are displayed in three columns, like the search control panel.

comment:15 Changed 3 years ago by hannosch

  • Component changed from Content Types to Infrastructure
Note: See TracTickets for help on using tickets.