diff --git a/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx index 826c73f400e..0ef20e95c5e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/EntityTable/EntityTable.component.tsx @@ -15,7 +15,7 @@ import { faCaretDown, faCaretRight } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Popover, Table } from 'antd'; import classNames from 'classnames'; -import { cloneDeep, isEmpty, isNil, isUndefined, lowerCase } from 'lodash'; +import { cloneDeep, isEmpty, isUndefined, lowerCase } from 'lodash'; import { EntityFieldThreads, EntityTags, TagOption } from 'Models'; import React, { Fragment, @@ -349,18 +349,26 @@ const EntityTable = ({ columnName: string, columnConstraint?: string ) => { - if (!isNil(columnConstraint)) { - return getConstraintIcon(columnConstraint, 'tw-mr-2'); - } else { - const flag = tableConstraints?.find((constraint) => - constraint.columns?.includes(columnName) - ); - if (!isUndefined(flag)) { - return getConstraintIcon(flag.constraintType, 'tw-mr-2'); - } else { - return null; - } - } + // get the table constraint for column + const tableConstraint = tableConstraints?.find((constraint) => + constraint.columns?.includes(columnName) + ); + + // prepare column constraint element + const columnConstraintEl = columnConstraint + ? getConstraintIcon(columnConstraint, 'tw-mr-2') + : null; + + // prepare table constraint element + const tableConstraintEl = tableConstraint + ? getConstraintIcon(tableConstraint.constraintType, 'tw-mr-2') + : null; + + return ( + + {columnConstraintEl} {tableConstraintEl} + + ); }; const handleUpdate = (column: Column, index: number) => { diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx index 0e5d9b0c68f..f7c42c4f7fe 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx @@ -222,8 +222,7 @@ const TagsPage = () => { createTagCategory(data) .then((res) => { if (res) { - setCurrentCategory(res); - fetchCategories(); + history.push(getTagPath(res.name)); } else { throw jsonData['api-error-messages']['unexpected-server-response']; } @@ -268,9 +267,12 @@ const TagsPage = () => { const updatedCategory = categories.filter( (data) => data.id !== categoryId ); - setCurrentCategory(updatedCategory[0]); - setCategoreis(updatedCategory); - setIsLoading(false); + const currentCategory = updatedCategory[0]; + history.push( + getTagPath( + currentCategory?.fullyQualifiedName || currentCategory?.name + ) + ); } else { showErrorToast( jsonData['api-error-messages']['delete-tag-category-error'] @@ -283,7 +285,10 @@ const TagsPage = () => { jsonData['api-error-messages']['delete-tag-category-error'] ); }) - .finally(() => setDeleteTags({ data: undefined, state: false })); + .finally(() => { + setDeleteTags({ data: undefined, state: false }); + setIsLoading(false); + }); }; /**