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

Feat: transit processor portal link for admin dashboard #2370

Merged
merged 8 commits into from
Sep 17, 2024

Conversation

lalver1
Copy link
Member

@lalver1 lalver1 commented Sep 16, 2024

Closes #2268

This PR adds a button that links to the TransitProcessor's portal so that a user can open the portal in a new tab.

image

To test

  • Apply the migration introduced by this PR: python manage.py migrate
  • Reset your database to local_fixtures.json if needed
  • Using the admin panel
    • In Groups add a CST group
    • In Transit Agencys add CST to the Staff group and Customer service group fields
    • In Transit processors add https://control.littlepay.com to the Portal url field
    • In Users add CST to your Chosen groups and remove the Superuser status property from your user
  • Log in using the sample agency user and verify that the home dashboard has the button to the portal
  • Set the Portal url field to blank and verify that the Transit Processor section does not appear in the home dashboard

@lalver1 lalver1 self-assigned this Sep 16, 2024
@lalver1 lalver1 force-pushed the feat/transit-processor-portal branch from 5823a62 to 931274e Compare September 17, 2024 15:59
Copy link

github-actions bot commented Sep 17, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits
  admin.py
  benefits/core
  models.py
Project Total  

This report was generated by python-coverage-comment-action

@lalver1 lalver1 marked this pull request as ready for review September 17, 2024 16:51
@lalver1 lalver1 requested a review from a team as a code owner September 17, 2024 16:51
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to bake some of these setup steps into the fixtures file?

E.g. creating a transit agency user and group, linking everything together, adding a sample portal link...

@lalver1 lalver1 force-pushed the feat/transit-processor-portal branch from 552e016 to cd854a6 Compare September 17, 2024 18:45
@lalver1
Copy link
Member Author

lalver1 commented Sep 17, 2024

Ah good idea, cd854a6 should simplify the setup

@thekaveman
Copy link
Member

Ah good idea, cd854a6 should simplify the setup

This is great! But I'd still like to shortcut the user setup. I created a local user account and exported the JSON, can you please add this to the fixture here?

{
  "model": "auth.user",
  "pk": 3,
  "fields": {
    "password": "pbkdf2_sha256$870000$5pS1ll33O6bi2rCCELW8kZ$OvFJJIERCEE0H2RhI8WzKTi+tFhbrfo/sxFdwAUzESI=",
    "last_login": null,
    "is_superuser": false,
    "username": "cst-user",
    "first_name": "CST",
    "last_name": "User",
    "email": "[email protected]",
    "is_staff": true,
    "is_active": true,
    "date_joined": "2024-09-17T18:54:46Z",
    "groups": [2],
    "user_permissions": []
  }
}

The account details are stored in a shared LastPass item: Benefits Admin sample agency user.

I also think it would be most helpful if our default value (in .env.sample) for SSO_SHOW_FORM_ON_ADMIN_PAGE=True to make logging in with sample users locally much easier.

- set up a sample agency user using the fixtures file
- show form on the admin page to simplify logging in with sample users
@lalver1
Copy link
Member Author

lalver1 commented Sep 17, 2024

I was wondering how to streamline it further and this is great, thanks! The changes are in eba2877

Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thank you for addressing my feedback!

@lalver1 lalver1 merged commit 105a053 into main Sep 17, 2024
13 checks passed
@lalver1 lalver1 deleted the feat/transit-processor-portal branch September 17, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transit agency staff users should be able to open their transit processor portal in a new tab
2 participants