Skip to content

Commit

Permalink
[Automation] ISTANBUL PRESET PATH is not working fine with constructo…
Browse files Browse the repository at this point in the history
…r(private foo) (#42683)
  • Loading branch information
alexwizp authored Aug 9, 2019
1 parent 4a9300f commit b27be54
Showing 1 changed file with 10 additions and 8 deletions.
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

0 comments on commit b27be54

Please sign in to comment.