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

[ML] Convert Angular filters to formatter functions #18681

Merged
merged 2 commits into from
May 2, 2018

Conversation

peteharverson
Copy link
Contributor

Converts three Angular filters used for formatting values in the results pages to functions, and renamed the parents directory from filters to formatters:

  • abbreviate_whole_number
  • format_value
  • metric_change_description

An Angular filter wrapper has been retained in each file, but this will be removed once all the Angular components that use these filters have been migrated to Eui / React (see #18374).

Changes to format_value.js and metric_change_description.js also include better handling for multi-valued actual and typical values from lat_long detectors (see #18192).

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Just a nit pick about making the filter wrapper a bit cleaner.

} else {
return numeral(value).format('0a');
}
return abbreviateWholeNumber(value, maxDigits);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this not just be return abbreviateWholeNumber ?
as in,

module.filter('abbreviateWholeNumber', function () {
  return abbreviateWholeNumber;
}

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants