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

Gauge 2way sync #1

Closed
wants to merge 5 commits into from
Closed

Gauge 2way sync #1

wants to merge 5 commits into from

Conversation

abhaypersistent
Copy link
Owner

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

? dataConfig[AGGREGATIONS].filter((item) => item.name !== '')
: [];
const dimensionsLength = dimensions.length;
let xaxes = dataConfig[GROUPBY] ? dataConfig[GROUPBY] : [];

Choose a reason for hiding this comment

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

can be written as let xaxes = dataConfig[GROUPBY] ?? [];

Copy link
Owner Author

Choose a reason for hiding this comment

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

ok adding the changes

: [];
const dimensionsLength = dimensions.length;
let xaxes = dataConfig[GROUPBY] ? dataConfig[GROUPBY] : [];
const series = dataConfig[AGGREGATIONS] ? dataConfig[AGGREGATIONS] : [];

Choose a reason for hiding this comment

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

Same as above

const xaxesLength = xaxes.length;

const getAggValue = (metric: any) => {
return metric.alias ? metric.alias : metric.aggregation + '' + '(' + metric.name + ')';

Choose a reason for hiding this comment

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

use template literals instead

Copy link
Owner Author

Choose a reason for hiding this comment

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

For this used the common function created by Dipra in his PR

});
}
const selectedSeriesData = series.map((seriesItem: any) => {
const val = getAggValue(seriesItem);

Choose a reason for hiding this comment

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

Please provide a meaningful name to variable

Copy link

@ruchika-narang ruchika-narang left a comment

Choose a reason for hiding this comment

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

Please work on the changes

@@ -16,9 +16,10 @@ export const ConfigPanelOptionGauge = ({
handleConfigChange,
}: any) => {
const { dataConfig = {} } = visualizations?.data?.userConfigs;
const dimensions = dataConfig?.valueOptions?.dimensions
? dataConfig.valueOptions.dimensions.filter((i) => i.name !== '')
const dimensions = dataConfig?.dimensions

Choose a reason for hiding this comment

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

Change to dataConfig[GROUPBY] instead of dataConfig?.dimensions

Copy link

@ruchika-narang ruchika-narang left a comment

Choose a reason for hiding this comment

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

Everything looks good, please address one minor comment and then raise external PR

Signed-off-by: Abhay Pandey <[email protected]>
Signed-off-by: Abhay Pandey <[email protected]>
Signed-off-by: Abhay Pandey <[email protected]>
@abhaypersistent
Copy link
Owner Author

Raised external PR so, closing this PR.
opensearch-project#1048

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

Successfully merging this pull request may close these issues.

2 participants