Skip to content

fix(frontend, amber, v1.2): source filter owners per resource kind and apply them to datasets - #8061

Draft
github-actions[bot] wants to merge 1 commit into
release/v1.2from
backport/8060-source-filter-owners-per-resource-kind-a-v1.2
Draft

fix(frontend, amber, v1.2): source filter owners per resource kind and apply them to datasets#8061
github-actions[bot] wants to merge 1 commit into
release/v1.2from
backport/8060-source-filter-owners-per-resource-kind-a-v1.2

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Automated backport of #8060 to release/v1.2.

Source: eddec26 · automation run

Any related issues, documentation, discussions?

Backport of #8060. Originally linked #8059.

How was this PR tested?

Release-branch CI runs on this branch once the conflicts are resolved and this PR is marked ready for review.

Was this PR authored or co-authored using generative AI tooling?

No.

…y them to datasets (#8060)

### What changes were proposed in this PR?

The Owner filter on the Datasets pages was broken on both sides:

1. **Wrong list.** `<texera-filters>` always read its Owner and ID
dropdowns from `WorkflowPersistService`, so Datasets listed workflow
owners and offered a workflow-ID filter.
2. **No effect.** `VersionedResourceSearchQueryBuilder` applied the
date, id and full-text filters but dropped `params.owners`, so selecting
an owner changed nothing.

```
Before:  Datasets -> filters -> workflowPersistService.retrieveOwners()  -> workflow owners
         owner=<email> -> VersionedResourceSearchQueryBuilder            -> ignored

After:   Datasets -> filters -> datasetService.retrieveOwners()          -> dataset owners
         owner=<email> -> VersionedResourceSearchQueryBuilder            -> USER.EMAIL predicate
```
Before -
<img width="1239" height="533" alt="Screenshot 2026-08-27 at 3 36 49 PM"
src="https://github.com/user-attachments/assets/ca1f0055-17d3-46cb-b4c8-65a1005bec5f"
/>

After -
<img width="1227" height="598" alt="Screenshot 2026-08-27 at 4 41 05 PM"
src="https://github.com/user-attachments/assets/294335e6-6028-44c2-af46-c2ad19781c97"
/>

- `filters.component.ts` gains `@Input() entityType`, defaulting to
`Workflow`, so the Workflows and
  unified search pages are untouched.
- `VersionedResourceSearchQueryBuilder` adds the
`getContainsFilter(params.owners, USER.EMAIL)` the
workflow builder already uses. The `USER` join was already in the FROM
clause.
- The id dropdown hides where no id endpoint exists. Adding
`/dataset/user-dataset-ids` and
  `/model/user-model-ids` is left to a follow-up feature.

### Any related issues, documentation, discussions?

Closes #8059.

### How was this PR tested?

Five new tests in `filters.component.spec.ts` (owners per kind, ids only
for workflows, dropdown
hidden for datasets) and three in `DatasetSearchQueryBuilderSpec` (one
owner renders the predicate,
several OR together but AND with the id filter, none renders nothing).

```bash
cd frontend && npx ng test $(grep -rl "FiltersComponent\|DatasetService" src/app | grep "spec.ts$" | sed 's/^/--include /' | tr '\n' ' ')
sbt 'testOnly *DatasetSearchQueryBuilderSpec'
```

909 frontend tests, 21 backend, all passing. Plus `tsc --noEmit`,
eslint, prettier, `scalafmtCheck`.

Manual: signed in as a user with a shared dataset plus their own
workflow, the Datasets page now
lists only the dataset's owner, ticking it narrows the list, and the id
dropdown is gone. Workflows
page unchanged.

### Was this PR authored or co-authored using generative AI tooling?

(backported from commit eddec26)

Generated-by: Claude Code Opus 5
@github-actions

Copy link
Copy Markdown
Contributor Author

The cherry-pick conflicted and was committed with conflict markers. Resolve the conflicts on this branch, then mark this PR ready for review.

Conflicting files:

  • amber/src/main/scala/org/apache/texera/web/resource/dashboard/VersionedResourceSearchQueryBuilder.scala
  • amber/src/test/scala/org/apache/texera/web/resource/dashboard/DatasetSearchQueryBuilderSpec.scala
  • frontend/src/app/dashboard/component/user/filters/filters.component.spec.ts
  • frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.html
  • frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.spec.ts
  • frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.ts
  • frontend/src/app/hub/component/hub-search-result/hub-search-result.component.html
  • frontend/src/app/hub/component/hub-search-result/hub-search-result.component.spec.ts

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.

1 participant