Skip to content

Commit

Permalink
Introduce type parameter for event action modals. (#21179)
Browse files Browse the repository at this point in the history
* Introduce type parameter for event action modals.

* Using `unknown` as default for type parameter.
  • Loading branch information
dennisoelkers authored Dec 13, 2024
1 parent 5b1c7d1 commit e38c44d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions graylog2-web-interface/src/views/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ type DashboardAction<T> = {
useCondition?: () => boolean,
}

export type EventAction = {
export type EventAction<T = unknown> = {
useCondition: (events: Array<Event>) => boolean,
modal?: React.ComponentType<EventActionModalProps<unknown>>,
component: React.ComponentType<EventActionComponentProps>,
modal?: React.ComponentType<EventActionModalProps<T>>,
component: React.ComponentType<EventActionComponentProps<T>>,
key: string,
isBulk?: boolean
}
Expand All @@ -337,9 +337,9 @@ type AssetInformation = {
key: string,
}

export type EventActionComponentProps = {
export type EventActionComponentProps<T = unknown> = {
events: Array<Event>,
modalRef: () => unknown,
modalRef: () => T,
}

type MessageActionComponentProps = {
Expand Down Expand Up @@ -491,7 +491,7 @@ declare module 'graylog-web-plugin/plugin' {
'views.completers'?: Array<Completer>;
'views.components.assetInformationActions'?: Array<AssetInformation>;
'views.components.dashboardActions'?: Array<DashboardAction<unknown>>
'views.components.eventActions'?: Array<EventAction>;
'views.components.eventActions'?: Array<EventAction<unknown>>;
'views.components.widgets.messageTable.previewOptions'?: Array<MessagePreviewOption>;
'views.components.widgets.messageTable.messageRowOverride'?: Array<React.ComponentType<MessageRowOverrideProps>>;
'views.components.widgets.messageDetails.contextProviders'?: Array<React.ComponentType<React.PropsWithChildren<MessageDetailContextProviderProps>>>;
Expand Down

0 comments on commit e38c44d

Please sign in to comment.