Skip to content

[reporting] formatters are loaded from index pattern saved object, should be loaded via index patterns service #84388

@mattkime

Description

@mattkime

#82223 removed fields from the index pattern saved object (except for scripted fields).

x-pack/plugins/reporting/server/export_types/csv/generate_csv/index.ts:86 loads the index pattern saved object, looks at the field list and loads all the field formatters.

pseudo code recommendation -

const fields (assume defined);
const indexPattern = await indexPatterns.get(id);
fields.reduce((collector, field) => {
  const indexPatternField = indexPattern.fields.getByName(field);
  collector[field] = indexPattern.getFormatterForField(indexPatternField);
  return collector;
}, {});

Its possible that the majority of the work will involve bootstraping the index patterns service.

Metadata

Metadata

Assignees

Labels

Feature:Reporting:FrameworkReporting issues pertaining to the overall frameworkSharedUX/fix-it-weekBugs that have been groomed and queued up for the team's next fix it weekbugFixes for quality problems that affect the customer experienceimpact:highAddressing this issue will have a high level of impact on the quality/strength of our product.needs-teamIssues missing a team labelv8.0.0

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions