-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Allow Sorting Based On EOL Date #12392
Conversation
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Allowing sorting via EOL.
|
EOL on the asset isn't sortable because it's not a native database field, it's calculated.
snipe-it/app/Presenters/AssetPresenter.php Lines 415 to 423 in 2564da6
|
Oh I see, my apologies! |
I think we'd need to do something more like this to make it work: #12393 |
I'd be happy to go into more detail on that PR if you have questions - it does get a bit in the weeds. Definitely appreciate you trying to solve it via this PR though. As you can see, it's a little trickier than it first seems offhand, as so many things are. |
Thank you so much! I really appreciate how welcoming and freindly to novices like myself y'all are! I guess I'm just curious as to why calculated values shouldn't be sorted. There's a lot of reading up I should probably do on php tbh 😅 |
It's honestly largely just the complexity of the query in the database (AND people have asked to be able to edit that date directly in the past, so we can kill two birds with one stone here.) Even though we technically only officially support MySQL and MariaDB, I do know that some folks are using other databases (pgSQL, SQLite, etc) so we generally try to keep those queries as simple as possible for maximum compatibility. That said, my PR could get rejected by my team come Monday, so... we'll see :D So it's a bit more of a product decision than it is a technical one, and there's no way you could have known every little thing that folks have asked for here. |
Allowing sorting via EOL.
Description
Saw a post ( #12372 ) requesting this, gave this change a test on our server and it seems to work fairly well. If an asset has a buy date and EOL on the model it can sort by the dates.
Fixes #12372
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tested on my server, another really small change in the asset presenter file.
Test Configuration:
Checklist: