FIX: Sort admin dashboard new updates by latest (#12146)
This commit is contained in:
parent
aac9e6cb0a
commit
7ee660a017
|
@ -664,7 +664,6 @@
|
|||
|
||||
.new-feature-content {
|
||||
padding-right: 0.5em;
|
||||
align-self: center;
|
||||
.header {
|
||||
font-size: $font-up-1;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -133,7 +133,7 @@ module DiscourseUpdates
|
|||
item["discourse_version"].nil? || Discourse.has_needed_version?(Discourse::VERSION::STRING, item["discourse_version"]) rescue nil
|
||||
end
|
||||
|
||||
entries.sort { |item| Time.zone.parse(item["created_at"]) }
|
||||
entries.sort_by { |item| Time.zone.parse(item["created_at"]).to_i }.reverse
|
||||
end
|
||||
|
||||
def has_unseen_features?(user_id)
|
||||
|
|
|
@ -202,8 +202,8 @@ describe DiscourseUpdates do
|
|||
|
||||
it 'correctly shows features by Discourse version' do
|
||||
features_with_versions = [
|
||||
{ "emoji" => "🤾", "title" => "Bells", "created_at" => 40.minutes.ago },
|
||||
{ "emoji" => "🙈", "title" => "Whistles", "created_at" => 20.minutes.ago, discourse_version: "2.6.0.beta1" },
|
||||
{ "emoji" => "🤾", "title" => "Bells", "created_at" => 2.days.ago },
|
||||
{ "emoji" => "🙈", "title" => "Whistles", "created_at" => 120.minutes.ago, discourse_version: "2.6.0.beta1" },
|
||||
{ "emoji" => "🙈", "title" => "Confetti", "created_at" => 15.minutes.ago, discourse_version: "2.7.0.beta2" },
|
||||
{ "emoji" => "🤾", "title" => "Not shown yet", "created_at" => 10.minutes.ago, discourse_version: "2.7.0.beta5" },
|
||||
{ "emoji" => "🤾", "title" => "Not shown yet (beta < stable)", "created_at" => 10.minutes.ago, discourse_version: "2.7.0" },
|
||||
|
|
Loading…
Reference in New Issue