-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Refactor Comments UI #2113
Refactor Comments UI #2113
Conversation
@macfanatic since I went to the trouble of modernizing the Comments index view, I'd really like it to be usable. By that, I mean the menu visibility should be a What do you think? |
I'm not sure what you are getting at with your two examples of what it should be able to do. Can you elaborate? |
Both with the current state of this PR, and with master, you can go to An earlier PR also changed |
Gotcha, makes sense. I'm not positive, but I think you could just use the |
Yeah, it's been done plenty of times in the AA codebase. Just wanted to get some feedback. |
Ah... neither |
Okay, I've mostly finalized this PR. Everything seems to work right. |
The cukes are failing; I'll fix them tomorrow :V |
All green 🍀. Anything you want changed @macfanatic? BTW, I'll want to squash these commits before they're merged. |
Squash and I'll merge, looks good to me. |
+ new configuration options: + menu item visibility (defaults to true) + `:as` registration name. For #301; replaces #2060 (defaults to Comment) + index page: + added a scope for every AA namespace, with the current namespace as the default + updated `resource_type` and `author_type` filters to be select fields (for Rails >= 3.2) + updated table to show every attribute + show page: + instead of redirecting to the associated resource, we now have a proper show page
Okay, squashed. |
By the way, as a result of a Comments admin heading being automatically added, I straight up disabled comments. I don't know why my clients want to see a CRUD interface for admin comments on records in the admin. Update: Apparently you can't disable comments. It hides the heading, but the queries are still made. |
There are three settings. You'd need to use the first one. config.allow_comments # outright disables comments
config.show_comments_in_menu # hides the menu item
config.comments_registration_name # lets you use e.g. AdminComment instead of Comment |
I actually used the first one, but had |
Looking into it now. So you're aware, before this PR Comments were already fully registered as a AA resource. As in if you went to This PR was an attempt to make that page actually be useful. If the end result of me bringing this to light is that Comments are modularized and removed from AA proper, I'm fine with that. This was more of an effort to understand the current codebase and to try and improve it where possible. |
All of these hidden features in ActiveAdmin are really more of a pain than a boon, so I appreciate your exposing it I have tried (and failed) to build clean installs without comments in the past but because ActiveAdmin is so tightly coupled to the notion of including comments I can never manage to get it to work properly without creating the comments tables at the least. Are the two flags you pointed out above ( Random idea for consideration — why not generate the comment resource when AA is installed so users can see/modify/delete it? |
I haven't added them to the docs, but they are included in newly generated AA config files (see the diff of this PR) |
Coming back to this thread... @coreyward the one thing I'm aware of that would prevent moving Comments completely into the realm of the everyday developer would be registration of the view helper, |
I know this is very old, and by the way hello @coreyward, but apparently I missed the ability to change the registered names for comments using config.comments_registration_name = 'AdminComment' (posting this comment in case someone else is digging around looking for the solution). |
While working on #1979, I noticed that we happen to register an index page for Comments, but it's hidden by default. This PR updates that UI so it's worthy of being shown by default.
Changes
:as
registration name. For Don't register ActiveAdmin::Comment as Comments #301; replaces Register Comment as AdminComment #2060 (defaults to Comment)resource_type
andauthor_type
filters to be select fields (for Rails >= 3.2)