-
Notifications
You must be signed in to change notification settings - Fork 987
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
Approve organization account #11208
Approve organization account #11208
Conversation
281f7b3
to
55ef819
Compare
Rebased against Events now use |
Realized that translations for admin-* emails don't really make sense. Similar to commit bec7058.
- admin-new-organization-approved - admin-new-organization-declined - new-organization-approved - new-organization-declined
As @ewdurbin pointed out, the approve organziation form in the admin interface should use the same design as the rest of the admin interface: - Changed style to AdminLTE theme. - Moved *Approve* or *Decline* dialog to *Actions* box. - Added confirmation modals for *Approve* or *Decline*. - Added *type orgnization name to confirm* to confirmation modals. The *Actions* box and confirmation modals follow the same patterns used in the user detail admin page.
Used Organization.events relationship per @sterbo's suggestion.
- Add "Approval Status" to "Organization Request" details - Allow admin to change approval decision - Disable "Approve" button if already approved - Disable "Decline" button if already declined
`Organization.Event` with tag: - organization.approve - organization.decline
55ef819
to
4995dec
Compare
Rebased against |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One request, but it can be addressed later. @s-mm can we ensure we capture the requested feature (list view for organization requests) somewhere?
{% block title %}{{ organization.name }}{% endblock %} | ||
|
||
{% block breadcrumb %} | ||
{# TODO: <li><a href="{{ request.route_path('admin.organization.list') }}">Organizations</a></li> #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if we included the list view as part of this PR 1) so we don't forget 2) so admins can view/process requests in bulk rather than having to go email by email link by link.
Ideally this would by default only show requests that have not been acted on, but have the option to display "approved", "declined", "submitted"
@divbzero if you don't respond saying "oh that's easy I'll add the list admin view real quick" I'll merge this later today. |
@ewdurbin It would be a bit more than “real quick” to make sure I do it right so maybe I can address this in another PR? I will be adding a list of pending organization requests for both users and admins. |
Show only if `AdminFlagValue.DISABLE_ORGANIZATIONS` is unchecked.
404 Not Found for "Organizations" admin if `disable-organizations` admin flag is checked.
Thank you so much @divbzero |
It looks like a test is broken after rebase, or may be flaky. |
Head branch was pushed to by a user without write access
33fdfec
to
ce90357
Compare
- Avoid unstable sort using `.normalized_name.lower()` as key - Avoid unreliable comparison of `paginate.Page` and `list`
ce90357
to
1bccec9
Compare
@ewdurbin Thanks, looks like my tests were flaky due to a bad sort key and unreliable comparison of |
* tests, warehouse: validate job_workflow_ref Add a bunch of counterexample tests to be certain. * oidc/models: wrap `re.match` to make mypy happy * tests/oidc: update * warehouse, tests: fix `job_workflow_ref` regex * tests, warehouse: refactor `job_workflow_ref` again * warehouse, tests: refactor `job_workflow_ref` verification again Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
* admin-new-organization-approved email template * admin-new-organization-declined email template * new-organization-approved email template * new-organization-declined email template * Remove translations from admin-* emails Realized that translations for admin-* emails don't really make sense. Similar to commit bec7058. * Test *new-organization-{approved,declined} emails - admin-new-organization-approved - admin-new-organization-declined - new-organization-approved - new-organization-declined * Mockup of approve organization form for admin * Add message textarea to approve organization form * Add more context to approve organization form * Rename view admin.organization.{approve => detail} * Implement GET approve organization form * Revamp UX for approve organization form As @ewdurbin pointed out, the approve organziation form in the admin interface should use the same design as the rest of the admin interface: - Changed style to AdminLTE theme. - Moved *Approve* or *Decline* dialog to *Actions* box. - Added confirmation modals for *Approve* or *Decline*. - Added *type orgnization name to confirm* to confirmation modals. The *Actions* box and confirmation modals follow the same patterns used in the user detail admin page. * Implement POST approve organization form * Get requesting user for approve organization form Used Organization.events relationship per @sterbo's suggestion. * Handle status in approve organization form - Add "Approval Status" to "Organization Request" details - Allow admin to change approval decision - Disable "Approve" button if already approved - Disable "Decline" button if already declined * Store id instead of username in new events `Organization.Event` with tag: - organization.approve - organization.decline * GET /admin/organizations/ to list organizations * Add "Organizations" to admin sidebar Show only if `AdminFlagValue.DISABLE_ORGANIZATIONS` is unchecked. * Test GET /admin/organizations/ * NFC: Rename tests *_{disallow => disable}_organizations * "Organizations" admin 404 if disable-organizations 404 Not Found for "Organizations" admin if `disable-organizations` admin flag is checked. * NFC: `organization_*` prefix for admin org views * GET /admin/organizations/?q=... faceted search * GET /admin/organizations?q=... improved search UI * Update tests for GET /admin/organizations/ * Link breadcrumb to GET /admin/organizations/ * Fix flaky tests for /admin/organizations/ - Avoid unstable sort using `.normalized_name.lower()` as key - Avoid unreliable comparison of `paginate.Page` and `list` Co-authored-by: Ee Durbin <ewdurbin@gmail.com>
Testing Setup
make serve
to run locally.make initdb
to initialize database.disable-organizations
admin flag at http://localhost/admin/flags/.Testing Steps
Expected Behavior