Skip to content

feat(14550): Added isParentMutable to pass the scope permission to the filters - #26816

Open
zeeklop wants to merge 6 commits into
masterfrom
feat/14550-scoped-search-filters-ui
Open

feat(14550): Added isParentMutable to pass the scope permission to the filters#26816
zeeklop wants to merge 6 commits into
masterfrom
feat/14550-scoped-search-filters-ui

Conversation

@zeeklop

@zeeklop zeeklop commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Added isParentMutable to pass the scope permission to the filters

closes: Graylog2/graylog-plugin-enterprise#14550

/prd Graylog2/graylog-plugin-enterprise#14994

/nocl

Description

Search filters bar has a new prop that allows to check if the parent entity is mutable checking the scope permissions.
We are now starting to ship with ILLUMINATE packages search filters on event definitions. These filters are there for the user to use but they are Read Only. This change is to check if the parent entity is mutable since if it isn't then we don't want users to change any of the configuration.

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for propagating “parent entity mutability” into pluggable search filter UI for event definitions, so filter UIs can become read-only when the parent entity is not mutable (e.g., ILLUMINATE-scoped content).

Changes:

  • Extends the pluggable SearchBarControl component type to accept an optional isParentMutable prop.
  • Fetches scope permissions for an event definition and forwards mutability into SearchFiltersFormControls.
  • Updates SearchFiltersFormControls to pass isParentMutable through to the pluggable search-filters component and adjusts a related test to mock useScopePermissions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
graylog2-web-interface/src/views/types.ts Updates the SearchBarControl type so pluggable controls can receive isParentMutable.
graylog2-web-interface/src/components/event-definitions/event-definition-types/FilterForm.tsx Determines mutability via useScopePermissions(eventDefinition) and passes it to SearchFiltersFormControls.
graylog2-web-interface/src/components/event-definitions/event-definition-types/FilterAggregationForm.test.tsx Mocks useScopePermissions to keep tests stable after the new hook usage.
graylog2-web-interface/src/components/common/SearchFiltersFormControls.tsx Accepts isParentMutable and forwards it to the pluggable search filters component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +222 to +224
const { scopePermissions } = useScopePermissions(eventDefinition);
const isMutable = useMemo(() => scopePermissions?.is_mutable, [scopePermissions]);


export interface SearchBarControl {
component: React.ComponentType;
component: React.ComponentType<{ isParentMutable?: boolean }>;
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.

2 participants