diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/TabsLabel/TabsLabel.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/common/TabsLabel/TabsLabel.interface.ts index 58c89fa7260..76c3add389b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/TabsLabel/TabsLabel.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/TabsLabel/TabsLabel.interface.ts @@ -10,6 +10,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +import { EntityTabs } from '../../../enums/entity.enum'; + +export interface TabProps { + label: JSX.Element; + key: EntityTabs; + children?: JSX.Element; + isHidden?: boolean; +} + export interface TabsLabelProps { name: string; id: string; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableConstraints/TableConstraints.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableConstraints/TableConstraints.tsx index 92cf2c0d6e8..e07400904f8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableConstraints/TableConstraints.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableConstraints/TableConstraints.tsx @@ -84,7 +84,7 @@ const TableConstraints: FC = ({ })}> - + )} diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableConstraints/TableConstraintsModal/table-constraint.style.less b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableConstraints/TableConstraintsModal/table-constraint.style.less new file mode 100644 index 00000000000..46ece59b3cc --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TableDetailsPageV1/TableConstraints/TableConstraintsModal/table-constraint.style.less @@ -0,0 +1,39 @@ +/* + * Copyright 2024 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. + */ + +@import url('../../../../styles/variables.less'); + +.table-constraint-form-container { + margin-bottom: 20px; + position: relative; + background: @grey-6; + padding: 20px; + border-radius: 10px; + border: @global-border; + + .ant-form-item { + &:last-child { + margin-bottom: 0; + } + } + + .delete-constraint-button { + position: absolute; + top: 10px; + right: 12px; + } + + &:last-child { + margin-bottom: 0; + } +} diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/DatabaseSchemaClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/DatabaseSchemaClassBase.ts index 76a361d3815..2313dc38b82 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/DatabaseSchemaClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/DatabaseSchemaClassBase.ts @@ -10,9 +10,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { TabsProps } from 'antd'; import { EntityTags, PagingResponse } from 'Models'; import { PagingHandlerParams } from '../components/common/NextPrevious/NextPrevious.interface'; +import { TabProps } from '../components/common/TabsLabel/TabsLabel.interface'; import { EntityTabs } from '../enums/entity.enum'; import { DatabaseSchema } from '../generated/entity/data/databaseSchema'; import { Table } from '../generated/entity/data/table'; @@ -56,7 +56,7 @@ export interface DatabaseSchemaPageTabProps { class DatabaseSchemaClassBase { public getDatabaseSchemaPageTabs( databaseSchemaTabData: DatabaseSchemaPageTabProps - ): TabsProps['items'] { + ): TabProps[] { return getDataBaseSchemaPageBaseTabs(databaseSchemaTabData); } } diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/DatabaseSchemaDetailsUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/DatabaseSchemaDetailsUtils.tsx index 0257d6c8b33..b13aff71e35 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/DatabaseSchemaDetailsUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/DatabaseSchemaDetailsUtils.tsx @@ -19,6 +19,7 @@ import { ActivityFeedTab } from '../components/ActivityFeed/ActivityFeedTab/Acti import { CustomPropertyTable } from '../components/common/CustomPropertyTable/CustomPropertyTable'; import ResizablePanels from '../components/common/ResizablePanels/ResizablePanels'; import TabsLabel from '../components/common/TabsLabel/TabsLabel.component'; +import { TabProps } from '../components/common/TabsLabel/TabsLabel.interface'; import EntityRightPanel from '../components/Entity/EntityRightPanel/EntityRightPanel'; import { COMMON_RESIZABLE_PANEL_CONFIG } from '../constants/ResizablePanel.constants'; import { EntityTabs, EntityType, TabSpecificField } from '../enums/entity.enum'; @@ -57,7 +58,7 @@ export const getDataBaseSchemaPageBaseTabs = ({ getEntityFeedCount, fetchDatabaseSchemaDetails, handleFeedCount, -}: DatabaseSchemaPageTabProps) => { +}: DatabaseSchemaPageTabProps): TabProps[] => { return [ { label: ( diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TableClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/TableClassBase.ts index 052575f01b3..af7632fb2f8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TableClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TableClassBase.ts @@ -10,6 +10,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { TabProps } from '../components/common/TabsLabel/TabsLabel.interface'; import { OperationPermission } from '../context/PermissionProvider/PermissionProvider.interface'; import { EntityTabs } from '../enums/entity.enum'; import { Table } from '../generated/entity/data/table'; @@ -43,7 +44,7 @@ export interface TableDetailPageTabProps { class TableClassBase { public getTableDetailPageTabs( tableDetailsPageProps: TableDetailPageTabProps - ) { + ): TabProps[] { return getTableDetailPageBaseTabs(tableDetailsPageProps); } } diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx index b9595d766ee..6d02bb20e3a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx @@ -85,6 +85,7 @@ import { CustomPropertyTable } from '../components/common/CustomPropertyTable/Cu import ErrorPlaceHolder from '../components/common/ErrorWithPlaceholder/ErrorPlaceHolder'; import QueryViewer from '../components/common/QueryViewer/QueryViewer.component'; import TabsLabel from '../components/common/TabsLabel/TabsLabel.component'; +import { TabProps } from '../components/common/TabsLabel/TabsLabel.interface'; import TableProfiler from '../components/Database/Profiler/TableProfiler/TableProfiler'; import SampleDataTableComponent from '../components/Database/SampleDataTable/SampleDataTable.component'; import TableQueries from '../components/Database/TableQueries/TableQueries'; @@ -643,7 +644,7 @@ export const getTableDetailPageBaseTabs = ({ fetchTableDetails, testCaseSummary, isViewTableType, -}: TableDetailPageTabProps) => { +}: TableDetailPageTabProps): TabProps[] => { return [ { label: ,