UX: Rename Priority to score for sorting. (#9846)

UX: Rename Priority to score for sorting. (#9846)

diff --git a/app/assets/javascripts/discourse/app/controllers/review-index.js b/app/assets/javascripts/discourse/app/controllers/review-index.js
index 103edb4..28f8262 100644
--- a/app/assets/javascripts/discourse/app/controllers/review-index.js
+++ b/app/assets/javascripts/discourse/app/controllers/review-index.js
@@ -57,14 +57,12 @@ export default Controller.extend({
 
   @discourseComputed
   sortOrders() {
-    return ["priority", "priority_asc", "created_at", "created_at_asc"].map(
-      order => {
-        return {
-          id: order,
-          name: I18n.t(`review.filters.orders.${order}`)
-        };
-      }
-    );
+    return ["score", "score_asc", "created_at", "created_at_asc"].map(order => {
+      return {
+        id: order,
+        name: I18n.t(`review.filters.orders.${order}`)
+      };
+    });
   },
 
   @discourseComputed
@@ -129,14 +127,14 @@ export default Controller.extend({
         priorityStatuses.includes(nextStatus) &&
         nextOrder === "created_at"
       ) {
-        nextOrder = "priority";
+        nextOrder = "score";
       }
 
       if (
         priorityStatuses.includes(currentStatus) &&
-        currentOrder === "priority" &&
+        currentOrder === "score" &&
         createdAtStatuses.includes(nextStatus) &&
-        nextOrder === "priority"
+        nextOrder === "score"
       ) {
         nextOrder = "created_at";
       }
diff --git a/app/assets/javascripts/discourse/app/routes/review-index.js b/app/assets/javascripts/discourse/app/routes/review-index.js
index b83a951..7311678 100644
--- a/app/assets/javascripts/discourse/app/routes/review-index.js
+++ b/app/assets/javascripts/discourse/app/routes/review-index.js
@@ -7,7 +7,7 @@ export default DiscourseRoute.extend({
       if (params.status === "reviewed" || params.status === "all") {
         params.sort_order = "created_at";
       } else {
-        params.sort_order = "priority";
+        params.sort_order = "score";
       }
     }
 
diff --git a/app/models/reviewable.rb b/app/models/reviewable.rb
index 99c2ad6..8e8cbd4 100644
--- a/app/models/reviewable.rb
+++ b/app/models/reviewable.rb
@@ -450,7 +450,7 @@ class Reviewable < ActiveRecord::Base
     min_score = Reviewable.min_score_for_priority(priority)
 
     order = case sort_order
-            when 'priority_asc'
+            when 'score_asc'
               'reviewables.score ASC, reviewables.created_at DESC'
             when 'created_at'
               'reviewables.created_at DESC, reviewables.score DESC'
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index a8ff521..1d2615f 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -512,8 +512,8 @@ en:
         status: "Status"
         category: "Category"
         orders:
-          priority: "Priority"
-          priority_asc: "Priority (reverse)"
+          score: "Score"
+          score_asc: "Score (reverse)"
           created_at: "Created At"
           created_at_asc: "Created At (reverse)"
 
diff --git a/spec/models/reviewable_spec.rb b/spec/models/reviewable_spec.rb
index 8d58d6a..96604b7 100644
--- a/spec/models/reviewable_spec.rb
+++ b/spec/models/reviewable_spec.rb
@@ -159,11 +159,11 @@ RSpec.describe Reviewable, type: :model do
           r0 = Fabricate(:reviewable, score: 100, created_at: 3.months.ago)
           r1 = Fabricate(:reviewable, score: 999, created_at: 1.month.ago)
 
-          list = Reviewable.list_for(user, sort_order: 'priority')
+          list = Reviewable.list_for(user, sort_order: 'score')
           expect(list[0].id).to eq(r1.id)
           expect(list[1].id).to eq(r0.id)
 
-          list = Reviewable.list_for(user, sort_order: 'priority_asc')
+          list = Reviewable.list_for(user, sort_order: 'score_asc')
           expect(list[0].id).to eq(r0.id)
           expect(list[1].id).to eq(r1.id)
 

GitHub sha: 461df7d0

1 Like

This commit appears in #9846 which was approved by eviltrout. It was merged by romanrizzi.