Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Automation] ISTANBUL PRESET PATH is not working fine with constructor(private foo) #42683

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export class VisualizeEmbeddableFactory extends EmbeddableFactory<
VisualizationAttributes
> {
public readonly type = VISUALIZE_EMBEDDABLE_TYPE;
private readonly visTypes: VisTypesRegistry;

static async createVisualizeEmbeddableFactory(): Promise<VisualizeEmbeddableFactory> {
const $injector = await chrome.dangerouslyGetActiveInjector();
Expand All @@ -88,32 +89,31 @@ export class VisualizeEmbeddableFactory extends EmbeddableFactory<
return new VisualizeEmbeddableFactory(visTypes);
}

constructor(private visTypes: VisTypesRegistry) {
constructor(visTypes: VisTypesRegistry) {
super({
savedObjectMetaData: {
name: i18n.translate('kbn.visualize.savedObjectName', { defaultMessage: 'Visualization' }),
type: 'visualization',
getIconForSavedObject: savedObject => {
if (!this.visTypes) {
if (!visTypes) {
return 'visualizeApp';
}
return (
this.visTypes.byName[JSON.parse(savedObject.attributes.visState).type].icon ||
'visualizeApp'
visTypes.byName[JSON.parse(savedObject.attributes.visState).type].icon || 'visualizeApp'
);
},
getTooltipForSavedObject: savedObject => {
if (!this.visTypes) {
if (!visTypes) {
return '';
}
return `${savedObject.attributes.title} (${this.visTypes.byName[JSON.parse(savedObject.attributes.visState).type].title})`;
return `${savedObject.attributes.title} (${visTypes.byName[JSON.parse(savedObject.attributes.visState).type].title})`;
},
showSavedObject: savedObject => {
if (!this.visTypes) {
if (!visTypes) {
return false;
}
const typeName: string = JSON.parse(savedObject.attributes.visState).type;
const visType = this.visTypes.byName[typeName];
const visType = visTypes.byName[typeName];
if (!visType) {
return false;
}
Expand All @@ -124,6 +124,8 @@ export class VisualizeEmbeddableFactory extends EmbeddableFactory<
},
},
});

this.visTypes = visTypes;
}

public isEditable() {
Expand Down