Bug #3266
Station Panel - Implement A-Z Sorting for Station Lists Across All Pages
Description
Currently, station lists are displayed in inconsistent order across multiple pages in the application (e.g., Received History, Station Selling Price, Station Expense Ledger, Payout Ledger, Transactions — Transfers/Expenses). There is no alphabetical sorting applied. Users face difficulty in locating a specific station, especially when the list contains many stations (101+ stations shown in some pages).
implementing A-Z alphabetical sorting by Station Name consistently across all pages where a station list or station filter dropdown is displayed.
And also station panel open
Updated by Shreya Agarwal 7 days ago
implement alphabetical sorting for station dropdown filters across multiple modules and resolve duplicate charger naming in the charger details drawer
First, on the Transactions page (/stations/expenses/claims in
EmployeeExpenseClaimsPage.tsx
) implemented case-insensitive alphabetical (A–Z) sorting for the Station filter dropdown. Following the existing project patterns found in reference pages like /stations/service, memoized the dynamically fetched stations using useMemo and sorted them via .toLowerCase().localeCompare(), ensuring that stations appear in clean alphabetical order without redundant re-renders.
Second, on the Payout Ledger page I applied the identical A–Z alphabetical sorting pattern to the Station filter dropdown (Search stations). The dynamically loaded stations from the API are sorted via useMemo, allowing users to quickly find stations in alphabetical sequence.
Third, on the Station Expense Ledger report page implemented the same A–Z alphabetical sorting for the Station filter dropdown (All stations). The station list received from the API is memoized and sorted alphabetically before binding to the Autocomplete component.
fourth Alphabetically sorted the Station filter dropdown (All stations).
Daily Vendor Tariff Validation Page Implemented alphabetical sorting for both the Station filter dropdown and the Charger filter dropdown, ensuring filtered chargers are listed in A–Z order.
Also Charger Details Drawer Redundant Naming Fix
Global Charger Details Slider (
MachineDetailsSlider.tsx
): Addressed the issue where identical charger names were duplicated in the drawer header subtitle (e.g., Chargejet QA Chargeer · Chargejet QA Chargeer) due to joining machineName and displayName. Updated the subtitle to cleanly display only machineDetails?.machineName, resolving redundant naming across all charger panels application-wide while preserving display name details inside the Basic Information card.
3. Station Details Panel Integration
component to open the station details side drawer without altering any existing styles or layout:
Station Selling Price Page Enabled clicking on the station name in the Station Name column to open the Station Details panel, using e.stopPropagation() to prevent conflicting row-click events while preserving all original text styles.
Received / Capital Fund Receipt Page - Connected the same panel logic to station names in the Received History table and the single-station view header, allowing users to inspect full station details directly while keeping existing receipt action buttons intact.
and in the Charger Details side drawer, resolved the redundant duplicate name display in the drawer header subtitle. Previously, the component concatenated machineName and displayName with a dot separator, which resulted in duplicate identical names when both fields held the same value (e.g., Chargejet QA Chargeer · Chargejet QA Chargeer).