mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-23 16:38:17 +00:00
[issues-5697] made All Entities as the default visible option and mi… (#5699)
* [issues-5697] made All Entities as the default visible option and minor css fix * file added. * test fix * unit test fixed.
This commit is contained in:
parent
4473280e63
commit
408dd02be9
@ -121,9 +121,13 @@ const ActivityFeedCard: FC<ActivityFeedCardProp> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(className, 'hover:tw-bg-gray-100', {
|
className={classNames(
|
||||||
|
className,
|
||||||
|
'hover:tw-bg-gray-100 tw-p-2 tw-pb-1 tw-mb-1',
|
||||||
|
{
|
||||||
'tw-bg-gray-100': visible,
|
'tw-bg-gray-100': visible,
|
||||||
})}>
|
}
|
||||||
|
)}>
|
||||||
<Popover
|
<Popover
|
||||||
destroyTooltipOnHide
|
destroyTooltipOnHide
|
||||||
align={{ targetOffset: [0, -35] }}
|
align={{ targetOffset: [0, -35] }}
|
||||||
|
@ -199,13 +199,15 @@ describe('Test AddWebhook component', () => {
|
|||||||
expect(
|
expect(
|
||||||
await findByText(container, 'Webhook endpoint is required.')
|
await findByText(container, 'Webhook endpoint is required.')
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
expect(
|
// default value is prefilled , use below condition when value is empty
|
||||||
await findByText(container, 'Webhook event filters are required.')
|
// expect(
|
||||||
).toBeInTheDocument();
|
// await findByText(container, 'Webhook event filters are required.')
|
||||||
|
// ).toBeInTheDocument();
|
||||||
expect(active).toHaveClass('open');
|
expect(active).toHaveClass('open');
|
||||||
expect(entityCreatedCheckbox).not.toBeChecked();
|
// default value is prefilled , use below condition when value is empty
|
||||||
expect(entityUpdatedCheckbox).not.toBeChecked();
|
// expect(entityCreatedCheckbox).not.toBeChecked();
|
||||||
expect(entityDeletedCheckbox).not.toBeChecked();
|
// expect(entityUpdatedCheckbox).not.toBeChecked();
|
||||||
|
// expect(entityDeletedCheckbox).not.toBeChecked();
|
||||||
|
|
||||||
fireEvent.change(nameField, {
|
fireEvent.change(nameField, {
|
||||||
target: {
|
target: {
|
||||||
|
@ -43,6 +43,11 @@ import DropDown from '../dropdown/DropDown';
|
|||||||
import Loader from '../Loader/Loader';
|
import Loader from '../Loader/Loader';
|
||||||
import ConfirmationModal from '../Modals/ConfirmationModal/ConfirmationModal';
|
import ConfirmationModal from '../Modals/ConfirmationModal/ConfirmationModal';
|
||||||
import { AddWebhookProps } from './AddWebhook.interface';
|
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 }) => {
|
const Field = ({ children }: { children: React.ReactNode }) => {
|
||||||
return <div className="tw-mt-4">{children}</div>;
|
return <div className="tw-mt-4">{children}</div>;
|
||||||
@ -135,17 +140,17 @@ const AddWebhook: FunctionComponent<AddWebhookProps> = ({
|
|||||||
const [createEvents, setCreateEvents] = useState<EventFilter>(
|
const [createEvents, setCreateEvents] = useState<EventFilter>(
|
||||||
data
|
data
|
||||||
? getEventFilterByType(data.eventFilters, EventType.EntityCreated)
|
? getEventFilterByType(data.eventFilters, EventType.EntityCreated)
|
||||||
: ({} as EventFilter)
|
: (CREATE_EVENTS_DEFAULT_VALUE as EventFilter)
|
||||||
);
|
);
|
||||||
const [updateEvents, setUpdateEvents] = useState<EventFilter>(
|
const [updateEvents, setUpdateEvents] = useState<EventFilter>(
|
||||||
data
|
data
|
||||||
? getEventFilterByType(data.eventFilters, EventType.EntityUpdated)
|
? getEventFilterByType(data.eventFilters, EventType.EntityUpdated)
|
||||||
: ({} as EventFilter)
|
: (UPDATE_EVENTS_DEFAULT_VALUE as EventFilter)
|
||||||
);
|
);
|
||||||
const [deleteEvents, setDeleteEvents] = useState<EventFilter>(
|
const [deleteEvents, setDeleteEvents] = useState<EventFilter>(
|
||||||
data
|
data
|
||||||
? getEventFilterByType(data.eventFilters, EventType.EntityDeleted)
|
? getEventFilterByType(data.eventFilters, EventType.EntityDeleted)
|
||||||
: ({} as EventFilter)
|
: (DELETE_EVENTS_DEFAULT_VALUE as EventFilter)
|
||||||
);
|
);
|
||||||
const [secretKey, setSecretKey] = useState<string>(data?.secretKey || '');
|
const [secretKey, setSecretKey] = useState<string>(data?.secretKey || '');
|
||||||
const [batchSize, setBatchSize] = useState<number | undefined>(
|
const [batchSize, setBatchSize] = useState<number | undefined>(
|
||||||
|
@ -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'],
|
||||||
|
};
|
@ -108,8 +108,9 @@ const Reactions = ({ reactions, onReactionSelect }) => {
|
|||||||
<SVGIcons
|
<SVGIcons
|
||||||
alt="add-reaction"
|
alt="add-reaction"
|
||||||
icon={Icons.ADD_REACTION}
|
icon={Icons.ADD_REACTION}
|
||||||
|
style={{ verticalAlign: 'text-bottom' }}
|
||||||
title="Add reactions"
|
title="Add reactions"
|
||||||
width="16px"
|
width="18px"
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user