Skip to content

Conversation

@gokulvij
Copy link
Collaborator

Summary

  • Add SortOrder property to GroupDto class to expose sort_order values in API responses
  • Update all service mappings (StatusService, EndpointService, HistoryService) to include SortOrder
  • Fix StatusService sorting logic to use Group.SortOrder instead of GroupId
  • Implement proper group ordering: SortOrder ascending (nulls last), then Name

Changes Made

  • StatusDtos.cs: Added SortOrder property to GroupDto
  • StatusService.cs: Updated GroupDto mapping and fixed sorting in GetLiveStatusAsync and group caching
  • EndpointService.cs: Updated GroupDto mapping to include SortOrder
  • HistoryService.cs: Updated GroupDto mapping to include SortOrder

Test Plan

  • Verify API responses include sort_order values for groups
  • Test that groups are sorted by sort_order in live status endpoint
  • Test that groups without sort_order appear last in lists
  • Verify endpoint sorting follows group sort_order, then group name, then endpoint name

Impact

  • Groups with sort_order defined in YAML configuration will now be properly ordered in UI
  • Groups without sort_order will appear last (sorted by name)
  • All API endpoints (live status, endpoint details, history) now provide consistent group ordering

🤖 Generated with Claude Code

- Add SortOrder property to GroupDto class
- Update StatusService, EndpointService, and HistoryService to include SortOrder in GroupDto mappings
- Fix StatusService sorting to use Group.SortOrder instead of GroupId
- Implement proper group ordering: SortOrder (nulls last), then Name
- Ensure all API responses (live status, endpoints, history) include sort_order values
- Groups without sort_order will appear last in UI lists

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
gokulvij and others added 2 commits September 23, 2025 12:44
- Fix JSON schema to allow null values for color and sort_order fields
- Update both server and test schema files to use ["string", "null"] for color
- Update sort_order to allow ["integer", "string", "null"] values
- Resolves validation failures when saving groups without optional fields

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…ation

- Create OptionalRegularExpressionAttribute that properly handles null/empty values
- Replace RegularExpression attribute with custom attribute for Color field
- Allows groups to be saved without color field while validating hex format when present
- Fixes validation failures when optional fields (color, sort_order, parent_id) are missing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants