Skip to content

Commit

Permalink
fix(index): sort pact publication by date, not string
Browse files Browse the repository at this point in the history
Use data-text attribute with date converted to integer to properly sort
column
  • Loading branch information
eraffel-MDSol authored and bethesque committed Aug 30, 2019
1 parent 3ccda93 commit 75d3580
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/pact_broker/ui/view_models/index_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ def publication_date_of_latest_pact
PactBroker::DateHelper.distance_of_time_in_words(date, DateTime.now) + " ago"
end

def publication_date_of_latest_pact_order
@relationship.latest_pact.created_at.to_time.to_i
end

def verification_status
case @relationship.verification_status
when :success then "success"
Expand Down
2 changes: 1 addition & 1 deletion lib/pact_broker/ui/views/index/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
%a{ href: index_item.provider_group_url }
= escape_html(index_item.provider_name)
%td
%td
%td{"data-text": index_item.publication_date_of_latest_pact_order}
= index_item.publication_date_of_latest_pact
%td{class: index_item.webhook_status}
%a{ href: index_item.webhook_url }
Expand Down

0 comments on commit 75d3580

Please sign in to comment.