Refactoring Talawa Admin

palisadoes

Administrator
How could Talawa Admin be refactored to have more reusable code? For example the User and Admin portals often have duplicate code for the same features which makes maintenance difficult.

  1. What simple refactors would you suggest towards an end goal of a complete modularity?
  2. How would you stage the deployment of the refactoring so that we don't have a single massive PR for your suggested refactoring area?
 
@palisadoes The duplicate code present in Admin and User Portal, can be converted into components and then using props, we can use it in both Admin and User portal files.
This way there would be less need of re writing same code.
 
@palisadoes admin and user posts have different component, which is making difficult to implement same changes at both places.
Problems caused due to separate components:
1. Admin posts also lacks comments and likes.
2. Making it difficult for admin to view / delete comments
 
@Jashan

I see that you have been incrementally working on fixing chat recently. This is greatly appreciated.

Based on your comments I think the next step is to refactor chat to use reusable components for the User Portal and Admin Portal based on best practices before working on any other improvements.

Could you do this?

Even before that it would be good to create a document on what those best practices should be and add them here for us on this thread to review as a separate PR. Then we can refer to that document in all future issues.

- https://github.com/PalisadoesFoundation/talawa-admin/tree/develop/docs/docs/docs/developer-resources

You can follow the template of the other files in the directory. The header at the top is important.

Could you do that too?
 
@palisadoes Thanks for the feedback,
Yes, I can definitely start by creating documentation for reusable components using the provided documentation template.
Once i have it ready i will add them here for review.
 
Last edited:
@Jashan

This is good.

Please edit this page, replace all the text in the "Embrace Modularity" section with a short sentence that links to the new page you will be adding. That will help.

After thinking about this some more, the refactoring.md file is really a best practices coding standards file, so we should move it's text to the introduction.md file under a "coding standards" section. The refactoring.md file can then be deleted.

- https://github.com/Jashan32/talawa-.../docs/docs/developer-resources/refactoring.md

Please open a PR with these changes so that we can start the work. This will really help us in cleaning up the code.
 
@Jashan I have updated the code to use a reusable navbar for all the section, and the PR has been merged. Do you have any other suggestions?
 
Back
Top