mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-27 18:36:08 +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 { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { Popover, Table } from 'antd';
|
import { Popover, Table } from 'antd';
|
||||||
import classNames from 'classnames';
|
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 { EntityFieldThreads, EntityTags, TagOption } from 'Models';
|
||||||
import React, {
|
import React, {
|
||||||
Fragment,
|
Fragment,
|
||||||
@ -349,18 +349,26 @@ const EntityTable = ({
|
|||||||
columnName: string,
|
columnName: string,
|
||||||
columnConstraint?: string
|
columnConstraint?: string
|
||||||
) => {
|
) => {
|
||||||
if (!isNil(columnConstraint)) {
|
// get the table constraint for column
|
||||||
return getConstraintIcon(columnConstraint, 'tw-mr-2');
|
const tableConstraint = tableConstraints?.find((constraint) =>
|
||||||
} else {
|
constraint.columns?.includes(columnName)
|
||||||
const flag = tableConstraints?.find((constraint) =>
|
);
|
||||||
constraint.columns?.includes(columnName)
|
|
||||||
);
|
// prepare column constraint element
|
||||||
if (!isUndefined(flag)) {
|
const columnConstraintEl = columnConstraint
|
||||||
return getConstraintIcon(flag.constraintType, 'tw-mr-2');
|
? getConstraintIcon(columnConstraint, 'tw-mr-2')
|
||||||
} else {
|
: null;
|
||||||
return 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) => {
|
const handleUpdate = (column: Column, index: number) => {
|
||||||
|
@ -222,8 +222,7 @@ const TagsPage = () => {
|
|||||||
createTagCategory(data)
|
createTagCategory(data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
setCurrentCategory(res);
|
history.push(getTagPath(res.name));
|
||||||
fetchCategories();
|
|
||||||
} else {
|
} else {
|
||||||
throw jsonData['api-error-messages']['unexpected-server-response'];
|
throw jsonData['api-error-messages']['unexpected-server-response'];
|
||||||
}
|
}
|
||||||
@ -268,9 +267,12 @@ const TagsPage = () => {
|
|||||||
const updatedCategory = categories.filter(
|
const updatedCategory = categories.filter(
|
||||||
(data) => data.id !== categoryId
|
(data) => data.id !== categoryId
|
||||||
);
|
);
|
||||||
setCurrentCategory(updatedCategory[0]);
|
const currentCategory = updatedCategory[0];
|
||||||
setCategoreis(updatedCategory);
|
history.push(
|
||||||
setIsLoading(false);
|
getTagPath(
|
||||||
|
currentCategory?.fullyQualifiedName || currentCategory?.name
|
||||||
|
)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
jsonData['api-error-messages']['delete-tag-category-error']
|
jsonData['api-error-messages']['delete-tag-category-error']
|
||||||
@ -283,7 +285,10 @@ const TagsPage = () => {
|
|||||||
jsonData['api-error-messages']['delete-tag-category-error']
|
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