diff --git a/frontend/src/app/graphic-builder/chart-builder/chart-builder.component.ts b/frontend/src/app/graphic-builder/chart-builder/chart-builder.component.ts index c22398b4b..1691081b8 100644 --- a/frontend/src/app/graphic-builder/chart-builder/chart-builder.component.ts +++ b/frontend/src/app/graphic-builder/chart-builder/chart-builder.component.ts @@ -93,6 +93,8 @@ export class ChartBuilderComponent implements OnInit, AfterViewChecked { if (this.mode === 'edit') { this.visualizationService.find(this.visualizationId).subscribe(vis => { this.visualization = vis.body; + this.pattern = this.visualization.pattern.pattern; + this.getFields(); const defaultFilterTime = this.getDefaultFilterTimeFromVisualization(this.visualization.filterType); this.defaultTime = defaultFilterTime ? defaultFilterTime : new ElasticFilterDefaultTime('now-24h', 'now'); }); @@ -121,6 +123,7 @@ export class ChartBuilderComponent implements OnInit, AfterViewChecked { } getFields() { + if(!this.pattern){return} this.fieldDataBehavior.getFields(this.pattern) .subscribe(fields => { this.fieldDataBehavior.$fields.next(fields); diff --git a/frontend/src/app/shared/components/utm/index-pattern/index-pattern-create/index-pattern-create.component.ts b/frontend/src/app/shared/components/utm/index-pattern/index-pattern-create/index-pattern-create.component.ts index 729018788..bc47e1931 100644 --- a/frontend/src/app/shared/components/utm/index-pattern/index-pattern-create/index-pattern-create.component.ts +++ b/frontend/src/app/shared/components/utm/index-pattern/index-pattern-create/index-pattern-create.component.ts @@ -153,6 +153,7 @@ export class IndexPatternCreateComponent implements OnInit { const req = { indexPattern: this.regex }; + alert('2') this.elasticIndexService.getElasticIndexField(req).subscribe(fields => { filterFieldDataType(fields.body, ElasticDataTypesEnum.DATE).subscribe(field => { this.loadingFields = false;