Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DFV: Clean up all selection limit enforcement #4197

Closed
5 tasks done
JoryHogeveen opened this issue May 16, 2017 · 12 comments
Closed
5 tasks done

DFV: Clean up all selection limit enforcement #4197

JoryHogeveen opened this issue May 16, 2017 · 12 comments
Assignees
Milestone

Comments

@JoryHogeveen
Copy link
Member

JoryHogeveen commented May 16, 2017

PR: #4218

[Edit: This has become a generic "sweep up selection limits" issue]

  • I don't think there's a way to select no items once there has been a selection (er, whoops) [ctrl-click here... it's just whatever standard multiselect behavior is for the platform]
  • We need a plan for how to handle consecutive selections that go over the limit (click-select). This may need some discussion
  • Disable "add new" whenever selection limit is reached
  • Disable checkboxes to enforce limit, using the same approach as multiselect
  • Make sure all views still respect unlimited selection (limit = 0)
@JoryHogeveen JoryHogeveen added this to the Pods 2.7 milestone May 16, 2017
@JoryHogeveen JoryHogeveen changed the title Multiselect & checkboxes: max allowed values not working DFV: Multiselect & checkboxes: max allowed values not working May 16, 2017
@sc0ttkclark sc0ttkclark added Keyword: Puntable Type: Enhancement Enhancements to features that already exist, but are not major additions and removed Type: Bug labels May 17, 2017
@pglewis pglewis added Type: Bug and removed Type: Enhancement Enhancements to features that already exist, but are not major additions Keyword: Puntable labels May 17, 2017
@pglewis pglewis added Status: In Progress Issue or PR is currently in progress but not yet done Fixed / Needs Testing labels May 18, 2017
@pglewis pglewis changed the title DFV: Multiselect & checkboxes: max allowed values not working DFV: Clean up all selection limit enforcement May 18, 2017
@pglewis
Copy link
Contributor

pglewis commented May 18, 2017

A couple different ways we could handle Add New at first blush:

  • Disable add new button if at selection limit
  • Allow add new but don't select it

@pglewis
Copy link
Contributor

pglewis commented May 18, 2017

Handy package to test various relationship views. All the relationships are set to WordPress Pages, simply because that's where I already had a dozen or so test records.

https://gist.github.com/pglewis/b15b71db343ecb19df8efae6c275b0a5

@pglewis
Copy link
Contributor

pglewis commented May 23, 2017

A couple different ways we could handle Add New at first blush:

Disable add new button if at selection limit
Allow add new but don't select it

@sc0ttkclark: probably an executive decision on how to handle this one

@sc0ttkclark
Copy link
Member

An idea -- disable add new button at selection limit but show some sort of text saying "you have reached the limit, remove items to select more"?

@pglewis
Copy link
Contributor

pglewis commented May 23, 2017

That'll go hand in hand with the "Come up with a UI indicator that will explain why the UI isn't letting you select more items" task item. We'll need that even if they don't allow add new on the field.

My thinking to this point is to have a message that the field is limited to N items and style that to red/alert whenever you're actually at the limit.

@pglewis
Copy link
Contributor

pglewis commented May 23, 2017

My thinking to this point is to have a message that the field is limited to N items and style that to red/alert whenever you're actually at the limit.

@JoryHogeveen: any brainstorming / placement ideas in that direction?

@jimtrue
Copy link
Contributor

jimtrue commented May 23, 2017

screenshot 2017-05-23 12 24 59

I actually really like the placement of this and agree the alert message should advise you to remove first to add a new one:
"You can only select # item(s). To add a new one, remove an existing record first."

@jimtrue
Copy link
Contributor

jimtrue commented May 23, 2017

Or possible when AT the selection limit, when you disable the add-new button, add a message to the right of the button: You are at the selection limit. To add new records, remove an existing one first.

@quasel
Copy link
Member

quasel commented May 23, 2017

Nicely done - agree with jim - it's alway better to be explicit if possible I would grey out the add new button too once the limit is reached

@JoryHogeveen
Copy link
Member Author

Nice one @jimtrue. I'd say that should be fine!

@sc0ttkclark
Copy link
Member

Messaging either next to add new button or above it in what Jim did an example of but not at top of list, it'd be at bottom of list.

It might also be handy to see %1$d of %2$d %3$s selected:

  • %1$d: # of items selected
  • %2$d: # of items allowed
  • %3$s: item vs items

Just an idea though.

@pglewis
Copy link
Contributor

pglewis commented May 23, 2017

I would grey out the add new button too once the limit is reached

That was definitely the plan all along for that, no way we could leave the button normal without some visual indicator.

Implemented now and ready to be tested.

@ghost ghost removed the Status: In Progress Issue or PR is currently in progress but not yet done label May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants