Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling bulk actions for event definitions. #21238

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/unreleased/pr-21238.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type = "a"
message = "Enabling bulk actions for event definitions."

pulls = ["21238"]
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* <http://www.mongodb.com/licensing/server-side-public-license>.
*/
import * as React from 'react';
import { useCallback } from 'react';

import {
QueryHelper,
Expand All @@ -24,9 +23,9 @@ import {
} from 'components/common';
import { Link } from 'components/common/router';
import Routes from 'routing/Routes';
import type { ColumnRenderers } from 'components/common/EntityDataTable';
import FilterValueRenderers from 'components/streams/StreamsOverview/FilterValueRenderers';
import { keyFn, fetchEventDefinitions } from 'components/event-definitions/hooks/useEventDefinitions';
import BulkActions from 'components/event-definitions/event-definitions/BulkActions';

import EventDefinitionActions from './EventDefinitionActions';
import SchedulingCell from './SchedulingCell';
Expand All @@ -35,7 +34,7 @@ import StatusCell from './StatusCell';
import type { EventDefinition } from '../event-definitions-types';
import { DEFAULT_LAYOUT, ADDITIONAL_ATTRIBUTES, COLUMNS_ORDER } from '../constants';

const customColumnRenderers = (): ColumnRenderers<EventDefinition> => ({
const customColumnRenderers = {
attributes: {
title: {
renderCell: (title: string, eventDefinition) => (
Expand All @@ -62,28 +61,29 @@ const customColumnRenderers = (): ColumnRenderers<EventDefinition> => ({
staticWidth: 100,
},
},
});

const EventDefinitionsContainer = () => {
const columnRenderers = customColumnRenderers();
};

const renderEventDefinitionActions = useCallback((listItem: EventDefinition) => (
<EventDefinitionActions eventDefinition={listItem} />
), []);
const bulkSelection = {
actions: <BulkActions />,

return (
<PaginatedEntityTable<EventDefinition> humanName="event definitions"
columnsOrder={COLUMNS_ORDER}
additionalAttributes={ADDITIONAL_ATTRIBUTES}
queryHelpComponent={<QueryHelper entityName="event definition" />}
tableLayout={DEFAULT_LAYOUT}
fetchEntities={fetchEventDefinitions}
entityActions={renderEventDefinitionActions}
keyFn={keyFn}
entityAttributesAreCamelCase={false}
filterValueRenderers={FilterValueRenderers}
columnRenderers={columnRenderers} />
);
};
const renderEventDefinitionActions = (listItem: EventDefinition) => (
<EventDefinitionActions eventDefinition={listItem} />
);

const EventDefinitionsContainer = () => (
<PaginatedEntityTable<EventDefinition> humanName="event definitions"
columnsOrder={COLUMNS_ORDER}
additionalAttributes={ADDITIONAL_ATTRIBUTES}
queryHelpComponent={<QueryHelper entityName="event definition" />}
tableLayout={DEFAULT_LAYOUT}
fetchEntities={fetchEventDefinitions}
entityActions={renderEventDefinitionActions}
keyFn={keyFn}
entityAttributesAreCamelCase={false}
filterValueRenderers={FilterValueRenderers}
columnRenderers={customColumnRenderers}
bulkSelection={bulkSelection} />
);

export default EventDefinitionsContainer;
Loading