This commit is contained in:
Sandeep Somavarapu
2024-01-08 13:57:52 +01:00
committed by GitHub
parent 3beaab3f7c
commit b0b59b4c5a
5 changed files with 19 additions and 2 deletions
@@ -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;