Skip to content

feat(dataset): add dataset contributor display and editing - #6953

Merged
xuang7 merged 7 commits into
apache:mainfrom
xuang7:feat/dataset-contributor-frontend
Aug 3, 2026
Merged

feat(dataset): add dataset contributor display and editing#6953
xuang7 merged 7 commits into
apache:mainfrom
xuang7:feat/dataset-contributor-frontend

Conversation

@xuang7

@xuang7 xuang7 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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:

  • Dataset detail page: a new "Metadata" card in the Data Card tab with a collapsible "Contributors" section. Each contributor is shown as a card with name, email, affiliation, and comments; the dataset creator is marked with a star. Long field values are truncated to two lines with the full content shown in tooltips.
  • Users with WRITE access can add, edit, and delete contributors through a dropdown menu on each card, with optimistic updates and rollback if saving fails.
  • A new user-dataset-contributor-editor modal 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).
  • Dataset creation: the create-dataset form accepts an optional initial list of contributors, sent with the create request.
  • DatasetService: createDataset gains a contributors argument, and a new updateDatasetContributors method posts the full list to POST /dataset/update/contributors.
  • Types: Contributor interface, DashboardDataset.contributors, and an optional isPlaceholder flag on User with 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

Create a dataset with contributor metadata Add a contributor from the dataset detail page
Create a dataset with contributor metadata Add a contributor from the dataset detail page

Contributor list:
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)

@github-actions github-actions Bot added feature frontend Changes related to the frontend GUI labels Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @rbelavadi, @aglinxinyuan, @jaeyun0503
    You can notify them by mentioning @rbelavadi, @aglinxinyuan, @jaeyun0503 in a comment.

@xuang7
xuang7 force-pushed the feat/dataset-contributor-frontend branch from 6f57f87 to 295c8a5 Compare July 28, 2026 21:25
@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.36364% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.86%. Comparing base (e7cd5b1) to head (1eb1f4e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ser-dataset-explorer/dataset-detail.component.html 92.59% 4 Missing ⚠️
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     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from e7cd5b1
agent-service 83.65% <ø> (ø) Carriedforward from e7cd5b1
amber 79.53% <ø> (ø) Carriedforward from e7cd5b1
computing-unit-managing-service 43.60% <ø> (ø) Carriedforward from e7cd5b1
config-service 65.97% <ø> (ø) Carriedforward from e7cd5b1
file-service 67.74% <ø> (ø) Carriedforward from e7cd5b1
frontend 83.84% <96.36%> (+0.28%) ⬆️
notebook-migration-service 78.89% <ø> (ø) Carriedforward from e7cd5b1
pyamber 97.36% <ø> (ø) Carriedforward from e7cd5b1
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from e7cd5b1

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
@xuang7
xuang7 force-pushed the feat/dataset-contributor-frontend branch from 2c2a3b3 to 7273780 Compare July 31, 2026 23:22
xuang7 and others added 4 commits July 31, 2026 16:22
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>

@aicam aicam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@aicam
aicam added this pull request to the merge queue Aug 3, 2026
@xuang7
xuang7 removed this pull request from the merge queue due to a manual request Aug 3, 2026
@xuang7
xuang7 added this pull request to the merge queue Aug 3, 2026
Merged via the queue into apache:main with commit 7f3bba5 Aug 3, 2026
26 checks passed
@xuang7
xuang7 deleted the feat/dataset-contributor-frontend branch August 3, 2026 20:53
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Aug 3, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support contributor metadata for datasets

4 participants