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

[De-Angular] Clean angular context in Data plugin #5417

Closed
wants to merge 7 commits into from

Conversation

ShatilKhan
Copy link
Contributor

@ShatilKhan ShatilKhan commented Nov 1, 2023

Description

  • Renamed the toAngularJSON function into toJSON
  • Renamed the to_angular_json file into to_json
  • Renamed the reference in index.ts from to_angular_json to to_json

Issues Resolved

Closes #5021

Screenshot

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: ShatilKhan <shatilshahriar009@gmail.com>
@joshuarrrr
Copy link
Member

@ShatilKhan There's a conflict to resolve. Let me know if you need assistance resolving it.

@ShatilKhan
Copy link
Contributor Author

@ShatilKhan There's a conflict to resolve. Let me know if you need assistance resolving it.

Thanks, I'm not done with all the updates for this PR yet, once that's done, I resolve the conflicts

Copy link
Member

@ananzh ananzh left a comment

Choose a reason for hiding this comment

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

I don't think we could directly remove this file, since toAngularJSON is still used in src/plugins/data/common/search/aggs/buckets/filters.ts right? We need to replace the usage of toAngularJSON in this file as well.

Copy link
Member

@ananzh ananzh left a comment

Choose a reason for hiding this comment

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

@ShatilKhan just see ur comment. makes sense to me. if you haven't done all the work, you could turn this PR into a draft so people won't start reviewing it.

@ShatilKhan
Copy link
Contributor Author

Thanks @ananzh
I'll draft this & make the necessary updates

@ShatilKhan
Copy link
Contributor Author

I don't think I have permission to draft
Please draft this PR until I've completed all changes

@joshuarrrr joshuarrrr marked this pull request as draft November 13, 2023 18:50
@ShatilKhan
Copy link
Contributor Author

I'm trying to understand this section in src/plugins/data/common/search/aggs/utils/to_angular_json.ts
image
I see the toAngularJSON function returns a JSON.stringify() method
Should I rename toAngularJSON to JSON.stringify() here?
I understand what the function is doing, but It would be helpfull to understand the desired changes
@ananzh can you help me understand this?

@ShatilKhan
Copy link
Contributor Author

I found the reference to to_angular_json on src/plugins/data/common/search/aggs/utils/index.ts here:
image
I understand it's imported from src/plugins/data/common/search/aggs/utils/to_angular_json.ts

@ShatilKhan
Copy link
Contributor Author

I'm trying out renaming the function
We can also try using only json.stringify method but that could cause some errors I believe ( I tried)

@ShatilKhan
Copy link
Contributor Author

Changed the name of the function
Didn't see any error mesaages
I tried running yarn test : jest twice
But both time my laptop hangs up :(

change `toAngularJSON` to `toJSON` function

Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
change reference for `to_angular_json` into `to_json`

Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f2a44ae) 67.02% compared to head (de70200) 67.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5417   +/-   ##
=======================================
  Coverage   67.02%   67.02%           
=======================================
  Files        3294     3294           
  Lines       63307    63307           
  Branches    10071    10071           
=======================================
+ Hits        42430    42432    +2     
+ Misses      18431    18430    -1     
+ Partials     2446     2445    -1     
Flag Coverage Δ
Linux_1 35.24% <ø> (ø)
Linux_2 55.19% <ø> (ø)
Linux_3 43.88% <ø> (?)
Linux_4 35.34% <ø> (ø)
Windows_1 35.26% <ø> (ø)
Windows_2 55.15% <ø> (ø)
Windows_3 43.88% <ø> (ø)
Windows_4 35.34% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Shahriar Shatil <52494840+ShatilKhan@users.noreply.github.com>
@ShatilKhan ShatilKhan closed this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[De-Angular] Clean angular context in Data plugin
3 participants