-
Notifications
You must be signed in to change notification settings - Fork 99
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
Destructured visMetaData and dataConfig Objects in all visualizations #1106
Conversation
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]>
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]>
@@ -33,6 +29,18 @@ export const Bar = ({ visualizations, layout, config }: any) => { | |||
}, | |||
vis: visMetaData, | |||
}: IVisualizationContainerProps = visualizations; | |||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
Please address failing tests. |
Signed-off-by: Koustubh Karmalkar <[email protected]>
Signed-off-by: Koustubh Karmalkar <[email protected]>
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@Koustubh5585 Can you please resolve the conflicts here. |
Signed-off-by: Koustubh Karmalkar <[email protected]>
Signed-off-by: Koustubh Karmalkar <[email protected]>
@@ -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) { |
There was a problem hiding this comment.
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 '';
There was a problem hiding this comment.
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.
Description
Issues Resolved
#1058
Check List
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.