From bb1da94cc8093b77ee978eeeafa20def7e6a144c Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Thu, 30 Sep 2021 22:49:20 +0530 Subject: [PATCH] Fix: fixed dataset page (#623) * Fix: fixed dataset page * fixed icon issue --- .../components/my-data-details/SchemaTab.tsx | 2 +- .../my-data-details/SchemaTable.tsx | 46 +++++++++---------- .../resources/ui/src/generated/type/basic.ts | 17 ------- 3 files changed, 23 insertions(+), 42 deletions(-) delete mode 100644 catalog-rest-service/src/main/resources/ui/src/generated/type/basic.ts diff --git a/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTab.tsx b/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTab.tsx index 7b9c9a0712f..49bb448a259 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTab.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTab.tsx @@ -70,7 +70,7 @@ const SchemaTab: FunctionComponent = ({ if (matchedColumn) { return { name: matchedColumn.name, - dataType: matchedColumn.columnDataType, + dataType: matchedColumn.dataType, }; } else { return { diff --git a/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTable.tsx b/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTable.tsx index 26aba6e37c9..7da98e9cde0 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTable.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTable.tsx @@ -29,8 +29,8 @@ import { Link } from 'react-router-dom'; import { getDatasetDetailsPath } from '../../constants/constants'; import { Column, - ColumnDataType, ColumnJoins, + DataType, JoinedWith, Table, } from '../../generated/entity/data/table'; @@ -87,26 +87,26 @@ const SchemaTable: FunctionComponent = ({ const rowRef = useRef(null); const getDataTypeString = (dataType: string): string => { switch (upperCase(dataType)) { - case ColumnDataType.String: - case ColumnDataType.Char: - case ColumnDataType.Text: - case ColumnDataType.Varchar: - case ColumnDataType.Mediumtext: - case ColumnDataType.Mediumblob: - case ColumnDataType.Blob: + case DataType.String: + case DataType.Char: + case DataType.Text: + case DataType.Varchar: + case DataType.Mediumtext: + case DataType.Mediumblob: + case DataType.Blob: return 'varchar'; - case ColumnDataType.Timestamp: - case ColumnDataType.Time: + case DataType.Timestamp: + case DataType.Time: return 'timestamp'; - case ColumnDataType.Int: - case ColumnDataType.Float: - case ColumnDataType.Smallint: - case ColumnDataType.Bigint: - case ColumnDataType.Numeric: - case ColumnDataType.Tinyint: + case DataType.Int: + case DataType.Float: + case DataType.Smallint: + case DataType.Bigint: + case DataType.Numeric: + case DataType.Tinyint: return 'numeric'; - case ColumnDataType.Boolean: - case ColumnDataType.Enum: + case DataType.Boolean: + case DataType.Enum: return 'boolean'; default: return dataType; @@ -216,9 +216,7 @@ const SchemaTable: FunctionComponent = ({ return ( lowerCase(column.name).includes(searchText) || lowerCase(column.description).includes(searchText) || - lowerCase(getDataTypeString(column.columnDataType)).includes( - searchText - ) + lowerCase(getDataTypeString(column.dataType)).includes(searchText) ); }); setSearchedColumns(searchCols); @@ -271,14 +269,14 @@ const SchemaTable: FunctionComponent = ({ key={index} ref={columnName === column.name ? rowRef : null}> - {getConstraintIcon(column.columnConstraint)} + {getConstraintIcon(column.constraint)} {column.name} - {column.columnDataType - ? lowerCase(getDataTypeString(column.columnDataType)) + {column.dataType + ? lowerCase(getDataTypeString(column.dataType)) : ''} diff --git a/catalog-rest-service/src/main/resources/ui/src/generated/type/basic.ts b/catalog-rest-service/src/main/resources/ui/src/generated/type/basic.ts deleted file mode 100644 index cb95008242e..00000000000 --- a/catalog-rest-service/src/main/resources/ui/src/generated/type/basic.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */