mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-30 18:46:26 +01:00
@@ -212,7 +212,8 @@ const PropertyType = {
|
||||
PreRelease: 'Microsoft.VisualStudio.Code.PreRelease',
|
||||
LocalizedLanguages: 'Microsoft.VisualStudio.Code.LocalizedLanguages',
|
||||
WebExtension: 'Microsoft.VisualStudio.Code.WebExtension',
|
||||
SponsorLink: 'Microsoft.VisualStudio.Code.SponsorLink'
|
||||
SponsorLink: 'Microsoft.VisualStudio.Code.SponsorLink',
|
||||
SupportLink: 'Microsoft.VisualStudio.Services.Links.Support',
|
||||
};
|
||||
|
||||
interface ICriterium {
|
||||
@@ -439,6 +440,10 @@ function getSponsorLink(version: IRawGalleryExtensionVersion): string | undefine
|
||||
return version.properties?.find(p => p.key === PropertyType.SponsorLink)?.value;
|
||||
}
|
||||
|
||||
function getSupportLink(version: IRawGalleryExtensionVersion): string | undefined {
|
||||
return version.properties?.find(p => p.key === PropertyType.SupportLink)?.value;
|
||||
}
|
||||
|
||||
function getIsPreview(flags: string): boolean {
|
||||
return flags.indexOf('preview') !== -1;
|
||||
}
|
||||
@@ -550,7 +555,8 @@ function toExtension(galleryExtension: IRawGalleryExtension, version: IRawGaller
|
||||
hasReleaseVersion: true,
|
||||
preview: getIsPreview(galleryExtension.flags),
|
||||
isSigned: !!assets.signature,
|
||||
queryContext
|
||||
queryContext,
|
||||
supportLink: getSupportLink(latestVersion)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -219,6 +219,7 @@ export interface IGalleryExtension {
|
||||
properties: IGalleryExtensionProperties;
|
||||
telemetryData?: any;
|
||||
queryContext?: IStringDictionary<any>;
|
||||
supportLink?: string;
|
||||
}
|
||||
|
||||
export interface IGalleryMetadata {
|
||||
|
||||
@@ -940,6 +940,11 @@ export class ExtensionEditor extends EditorPane {
|
||||
if (extension.url) {
|
||||
resources.push([localize('Marketplace', "Marketplace"), URI.parse(extension.url)]);
|
||||
}
|
||||
if (extension.url && extension.supportUrl) {
|
||||
try {
|
||||
resources.push([localize('issues', "Issues"), URI.parse(extension.supportUrl)]);
|
||||
} catch (error) {/* Ignore */ }
|
||||
}
|
||||
if (extension.repository) {
|
||||
try {
|
||||
resources.push([localize('repository', "Repository"), URI.parse(extension.repository)]);
|
||||
|
||||
@@ -217,6 +217,10 @@ export class Extension implements IExtension {
|
||||
return this.gallery && this.gallery.assets.license ? this.gallery.assets.license.uri : undefined;
|
||||
}
|
||||
|
||||
get supportUrl(): string | undefined {
|
||||
return this.gallery && this.gallery.supportLink ? this.gallery.supportLink : undefined;
|
||||
}
|
||||
|
||||
get state(): ExtensionState {
|
||||
return this.stateProvider(this);
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ export interface IExtension {
|
||||
readonly description: string;
|
||||
readonly url?: string;
|
||||
readonly repository?: string;
|
||||
readonly supportUrl?: string;
|
||||
readonly iconUrl: string;
|
||||
readonly iconUrlFallback: string;
|
||||
readonly licenseUrl?: string;
|
||||
|
||||
Reference in New Issue
Block a user