Skip to content

Persistent filter state between reports and runs pages#4868

Open
feyruzb wants to merge 1 commit into
Ericsson:masterfrom
feyruzb:feature/filter-preset-url-encoding
Open

Persistent filter state between reports and runs pages#4868
feyruzb wants to merge 1 commit into
Ericsson:masterfrom
feyruzb:feature/filter-preset-url-encoding

Conversation

@feyruzb
Copy link
Copy Markdown
Collaborator

@feyruzb feyruzb commented May 31, 2026

This pull request refactors and improves the filter preset handling in the report filter components. The main goals are to streamline preset application (especially via URL), improve state management during initialization, and clean up related code. The most important changes are grouped below:

Preset Application and Initialization Improvements:

  • Added a new function selectPresetSilently to PresetMenu.vue for setting the active preset without triggering UI side effects, supporting smoother preset initialization via URL.
  • Enhanced the initialization flow in ReportFilter.vue by introducing an isInitializing flag and updating initByUrl to properly handle preset application from URL parameters, ensuring correct state and preventing race conditions.
  • When clearing all filters, the filterPreset parameter is now removed from the URL, ensuring the UI and URL remain in sync.

Code Refactoring and Cleanup:

  • Split the logic for building preset query parameters into a new buildPresetQuery function, and separated preset application into initFilterPreset and initFilterPresetFromUrl for clarity and reuse.
  • Removed the old getFilterPreset function and updated event handling so that applying a preset now uses the improved initFilterPresetFromUrl logic.

State and Reactivity Enhancements:

  • Refactored the logic for tracking filter modifications into a checkModified function for better reusability and clarity, and ensured it is called at the appropriate times.

These changes collectively make preset management more robust, maintainable, and user-friendly, especially when dealing with URL-driven state.

@feyruzb feyruzb added this to the release 6.28.1 milestone May 31, 2026
@feyruzb feyruzb requested a review from gulyasgergely902 May 31, 2026 22:44
@feyruzb feyruzb self-assigned this May 31, 2026
@feyruzb feyruzb requested review from bruntib and vodorok as code owners May 31, 2026 22:44
Copy link
Copy Markdown
Collaborator

@gulyasgergely902 gulyasgergely902 left a comment

Choose a reason for hiding this comment

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

One question otherwise LGTM

isModified.value = !isEqual(normNew, normSnap);
}

watch(() => route.query, () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If you already query the route, wouldn't it be easier to just pass it to the checkModified function instead of querying it again inside it? Please check the feasibility of it.

await initByUrl();
updateUrl();
await nextTick();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove unnecessary new line.

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.

Improve filter preset handling and URL-driven state in report filters

2 participants