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

reimplemented MonitorATMServicesViewImpl in react functions with hook #2570

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

manzil-infinity180
Copy link
Contributor

@manzil-infinity180 manzil-infinity180 commented Jan 9, 2025

Which problem is this PR solving?

Issue #2013

Description of the changes

  • Re-implemented the MonitorATMServicesViewImpl class in React function with hooks

How was this change tested?

  • locally the test is passing and I removed the test which is class based and added new test which is react function based

Checklist

Signed-off-by: Rahul Vishwakarma <rahulvs2809@gmail.com>
@manzil-infinity180 manzil-infinity180 requested a review from a team as a code owner January 9, 2025 12:29
@manzil-infinity180 manzil-infinity180 requested review from joe-elliott and removed request for a team January 9, 2025 12:29
Signed-off-by: Rahul Vishwakarma <rahulvs2809@gmail.com>
Signed-off-by: Rahul Vishwakarma <rahulvs2809@gmail.com>
@manzil-infinity180
Copy link
Contributor Author

@yurishkuro would you please review it!!!

@@ -467,7 +425,7 @@ export function mapStateToProps(state: ReduxState): TReduxProps {
};
}

export function mapDispatchToProps(dispatch: Dispatch<ReduxState>): TDispatchProps {
export function mapDispatchToProps(dispatch: Dispatch<ReduxState>) {
Copy link
Member

Choose a reason for hiding this comment

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

With functional components, you can use hooks like useDispatch instead of mapDispatchToProps. Similarly, useSelector for mapStateToProps. That would be a better approach, imo

Copy link
Member

Choose a reason for hiding this comment

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

A lot of tests are removed. They gotta be replaced?

@anshgoyalevil
Copy link
Member

anshgoyalevil commented Jan 11, 2025

There are some regressions.

  • The monitor page on reload isn't showing the previously selected values.
  • The Services selector on selecting different Service is showing metrics under other service which isn't selected

store.set('lastAtmSearchSpanKind', selectedSpanKind);
store.set('lastAtmSearchTimeframe', selectedTimeFrame);
store.set('lastAtmSearchService', this.getSelectedService());
store.set('lastAtmSearchService', getSelectedService());
Copy link
Member

Choose a reason for hiding this comment

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

This is setting the last selected service to store on selecting a new service. The expected behavior is to set the currently selected service to store

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