freescout-helpdesk / freescout

FreeScout — Free self-hosted help desk & shared mailbox (Zendesk / Help Scout alternative)
https://freescout.net
GNU Affero General Public License v3.0
2.67k stars 458 forks source link

Sort conversations in Custom Folder in ascending order by the last_reply_at column by default #4014

Closed mahavirn closed 1 week ago

mahavirn commented 2 weeks ago

Hi @freescout-helpdesk

We had a requirement that we wanted to sort conversations in Custom Folders in ascending order by the last_reply_at column. So, I checked the code, and there was an Eventy filter available for the same. Therefore, I added the following listener in the AppServiceProvider.

\Eventy::addFilter('folder.conversations_order_by', function($order_by) {
            return [
                    ['last_reply_at' => 'asc']
                ];
        }, 20, 1);

But after doing that, the in page Table Sorting is not working. Please fix it for Custom Folders.

Thank You.

Screenshot 2024-05-03 at 10 38 23 PM
freescout-helpdesk commented 2 weeks ago

It looks like you want conversations in Custom Folders to be sorted in ascending order by the last_reply_at column by default?

mahavirn commented 2 weeks ago

Yes, Thats what i want, but when i am doing via above code, the front-end pagination is not working.

freescout-helpdesk commented 2 weeks ago

There is no such possibility for now. Feel free to submit a feature request: https://freescout.net/request-feature/

mahavirn commented 2 weeks ago

But i can do it via Eventy code that i shared above. The only fix needed from your side is to make sure the front-end sorting is working fine after doing changes in AppServiceProvider.

freescout-helpdesk commented 2 weeks ago

Feel free to send a pull request.

mahavirn commented 2 weeks ago

Okay understood. Thanks!