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

E2424. Reimplement the Bookmarks Controller #76

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

Conversation

MitanshuShaBa
Copy link
Contributor

The BookmarksController on Expertiza serves as the backend logic for bookmark management and user interactions. It features actions for listing bookmarks associated with a specific topic, creating new bookmarks, editing existing ones, and deleting bookmarks. Authorization rules, defined in the action_allowed? method, ensure that users have appropriate roles and permissions for each action. The controller includes functionality for users to get bookmark ratings , with methods like bookmark_rating and save_bookmark_rating_score. Additionally, it calculates and displays average scores for specific and total ratings using the specific_average_score and total_average_score methods, respectively. Strong parameters are handled through private methods (create_bookmark_params and update_bookmark_params). The controller logs various actions and provides feedback to users through flash messages. Overall, the BookmarksController orchestrates the interaction between users, bookmarks, and ratings within the application.

What needs to be done?

  • The controller should have the CRUD operations to create and edit bookmarks based on whether the user has adequate permission. The bookmarks controller should have methods for creating, updating, deleting, and viewing bookmarks.
  • The code should be written in a clean and concise manner. Methods with identical names that perform different functionalities should be renamed for clarity. Functions or functionality that are not clear should be commented on or removed. Any loops or methods that can be refactored for better performance should be addressed e.g. delete all questions that belong to a questionnaire
  • Any unused or unclear functionality should be removed from the controllers. This will help to reduce complexity and make the code easier to maintain.
  • Tests should be written for the bookmarks controller. The tests should cover at least 80% of the code, and tools like Rubocop and Code Climate should be used to verify code smells.

@MitanshuShaBa MitanshuShaBa marked this pull request as ready for review March 25, 2024 04:34
MitanshuShaBa and others added 12 commits April 20, 2024 13:08
* Adding files to setup

* Updating setup script with working seed file

* Adding a setup script to try to automate setup

* Adding setup.sh as entrypoint

* add db creation initilization script

---------

Co-authored-by: Muhammad Ali Qureshi <mquresh@vclvm178-91.vcl.ncsu.edu>
Co-authored-by: ameyagv <ameyav1234@gmail.com>
MitanshuShaBa and others added 3 commits April 21, 2024 20:15
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.

5 participants