diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/ManageButton/ManageButton.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/ManageButton/ManageButton.test.tsx index bfcb05f0ace..df1f1e0138a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/ManageButton/ManageButton.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/ManageButton/ManageButton.test.tsx @@ -29,6 +29,7 @@ const mockProps = { allowSoftDelete: true, entityName: 'string', entityId: 'string-id', + canDelete: true, entityType: 'table', entityFQN: 'x.y.z', isRecursiveDelete: true, diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index-page.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index.page.tsx similarity index 72% rename from openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index-page.tsx rename to openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index.page.tsx index 2bbdd993dfc..1656e734087 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index-page.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index.page.tsx @@ -13,6 +13,7 @@ import { QuestionCircleOutlined, ReloadOutlined } from '@ant-design/icons'; import { + Badge, Button, Card, Checkbox, @@ -25,6 +26,7 @@ import { Typography, } from 'antd'; import { AxiosError } from 'axios'; +import { isEmpty, startCase } from 'lodash'; import React, { useEffect, useState } from 'react'; import { getAllReIndexStatus, @@ -46,6 +48,7 @@ import { import SVGIcons from '../../utils/SvgUtils'; import { getDateTimeByTimeStampWithZone } from '../../utils/TimeUtils'; import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils'; +import './elastic-search-index.style.less'; const ElasticSearchIndexPage = () => { const [batchJobData, setBatchJobData] = useState(); @@ -54,8 +57,9 @@ const ElasticSearchIndexPage = () => { const { isAdminUser } = useAuth(); const [batchLoading, setBatchLoading] = useState(false); const [streamLoading, setStreamLoading] = useState(false); - const [recreateIndex, setRecreateIndex] = useState(true); + const [recreateIndex, setRecreateIndex] = useState(false); const [entities, setEntities] = useState([ + 'table', 'topic', 'dashboard', 'pipeline', @@ -137,7 +141,7 @@ const ElasticSearchIndexPage = () => {
Mode : - {batchJobData?.runMode || '--'} + {startCase(batchJobData?.runMode) || '--'}
@@ -162,35 +166,84 @@ const ElasticSearchIndexPage = () => {
+
+ + Index stats + {' '} + : + + {!isEmpty(batchJobData) ? ( + + + + + + + + ) : ( + '--' + )} + +
+
Last Updated {' '} : - {batchJobData?.failureDetails?.lastFailedAt + {batchJobData?.timestamp ? getDateTimeByTimeStampWithZone( - batchJobData?.failureDetails?.lastFailedAt + batchJobData?.timestamp ) : '--'}
-
- Last error : - - {batchJobData?.failureDetails?.lastFailedReason ? ( - - ) : ( - '--' - )} - -
+ +
+ + Last Failed At: + +

+ {batchJobData?.failureDetails?.lastFailedAt + ? getDateTimeByTimeStampWithZone( + batchJobData?.failureDetails?.lastFailedAt + ) + : '--'} +

+
+
+ + Last error: + + + {batchJobData?.failureDetails?.lastFailedReason ? ( + + ) : ( + '--' + )} + +
+
@@ -270,7 +323,7 @@ const ElasticSearchIndexPage = () => {
Mode : - {streamJobData?.runMode || '--'} + {startCase(streamJobData?.runMode) || '--'}
@@ -298,28 +351,44 @@ const ElasticSearchIndexPage = () => {
Last Updated : - {streamJobData?.failureDetails?.lastFailedAt + {streamJobData?.timestamp ? getDateTimeByTimeStampWithZone( - streamJobData?.failureDetails?.lastFailedAt + streamJobData?.timestamp ) : '--'}
-
- Last error : - - {streamJobData?.failureDetails?.lastFailedReason ? ( - - ) : ( - '--' - )} - +
+ +
+ + Last Failed At: + +

+ {streamJobData?.failureDetails?.lastFailedAt + ? getDateTimeByTimeStampWithZone( + streamJobData?.failureDetails?.lastFailedAt + ) + : '--'} +

+
+
+ Last error : + + {streamJobData?.failureDetails?.lastFailedReason ? ( + + ) : ( + '--' + )} + +
+
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index.style.less b/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index.style.less new file mode 100644 index 00000000000..1a3c7033e7a --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/pages/ElasticSearchIndexPage/elastic-search-index.style.less @@ -0,0 +1,34 @@ +/* + * Copyright 2022 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. + */ + +@primary-color: #7147e8; +@success-color: #008376; +@error-color: #ff4c3b; + +.request-badge { + &.success { + .ant-badge-count { + background-color: @success-color; + } + } + &.failed { + .ant-badge-count { + background-color: @error-color; + } + } + &.running { + .ant-badge-count { + background-color: @primary-color; + } + } +} diff --git a/openmetadata-ui/src/main/resources/ui/src/router/GlobalSettingRouter.tsx b/openmetadata-ui/src/main/resources/ui/src/router/GlobalSettingRouter.tsx index 76c80e07224..3465b5b01ca 100644 --- a/openmetadata-ui/src/main/resources/ui/src/router/GlobalSettingRouter.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/router/GlobalSettingRouter.tsx @@ -79,7 +79,7 @@ const MsTeamsPage = withSuspenseFallback( ); const ElasticSearchIndexPage = withSuspenseFallback( React.lazy( - () => import('../pages/ElasticSearchIndexPage/elastic-search-index-page') + () => import('../pages/ElasticSearchIndexPage/elastic-search-index.page') ) ); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EventPublisherUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/EventPublisherUtils.ts index 15811bdcd15..899564283da 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EventPublisherUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EventPublisherUtils.ts @@ -16,7 +16,10 @@ import { Icons } from './SvgUtils'; export const getStatusResultBadgeIcon = (status: string) => { switch (status) { + case Status.Idle: + return Icons.TASK_OPEN; case Status.Active: + case Status.Completed: return Icons.SUCCESS_BADGE; case Status.Activewitherror: @@ -32,6 +35,10 @@ export const getStatusResultBadgeIcon = (status: string) => { export const getEventPublisherStatusText = (status?: string) => { switch (status) { + case Status.Idle: + return 'Ideal'; + case Status.Completed: + return 'Completed'; case Status.Active: return 'Active';