提交 b8c6fbe9 编写于 作者: B Benjamin Pasero

debt - lift feedback contrib to browser

上级 ba301618
......@@ -19,4 +19,9 @@ export interface IProductService {
uiExtensions?: string[];
enableTelemetry: boolean;
sendASmile?: {
reportIssueUrl: string;
requestFeatureUrl: string;
};
}
\ No newline at end of file
......@@ -6,10 +6,11 @@
import { IProductService } from 'vs/platform/product/common/product';
import product from 'vs/platform/product/node/product';
import pkg from 'vs/platform/product/node/package';
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
export class ProductService implements IProductService {
_serviceBrand: any;
_serviceBrand: ServiceIdentifier<IProductService>;
get version(): string { return pkg.version; }
......@@ -24,4 +25,6 @@ export class ProductService implements IProductService {
get uiExtensions(): string[] | undefined { return product.uiExtensions; }
get enableTelemetry(): boolean { return product.enableTelemetry; }
get sendASmile(): { reportIssueUrl: string, requestFeatureUrl: string } { return product.sendASmile; }
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
import { Registry } from 'vs/platform/registry/common/platform';
import { IStatusbarRegistry, Extensions, StatusbarItemDescriptor } from 'vs/workbench/browser/parts/statusbar/statusbar';
import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
import { FeedbackStatusbarItem } from 'vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem';
import { FeedbackStatusbarItem } from 'vs/workbench/contrib/feedback/browser/feedbackStatusbarItem';
import { localize } from 'vs/nls';
// Register Statusbar item
......
......@@ -8,7 +8,6 @@ import * as nls from 'vs/nls';
import { IDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { Dropdown } from 'vs/base/browser/ui/dropdown/dropdown';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import product from 'vs/platform/product/node/product';
import * as dom from 'vs/base/browser/dom';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IIntegrityService } from 'vs/workbench/services/integrity/common/integrity';
......@@ -20,6 +19,7 @@ import { Button } from 'vs/base/browser/ui/button/button';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
import { IProductService } from 'vs/platform/product/common/product';
export interface IFeedback {
feedback: string;
......@@ -54,7 +54,7 @@ export class FeedbackDropdown extends Dropdown {
private hideButton: HTMLInputElement;
private remainingCharacterCount: HTMLElement;
private requestFeatureLink: string;
private requestFeatureLink: string | undefined;
private isPure: boolean = true;
......@@ -65,7 +65,8 @@ export class FeedbackDropdown extends Dropdown {
@ITelemetryService private readonly telemetryService: ITelemetryService,
@IIntegrityService private readonly integrityService: IIntegrityService,
@IThemeService private readonly themeService: IThemeService,
@IStatusbarService private readonly statusbarService: IStatusbarService
@IStatusbarService private readonly statusbarService: IStatusbarService,
@IProductService productService: IProductService
) {
super(container, {
contextViewProvider: options.contextViewProvider,
......@@ -79,7 +80,10 @@ export class FeedbackDropdown extends Dropdown {
this.feedbackDelegate = options.feedbackService;
this.maxFeedbackCharacters = this.feedbackDelegate.getCharacterLimit(this.sentiment);
this.requestFeatureLink = product.sendASmile.requestFeatureUrl;
if (productService.sendASmile) {
this.requestFeatureLink = productService.sendASmile.requestFeatureUrl;
}
this.integrityService.isPure().then(result => {
if (!result.isPure) {
......
......@@ -5,14 +5,14 @@
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
import { FeedbackDropdown, IFeedback, IFeedbackDelegate } from 'vs/workbench/contrib/feedback/electron-browser/feedback';
import { FeedbackDropdown, IFeedback, IFeedbackDelegate } from 'vs/workbench/contrib/feedback/browser/feedback';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import product from 'vs/platform/product/node/product';
import { Themable, STATUS_BAR_ITEM_HOVER_BACKGROUND } from 'vs/workbench/common/theme';
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { clearNode, EventHelper, addClass, removeClass, addDisposableListener } from 'vs/base/browser/dom';
import { IProductService } from 'vs/platform/product/common/product';
class TwitterFeedbackService implements IFeedbackDelegate {
......@@ -55,7 +55,8 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem {
@IInstantiationService private readonly instantiationService: IInstantiationService,
@IContextViewService private readonly contextViewService: IContextViewService,
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@IThemeService themeService: IThemeService
@IThemeService themeService: IThemeService,
@IProductService private productService: IProductService
) {
super(themeService);
......@@ -82,7 +83,7 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem {
private update(): IDisposable {
// Create
if (product.sendASmile) {
if (this.productService.sendASmile) {
if (!this.dropdown) {
this.dropdown = this._register(this.instantiationService.createInstance(FeedbackDropdown, this.container, {
contextViewProvider: this.contextViewService,
......
......@@ -293,7 +293,7 @@ import 'vs/workbench/contrib/snippets/browser/tabCompletion';
import 'vs/workbench/contrib/format/browser/format.contribution';
// Send a Smile
import 'vs/workbench/contrib/feedback/electron-browser/feedback.contribution';
import 'vs/workbench/contrib/feedback/browser/feedback.contribution';
// Update
import 'vs/workbench/contrib/update/electron-browser/update.contribution';
......
......@@ -310,7 +310,7 @@ import 'vs/workbench/contrib/snippets/browser/tabCompletion';
import 'vs/workbench/contrib/format/browser/format.contribution';
// Send a Smile
// import 'vs/workbench/contrib/feedback/electron-browser/feedback.contribution';
// import 'vs/workbench/contrib/feedback/browser/feedback.contribution';
// Update
// import 'vs/workbench/contrib/update/electron-browser/update.contribution';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册