mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-27 10:26:09 +00:00
* Fix #7957 Table with FK and PK only display PK label in schema tab * Add data-testid * Fix tag page issue
This commit is contained in:
parent
544bd7657f
commit
4be02c20b9
@ -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 (
|
||||
<span data-testid="constraints">
|
||||
{columnConstraintEl} {tableConstraintEl}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
const handleUpdate = (column: Column, index: number) => {
|
||||
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user