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

Implement first version of new aggregation controls, including support for metric configuration. #10281

Merged
merged 66 commits into from
Mar 22, 2021

Conversation

linuspahl
Copy link
Contributor

@linuspahl linuspahl commented Mar 18, 2021

Please note: We need to merge #10212 first.

Motivation and Context

To make better use of the space we have in the aggregation builder edit component, we created a new layout which displays the controls on the left side of the aggregation. The new implementation displays only the configured aggregation elements.

Description

  • We created a new component AggregationWizard which contains the new controls and the visualization.
    • We did not set the editComponent in views/bindings to not break the widget configuration.
    • if you want to test the new layout, please define the AggregationWizard as the editComponent for aggregations.
      import AggregationWizard from 'views/components/aggregationwizard/AggregationWizard';
    • Once we've deleted the old AggregationControls we can rename the AggregationWizard to AggregationControls.
  • All aggregation elements are part of the aggregationWizard/aggregationElements directory, in the future we will include them in the views/bindings.
  • We created an AggregationActionSelect which is only listing not configured actions.
  • We created an ActionConfigurationContainer which displays the title of an action
  • We implemented the required logic and components to configure metrics.

image

Fixes: #9737

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Copy link
Member

@dennisoelkers dennisoelkers left a comment

Choose a reason for hiding this comment

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

Looks good, works great! 🎉

dennisoelkers and others added 23 commits March 22, 2021 11:33
…justing bootstrap elements padding.

The negative row / form-group margin caused the horizontal scroll bar.
…ich separates each section of the metrics element configuration.
@dennisoelkers dennisoelkers force-pushed the widget-aggregation-wizard-forms branch from c89778f to c450d95 Compare March 22, 2021 10:33
@dennisoelkers dennisoelkers merged commit 9f7c4e4 into master Mar 22, 2021
@dennisoelkers dennisoelkers deleted the widget-aggregation-wizard-forms branch March 22, 2021 12:39
janheise pushed a commit that referenced this pull request Mar 25, 2021
…t for metric configuration. (#10281)

* Creating basic `AggregationWizard` component.

* Creating basic components for aggregation attribute configuration.

* Rename aggregation attribute to aggregation action.

* Improve aggregation actions structure and expandability.

* Fixing typo.

* Fixing headline font size and `AggregationWizard` props.

* Creating test for `AggregationActionSelect`.

* Creating test for `ActionConfigurationContainer`.

* Creating test for `AggregationWizard`.

* Clearing `AggregationActionSelect` value after selection an action.

* Renaming aggregation action properties label to title and value to key.

* Reverting `AggregationWizard` usage in views bindings.

* Fixing linter warnings.

* List aggregation action in `AggregationActionSelect` if it can be configured multiple times.

* Renaming aggregation action to aggregation element.

* Do not add new section for an already configured aggregation action.

* Removing no longer needed `createDefault` series method.

* Changing order of configured aggregation elements.

* Always display configured aggregation elements in correct order.

* Updating `AggregationElementSelect.test`.`

* Creating `WidgetConfigForm`.

* Moving `SearchBarForm` from `EditWidgetFrame` to `WidgetQueryControls`.

* Rename `MetricConfiguration` to `MetricsConfiguration`.

* Creating basic metric form with function and field select.

* Enable widget configuration update for metrics.

* Providing correct initial values for metrics configuration form.

* Removing no longer needed aggregation wizard state by using `WidgetConfigForm` only.

* Updating type definition of `SeriesConfig` value and constructor.

* Splitting up `AggregationWizard` in multiple components.

* Migrating `AggregationFunctionsStore` to ts.

* Importing aggregation functions for metrics configuration directly from `AggregationFunctionsStore`.

* Reverting `Series` and `SeriesConfiguration` constructor type definition changes.

* Fixing type imports

* Only display aggregation element configuraion container if form has related values.

* Validating metric functions, triggering manual validation on initial mount.

* Validate form on change/on mount.

* Switching from field-level to form-level validation.

* Handling percentile parameter for `percentile` function.

* Do not include metrics errors in validation result if empty.

* Include name field for metric.

* Include placeholder for name field.

* Fixing vertical scrolling of aggregation elements column in aggregation wizard.

(cherry picked from commit 0efd3b2)

* Styling fixes

* Removing section headlines to save vertical space.

* Fixing horizontal scrolling of element configuration containers by adjusting bootstrap elements padding.

The negative row / form-group margin caused the horizontal scroll bar.

* Creating one file for each aggregation element.

* Fixing types.

* Fixing types.

* Replacing aggregation element properties `isConfigured` and `multipleUse` with `allowCreate`.

* Defining theme color for element separator.

* Reducing element container padding.

* Fixing `allowCreate` usage.

* Providing form values as a prop for `AggregationElementSelect` to simplify testing.

* Updating `AggregationElementSelect.test`.

* Udpating `MetricsConfiguration.test`.

* Adding missing key in `MetricsConfiguration`.

* Extend PropType definition for common `Select` value with number.

* Extending `AgggregationWizard.test` with tests for metrics element.

* Fixing linter warnings

* Updating `WidgetQueryControls.test` regarding `SearchBarForm` addition.

* Implement `ElementConfigurationSection` for `MetricsConfiguration` which separates each section of the metrics element configuration.

* Test configuration of metric with multiple functions.

* Creating separate file for metric element tests.

* Fixing linter warnings.

* Reimplementing type definition for `Widget.tsx` config prop.

* Fixing import path.

Co-authored-by: Dennis Oelkers <dennis@graylog.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregation Builder: Create new layout
2 participants