Skip to content

Conversation

@yaroslav8765
Copy link
Contributor

No description provided.

@NoOne7135 NoOne7135 requested a review from Copilot September 26, 2025 12:20
Copy link

Copilot AI left a comment

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 fixes the filters reset functionality in the UniversalSearchInput component by improving state management and preventing unnecessary filter updates during initialization.

  • Removes automatic list refresh after filter updates to prevent conflicts
  • Adds logic to restore universal search filter value from URL query parameters on component mount
  • Implements a blocking mechanism to prevent filter updates during initialization and manual clearing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +39 to +42
return {
field,
operator,
value: JSON.parse(decodeURIComponent(route.query[k] as string))
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

The JSON.parse operation could throw an error if the query parameter contains invalid JSON. Consider wrapping it in a try-catch block or validating the input before parsing.

Suggested change
return {
field,
operator,
value: JSON.parse(decodeURIComponent(route.query[k] as string))
let value;
try {
value = JSON.parse(decodeURIComponent(route.query[k] as string));
} catch (e) {
value = undefined; // or '' if you prefer empty string
}
return {
field,
operator,
value

Copilot uses AI. Check for mistakes.
const props = defineProps<{ meta?: any; resource?: any; adminUser?: any }>();
const localValue = ref('');
let t: any = null;
let blockFilterUpdate = false;
Copy link

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

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

[nitpick] The blockFilterUpdate variable uses let but could be a ref() for better Vue 3 reactivity consistency with the rest of the component's reactive state.

Copilot uses AI. Check for mistakes.
@NoOne7135 NoOne7135 merged commit 75a37fc into main Sep 26, 2025
2 checks passed
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.

3 participants