codeforboston / maple

MAPLE makes it easy for anyone to view and submit testimony to the Massachusetts Legislature about the bills that will shape our future.
https://mapletestimony.org
MIT License
44 stars 118 forks source link

Organization Accounts: Upgrade Flow and Profile Pages #927

Closed alexjball closed 1 year ago

alexjball commented 1 year ago

Versioned Figma designs

Support for roles was added in #611 . Spefically, the setRole function is available in cloud functions to adjust the role of a user

alexjball commented 1 year ago

The profile page has some conditional rendering based on if the user is an org here

alexjball commented 1 year ago

We'll need to authorize access to admin page data using some kind of server-side code. There are two options for this:

  1. Create a new adminOperations cloud function that only admins can call. It handles requests for listing, upgrading, etc. Call this on the client to load data for the tables and submit forms. For reference, Here is the cloud function and auth logic for publishing testimony. These use HTTPS Callables.
  2. Use server-side rendering to create the admin pages using getServerSideProps. The benefit of this over 1 is it should simplify data fetching, as all of the page data is available immediately to the client, and it puts the data fetching logic closer to the page, so should be easier to iterate on. In order to use this approach, we need to pass the user's firebase auth token to the server and validate it. You can refer to the setup in this blog post. The important parts are setting persistence in step 1 and then doing the check step 6. You can see an example of server side rendering in maple here
alexjball commented 1 year ago

@tommagnusson Kelly is getting started on admin pages for signing up admins and organizations. We should be able to reuse this approach to build the admin pages for content moderation as well.

jellyyams commented 1 year ago

I wrote up the background for this epic in this google doc and will be putting running notes in the same place: https://docs.google.com/document/d/17lpl4ty79YQAFhX6akPWuk9w8WoOX2T9V5Wie7CEb2k/edit?usp=sharing

Dev will happen on this branch: https://github.com/jellyyams/maple/tree/orgprofiles

mvictor55 commented 1 year ago

Great! Thanks Kelly. We’ll find a designer to pair with you. Much much appreciated!

On Tue, Feb 7, 2023 at 10:20 AM jellyyams @.***> wrote:

I wrote up the background for this epic in this google doc and will be putting running notes in the same place: https://docs.google.com/document/d/17lpl4ty79YQAFhX6akPWuk9w8WoOX2T9V5Wie7CEb2k/edit?usp=sharing

Dev will happen on this branch: https://github.com/jellyyams/maple/tree/orgprofiles

— Reply to this email directly, view it on GitHub https://github.com/codeforboston/maple/issues/927#issuecomment-1420952175, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARANGSFNE2VUUTMHXDRMXYLWWJR4VANCNFSM6AAAAAAURG2OSE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jellyyams commented 1 year ago

Front end tasks:

Back end tasks:

mvictor55 commented 1 year ago

Awesome! So we need to get you front end support to finish this up?

Thanks Matt

On Tue, Mar 7, 2023 at 1:42 PM jellyyams @.***> wrote:

Front end tasks:

  • Profiles can be displayed as an org or a regular user
  • Update sign up flow to allow users to select profile type (org or individual) at the beginning of sign up flow
  • Add banner/notification for profiles that are awaiting admin approval for org accounts

Back end tasks:

  • Set up api endpoints for serving data to admin view
  • integrate api endpoints with react admin

— Reply to this email directly, view it on GitHub https://github.com/codeforboston/maple/issues/927#issuecomment-1458653376, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARANGSCLHZFW2LMIW6H5M2TW256SBANCNFSM6AAAAAAURG2OSE . You are receiving this because you commented.Message ID: @.***>

jellyyams commented 1 year ago

I think i'm able to finish up the front end tasks for this epic without additional support. We do however need people who are good at front end dev to clean up some of the existing pages. A lot of the styling is inconsistent across different pages or deviate from the designs that the ux team came up with. The site doesn't look super clean atm