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

[Feature Request] And/Or filters over the Causer Model and Subject Model #19

Open
promatik opened this issue Aug 30, 2023 · 5 comments · May be fixed by #44
Open

[Feature Request] And/Or filters over the Causer Model and Subject Model #19

promatik opened this issue Aug 30, 2023 · 5 comments · May be fixed by #44
Assignees

Comments

@promatik
Copy link
Contributor

Feature Request

When coming for a Model that is both Subject and Causer, should the selected filters be with AND (default) or should it be OR?

image

Should we create that exception?


What if I come from the entry button?

image

Both the causer model and subject model are selected with User::class, and model and subject with Demo User entry. How should the filters behave?

@tabacitu
Copy link
Member

tabacitu commented Aug 30, 2023

We solve this tomorrow, if we have the time. This one, we can push as a non-breaking change.

When coming for a Model that is both Subject and Causer, should the selected filters be with AND (default) or should it be OR?

OR 💯

What if I come from the entry button? Both the causer model and subject model are selected with User::class, and model and subject with Demo User entry. How should the filters behave?

I... don't understand the question/dilemma... could you please rephrase?

@promatik
Copy link
Contributor Author

Basically, when coming from this button;
image

Entry Activity Log
It will default to have everything selected;
image

Causer Model and Subject Model + Causer and Subject
What should be the query?

where (causer_model = X or subject_model = X) AND (causer = Y or subject = Y)
or
where (causer_model = X or subject_model = X) AND causer = Y AND subject = Y
or
where (causer_model = X or subject_model = X or causer = Y or subject = Y)
?

My brain is melting now 😂 I'll come back to this in an hour ahaha

@promatik
Copy link
Contributor Author

Long story short, after asking @pxpm his opinion, in order to do this, we need to do some nasty stuff 😅

If we have the key to combine the results, in order to have it combined, we need to disable the filters and add the queries manually.

Something like this;
image

Should we proceed? 😬

@tabacitu
Copy link
Member

Ouch! So let me understand...

  • you are on Users table; next to user Elon Musk you see - See Activity; you click it;
  • you are sent to ActivityLog table; the Causer and Subject filter are completely removed; and within the table I only see the entries where either the Subject or the Causer are Elon Musk (depending on what the dev has chosen);

Is that correct? If so... I'm ok with it. I like it.

If we could also change the title / heading for this filtered view, so that it makes it clear it's a sub-filtration... that would be great.

@promatik
Copy link
Contributor Author

Most of the work is done at https://github.com/Laravel-Backpack/activity-log/tree/combined-filter.
Me and @tabacitu, we decided not to merge/work on it now because we don't have a proper UI/UX to display this filter.

@pxpm pxpm linked a pull request Sep 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants