diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/ActivityFeedCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/ActivityFeedCard.tsx index 57a58340a95..c8c705ad8d7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/ActivityFeedCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCard/ActivityFeedCard.tsx @@ -121,9 +121,13 @@ const ActivityFeedCard: FC = ({ return (
+ className={classNames( + className, + 'hover:tw-bg-gray-100 tw-p-2 tw-pb-1 tw-mb-1', + { + 'tw-bg-gray-100': visible, + } + )}> { expect( await findByText(container, 'Webhook endpoint is required.') ).toBeInTheDocument(); - expect( - await findByText(container, 'Webhook event filters are required.') - ).toBeInTheDocument(); + // default value is prefilled , use below condition when value is empty + // expect( + // await findByText(container, 'Webhook event filters are required.') + // ).toBeInTheDocument(); expect(active).toHaveClass('open'); - expect(entityCreatedCheckbox).not.toBeChecked(); - expect(entityUpdatedCheckbox).not.toBeChecked(); - expect(entityDeletedCheckbox).not.toBeChecked(); + // default value is prefilled , use below condition when value is empty + // expect(entityCreatedCheckbox).not.toBeChecked(); + // expect(entityUpdatedCheckbox).not.toBeChecked(); + // expect(entityDeletedCheckbox).not.toBeChecked(); fireEvent.change(nameField, { target: { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddWebhook/AddWebhook.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddWebhook/AddWebhook.tsx index 27323890647..69e50505e55 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddWebhook/AddWebhook.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddWebhook/AddWebhook.tsx @@ -43,6 +43,11 @@ import DropDown from '../dropdown/DropDown'; import Loader from '../Loader/Loader'; import ConfirmationModal from '../Modals/ConfirmationModal/ConfirmationModal'; import { AddWebhookProps } from './AddWebhook.interface'; +import { + CREATE_EVENTS_DEFAULT_VALUE, + DELETE_EVENTS_DEFAULT_VALUE, + UPDATE_EVENTS_DEFAULT_VALUE, +} from './WebhookConstants'; const Field = ({ children }: { children: React.ReactNode }) => { return
{children}
; @@ -135,17 +140,17 @@ const AddWebhook: FunctionComponent = ({ const [createEvents, setCreateEvents] = useState( data ? getEventFilterByType(data.eventFilters, EventType.EntityCreated) - : ({} as EventFilter) + : (CREATE_EVENTS_DEFAULT_VALUE as EventFilter) ); const [updateEvents, setUpdateEvents] = useState( data ? getEventFilterByType(data.eventFilters, EventType.EntityUpdated) - : ({} as EventFilter) + : (UPDATE_EVENTS_DEFAULT_VALUE as EventFilter) ); const [deleteEvents, setDeleteEvents] = useState( data ? getEventFilterByType(data.eventFilters, EventType.EntityDeleted) - : ({} as EventFilter) + : (DELETE_EVENTS_DEFAULT_VALUE as EventFilter) ); const [secretKey, setSecretKey] = useState(data?.secretKey || ''); const [batchSize, setBatchSize] = useState( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddWebhook/WebhookConstants.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddWebhook/WebhookConstants.tsx new file mode 100644 index 00000000000..a83df29b33c --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddWebhook/WebhookConstants.tsx @@ -0,0 +1,27 @@ +/* + * Copyright 2021 Collate + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const CREATE_EVENTS_DEFAULT_VALUE = { + eventType: 'entityCreated', + entities: ['*', 'table', 'topic', 'dashboard', 'pipeline'], +}; + +export const UPDATE_EVENTS_DEFAULT_VALUE = { + eventType: 'entityUpdated', + entities: ['*', 'table', 'topic', 'dashboard', 'pipeline'], +}; + +export const DELETE_EVENTS_DEFAULT_VALUE = { + eventType: '"entityDeleted"', + entities: ['*', 'table', 'topic', 'dashboard', 'pipeline'], +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Reactions/Reactions.jsx b/openmetadata-ui/src/main/resources/ui/src/components/Reactions/Reactions.jsx index faff80fc13d..1b9e377275e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Reactions/Reactions.jsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Reactions/Reactions.jsx @@ -108,8 +108,9 @@ const Reactions = ({ reactions, onReactionSelect }) => {