mwalsh2020 / lsat-cracked

1 stars 0 forks source link

Add administrate and dashboards #186

Closed caioertai closed 3 years ago

caioertai commented 3 years ago

Closes #175

This includes #185, so let's review and merge that one first so the change log here is cleaner.

We can potentially just delete all the old admin namespace (changed to manage) after this merge.

Sorry if the commits are a bit jumbled. Administrate adds A LOT of boilerplate. And in the end it was easier to just add things and tweak them than to slowly add what's needed only.

It's better to view this PR as essentially a read through this: https://administrate-demo.herokuapp.com/getting_started

Cleaning up show, forms and indexes

When you generate a dashboard through the gem it tried to imply the fields you want in the show or form (it adds ALL of them). So the whole PR was mostly reordering and tweaking the defaults.

Adding custom behaviors

Also check the admin/answers controller. I had to tweak the defaults there to make sure the answer creation was done from the question show instead of as a dangling record (better UX like this should avoid us having problems with no tech folks changing a an answer's question by mistake). Also check the namespaced admin routes for answers, which as non-default.

Next steps

I'm going to wait for Sean's feedback on this before tweaking any further. This should be a good start, and although some of the search features and ordering should be broken, I'd rather not bother with this unless it's actually relevant for his daily use.