Skip to content

Commit 96f25ce

Browse files
committed
feat: star rating and sort for extension manager
1 parent 303e0f4 commit 96f25ce

6 files changed

Lines changed: 23 additions & 7 deletions

File tree

src/extensibility/ExtensionManagerView.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,17 @@ define(function (require, exports, module) {
298298
isVerified = true;
299299
}
300300

301+
if(context.gihubStars){
302+
context.githubStarCount = context.gihubStars;
303+
}
304+
301305
if (entry.registryInfo) {
302306
var latestVerCompatInfo = ExtensionManager.getCompatibilityInfo(entry.registryInfo, brackets.metadata.apiVersion);
303307
context.isCompatible = latestVerCompatInfo.isCompatible;
304308
context.requiresNewer = latestVerCompatInfo.requiresNewer;
305309
context.isCompatibleLatest = latestVerCompatInfo.isLatestVersion;
306310
entry.registryInfo.isVerified = isVerified ? 1 : 0;
311+
entry.registryInfo.githubStarCount = context.githubStarCount || 0;
307312
if (!context.isCompatibleLatest) {
308313
var installWarningBase = context.requiresNewer ? Strings.EXTENSION_LATEST_INCOMPATIBLE_NEWER : Strings.EXTENSION_LATEST_INCOMPATIBLE_OLDER;
309314
context.installWarning = StringUtils.format(installWarningBase, entry.registryInfo.versions[entry.registryInfo.versions.length - 1].version, latestVerCompatInfo.compatibleVersion);

src/extensibility/registry_utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ define(function (require, exports, module) {
106106
result = htmlEscape(userId);
107107
}
108108
if (ownerLink) {
109-
result = "<a href='" + htmlEscape(ownerLink) + "' title='" + htmlEscape(ownerLink) + "'>" + result + "</a>";
109+
result = `<a class="no-active-border" href='`
110+
+ htmlEscape(ownerLink) + "' title='" + htmlEscape(ownerLink) + "'>" + result + "</a>";
110111
}
111112
return result;
112113
};

src/htmlContent/extension-manager-dialog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<select class="sort-extensions">
2929
<option value="publishedDate">{{Strings.EXTENSIONS_LAST_UPDATED}}</option>
3030
<option value="totalDownloads">{{Strings.EXTENSIONS_DOWNLOADS}}</option>
31+
<option value="githubStarCount">{{Strings.EXTENSION_STAR_SORT}}</option>
3132
<option value="isVerified">{{Strings.EXTENSION_VERIFIED_SORT}}</option>
3233
</select>
3334
</div>

src/htmlContent/extension-manager-view-item.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<span class="muted ext-author">
66
{{{authorInfo}}}
77
{{#verified}}
8-
<a href="{{verifiedURL}}">
8+
<a href="{{verifiedURL}}" class="no-active-border">
99
<img class="extn-verified" title="{{verified}}" src="styles/images/verified.svg" style="width:1.5em;">
1010
</a>
1111
{{/verified}}
@@ -24,15 +24,17 @@
2424
{{/downloadCount}}
2525
</div>
2626
<div class="{{^githubStarCount}} forced-inVisible {{/githubStarCount}}">
27-
<div class="github-stars-button">
28-
<div class="parent">
27+
<a href="{{ownerRepo}}" class="no-active-border">
28+
<div class="github-stars-button">
29+
<div class="parent">
2930
<span class="starContainer">
3031
<i class="fa-regular fa-star star"></i>
31-
<span>Star</span>
32+
<span>{{Strings.EXTENSION_STAR}}</span>
3233
</span>
33-
<span class="count"> {{githubStarCount}} </span>
34+
<span class="count"> {{githubStarCount}} </span>
35+
</div>
3436
</div>
35-
</div>
37+
</a>
3638
</div>
3739
</div>
3840
</td>

src/nls/root/strings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ define({
591591
"UNKNOWN_ERROR": "Unknown internal error.",
592592
"EXTENSION_VERIFIED_PUBLISHER": "This publisher has verified ownership of {0}",
593593
"EXTENSION_VERIFIED_SORT": "Verified",
594+
"EXTENSION_STAR": "Star",
595+
"EXTENSION_STAR_SORT": "Star Rating",
594596
// For NOT_FOUND_ERR, see generic strings above
595597
"EXTENSION_MANAGER_TITLE": "Extension Manager",
596598
"EXTENSION_MANAGER_ERROR_LOAD": "Unable to access the extension registry. Please try again later.",

src/styles/brackets_patterns_override.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,11 @@ a[href^="http"] {
11611161
background-color: @bc-panel-bg-promoted;
11621162
min-width: @extension-manager-min-width;
11631163

1164+
.no-active-border:focus{
1165+
border-color: transparent !important;
1166+
box-shadow: none !important;
1167+
}
1168+
11641169
.current-theme-apply-hide{
11651170
display: none;
11661171
}

0 commit comments

Comments
 (0)