Skip to content

Commit

Permalink
Update 'about' and 'getting-started' api-version
Browse files Browse the repository at this point in the history
The commit updates the vscode api version for the `about` and
`getting-started` views to use a non-deprecated way to determine the
currently supported API version following recent changes to the
framework.

Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Aug 3, 2021
1 parent 4d8f470 commit 19a8f71
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,30 @@
import * as React from 'react';

import { AboutDialog, AboutDialogProps, ABOUT_CONTENT_CLASS } from '@theia/core/lib/browser/about-dialog';
import { injectable, inject } from 'inversify';
import { injectable, inject, postConstruct } from 'inversify';
import { renderDocumentation, renderDownloads, renderSourceCode, renderTickets, renderWhatIs, renderWhatIsNot } from './branding-util';
import { VSXApiVersionProvider } from '@theia/vsx-registry/lib/common/vsx-api-version-provider';
import { VSXEnvironment } from '@theia/vsx-registry/lib/common/vsx-environment';

@injectable()
export class TheiaBlueprintAboutDialog extends AboutDialog {

@inject(VSXApiVersionProvider)
protected readonly apiVersionProvider: VSXApiVersionProvider;
@inject(VSXEnvironment)
protected readonly environment: VSXEnvironment;

protected vscodeApiVersion: string;

constructor(
@inject(AboutDialogProps) protected readonly props: AboutDialogProps
) {
super(props);
}

@postConstruct()
protected async init(): Promise<void> {
this.vscodeApiVersion = await this.environment.getVscodeApiVersion();
super.init();
}

protected render(): React.ReactNode {
return <div className={ABOUT_CONTENT_CLASS}>
{this.renderContent()}
Expand Down Expand Up @@ -95,7 +103,7 @@ export class TheiaBlueprintAboutDialog extends AboutDialog {
</p>

<p className='gs-sub-header' >
{'VS Code API Version: ' + this.apiVersionProvider.getApiVersion()}
{'VS Code API Version: ' + this.vscodeApiVersion}
</p>
</div>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,26 @@
********************************************************************************/
import * as React from 'react';

import { inject, injectable } from 'inversify';
import { inject, injectable, postConstruct } from 'inversify';
import { renderDocumentation, renderDownloads, renderSourceCode, renderTickets, renderWhatIs, renderWhatIsNot } from './branding-util';

import { GettingStartedWidget } from '@theia/getting-started/lib/browser/getting-started-widget';
import { VSXApiVersionProvider } from '@theia/vsx-registry/lib/common/vsx-api-version-provider';
import { VSXEnvironment } from '@theia/vsx-registry/lib/common/vsx-environment';

@injectable()
export class TheiaBlueprintGettingStartedWidget extends GettingStartedWidget {

@inject(VSXApiVersionProvider)
protected readonly apiVersionProvider: VSXApiVersionProvider;
@inject(VSXEnvironment)
protected readonly environment: VSXEnvironment;

protected vscodeApiVersion: string;

@postConstruct()
protected async init(): Promise<void> {
super.init();
this.vscodeApiVersion = await this.environment.getVscodeApiVersion();
this.update();
}

protected render(): React.ReactNode {
return <div className='gs-container'>
Expand Down Expand Up @@ -108,7 +117,7 @@ export class TheiaBlueprintGettingStartedWidget extends GettingStartedWidget {
</p>

<p className='gs-sub-header' >
{'VS Code API Version: ' + this.apiVersionProvider.getApiVersion()}
{'VS Code API Version: ' + this.vscodeApiVersion}
</p>
</div>;
}
Expand Down

0 comments on commit 19a8f71

Please sign in to comment.