Skip to content

SRVKP-12917: Clear all filters should clear datasource instead of resetting to default#1189

Open
ankrsinha wants to merge 1 commit into
openshift-pipelines:masterfrom
ankrsinha:fix/SRVKP-12917
Open

SRVKP-12917: Clear all filters should clear datasource instead of resetting to default#1189
ankrsinha wants to merge 1 commit into
openshift-pipelines:masterfrom
ankrsinha:fix/SRVKP-12917

Conversation

@ankrsinha

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Refactoring
  • Migration
  • CVE Fix

Summary

"Clear all filters" on PipelineRuns and TaskRuns pages was not fully clearing the datasource filter. Instead of removing it, it was resetting to the default value ("Cluster"), leaving the filter chip visible and data still filtered by cluster source.

Problem

  • onClearAll called resetDatasourcePreference() which set the preference to ['cluster-data'] (default) instead of [] (no filter).
  • After clearing and navigating away, returning to the page caused a brief flash of "1 filter applied" because the preference fallback returned ['cluster-data'] while the ConfigMap value was still loading.

Fix

  • Added clearPreference method that sets the datasource preference to [], removing the filter entirely.
  • Removed unused resetPreference method.
  • Updated onClearAll to use clearPreference instead of resetPreference.
  • Deferred the default fallback (['cluster-data']) until the preference has finished loading, preventing the flash on navigation.

Screen Recordings / Screenshot

Screencast.From.2026-07-23.11-21-38.mp4

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ankrsinha
Once this PR has been reviewed and has the lgtm label, please assign vdemeester for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
openshift-ci Bot requested a review from vdemeester July 23, 2026 05:57
@qodo-code-review

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Warning

/review is deprecated. Use /agentic_review instead (removal date not yet scheduled).

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@ankrsinha ankrsinha changed the title fix: clear all filters should clear datasource instead of resetting to default SRVKP-12917: Clear all filters should clear datasource instead of resetting to default Jul 23, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

@ankrsinha: This pull request references SRVKP-12917 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 bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Type of Change

  • Bug fix
  • New feature
  • Refactoring
  • Migration
  • CVE Fix

Summary

"Clear all filters" on PipelineRuns and TaskRuns pages was not fully clearing the datasource filter. Instead of removing it, it was resetting to the default value ("Cluster"), leaving the filter chip visible and data still filtered by cluster source.

Problem

  • onClearAll called resetDatasourcePreference() which set the preference to ['cluster-data'] (default) instead of [] (no filter).
  • After clearing and navigating away, returning to the page caused a brief flash of "1 filter applied" because the preference fallback returned ['cluster-data'] while the ConfigMap value was still loading.

Fix

  • Added clearPreference method that sets the datasource preference to [], removing the filter entirely.
  • Removed unused resetPreference method.
  • Updated onClearAll to use clearPreference instead of resetPreference.
  • Deferred the default fallback (['cluster-data']) until the preference has finished loading, preventing the flash on navigation.

Screen Recordings / Screenshot

Screencast.From.2026-07-23.11-21-38.mp4

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.

@anwesha-palit-redhat
anwesha-palit-redhat requested review from adityavshinde and removed request for anwesha-palit-redhat July 23, 2026 09:13
@adityavshinde

adityavshinde commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

I have verified the changes, everything looks good to me.

Screencast.From.2026-07-23.15-33-30.mp4

add official /lgtm please

@anwesha-palit-redhat
anwesha-palit-redhat self-requested a review July 23, 2026 10:16
…o default

Signed-off-by: Ankur Sinha <anksinha@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants