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

Admin V2 #291

Open
KevinMulhern opened this issue Oct 7, 2023 · 1 comment
Open

Admin V2 #291

KevinMulhern opened this issue Oct 7, 2023 · 1 comment
Assignees
Labels
Status: In Progress This issue/PR has ongoing work being done

Comments

@KevinMulhern
Copy link
Member

Title Author Date
Admin V2 Kevin 07/10/2023

Roll our own admin

Summary

We currently use the Active Admin framework for the admin section on the site. It’s allowed us to build a basic admin system fast, but will limit us eventually.

We don’t have a lot of features in our admin system at the moment, but we’ve talked quite a bit about adding more this year. This is the ideal time to move to our own system instead of going deeper into Active Admin.

Motivation

  • Admin is mostly CRUD, it will be easy to build and extend our own with vanilla Rails.
  • Rolling our own admin future proofs us. We will be able to do whatever we need without compromising and hacking it to work with whatever a library expects.
  • The Active Admin DSL expects things to be done a certain way. If we need to go off script and do something remotely different, it can be very difficult and messy when it would have otherwise been easy with vanilla rails.
  • Active admin lags behind the latest developments in Rails. It need Sass and jQuery to run and doesn't work very well with the new asset management gems for Rails.
  • We’ll be able to reuse frontend components we use on the rest of the site instead of relying on the limited amount of UI components Active Admin provides

Suggested implementation

Scope

  • The goal will be to reach feature parity with the existing system.

Approach

  • We will put the new system behind an /admin_v2 base route. That will allow us to build the new system in small chunks and keep the legacy system accessible and working until feature parity is reached.
  • All new admin related files to be within an admin namespace so there is a clear boundary between the core system and admin.
  • Focus on building out the index and details pages for flags until feature complete first. Announcements will be able to reuse most of the same components.

Auth

  • Admin accounts will be stored in a new admin_users table instead of using an admin flag on the main users table.
    • To keep things secure, there will be no gateway to create admin accounts outside of the admin system. New admin will be invited via email instead of signing up on a page somewhere.
    • When someone leaves the team - their admin account will be deactivated instead of deleted to ensure data integrity with audit logs.
    • When someone rejoins, it will reactivate their account and send them a password reset email.

Drawbacks

N/A

Alternatives

There are many alternative admin libraries for Rails. But, I don't think we should go down that route. We'd still be tied to how they want things done instead of having the flexibility of our own system.

Additional

Adding 2fa to admin accounts would be a nice follow up to this.

@KevinMulhern KevinMulhern added the Status: Idea Funnel This issue is currently in the idea funnel label Oct 7, 2023
@KevinMulhern KevinMulhern self-assigned this Oct 7, 2023
@ManonLef
Copy link
Member

ManonLef commented Oct 7, 2023

Nice plan!

@KevinMulhern KevinMulhern added Status: In Progress This issue/PR has ongoing work being done and removed Status: Idea Funnel This issue is currently in the idea funnel labels Mar 3, 2024
KevinMulhern added a commit to TheOdinProject/theodinproject that referenced this issue Mar 23, 2024
Because:
- We our moving our Admin to a new system and need feature parity with
the old systems flag pages.
- Relates to TheOdinProject/top-meta#291

This commit:
- Adds flags index page to admin v2
- Displays flags in a table
- Adds tabs to easily navigate between active and resolved flags
- Adds a cta link to the admin v2 dashboard to make admins aware of
unresolved flags that need attention
- Adds an admin specific pagination component


Flags page:
<img width="961" alt="Screenshot 2024-03-23 at 12 43 40"
src="https://github.com/TheOdinProject/theodinproject/assets/7963776/d9d79c7c-2fe7-4883-8295-9715b77ff393">

New pagination:
<img width="1084" alt="Screenshot 2024-03-23 at 12 17 25"
src="https://github.com/TheOdinProject/theodinproject/assets/7963776/834dc0cb-788e-4405-97ca-e214963aac54">



Dashboard CTA:
<img width="835" alt="Screenshot 2024-03-23 at 12 17 33"
src="https://github.com/TheOdinProject/theodinproject/assets/7963776/22b21332-a6f4-4fd9-a769-8a51f55418a6">
KevinMulhern added a commit to TheOdinProject/theodinproject that referenced this issue Apr 2, 2024
Because:
- We are building a new Admin system and need a flag details page where
we can handle individual flags
- related to TheOdinProject/top-meta#291
- 
This commit:
- Adds a flag details view
- Flag actions will be chosen from a select instead of displayed as
separate buttons

New UI for selecting choosing what action to take:


https://github.com/TheOdinProject/theodinproject/assets/7963776/e32d73d0-c120-4784-bb05-65163de38a61



Overall Page:
<img width="1198" alt="Screenshot 2024-04-01 at 17 05 42"
src="https://github.com/TheOdinProject/theodinproject/assets/7963776/470c739d-3249-4205-9443-d0dcdc7f758c">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress This issue/PR has ongoing work being done
Projects
None yet
Development

No branches or pull requests

2 participants