提交 ea0fb52c 编写于 作者: J Joao Moreno

fixes #27229

上级 7f8b6a8c
...@@ -176,7 +176,8 @@ export enum SortBy { ...@@ -176,7 +176,8 @@ export enum SortBy {
PublisherName = 3, PublisherName = 3,
InstallCount = 4, InstallCount = 4,
PublishedDate = 5, PublishedDate = 5,
AverageRating = 6 AverageRating = 6,
WeightedRating = 12
} }
export enum SortOrder { export enum SortOrder {
......
...@@ -159,7 +159,7 @@ export class ExtensionsListView extends CollapsibleView { ...@@ -159,7 +159,7 @@ export class ExtensionsListView extends CollapsibleView {
switch (query.sortBy) { switch (query.sortBy) {
case 'installs': options = assign(options, { sortBy: SortBy.InstallCount }); break; case 'installs': options = assign(options, { sortBy: SortBy.InstallCount }); break;
case 'rating': options = assign(options, { sortBy: SortBy.AverageRating }); break; case 'rating': options = assign(options, { sortBy: SortBy.WeightedRating }); break;
case 'name': options = assign(options, { sortBy: SortBy.Title }); break; case 'name': options = assign(options, { sortBy: SortBy.Title }); break;
} }
...@@ -174,6 +174,7 @@ export class ExtensionsListView extends CollapsibleView { ...@@ -174,6 +174,7 @@ export class ExtensionsListView extends CollapsibleView {
result = result.sort((e1, e2) => e2.installCount - e1.installCount); result = result.sort((e1, e2) => e2.installCount - e1.installCount);
break; break;
case SortBy.AverageRating: case SortBy.AverageRating:
case SortBy.WeightedRating:
result = result.sort((e1, e2) => e2.rating - e1.rating); result = result.sort((e1, e2) => e2.rating - e1.rating);
break; break;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册