feat(dataset): add dataset contributor display and editing - #6953
Conversation
Automated Reviewer SuggestionsBased on the
|
6f57f87 to
295c8a5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6953 +/- ##
============================================
+ Coverage 82.73% 82.86% +0.12%
Complexity 4089 4089
============================================
Files 1162 1165 +3
Lines 46302 46412 +110
Branches 5162 5173 +11
============================================
+ Hits 38308 38458 +150
+ Misses 6302 6257 -45
- Partials 1692 1697 +5
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds Angular frontend support for dataset contributor metadata (introduced in the backend/API in #6952), enabling contributors to be displayed on the dataset detail page and edited via a modal, and allowing contributors to be provided during dataset creation.
Changes:
- Adds contributor typing and wires contributors through dataset create + dataset detail retrieval flows.
- Introduces a contributor editor modal (Formly-based) and integrates contributor add/edit/delete into the dataset detail UI with optimistic updates.
- Adds/updates frontend unit tests covering service calls and contributor edit flows.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/dashboard/type/dashboard-dataset.interface.ts | Extends dashboard dataset typing to include contributors. |
| frontend/src/app/dashboard/service/user/dataset/dataset.service.ts | Sends contributors on dataset creation; adds contributors update API call. |
| frontend/src/app/dashboard/service/user/dataset/dataset.service.spec.ts | Adds tests for contributors in create request + update contributors endpoint. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.ts | Adds optional contributors form array to dataset creation flow. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-version-creator/user-dataset-version-creator.component.spec.ts | Updates Formly stubs/expectations to include contributors field. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.ts | New modal component + reusable Formly contributor field group (incl. email validation). |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.spec.ts | Unit tests for contributor editor modal behavior and validation. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.scss | Styles for contributor editor modal layout and buttons. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-contributor-editor/user-dataset-contributor-editor.component.html | Template for contributor editor modal form + actions. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.ts | Stores contributors from dataset response; adds optimistic add/edit/delete + persistence. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts | Adds tests for contributor mapping and optimistic update/rollback behavior. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.scss | Adds contributor section/card styling with truncation and tooltips. |
| frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.html | Adds Contributors UI section, action dropdown, and add-card control. |
| frontend/src/app/common/type/dataset.ts | Adds Contributor type and contributors on Dataset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2c2a3b3 to
7273780
Compare
Blank optional contributor fields (email, affiliation, comments) are now omitted from requests so they are stored as NULL instead of empty strings, and the add-contributor tile activates on Space in addition to Enter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…st update Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ounts (apache#7280) ### What changes were proposed in this PR? This PR links dataset contributors to user accounts by email, so a contributor can later own their contributions with a real account. Follow-up to apache#6952 (backend) and apache#6953 (frontend). Changes: - When a contributor has an email, it is matched to a user account, ignoring case. If no account exists yet, a placeholder account is created for that email; saving the list again reuses it. - When someone later registers with that email (locally or via Google), they take over the placeholder. The account keeps its `uid`, so existing contributor links keep working. It still needs admin approval before it can log in and do anything, and an account that already has a password or Google login can never be taken over. - Placeholder accounts cannot be granted access to workflows, datasets, projects, or computing units. - The admin user list shows which accounts are placeholders. - A contributor email must be well-formed, and two contributors of the same dataset cannot use the same email. - The migration adds the new column, foreign key, and indexes, removes duplicate emails already in the data, and links existing contributors to registered users. Design notes: - Emails are optional for contributors, so updates keep replacing the whole list. - Emails are stored as typed but always compared case-insensitively. Lower-casing them in storage, and reusing the new `EmailUtil` in the two older email checks, are left as follow-ups. #### Demo First, the dataset owner adds a contributor whose email is not associated with an existing user account. <img width="1471" height="728" alt="add-contributor" src="https://github.com/user-attachments/assets/aba20a2f-d463-4c6e-ac31-a9451875af94" /> A placeholder user account is then created and displayed on the admin user page. <img width="1457" height="89" alt="place-holder" src="https://github.com/user-attachments/assets/d86d059c-41a7-4da6-9eb8-c9b4b91bc035" /> The contributor can claim the placeholder account by registering with the same email address through local or Google sign-in. <img width="418" height="396" alt="claim-account" src="https://github.com/user-attachments/assets/57a4030a-7b45-422a-85c1-84c65898de4b" /> After the account is claimed, the updated account information is shown on the admin user page. <img width="1452" height="82" alt="account" src="https://github.com/user-attachments/assets/161b7515-60eb-4bad-9d91-e2d2d5e2c750" /> <img width="1453" height="160" alt="after-claim" src="https://github.com/user-attachments/assets/37ffad0d-ea15-40a9-b9fb-f044f5025b5a" /> ### Any related issues, documentation, discussions? Closes apache#6976 Related to apache#6926 ### How was this PR tested? 17 new ScalaTest cases covering linking (existing user, placeholder creation and reuse, no-email, invalid/duplicate email), claiming (uid preserved, INACTIVE kept, login after claim, credentialed accounts not claimable, taken username rejected, case-variant duplicate registration rejected), the placeholder grant guard in each of the four access resources, and the shared EmailUtil. The pre-existing AuthResource and access-resource tests still pass. Fresh-DDL and migrated schemas verified identical via pg_dump diff. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Fable 5) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
What changes were proposed in this PR?
This PR adds the frontend for dataset contributor metadata so that dataset authors and other contributors can be properly acknowledged, on top of the backend added in #6952.
Changes:
user-dataset-contributor-editormodal component for adding and editing a contributor, backed by a shared Formly field group (contributor-form-fields.ts) with client-side validation (required name, email format, length limits).DatasetService:createDatasetgains a contributors argument, and a newupdateDatasetContributorsmethod posts the full list toPOST /dataset/update/contributors.Contributorinterface,DashboardDataset.contributors, and an optionalisPlaceholderflag onUserwith a "placeholder" tag in the admin user list. The tag stays hidden until the follow-up backend that auto-creates placeholder accounts for contributor emails lands; it is included here so the admin UI is ready for it.Demo
Contributor list:

Any related issues, documentation, discussions?
Depends on #6952
Closes #6926
How was this PR tested?
New vitest cases across four spec files: contributor card rendering and add/edit/delete flows with rollback on failure (dataset-detail), editor form validation and modal results (contributor-editor), request shapes for create/update (dataset.service), and the extended create-dataset form fields (version-creator). The flow was also manually tested in the UI.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Fable 5)