SRVKP-12524: Persist datasource filter selection for PipelineRuns#1152
SRVKP-12524: Persist datasource filter selection for PipelineRuns#1152ankrsinha wants to merge 5 commits into
Conversation
- Create useDatasourcePreference hook to persist datasource filter via useUserPreference - Add USER_PREFERENCE_PREFIX constant for preference key namespace - Wire datasource persistence into PipelineRunsList - Reset preference to default (Cluster) on clear all filters - Add unit tests for useDatasourcePreference hook Signed-off-by: Ankur Sinha <anksinha@redhat.com>
|
@ankrsinha: This pull request references SRVKP-12524 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ankrsinha The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
PR Reviewer Guide 🔍Warning
Here are some key observations to aid the review process:
|
Signed-off-by: Ankur Sinha <anksinha@redhat.com>
|
/agentic_review |
Code Review by Qodo
Context used 1.
|
| }, | ||
| }); | ||
|
|
||
| const onFilterChange = useCallback( |
There was a problem hiding this comment.
This needs to be moved inside /src/components/hooks/useDataViewFilter.ts.
What you are doing here is mutating methods that the hook exposes using baseOnFilterChange and baseOnClearAll which is not a practice that should be followed.
…iewFilter hook Signed-off-by: Ankur Sinha <anksinha@redhat.com>
Signed-off-by: Ankur Sinha <anksinha@redhat.com>
… mapping Signed-off-by: Ankur Sinha <anksinha@redhat.com>
Summary
Implements RFE SRVKP-12524: Persist the user's datasource filter selection (Cluster / Archived)
across sessions on the PipelineRuns list page.
The selection is stored in the Console's per-user ConfigMap via
useUserPreferencefrom thedynamic plugin SDK. On the next visit, the previously selected datasource filter is automatically
applied. Default selection is
Cluster.Changes
useDatasourcePreference: EncapsulatesuseUserPreferencefor datasource filterpersistence. Accepts a
pageType(pipelineRun|taskRun) to allow reuse for TaskRunsin a follow-up.
onFilterChangeto save datasource selection on change.Wraps
onClearAllto reset preference to default.USER_PREFERENCE_PREFIXfor consistent preference key naming.Behavior
Test plan
yarn test)Screen Recordings / Screenshot
Screencast.From.2026-07-03.11-44-56.mp4