未验证 提交 1351744f 编写于 作者: S Sandeep Somavarapu 提交者: GitHub

Merge pull request #36261 from golf1052/master

Show preview tag on extention page if extension is in preview
......@@ -157,6 +157,7 @@ export interface IGalleryExtension {
assets: IGalleryExtensionAssets;
properties: IGalleryExtensionProperties;
telemetryData: any;
preview: boolean;
}
export interface IGalleryMetadata {
......@@ -324,4 +325,4 @@ export interface IExtensionTipsService {
export const ExtensionsLabel = localize('extensions', "Extensions");
export const ExtensionsChannelId = 'extensions';
export const PreferencesLabel = localize('preferences', "Preferences");
\ No newline at end of file
export const PreferencesLabel = localize('preferences', "Preferences");
......@@ -54,6 +54,7 @@ interface IRawGalleryExtension {
publisher: { displayName: string, publisherId: string, publisherName: string; };
versions: IRawGalleryExtensionVersion[];
statistics: IRawGalleryExtensionStatistics[];
flags: string;
}
interface IRawGalleryQueryResult {
......@@ -252,6 +253,10 @@ function getEngine(version: IRawGalleryExtensionVersion): string {
return (values.length > 0 && values[0].value) || '';
}
function getIsPreview(flags: string): boolean {
return flags.indexOf('preview') !== -1;
}
function toExtension(galleryExtension: IRawGalleryExtension, extensionsGalleryUrl: string, index: number, query: Query, querySource?: string): IGalleryExtension {
const [version] = galleryExtension.versions;
const assets = {
......@@ -296,7 +301,8 @@ function toExtension(galleryExtension: IRawGalleryExtension, extensionsGalleryUr
index: ((query.pageNumber - 1) * query.pageSize) + index,
searchText: query.searchText,
querySource
}
},
preview: getIsPreview(galleryExtension.flags)
};
}
......
......@@ -153,6 +153,7 @@ export class ExtensionEditor extends BaseEditor {
private icon: HTMLImageElement;
private name: HTMLElement;
private identifier: HTMLElement;
private preview: HTMLElement;
private license: HTMLElement;
private publisher: HTMLElement;
private installCount: HTMLElement;
......@@ -215,6 +216,7 @@ export class ExtensionEditor extends BaseEditor {
const title = append(details, $('.title'));
this.name = append(title, $('span.name.clickable', { title: localize('name', "Extension name") }));
this.identifier = append(title, $('span.identifier', { title: localize('extension id', "Extension identifier") }));
this.preview = append(title, $('span.preview', { title: localize('preview', "Preview") }));
const subtitle = append(details, $('.subtitle'));
this.publisher = append(subtitle, $('span.publisher.clickable', { title: localize('publisher', "Publisher name") }));
......@@ -286,6 +288,11 @@ export class ExtensionEditor extends BaseEditor {
this.name.textContent = extension.displayName;
this.identifier.textContent = extension.id;
if (extension.preview) {
this.preview.textContent = localize('preview', "Preview");
} else {
this.preview.textContent = null;
}
this.publisher.textContent = extension.publisherDisplayName;
this.description.textContent = extension.description;
......
......@@ -62,6 +62,14 @@
white-space: nowrap;
}
.extension-editor > .header > .details > .title > .preview {
background: rgb(214, 63, 38);
font-size: 14px;
margin-left: 10px;
padding: 0px 4px;
border-radius: 4px;
}
.extension-editor > .header > .details > .subtitle {
padding-top: 6px;
white-space: nowrap;
......@@ -324,4 +332,4 @@
font-size: 90%;
font-weight: 600;
opacity: 0.6;
}
\ No newline at end of file
}
......@@ -48,6 +48,7 @@ export interface IExtension {
disabledForWorkspace: boolean;
dependencies: string[];
telemetryData: any;
preview: boolean;
getManifest(): TPromise<IExtensionManifest>;
getReadme(): TPromise<string>;
getChangelog(): TPromise<string>;
......@@ -88,4 +89,4 @@ export const AutoUpdateConfigurationKey = 'extensions.autoUpdate';
export interface IExtensionsConfiguration {
autoUpdate: boolean;
ignoreRecommendations: boolean;
}
\ No newline at end of file
}
......@@ -179,6 +179,10 @@ class Extension implements IExtension {
}
}
get preview(): boolean {
return this.gallery ? this.gallery.preview : false;
}
getManifest(): TPromise<IExtensionManifest> {
if (this.gallery) {
if (this.gallery.assets.manifest) {
......@@ -935,4 +939,4 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
this.syncDelayer.cancel();
this.disposables = dispose(this.disposables);
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册