Add hasChangelog method to display the tab eventually
This commit is contained in:
parent
23815a07bf
commit
b98c3f7d79
|
@ -254,7 +254,10 @@ export class ExtensionEditor extends BaseEditor {
|
|||
this.navbar.onChange(this.onNavbarChange.bind(this, extension), this, this.transientDisposables);
|
||||
this.navbar.push(NavbarSection.Readme, localize('details', "Details"));
|
||||
this.navbar.push(NavbarSection.Contributions, localize('contributions', "Contributions"));
|
||||
this.navbar.push(NavbarSection.Changelog, localize('changelog', "Changelog"));
|
||||
|
||||
if (extension.hasChangelog) {
|
||||
this.navbar.push(NavbarSection.Changelog, localize('changelog', "Changelog"));
|
||||
}
|
||||
|
||||
this.content.innerHTML = '';
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ export interface IExtension {
|
|||
telemetryData: any;
|
||||
getManifest(): TPromise<IExtensionManifest>;
|
||||
getReadme(): TPromise<string>;
|
||||
hasChangelog : boolean;
|
||||
getChangelog() : TPromise<string>;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,6 +187,10 @@ class Extension implements IExtension {
|
|||
return this.galleryService.getAsset(readmeUrl).then(asText);
|
||||
}
|
||||
|
||||
get hasChangelog() : boolean {
|
||||
return !!(this.local && this.local.changelogUrl ? this.local.changelogUrl : '');
|
||||
}
|
||||
|
||||
getChangelog() : TPromise<string> {
|
||||
const changelogUrl = this.local && this.local.changelogUrl ? this.local.changelogUrl : '';
|
||||
|
||||
|
|
Loading…
Reference in a new issue