-
Notifications
You must be signed in to change notification settings - Fork 968
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
[BUG] Fix bug in data source aggregated view to change it to depend on displayAllCompatibleDataSources property to show the badge value #6291
Conversation
Signed-off-by: Lu Yu <nluyu@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6291 +/- ##
=======================================
Coverage 67.47% 67.47%
=======================================
Files 3368 3368
Lines 65431 65431
Branches 10560 10560
=======================================
+ Hits 44147 44150 +3
+ Misses 18713 18710 -3
Partials 2571 2571
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Lu Yu <nluyu@amazon.com>
@@ -111,17 +111,17 @@ export class DataSourceAggregatedView extends React.Component< | |||
let items = []; | |||
|
|||
// only display active data sources |
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.
do we need to update the comment here?
disabled: true, | ||
}; | ||
}); | ||
} else { | ||
items = [...this.state.allDataSourcesIdToTitleMap.values()].map((title) => { | ||
items = this.props.activeDataSourceIds!.map((id) => { |
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.
Force unwrap looks a little risky here. Are there any possibilities that activeDataSourceIds will be undefined?
Maybe we can update it in following way to avoid force unwrap:
const activeDataSoureceIds = this.props.activeDataSoruceIds ?? [];
items = activeDataSoureceIds.map() .....
What do you think?
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.
Right, sine the two states start to diverge, I think we can make it simpler by having a separate component for display active. The reason I am hesitate to give a default value is the activeDataSourceIds are required when displayAllCompatibleDataSources is false
…n displayAllCompatibleDataSources property to show the badge value (#6291) * fix bug Signed-off-by: Lu Yu <nluyu@amazon.com> * add tests Signed-off-by: Lu Yu <nluyu@amazon.com> * add change log Signed-off-by: Lu Yu <nluyu@amazon.com> * fix lint error Signed-off-by: Lu Yu <nluyu@amazon.com> --------- Signed-off-by: Lu Yu <nluyu@amazon.com> (cherry picked from commit f13537c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…n displayAllCompatibleDataSources property to show the badge value (#6291) (#6323) * fix bug Signed-off-by: Lu Yu <nluyu@amazon.com> * add tests Signed-off-by: Lu Yu <nluyu@amazon.com> * add change log Signed-off-by: Lu Yu <nluyu@amazon.com> * fix lint error Signed-off-by: Lu Yu <nluyu@amazon.com> --------- Signed-off-by: Lu Yu <nluyu@amazon.com> (cherry picked from commit f13537c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
This change fixes bug in data source aggregated view to change it to depend on displayAllCompatibleDataSources property to show the badge value
Issues Resolved
Screenshot
aggregatebug.mp4
Testing the changes
The following was performed in the recording above:
Check List
yarn test:jest
yarn test:jest_integration