Skip to content

Commit

Permalink
[Security/Timeline] Update Timeline datagrid to accept/pass `visibleC…
Browse files Browse the repository at this point in the history
…ellActions` prop

+ update Security to show 3 visible cell actions
  • Loading branch information
cee-chen committed Apr 7, 2022
1 parent 86b4a0f commit 793d208
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ const StatefulEventsViewerComponent: React.FC<Props> = ({
dataProviders,
dataViewId,
defaultCellActions,
visibleCellActions: 3,
deletedEventIds,
disabledCellActions: FIELDS_WITHOUT_CELL_ACTIONS,
docValueFields,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ interface OwnProps {
bulkActions?: BulkActionsProp;
data: TimelineItem[];
defaultCellActions?: TGridCellAction[];
visibleCellActions?: number;
disabledCellActions: string[];
fieldBrowserOptions?: FieldBrowserOptions;
filters?: Filter[];
Expand Down Expand Up @@ -307,6 +308,7 @@ export const BodyComponent = React.memo<StatefulBodyProps>(
columnHeaders,
data,
defaultCellActions,
visibleCellActions,
disabledCellActions,
fieldBrowserOptions,
filterQuery,
Expand Down Expand Up @@ -716,6 +718,7 @@ export const BodyComponent = React.memo<StatefulBodyProps>(
cellActions:
header.tGridCellActions?.map(buildAction) ??
defaultCellActions?.map(buildAction),
visibleCellActions,
}
: {}),
};
Expand All @@ -725,6 +728,7 @@ export const BodyComponent = React.memo<StatefulBodyProps>(
columnHeaders,
data,
defaultCellActions,
visibleCellActions,
disabledCellActions,
dispatch,
id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export interface TGridIntegratedProps {
dataProviders: DataProvider[];
dataViewId?: string | null;
defaultCellActions?: TGridCellAction[];
visibleCellActions?: number;
deletedEventIds: Readonly<string[]>;
disabledCellActions: string[];
docValueFields: DocValueFields[];
Expand Down Expand Up @@ -149,6 +150,7 @@ const TGridIntegratedComponent: React.FC<TGridIntegratedProps> = ({
dataProviders,
dataViewId = null,
defaultCellActions,
visibleCellActions,
deletedEventIds,
disabledCellActions,
docValueFields,
Expand Down Expand Up @@ -366,6 +368,7 @@ const TGridIntegratedComponent: React.FC<TGridIntegratedProps> = ({
bulkActions={bulkActions}
data={nonDeletedEvents}
defaultCellActions={defaultCellActions}
visibleCellActions={visibleCellActions}
disabledCellActions={disabledCellActions}
fieldBrowserOptions={fieldBrowserOptions}
filterQuery={filterQuery}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface TGridStandaloneProps {
columns: ColumnHeaderOptions[];
dataViewId?: string | null;
defaultCellActions?: TGridCellAction[];
visibleCellActions?: number;
deletedEventIds: Readonly<string[]>;
disabledCellActions: string[];
end: string;
Expand Down Expand Up @@ -120,6 +121,7 @@ const TGridStandaloneComponent: React.FC<TGridStandaloneProps> = ({
columns,
dataViewId = null,
defaultCellActions,
visibleCellActions,
deletedEventIds,
disabledCellActions,
end,
Expand Down Expand Up @@ -361,6 +363,7 @@ const TGridStandaloneComponent: React.FC<TGridStandaloneProps> = ({
browserFields={browserFields}
data={nonDeletedEvents}
defaultCellActions={defaultCellActions}
visibleCellActions={visibleCellActions}
disabledCellActions={disabledCellActions}
filterQuery={filterQuery}
hasAlertsCrud={hasAlertsCrud}
Expand Down

0 comments on commit 793d208

Please sign in to comment.