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

emptyOption for controller filters #3116

Closed
hambern opened this issue Sep 15, 2017 · 14 comments
Closed

emptyOption for controller filters #3116

hambern opened this issue Sep 15, 2017 · 14 comments

Comments

@hambern
Copy link
Contributor

hambern commented Sep 15, 2017

Expected behavior

Just like I can add an emptyOption to fields in the backend forms i would like to be able to filter the fields with an emptyOption as well. Like this:

status:
        label: acme.plugin::lang.string.status
        modelClass: Acme\Plugin\Models\Status
        conditions: status_id in (:filtered)
        emptyOption: acme.plugin::lang.string.none
Actual behavior

No empty option shows up

Reproduce steps
  1. Add an emptyOption string to a filter
  2. See the result
October build

423

@LukeTowers
Copy link
Contributor

Mind explaining a bit more how this would work?

@hambern
Copy link
Contributor Author

hambern commented Sep 15, 2017

Not at all. Like this:

Lets say I have a status_id column in the database. It could either be an integer or NULL (or 0). That relates to another table's id number.

Then Lets say the relation looks like this Stuff –> belongsTo -> Status.

This can be done as a field in the backend like this:

status:
        label: 'maker.plugin::lang.string.status'
        type: relation
        emptyOption: 'maker.plugin::lang.string.none'

Now I want to be able to filter the list based on this. Including the Stuff with status_id NULL or 0. And preferably like this:

status:
        type: group
        label: 'maker.plugin::lang.string.status'
        modelClass: Maker\Plugin\Models\Status
        conditions: status_id in (:filtered)
        emptyOption: 'maker.plugin::lang.string.none'

Than I want it to list the Statuses like it does right now, but add an emptyOption that adds the string maker.plugin::lang.string.none to the list and adds null (or 0) to the (:filtered). Look at it as the inversion of the field.

How to this technically I have no idea ;) Explained my self enough?

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see action on it, please respond and we will get the ball rolling.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see action on it, please respond and we will get the ball rolling.

@github-actions
Copy link

github-actions bot commented Jan 7, 2020

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.

@github-actions
Copy link

github-actions bot commented Feb 7, 2020

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.

  • If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. - If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

github-actions bot commented Mar 9, 2020

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

github-actions bot commented Apr 9, 2020

This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

github-actions bot commented Jun 9, 2020

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

github-actions bot commented Aug 9, 2020

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

github-actions bot commented Oct 9, 2020

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@github-actions
Copy link

github-actions bot commented Feb 9, 2021

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

@daftspunk
Copy link
Member

This was easy enough to implement so I just did it. You can expect it in the next update. Thanks @hambern 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants