Skip to content
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
## Unreleased

### Compatible changes
* `geordi branch` and `geordi commit` will now order the list of suggested issues by team

### Breaking changes

Expand Down
3 changes: 2 additions & 1 deletion lib/geordi/linear_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def choose_issue
if issues.empty?
Geordi::Interaction.fail('No issues to offer.')
end
issues.sort_by! { |i| -i.dig('state', 'position') }
team_ids = settings.linear_team_ids
issues.sort_by! { |i| [team_ids.index(i.dig('team', 'id')), -i.dig('state', 'position')] }
Comment on lines +42 to +43
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to have a test for this new behavior. I know it's a bit more difficult because we need to stub the linear responses but if we care about ordering I'd like to make sure the behavior is tested.


highline.choose do |menu|
max_label_length = 60
Expand Down