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

#268: Create context for reloading sidebar data #269

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yashwanthvarma18
Copy link

@yashwanthvarma18 yashwanthvarma18 commented Oct 23, 2024

Description

This pull request introduces a new context for managing sidebar data across the application. The goal is to streamline the refresh of sidebar data by avoiding prop drilling and making the refreshSidebarData method accessible from any component in the app.

Commit type

feat

Issue

#268
The current implementation requires prop drilling to access the refreshSidebarData method in various components, making the codebase cumbersome and less maintainable.

Solution

We have created a context that provides the refreshSidebarData method, allowing any component to access it directly without passing it through several layers of components.

Proposed Changes

  1. Created a new context for sidebar data management.
  2. Updated the App.tsx component to supply the refreshSidebarData method to the context provider.
  3. Refactored existing components to use the new context instead of prop drilling for accessing refreshSidebarData.

Potential Impact

These changes will enhance the maintainability of the application by reducing the complexity of prop passing. There is a potential for minor adjustments needed in components that previously relied on direct props, but it improves the overall structure and accessibility of the sidebar data functionality.

Additional Tasks

  1. Update documentation to reflect the new context usage.
  2. Additional testing may be required to ensure that components correctly consume the context.

Assigned

@AntonioMrtz

@yashwanthvarma18
Copy link
Author

@AntonioMrtz Could you please review my pull request and merge it? I'm a beginner and have done my best to deliver.

Thank you!

@AntonioMrtz
Copy link
Owner

AntonioMrtz commented Oct 23, 2024

Hi @yashwanthvarma18 , thanks for your work, I will try to review it ASAP :) . We have a list of contributors in Readme.md and Contributors.md, feel free to add yourself keeping the format and commit the changes :)

I runned the pipelines, it seems like eslint, prettier and some tests are failing. Can you take a look at it? Let me know if you need any help

@yashwanthvarma18
Copy link
Author

@AntonioMrtz
I am not familiar with what these issues means and caused due to
Please let me know how to resolve them
ESlint Check / run-frontend-lint (pull_request)
Frontend Style Prettier / run-frontend-style-check (pull_request)
Frontend Tests / frontend-test (pull_request)

@AntonioMrtz
Copy link
Owner

@AntonioMrtz I am not familiar with what these issues means and caused due to Please let me know how to resolve them ESlint Check / run-frontend-lint (pull_request) Frontend Style Prettier / run-frontend-style-check (pull_request) Frontend Tests / frontend-test (pull_request)

If you go inside details for each failed pipeline you can see the error logs. To reproduce it locally run the follow commands:

  • Prettier: npm run format:write. Pipeline checks styling is correct
  • Lint: npm run lint. Check linting rules
  • Tests: npm run tests. Tests are failing because of the modifications

@AntonioMrtz AntonioMrtz changed the title #268:Create context for reloading sidebar data #268: Create context for reloading sidebar data Oct 23, 2024
@yashwanthvarma18
Copy link
Author

@AntonioMrtz
I finally made it! All tests are running without any issues. You can check it out too. It took me four hours to figure out where I made mistakes in the implementation, but I learned a lot from them. Thank you for giving me this opportunity!

@yashwanthvarma18
Copy link
Author

@AntonioMrtz what can i do to correct this
Check OpenAPI schema is updated / check-openapi-schema-is-updated (pull_request) Failing after 1m

@yashwanthvarma18
Copy link
Author

@AntonioMrtz Please check the new commit and let me know if there is any issue again

@AntonioMrtz
Copy link
Owner

Hi @yashwanthvarma18 , just a few things:

I know it probably took some time to do the adjustments but we don't want all the external .erb packages, markdown doc files and more to use frontend prettier format. Also I found that many rules that we don't use are being applied. I'm confident to say that this can be due to running npm run commands in an incorrect directory or that these commands didn't follow the ruleset they have as input

As you can see here, the custom commands that run with npm run have parameters that affect the output such as file to be ignored and the rules to be applied.

"scripts": {
    "lint": "cross-env NODE_ENV=development eslint src/ --ext .js,.jsx,.ts,.tsx --fix",
    "format:write": "prettier src/ --write --ignore-path .prettierignore",
}

Example with npm run format:write: only src/ files will be formatted and it will honor .prettierignore rules

What would I do:

  • Revert back to commit 89e47c85b53a5e12749f56045ef3ed5b5e520b62
  • Run the the commands I mentioned in previous message while being in the directory Electron/ and making sure the command rules are being honored
  • Make the adjustments that the commands output, there won't be a lot, it will only output warnings about code that YOU changed, the actual codebase passes the pipelines with no adjusments
  • I will review the provided code :)

Let me know if you have any question, code looked good but I cannot merge a lot of modified files that were out of scope for this task :)

@yashwanthvarma18
Copy link
Author

@AntonioMrtz
I spent most of the day working on this, and I understand that you're not satisfied with the PR. That's fine—I hope the code I pushed can still be helpful to you in some way. Thanks for the opportunity!

@AntonioMrtz
Copy link
Owner

AntonioMrtz commented Oct 23, 2024

@AntonioMrtz I spent most of the day working on this, and I understand that you're not satisfied with the PR. That's fine—I hope the code I pushed can still be helpful to you in some way. Thanks for the opportunity!

Yeah, I checked the changes and know they have took a long time to implement. I feel bad for it :( , but we have to keep the codebase with the same style and format

@AntonioMrtz AntonioMrtz linked an issue Oct 23, 2024 that may be closed by this pull request
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.

Create context for reloading sidebar data
2 participants