提交 a8bd1467 编写于 作者: R Ramya Achutha Rao

Refactoring experiment service for simplicity

上级 58137254
......@@ -5,7 +5,7 @@
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { INotificationService, Severity, IPromptChoice } from 'vs/platform/notification/common/notification';
import { IExperimentService, IExperiment, ExperimentActionType, IExperimentActionPromptProperties, ExperimentState } from 'vs/workbench/parts/experiments/node/experimentService';
import { IExperimentService, IExperiment, ExperimentActionType, IExperimentActionPromptProperties, IExperimentActionPromptCommand, ExperimentState } from 'vs/workbench/parts/experiments/node/experimentService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IExtensionsViewlet } from 'vs/workbench/parts/extensions/common/extensions';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
......@@ -57,7 +57,7 @@ export class ExperimentalPrompts extends Disposable implements IWorkbenchContrib
actionProperties.commands = [];
}
const choices: IPromptChoice[] = actionProperties.commands.map(command => {
const choices: IPromptChoice[] = actionProperties.commands.map((command: IExperimentActionPromptCommand) => {
return {
label: command.text,
run: () => {
......
......@@ -57,7 +57,18 @@ interface IRawExperiment {
},
userProbability?: number;
};
action?: { type: string; properties: any };
action?: IExperimentAction;
}
interface IExperimentAction {
type: ExperimentActionType;
properties: any;
}
export enum ExperimentActionType {
Custom = 'Custom',
Prompt = 'Prompt',
AddToRecommendations = 'AddToRecommendations'
}
export interface IExperimentActionPromptProperties {
......@@ -65,10 +76,9 @@ export interface IExperimentActionPromptProperties {
commands: IExperimentActionPromptCommand[];
}
interface IExperimentActionPromptCommand {
export interface IExperimentActionPromptCommand {
text: string;
externalLink?: string;
dontShowAgain?: boolean;
curatedExtensionsKey?: string;
curatedExtensionsList?: string[];
}
......@@ -80,17 +90,6 @@ export interface IExperiment {
action?: IExperimentAction;
}
export enum ExperimentActionType {
Custom,
Prompt,
AddToRecommendations
}
interface IExperimentAction {
type: ExperimentActionType;
properties: any;
}
export interface IExperimentService {
_serviceBrand: any;
getExperimentById(id: string): TPromise<IExperiment>;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册