Create membership preview feature for membership portal
This feature, available to EF users marked as admin in the project (not using the Drupal flags, which are separate), would allow the mentioned users to add a parameter to spoof an organization's dashboard for demonstration purposes. This would be used for the dashboard landing page and would be read-only, as the other data can either be managed through the internal Foundation portal or using the new admin page that is in the process of being authored for #484 (closed).
To enable this, when requesting user info from the portal API, the endpoint should check if the user is an admin to enable special features. The new feature would allow a query string parameter of organization_id
to be set that would add an entry to the list of organizations in the user info for the given org. Additionally, we should allow for an optional role
to be set that would allow for previews as other roles, with a default of CR
when not set. This should give sufficient flexibility to the front end to display multiple scenarios while not over-engineering the solution.
In terms of how this would be presented in the UI, there are multiple options to this. The most user-friendly option would be to display 2 additional fields in the top area of the portal dashboard when logged in as an admin. The first field would contain the roles to preview using the user-friendly string as a display and with the relation code as the value. The second field would allow an organization ID to be input that would be passed to the subsequent requests for user info. This would allow us to spoof whatever organization is targeted and provide flexibility while not requiring non-technical users to modify the URL.
This may need some additional tweaks to retrieve non-member organizations on request, so some investigation will need to be done to see if special handling needs to be done in the API to handle the case of non-member previews being requested.