remove the extension name link (#8271)

* remove the extension name link

* pr comments

* pr comments
This commit is contained in:
Alan Ren
2019-11-09 13:37:09 -08:00
committed by GitHub
parent 7f7052ad42
commit e2ef1f8a89
2 changed files with 20 additions and 8 deletions

View File

@@ -60,6 +60,7 @@ import { renderMarkdownDocument } from 'vs/workbench/contrib/markdown/common/mar
import { IModeService } from 'vs/editor/common/services/modeService';
import { TokenizationRegistry } from 'vs/editor/common/modes';
import { generateTokensCSSForColorMap } from 'vs/editor/common/modes/supports/tokenization';
import { ExtensionsViewlet } from 'vs/workbench/contrib/extensions/browser/extensionsViewlet';
function removeEmbeddedSVGs(documentContent: string): string {
const newDocument = new DOMParser().parseFromString(documentContent, 'text/html');
@@ -358,7 +359,7 @@ export class ExtensionEditor extends BaseEditor {
this.telemetryService.publicLog('extensionGallery:openExtension', assign(extension.telemetryData, recommendationsData));
toggleClass(template.name, 'clickable', !!extension.url);
toggleClass(template.publisher, 'clickable', !!extension.url);
toggleClass(template.publisher, 'clickable', !!extension.publisher); // {{SQL CARBON EDIT}} !!extension.url -> !!extension.publisher, for ADS we don't have marketplace website, but still want to make it clickable and filter extensions by publisher
toggleClass(template.rating, 'clickable', !!extension.url);
if (extension.url) {
this.transientDisposables.add(this.onClick(template.name, () => this.openerService.open(URI.parse(extension.url!))));
@@ -379,13 +380,20 @@ export class ExtensionEditor extends BaseEditor {
template.license.style.display = 'none';
}
// {{SQL CARBON EDIT}} add license url
if (extension.licenseUrl) {
template.license.onclick = finalHandler(() => window.open(extension.licenseUrl));
template.license.style.display = 'initial';
} else {
template.license.onclick = null;
template.license.style.display = 'none';
// {{SQL CARBON EDIT}}
// copied from the the extension.url condition block above
// for ADS the extension.url will be empty but we still want to make the publisher and license controls to be clickable
if (!extension.url) {
if (extension.licenseUrl) {
this.transientDisposables.add(this.onClick(template.license, () => this.openerService.open(URI.parse(extension.licenseUrl!))));
template.license.style.display = 'initial';
} else {
template.license.style.display = 'none';
}
this.transientDisposables.add(this.onClick(template.publisher, () => {
this.viewletService.openViewlet(VIEWLET_ID, true)
.then((viewlet: ExtensionsViewlet) => viewlet.search(`publisher:"${extension.publisherDisplayName}"`));
}));
}
// {{SQL CARBON EDIT}} - End

View File

@@ -118,11 +118,15 @@ class Extension implements IExtension {
}
get url(): string | undefined {
// {{SQL CARBON EDIT}} - ADS doesn't have a marketplace website.
return undefined;
/*
if (!this.productService.extensionsGallery || !this.gallery) {
return undefined;
}
return `${this.productService.extensionsGallery.itemUrl}?itemName=${this.publisher}.${this.name}`;
*/
}
// {{SQL CARBON EDIT}}