[resolves 6298] Add Custom Admin-Defined Navbar Links#6350
[resolves 6298] Add Custom Admin-Defined Navbar Links#6350compwron merged 1 commit intorubyforgood:mainfrom
Conversation
562aebc to
3129c01
Compare
kcdragon
left a comment
There was a problem hiding this comment.
This PR looks good. Once the rest of the specs are added, I think it will be ready to merge.
|
The stakeholders are very interested in this one, they asked today :) |
3129c01 to
192b81b
Compare
192b81b to
f90b407
Compare
f90b407 to
60de39a
Compare
60de39a to
a1c76ff
Compare
|
We would love to get this merged soon! |
There was a problem hiding this comment.
Pull Request Overview
This PR adds the functionality for custom, administrator-defined navbar links by introducing a new CustomOrgLink model, associated controller/actions, view components, and validations along with tests and policies.
- Introduces CustomOrgLink model with validations and associations.
- Implements CRUD operations and updates the UI to include custom links in the sidebar and organization edit views.
- Adds new URL validation logic and corresponding tests, policies, and factory definitions.
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spec/policies/custom_org_link_policy_spec.rb | Adds policy specs for CustomOrgLink permissions |
| spec/models/custom_org_link_spec.rb | Adds model tests for validations and associations |
| spec/models/casa_org_spec.rb | Updates association for custom_org_links on CasaOrg |
| spec/factories/custom_org_links.rb | Provides factory for creating CustomOrgLink instances |
| db/schema.rb, db/migrate/* | Adds database table and migration for custom_org_links |
| config/routes.rb | Registers routes for custom_org_links CRUD operations |
| app/views/layouts/_sidebar.html.erb | Renders active custom links in the sidebar navigation |
| app/views/custom_org_links/* | Creates views for new, edit, and form for CustomOrgLink records |
| app/views/casa_org/_custom_org_links.html.erb | Implements table view to list and manage custom links in CasaOrg views |
| app/validators/url_validator.rb | Introduces a URL validation class for CustomOrgLink |
| app/policies/custom_org_link_policy.rb | Implements authorization policy for CustomOrgLink instances |
| app/models/custom_org_link.rb | Defines model-level associations and validations for CustomOrgLink |
| app/controllers/custom_org_links_controller.rb | Implements controller actions for CustomOrgLink CRUD operations |
| app/controllers/casa_org_controller.rb | Updates CasaOrg controller to load custom_org_links for editing |
| .allow_skipping_tests | Adds URL validator to the list of allowable skipped test files |
Comments suppressed due to low confidence (2)
app/views/custom_org_links/_form.html.erb:21
- The label for the display text field incorrectly uses the attribute :name instead of :text. Consider updating it to <%= form.label :text, "Display Text" %>.
<%= form.label :name, "Display Text" %>
app/views/custom_org_links/_form.html.erb:26
- The label for the URL field incorrectly uses the attribute :name instead of :url. Consider updating it to <%= form.label :url, "URL" %>.
<%= form.label :name, "URL" %>
| @@ -0,0 +1,12 @@ | |||
| class CustomOrgLinkPolicy < ApplicationPolicy | |||
| </div> | ||
| </div> | ||
| </div> | ||
| </div><!-- ==== end title ==== --> |
There was a problem hiding this comment.
nit: comments not needed here
| @@ -0,0 +1,8 @@ | |||
| FactoryBot.define do | |||
compwron
left a comment
There was a problem hiding this comment.
looks good, let's do it!
What github issue is this PR for, if any?
Resolves #6298
What changed, and why?
TODO: Need to discuss authorization/policy logic requirements with a more experienced casa developer
How is this tested? (please write rspec and jest tests!) 💖💪
TODO: Still need to write feature/request specs
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system
Screenshots please :)
Feelings gif (optional)