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

[ENG-6945] Added draft registrations page in admin app #10962

Conversation

ihorsokhanexoft
Copy link

@ihorsokhanexoft ihorsokhanexoft commented Feb 6, 2025

Purpose

User should be able to view users' draft registrations by their guid by the requirement:

Clicking on a draft registration will show the metadata of that draft

Changes

Search by user's guid:
image

List of his draft registrations:
Screenshot from 2025-02-06 11-48-42

Specific draft registration page:
image

Notes

  1. Worth to note that DraftRegistrations don't have guid, only _id from ObjectIDMixin, this is why I had to override it in some places
  2. Also some templates cannot be reused because DraftRegistration doesn't inherit from Node
  3. The following requirement is ignored because admin can click "back" button as the previous page is user's draft registrations

Add a link to the user detail view in the admin app to take the admin to the list of draft registrations associated with that user.

  1. In UserDraftRegistrationsList.get_queryset I used draft_registrations_active assuming we don't show deleted drafts

Ticket

https://openscience.atlassian.net/browse/ENG-6945

Copy link
Collaborator

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

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

One question about a couple of labels, otherwise looks great. Oh, and also Product is wondering if you could put in total storage usage into the detail page.

<table class="table table-striped table-hover table-responsive">
<thead>
<tr>
<th>GUID</th>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here with id

</thead>
<tbody>
<tr>
<td>Guid</td>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since draft registrations don't have a guid, would it make more sense to just call this id?

Copy link
Author

@ihorsokhanexoft ihorsokhanexoft Feb 7, 2025

Choose a reason for hiding this comment

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

Yeah, I left it because for Product it's guid and didn't want to confuse them, will rename it

@ihorsokhanexoft
Copy link
Author

ihorsokhanexoft commented Feb 7, 2025

One question about a couple of labels, otherwise looks great. Oh, and also Product is wondering if you could put in total storage usage into the detail page.

I'll try but this functionality can be reused only if model inherits from Node that is not our case (drafts don't have guid, custom_storage_usage_limit_public, custom_storage_usage_limit_private fields), thus cannot be sure it's possible

@ihorsokhanexoft
Copy link
Author

@brianjgeiger I managed to implement it. As expected the issue was that Drafts don't inherit from AbstractNode, but files have relationship to AbstractNode via target_content_type thus added additional conditions

@brianjgeiger brianjgeiger merged commit 29dd2aa into CenterForOpenScience:feature/b-and-i-25-01 Feb 10, 2025
6 checks passed
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.

2 participants