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

Destructured visMetaData and dataConfig Objects in all visualizations #1106

Merged

Conversation

Koustubh5585
Copy link
Contributor

Description

  • Destructured visMetaData and dataConfig Objects in all visualizations
  • Fixed No results found alignment issue in charts view

Issues Resolved

#1058

Check List

  • 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.

Signed-off-by: Koustubh Karmalkar <[email protected]>
Signed-off-by: Koustubh Karmalkar <[email protected]>
Signed-off-by: Koustubh Karmalkar <[email protected]>
Signed-off-by: Koustubh Karmalkar <[email protected]>
Signed-off-by: Koustubh Karmalkar <[email protected]>
@Koustubh5585 Koustubh5585 requested a review from a team as a code owner October 11, 2022 13:37
@@ -33,6 +29,18 @@ export const Bar = ({ visualizations, layout, config }: any) => {
},
vis: visMetaData,
}: IVisualizationContainerProps = visualizations;

Copy link
Collaborator

Choose a reason for hiding this comment

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

You could destruct visMetaData at line 30 directly without renaming. Please apply this code review to all other charts that have this similar problem.

Copy link
Contributor Author

@Koustubh5585 Koustubh5585 Oct 12, 2022

Choose a reason for hiding this comment

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

Hi @mengweieric, this is already taken care, can you please check once https://github.com/opensearch-project/observability/pull/1106/files (commit id: 95fef81)

@@ -44,6 +44,8 @@ export const Line = ({ visualizations, layout, config }: any) => {
},
vis: visMetaData,
}: IVisualizationContainerProps = visualizations;

const { icontype, name } = visMetaData;
Copy link
Collaborator

Choose a reason for hiding this comment

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

similar, please refer to above comments.

@@ -36,6 +36,7 @@ export const Pie = ({ visualizations, layout, config }: any) => {
vis: visMetaData,
}: IVisualizationContainerProps = visualizations;

const { mode, icontype, showlegend, legendSize, labelSize, legendposition } = visMetaData;
Copy link
Collaborator

Choose a reason for hiding this comment

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

please refer to the first comment.

@@ -65,6 +65,7 @@ export const Stats = ({ visualizations, layout, config }: any) => {
vis: visMetaData,
}: IVisualizationContainerProps = visualizations;

const { charttype, titlesize, valuesize, textmode, orientation, precisionvalue } = visMetaData;
Copy link
Collaborator

Choose a reason for hiding this comment

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

please refer to the first comment.

@mengweieric
Copy link
Collaborator

Please address failing tests.

Signed-off-by: Koustubh Karmalkar <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2022

Codecov Report

Merging #1106 (e71e35f) into main (249ab50) will increase coverage by 0.22%.
The diff coverage is 71.69%.

@@             Coverage Diff              @@
##               main    #1106      +/-   ##
============================================
+ Coverage     53.49%   53.72%   +0.22%     
  Complexity      291      291              
============================================
  Files           279      279              
  Lines          9454     9475      +21     
  Branches       2215     2278      +63     
============================================
+ Hits           5057     5090      +33     
+ Misses         4227     4215      -12     
  Partials        170      170              
Flag Coverage Δ
dashboards-observability 47.86% <71.69%> (+0.32%) ⬆️
opensearch-observability 71.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../components/visualizations/charts/maps/heatmap.tsx 15.15% <36.36%> (+8.90%) ⬆️
.../public/components/event_analytics/utils/utils.tsx 52.00% <50.00%> (-0.39%) ⬇️
...c/components/visualizations/charts/stats/stats.tsx 9.58% <52.94%> (-0.42%) ⬇️
...ts/visualizations/charts/data_table/data_table.tsx 46.66% <54.54%> (ø)
...ic/components/visualizations/charts/lines/line.tsx 40.00% <75.00%> (+4.77%) ⬆️
...ublic/components/visualizations/charts/bar/bar.tsx 48.42% <75.60%> (+8.17%) ⬆️
...ts/visualizations/charts/financial/gauge/gauge.tsx 30.26% <85.00%> (+2.86%) ⬆️
...ents/visualizations/charts/histogram/histogram.tsx 92.10% <85.00%> (+5.99%) ⬆️
...ublic/components/visualizations/charts/pie/pie.tsx 45.09% <86.66%> (-1.06%) ⬇️
...components/visualizations/charts/maps/treemaps.tsx 54.25% <90.00%> (+4.75%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ps48
Copy link
Member

ps48 commented Oct 13, 2022

@Koustubh5585 Can you please resolve the conflicts here.

Signed-off-by: Koustubh Karmalkar <[email protected]>
@mengweieric mengweieric self-requested a review October 14, 2022 16:04
@@ -381,8 +381,12 @@ export const getPropName = (queriedVizObj: {
name: string;
label: string;
}) => {
if (queriedVizObj[CUSTOM_LABEL] === '' || queriedVizObj[CUSTOM_LABEL] === undefined) {
return `${queriedVizObj.aggregation}(${queriedVizObj.name})`;
if (queriedVizObj) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we take look at reviews from previous PRs and having one more reviewer internally to review to avoid spending effort reviewing the same issues? Previously we've reviewed some similar code already like this, below code piece can be further simplified as

if (queriedVizObj && !isEmpty(queriedVizObj[CUSTOM_LABEL]))  return `${queriedVizObj.aggregation}(${queriedVizObj.name})`;
return '';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mengweieric Sure, will ensure in next PRs that such small issues can be addressed internally.

@mengweieric mengweieric self-requested a review October 14, 2022 21:45
@mengweieric mengweieric merged commit 459289c into opensearch-project:main Oct 14, 2022
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.

5 participants