Skip to content

Support editing organization profiles with staff approvals #468

@allanlasser

Description

@allanlasser

We have a page for admins to edit the properties of their organization’s profile. This information will be displayed on the organization’s profile, if it’s public.

This mockup shows how the form will appear to an org admin.

This mockup shows how the form will appear to an org admin.

Org admins may freely edit these organization fields:

Org admins should be able to request changes to the following data:

  • name
  • The slug used to identify the organization in URLs.
    • Like with individual profiles, slugs may be changed once before editing them is disabled. If an org admin would like to change their slug again, they need to contact support with a change request.
    • When we can’t find an org matching a slug, we can query the table of approved change requests to find an older slug that matches.
    • Since changing a slug will break existing URLs to the organization’s pages in Accounts, we will handle broken links by showing signed-in users a list of their orgs on any organization 404 pages.
  • url
  • Location

When requesting a change, we’ll also want to prompt users for an explanation of their changes. After the user clicks the “Request changes” button, we can raise a prompt to captures this explanation before continuing with the submission.

When a staff member saves the form, we don’t need an explanation and don’t need to issue a change request. For staff members, the button should read “Save Changes”.

Tracking change requests

We require staff confirmation for names and URLs to prevent impersonations. When changes are requested, we will create a new support ticket with a link to the organization’s profile.

Each change to an organization’s profile data should be recorded in a new table, OrganizationProfileChangeRequests. The model should include fields for:

  • a unique id
  • the user who made the request
  • a relation to the organization
  • an explanation for the change
  • a status for the change (one of: pending, accepted, rejected)
  • “previous” data, pulled from the organization during creation:
    • old_display_name
    • old_slug
    • old_url
    • old_location
  • the “changed” data, possibly null if not different from previous data:
    • new_display_name
    • new_slug
    • new_url
    • new_location

When a change request is created, we will also create a support ticket with Zenpy and the ZenDesk API. See the muckrock repo for a reference implementation using the Zenpy library. This will allow staff to respond to the user to discuss their request.

The support request can look something like:

<user.name> requested the following changes to their organization <organization.name>:

- Display Name: New Yor Times -> New York Times
- Slug: new-yor-times -> new-york-times

They provided the following explanation:

> We had a typo in our org name.

To approve this change, please follow this link:

https://accounts.muckrock.com/organization/<slug>/change-request/<id>

Staff will have permission to make the edit on this page, so they can make any adjustments they need to before “Confirming” the changes by saving the form.

When the form is saved, the changed data should be applied to the Organization.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions