mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-12 11:39:39 +00:00
UI :- Placeholder fixes in Webhook (#7308)
* Placeholder fixes in Webhook * added switch button on placeholder screen in bot * change placeholder in dataquality table and tooltip placement in webhook table
This commit is contained in:
parent
9e0203e21b
commit
6d3c0de512
@ -173,24 +173,41 @@ const BotListV1 = ({
|
|||||||
}, [showDeleted]);
|
}, [showDeleted]);
|
||||||
|
|
||||||
return handleErrorPlaceholder ? (
|
return handleErrorPlaceholder ? (
|
||||||
<ErrorPlaceHolder
|
<Row>
|
||||||
buttons={
|
<Col className="w-full tw-flex tw-justify-end">
|
||||||
<div className="tw-text-lg tw-text-center">
|
<Space align="end" size={5}>
|
||||||
<Tooltip
|
<Switch
|
||||||
title={createPermission ? 'Add Bot' : NO_PERMISSION_FOR_ACTION}>
|
checked={showDeleted}
|
||||||
<Button
|
id="switch-deleted"
|
||||||
disabled={!createPermission}
|
size="small"
|
||||||
type="primary"
|
onClick={handleShowDeleted}
|
||||||
onClick={handleAddBotClick}>
|
/>
|
||||||
Add Bot
|
<label htmlFor="switch-deleted">Show deleted</label>
|
||||||
</Button>
|
</Space>
|
||||||
</Tooltip>
|
</Col>
|
||||||
</div>
|
<Col className="w-full">
|
||||||
}
|
<ErrorPlaceHolder
|
||||||
doc={BOTS_DOCS}
|
buttons={
|
||||||
heading="Bot"
|
<div className="tw-text-lg tw-text-center">
|
||||||
type="ADD_DATA"
|
<Tooltip
|
||||||
/>
|
placement="left"
|
||||||
|
title={createPermission ? 'Add Bot' : NO_PERMISSION_FOR_ACTION}>
|
||||||
|
<Button
|
||||||
|
ghost
|
||||||
|
disabled={!createPermission}
|
||||||
|
type="primary"
|
||||||
|
onClick={handleAddBotClick}>
|
||||||
|
Add Bot
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
doc={BOTS_DOCS}
|
||||||
|
heading="Bot"
|
||||||
|
type="ADD_DATA"
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
) : (
|
) : (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col flex={1} />
|
<Col flex={1} />
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Col, Empty, Row, Select, Space, Typography } from 'antd';
|
import { Col, Row, Select, Space, Typography } from 'antd';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
@ -40,6 +40,7 @@ import {
|
|||||||
} from '../../../generated/tests/tableTest';
|
} from '../../../generated/tests/tableTest';
|
||||||
import { TestCaseParameterValue } from '../../../generated/tests/testCase';
|
import { TestCaseParameterValue } from '../../../generated/tests/testCase';
|
||||||
import { showErrorToast } from '../../../utils/ToastUtils';
|
import { showErrorToast } from '../../../utils/ToastUtils';
|
||||||
|
import ErrorPlaceHolder from '../../common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
import RichTextEditorPreviewer from '../../common/rich-text-editor/RichTextEditorPreviewer';
|
import RichTextEditorPreviewer from '../../common/rich-text-editor/RichTextEditorPreviewer';
|
||||||
import Loader from '../../Loader/Loader';
|
import Loader from '../../Loader/Loader';
|
||||||
import SchemaEditor from '../../schema-editor/SchemaEditor';
|
import SchemaEditor from '../../schema-editor/SchemaEditor';
|
||||||
@ -234,7 +235,9 @@ const TestSummary: React.FC<TestSummaryProps> = ({ data }) => {
|
|||||||
</ResponsiveContainer>
|
</ResponsiveContainer>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<Empty description="No Result Available" />
|
<ErrorPlaceHolder classes="tw-mt-0">
|
||||||
|
<Typography.Text>No Result Available</Typography.Text>
|
||||||
|
</ErrorPlaceHolder>
|
||||||
)}
|
)}
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={10}>
|
<Col span={10}>
|
||||||
|
@ -142,7 +142,6 @@ const WebhookTable: FC<Props> = ({ onEdit, webhookList, onDelete }) => {
|
|||||||
return (
|
return (
|
||||||
<Space size={4}>
|
<Space size={4}>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
placement="left"
|
|
||||||
title={deletePermission ? 'Delete' : NO_PERMISSION_FOR_ACTION}>
|
title={deletePermission ? 'Delete' : NO_PERMISSION_FOR_ACTION}>
|
||||||
<Button
|
<Button
|
||||||
data-testid={`delete-action-${getEntityName(record)}`}
|
data-testid={`delete-action-${getEntityName(record)}`}
|
||||||
@ -155,7 +154,6 @@ const WebhookTable: FC<Props> = ({ onEdit, webhookList, onDelete }) => {
|
|||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
placement="left"
|
|
||||||
title={
|
title={
|
||||||
createPermission || editPermission
|
createPermission || editPermission
|
||||||
? 'Edit'
|
? 'Edit'
|
||||||
|
@ -26,6 +26,7 @@ type Props = {
|
|||||||
buttons?: React.ReactNode;
|
buttons?: React.ReactNode;
|
||||||
buttonId?: string;
|
buttonId?: string;
|
||||||
description?: React.ReactNode;
|
description?: React.ReactNode;
|
||||||
|
classes?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ErrorPlaceHolder = ({
|
const ErrorPlaceHolder = ({
|
||||||
@ -35,6 +36,7 @@ const ErrorPlaceHolder = ({
|
|||||||
heading,
|
heading,
|
||||||
buttons,
|
buttons,
|
||||||
description,
|
description,
|
||||||
|
classes,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { Paragraph, Link } = Typography;
|
const { Paragraph, Link } = Typography;
|
||||||
|
|
||||||
@ -68,7 +70,7 @@ const ErrorPlaceHolder = ({
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex-center flex-col tw-mt-24 w-full">
|
<div className={`${classes} flex-center flex-col mt-24 w-full`}>
|
||||||
<div data-testid="error">
|
<div data-testid="error">
|
||||||
<img
|
<img
|
||||||
data-testid="no-data-image"
|
data-testid="no-data-image"
|
||||||
@ -77,7 +79,7 @@ const ErrorPlaceHolder = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{children ? (
|
{children ? (
|
||||||
<div className="tw-flex tw-flex-col tw-items-center tw-mt-8 tw-text-base tw-font-medium">
|
<div className="tw-flex tw-flex-col tw-items-center tw-mt-5 tw-text-base tw-font-medium">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
@ -15,7 +15,6 @@ import { AxiosError } from 'axios';
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { getWebhooks } from '../../axiosAPIs/webhookAPI';
|
import { getWebhooks } from '../../axiosAPIs/webhookAPI';
|
||||||
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
|
||||||
import Loader from '../../components/Loader/Loader';
|
import Loader from '../../components/Loader/Loader';
|
||||||
import WebhooksV1 from '../../components/Webhooks/WebhooksV1';
|
import WebhooksV1 from '../../components/Webhooks/WebhooksV1';
|
||||||
import {
|
import {
|
||||||
@ -96,24 +95,20 @@ const MsTeamsPage = () => {
|
|||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return !isLoading ? (
|
||||||
<PageContainerV1>
|
<WebhooksV1
|
||||||
{!isLoading ? (
|
currentPage={currentPage}
|
||||||
<WebhooksV1
|
data={data}
|
||||||
currentPage={currentPage}
|
paging={paging}
|
||||||
data={data}
|
selectedStatus={selectedStatus}
|
||||||
paging={paging}
|
webhookType={WebhookType.Msteams}
|
||||||
selectedStatus={selectedStatus}
|
onAddWebhook={handleAddWebhook}
|
||||||
webhookType={WebhookType.Msteams}
|
onClickWebhook={handleClickWebhook}
|
||||||
onAddWebhook={handleAddWebhook}
|
onPageChange={handlePageChange}
|
||||||
onClickWebhook={handleClickWebhook}
|
onStatusFilter={handleStatusFilter}
|
||||||
onPageChange={handlePageChange}
|
/>
|
||||||
onStatusFilter={handleStatusFilter}
|
) : (
|
||||||
/>
|
<Loader />
|
||||||
) : (
|
|
||||||
<Loader />
|
|
||||||
)}
|
|
||||||
</PageContainerV1>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { findByTestId, findByText, render } from '@testing-library/react';
|
import { findByText, render } from '@testing-library/react';
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
import { getWebhooks } from '../../axiosAPIs/webhookAPI';
|
import { getWebhooks } from '../../axiosAPIs/webhookAPI';
|
||||||
@ -38,10 +38,8 @@ describe('Test MS Teams page Component', () => {
|
|||||||
const { container } = render(<MsTeamsPage />, {
|
const { container } = render(<MsTeamsPage />, {
|
||||||
wrapper: MemoryRouter,
|
wrapper: MemoryRouter,
|
||||||
});
|
});
|
||||||
const PageContainerV1 = await findByTestId(container, 'PageContainerV1');
|
|
||||||
const webhookComponent = await findByText(container, /testWebhookV1/);
|
const webhookComponent = await findByText(container, /testWebhookV1/);
|
||||||
|
|
||||||
expect(PageContainerV1).toBeInTheDocument();
|
|
||||||
expect(webhookComponent).toBeInTheDocument();
|
expect(webhookComponent).toBeInTheDocument();
|
||||||
expect(getWebhooks).toBeCalledTimes(1);
|
expect(getWebhooks).toBeCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,6 @@ import { AxiosError } from 'axios';
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { getWebhooks } from '../../axiosAPIs/webhookAPI';
|
import { getWebhooks } from '../../axiosAPIs/webhookAPI';
|
||||||
import PageContainerV1 from '../../components/containers/PageContainerV1';
|
|
||||||
import Loader from '../../components/Loader/Loader';
|
import Loader from '../../components/Loader/Loader';
|
||||||
import WebhooksV1 from '../../components/Webhooks/WebhooksV1';
|
import WebhooksV1 from '../../components/Webhooks/WebhooksV1';
|
||||||
import {
|
import {
|
||||||
@ -94,24 +93,20 @@ export const SlackSettingsPage = () => {
|
|||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return !isLoading ? (
|
||||||
<PageContainerV1>
|
<WebhooksV1
|
||||||
{!isLoading ? (
|
currentPage={currentPage}
|
||||||
<WebhooksV1
|
data={data}
|
||||||
currentPage={currentPage}
|
paging={paging}
|
||||||
data={data}
|
selectedStatus={selectedStatus}
|
||||||
paging={paging}
|
webhookType={WebhookType.Slack}
|
||||||
selectedStatus={selectedStatus}
|
onAddWebhook={handleAddWebhook}
|
||||||
webhookType={WebhookType.Slack}
|
onClickWebhook={handleClickWebhook}
|
||||||
onAddWebhook={handleAddWebhook}
|
onPageChange={handlePageChange}
|
||||||
onClickWebhook={handleClickWebhook}
|
onStatusFilter={handleStatusFilter}
|
||||||
onPageChange={handlePageChange}
|
/>
|
||||||
onStatusFilter={handleStatusFilter}
|
) : (
|
||||||
/>
|
<Loader />
|
||||||
) : (
|
|
||||||
<Loader />
|
|
||||||
)}
|
|
||||||
</PageContainerV1>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { findByTestId, findByText, render } from '@testing-library/react';
|
import { findByText, render } from '@testing-library/react';
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
import { getWebhooks } from '../../axiosAPIs/webhookAPI';
|
import { getWebhooks } from '../../axiosAPIs/webhookAPI';
|
||||||
@ -38,10 +38,8 @@ describe('Test SlackSettings page Component', () => {
|
|||||||
const { container } = render(<SlackSettingsPage />, {
|
const { container } = render(<SlackSettingsPage />, {
|
||||||
wrapper: MemoryRouter,
|
wrapper: MemoryRouter,
|
||||||
});
|
});
|
||||||
const PageContainerV1 = await findByTestId(container, 'PageContainerV1');
|
|
||||||
const webhookComponent = await findByText(container, /testWebhookV1/);
|
const webhookComponent = await findByText(container, /testWebhookV1/);
|
||||||
|
|
||||||
expect(PageContainerV1).toBeInTheDocument();
|
|
||||||
expect(webhookComponent).toBeInTheDocument();
|
expect(webhookComponent).toBeInTheDocument();
|
||||||
expect(getWebhooks).toBeCalledTimes(1);
|
expect(getWebhooks).toBeCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
@ -55,3 +55,11 @@
|
|||||||
border-left: 2px solid @primary;
|
border-left: 2px solid @primary;
|
||||||
background: @primary-light;
|
background: @primary-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mt-0 {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-24 {
|
||||||
|
margin-top: 6rem;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user