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

ui: Add ability to sort service based on health #7989

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

johncowen
Copy link
Contributor

@johncowen johncowen commented May 29, 2020

This PR adds the ability to sort Services based on their health.

I would imagine that moving forwards we will potentially need several of these, so I followed the same pattern as our 'searchables' here, which allow us to use pure vanilla javascript to define searching functionality per model.

This gives us a set of 'comparators' (currently there only being one), that we can use in any template/component via the helper in a composable fashion, without the functionality being tied to any one Controller or Mixin.

'Comparators' can either return a simple string or a comparator function, both of which are accepted by the ember-composable-helpers sort-by helper.

Unit and simple acceptance tests are added here.

@johncowen johncowen added the theme/ui Anything related to the UI label May 29, 2020
@johncowen johncowen requested a review from a team May 29, 2020 15:54
This moves custom sorting to use the same pattern as custom searching.
@johncowen johncowen added this to the 1.8.0 milestone Jun 3, 2020
@johncowen johncowen marked this pull request as ready for review June 3, 2020 12:14
Copy link
Contributor

@kaxcode kaxcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johncowen johncowen merged this pull request into ui-staging Jun 3, 2020
@johncowen johncowen deleted the ui/feature/health-based-sorting branch June 3, 2020 16:07
johncowen added a commit that referenced this pull request Jun 3, 2020
* ui: Add ability to sort service based on health

* ui: Move custom sorting to sort/comparator Service/Helper (like search)

This moves custom sorting to use the same pattern as custom searching.

* Remove old Controller based comparator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants