Skip to content

Commit 303e0f4

Browse files
committed
feat: verified extensions in extension store
1 parent ac65602 commit 303e0f4

7 files changed

Lines changed: 20 additions & 5 deletions

File tree

src/extensibility/ExtensionManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ define(function (require, exports, module) {
112112
_idsToDisable = {};
113113

114114
PreferencesManager.stateManager.definePreference(FOLDER_AUTOINSTALL, "object", undefined);
115-
PreferencesManager.definePreference("extensions.sort", "string", "downloadCount", {
115+
PreferencesManager.definePreference("extensions.sort", "string", "totalDownloads", {
116116
description: Strings.SORT_EXTENSION_METHOD
117117
});
118118

src/extensibility/ExtensionManagerView.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,20 @@ define(function (require, exports, module) {
290290
context.disabled = (entry.installInfo && entry.installInfo.status === ExtensionManager.DISABLED);
291291
context.hasVersionInfo = !!info.versions;
292292

293+
let isVerified = false;
294+
if(context.ownershipVerifiedByGitHub){
295+
context.verified = StringUtils.format(Strings.EXTENSION_VERIFIED_PUBLISHER,
296+
context.ownershipVerifiedByGitHub[0].replace("https://", ""));
297+
context.verifiedURL = context.ownershipVerifiedByGitHub[0];
298+
isVerified = true;
299+
}
300+
293301
if (entry.registryInfo) {
294302
var latestVerCompatInfo = ExtensionManager.getCompatibilityInfo(entry.registryInfo, brackets.metadata.apiVersion);
295303
context.isCompatible = latestVerCompatInfo.isCompatible;
296304
context.requiresNewer = latestVerCompatInfo.requiresNewer;
297305
context.isCompatibleLatest = latestVerCompatInfo.isLatestVersion;
306+
entry.registryInfo.isVerified = isVerified ? 1 : 0;
298307
if (!context.isCompatibleLatest) {
299308
var installWarningBase = context.requiresNewer ? Strings.EXTENSION_LATEST_INCOMPATIBLE_NEWER : Strings.EXTENSION_LATEST_INCOMPATIBLE_OLDER;
300309
context.installWarning = StringUtils.format(installWarningBase, entry.registryInfo.versions[entry.registryInfo.versions.length - 1].version, latestVerCompatInfo.compatibleVersion);

src/extensibility/registry_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ define(function (require, exports, module) {
136136
sortedEntries.sort(function (entry1, entry2) {
137137
if (sortBy !== "publishedDate") {
138138
if (entry1.registryInfo && entry2.registryInfo) {
139-
return entry2.registryInfo.totalDownloads - entry1.registryInfo.totalDownloads;
139+
return entry2.registryInfo[sortBy] - entry1.registryInfo[sortBy];
140140
}
141141
return Number.NEGATIVE_INFINITY;
142142

src/extensions/default/DefaultExtensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"description": "list extension ids here that you want to show this warning in extension store: 'You may not need this extension. Phoenix comes built in with this feature.'",
4343
"note": "This is only to for legacy extensions that havent been updated for a long time, remove flag unconditionally if instructed by the extension author, but inform of the issues in extension.",
4444
"extensionIDs": [
45-
"brackets-beautify", "beautify.io", "hirse.beautify", "jsbeautifier", "sizuhiko.brackets.prettier", "pretty_json"
45+
"brackets-beautify", "beautify.io", "hirse.beautify", "jsbeautifier", "sizuhiko.brackets.prettier", "pretty_json",
46+
"bib-locked-live-preview"
4647
]
4748
}
4849
}

src/htmlContent/extension-manager-dialog.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
<div id="sort-attributes-icon"></div>
2828
<select class="sort-extensions">
2929
<option value="publishedDate">{{Strings.EXTENSIONS_LAST_UPDATED}}</option>
30-
<option value="downloadCount">{{Strings.EXTENSIONS_DOWNLOADS}}</option>
30+
<option value="totalDownloads">{{Strings.EXTENSIONS_DOWNLOADS}}</option>
31+
<option value="isVerified">{{Strings.EXTENSION_VERIFIED_SORT}}</option>
3132
</select>
3233
</div>
3334
<div class="search-container">

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<span class="muted ext-author">
66
{{{authorInfo}}}
77
{{#verified}}
8-
<img class="extn-verified" title="This publisher has verified ownership of {{verified}}" src="styles/images/verified.svg" style="width:1.5em;">
8+
<a href="{{verifiedURL}}">
9+
<img class="extn-verified" title="{{verified}}" src="styles/images/verified.svg" style="width:1.5em;">
10+
</a>
911
{{/verified}}
1012
</span>
1113
{{/authorInfo}}

src/nls/root/strings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ define({
589589
"MALFORMED_URL": "The URL is invalid. Please check that you entered it correctly.",
590590
"UNSUPPORTED_PROTOCOL": "The URL must be an http or https URL.",
591591
"UNKNOWN_ERROR": "Unknown internal error.",
592+
"EXTENSION_VERIFIED_PUBLISHER": "This publisher has verified ownership of {0}",
593+
"EXTENSION_VERIFIED_SORT": "Verified",
592594
// For NOT_FOUND_ERR, see generic strings above
593595
"EXTENSION_MANAGER_TITLE": "Extension Manager",
594596
"EXTENSION_MANAGER_ERROR_LOAD": "Unable to access the extension registry. Please try again later.",

0 commit comments

Comments
 (0)