chatwoot/app/javascript/dashboard/components
Sivin Varghese 7c2ca1a07e
fix: Not using saved order_by when fetching conversation list (#11008)
# Pull Request Template

## Description

This PR fixes the issue where the saved `order_by` value for the
conversation list is not being applied. The feature was originally added
in PR https://github.com/chatwoot/chatwoot/pull/8237 but broke after
merging the Vue 3 migration PR
https://github.com/chatwoot/chatwoot/pull/10047

Fixes
https://linear.app/chatwoot/issue/CW-4110/not-using-the-saved-sort-order-by-option-from-ui-settings

**Cause of the Issue:**  
The previous implementation checked `orderBy` against the keys of the
sorting constants instead of their values. Since `orderBy` stores a
sorting value, this caused the condition to fail, leading to fallback to
the default sorting option.

**Solution:**  
The fix ensures that `orderBy` is validated against the values of the
sorting constants rather than the keys. This correctly applies the saved
sorting preference, while still falling back to the default if needed.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

**Loom video**

https://www.loom.com/share/ebe8a4d3f1c041c6862334dc3b6d43a3?sid=5167feb7-eb4a-4f2c-8211-662830ba946c




## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
2025-03-03 14:22:27 +05:30
..
Accordion fix: Remove overflow-hidden on accordionItem (#10692) 2025-01-16 01:29:20 +05:30
app style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
base feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
buttons refactor: show deprecation warnings in dev only (#10868) 2025-02-11 19:15:46 +05:30
copilot feat: allow copilot use without connecting an inbox (#10992) 2025-02-28 15:20:39 -08:00
layout chore: Add internal feature flags for Chatwoot Cloud (#10902) 2025-02-15 16:21:46 -08:00
specs feat: Add new sidebar for Chatwoot V4 (#10291) 2024-10-23 18:32:37 -07:00
table feat(v4): Update the report pages to show aggregate values (#10766) 2025-01-28 09:19:18 +05:30
ui feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
widgets feat: Add June events for linear integration (#11007) 2025-03-03 13:33:11 +05:30
ChannelSelector.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
ChatList.vue fix: Not using saved order_by when fetching conversation list (#11008) 2025-03-03 14:22:27 +05:30
ChatListHeader.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
Code.vue feat: update colors for v4 (#10660) 2025-01-15 17:13:03 +05:30
ConversationItem.vue fix: Usability issues in conversation card context menu (#10971) 2025-02-25 16:48:04 +05:30
CustomAttribute.vue chore(v4): Update colors (#10700) 2025-01-16 15:27:23 +05:30
CustomBrandPolicyWrapper.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
CustomSnoozeModal.vue fix: Update the styles for the datepicker in custom snooze modal (#10207) 2024-10-03 22:06:51 -07:00
FormSection.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
index.js feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
IntersectionObserver.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
MaskedText.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
Modal.vue refactor: show deprecation warnings in dev only (#10868) 2025-02-11 19:15:46 +05:30
ModalHeader.vue chore: fix circleci on vite build (#10214) 2024-10-07 15:27:41 +05:30
NetworkNotification.vue feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
policy.vue feat: Add visibility checks for installation types (#10773) 2025-02-21 14:48:31 -08:00
SettingsSection.vue feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
SidemenuIcon.vue feat: Add new sidebar for Chatwoot V4 (#10291) 2024-10-23 18:32:37 -07:00
Snackbar.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30
SnackbarContainer.vue feat: update notification settings (#10529) 2024-12-05 19:05:04 +05:30