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

Fix/1100 table sorting #1102

Merged
merged 2 commits into from
Jan 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions DSL/Resql/get-cs-all-ended-chats.sql
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,24 @@ ORDER BY
CASE WHEN :sorting = 'comment desc' THEN s.comment END DESC,
CASE WHEN :sorting = 'labels asc' THEN c.labels END ASC,
CASE WHEN :sorting = 'labels desc' THEN c.labels END DESC,
CASE WHEN :sorting = 'status asc' THEN c.status END ASC,
CASE WHEN :sorting = 'status desc' THEN c.status END DESC,
CASE
WHEN :sorting = 'status asc' THEN
CASE
WHEN m.event IS NULL OR m.event = '' THEN NULL
ELSE m.event
END
END ASC NULLS LAST,
CASE
WHEN :sorting = 'status desc' THEN
CASE
WHEN m.event IS NULL OR m.event = '' THEN NULL
ELSE m.event
END
END DESC NULLS LAST,
CASE WHEN :sorting = 'feedbackRating desc' THEN c.feedback_rating END DESC NULLS LAST,
CASE WHEN :sorting = 'feedbackRating asc' THEN c.feedback_rating END ASC,
CASE WHEN :sorting = 'customerSupportFullName desc' THEN (cu.first_name || ' ' || cu.last_name) END DESC NULLS LAST,
CASE WHEN :sorting = 'customerSupportFullName asc' THEN (cu.first_name || ' ' || cu.last_name) END ASC NULLS LAST,
CASE WHEN :sorting = 'id asc' THEN c.base_id END ASC,
CASE WHEN :sorting = 'id desc' THEN c.base_id END DESC
OFFSET ((GREATEST(:page, 1) - 1) * :page_size) LIMIT :page_size;