mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-17 11:43:54 +00:00
UI : Fix Tags page and minor ui issue (#7247)
* Fix Tags page and minor ui issue * Fix cypress issue
This commit is contained in:
parent
57501dc8ee
commit
652a12e4d7
@ -200,6 +200,7 @@ const ActivityFeedList: FC<ActivityFeedListProp> = ({
|
||||
</Button>
|
||||
{showThreadTypeList && (
|
||||
<DropDownList
|
||||
horzPosRight
|
||||
dropDownList={threadFilterList}
|
||||
value={threadType}
|
||||
onSelect={handleThreadTypeDropDownChange}
|
||||
|
@ -348,7 +348,7 @@ const GlossaryV1 = ({
|
||||
: NO_PERMISSION_FOR_ACTION
|
||||
}>
|
||||
<button
|
||||
className="tw-mt-1 tw-w-full tw-flex-center tw-gap-2 tw-py-1 tw-text-primary tw-border tw-rounded-md"
|
||||
className="tw-mt-1 tw-w-full tw-flex-center tw-gap-2 tw-py-1 tw-text-primary tw-border tw-rounded-md tw-text-center"
|
||||
disabled={!createGlossaryPermission}
|
||||
onClick={handleAddGlossaryClick}>
|
||||
<SVGIcons alt="plus" icon={Icons.ICON_PLUS_PRIMERY} />{' '}
|
||||
|
@ -279,18 +279,13 @@ const GlossaryDetails = ({ permissions, glossary, updateGlossary }: props) => {
|
||||
placement="topRight"
|
||||
title={permissions.EditAll ? 'Add Reviewer' : NO_PERMISSION_FOR_ACTION}>
|
||||
<ButtonAntd
|
||||
className="tw-p-0 add-reviewer-btn"
|
||||
className="tw-p-0 flex-center"
|
||||
data-testid="add-new-reviewer"
|
||||
disabled={!permissions.EditAll}
|
||||
size="small"
|
||||
type="text"
|
||||
onClick={() => setShowRevieweModal(true)}>
|
||||
<SVGIcons
|
||||
alt="edit"
|
||||
className="tw--mt-1"
|
||||
icon={Icons.EDIT}
|
||||
title="Edit"
|
||||
width="16px"
|
||||
/>
|
||||
<SVGIcons alt="edit" icon={Icons.EDIT} title="Edit" width="16px" />
|
||||
</ButtonAntd>
|
||||
</Tooltip>
|
||||
);
|
||||
@ -307,19 +302,13 @@ const GlossaryDetails = ({ permissions, glossary, updateGlossary }: props) => {
|
||||
: NO_PERMISSION_FOR_ACTION
|
||||
}>
|
||||
<ButtonAntd
|
||||
className="tw-p-0"
|
||||
className="tw-p-0 flex-center"
|
||||
data-testid="owner-dropdown"
|
||||
disabled={!(permissions.EditOwner || permissions.EditAll)}
|
||||
size="small"
|
||||
type="text"
|
||||
onClick={handleSelectOwnerDropdown}>
|
||||
<SVGIcons
|
||||
alt="edit"
|
||||
className="tw--mt-1"
|
||||
icon={Icons.EDIT}
|
||||
title="Edit"
|
||||
width="16px"
|
||||
/>
|
||||
<SVGIcons alt="edit" icon={Icons.EDIT} title="Edit" width="16px" />
|
||||
</ButtonAntd>
|
||||
</Tooltip>
|
||||
{listVisible && (
|
||||
|
@ -31,13 +31,13 @@ const Card = ({ children, heading, action, className }: CardProps) => {
|
||||
className
|
||||
)}
|
||||
data-testid={`${lowerCase(heading)}-card-container`}>
|
||||
<Row className="tw-border-b tw-px-4 tw-py-3 tw-w-full">
|
||||
<Row className="tw-border-b tw-px-4 tw-py-2 tw-w-full tw-items-center">
|
||||
<Col span={8}>
|
||||
<span className="tw-font-semibold">{heading}</span>
|
||||
<span className="tw-font-medium">{heading}</span>
|
||||
</Col>
|
||||
<Col offset={14}>{action}</Col>
|
||||
</Row>
|
||||
<div className="tw-p-4">{children}</div>
|
||||
<div className="tw-px-4 tw-py-2">{children}</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -137,12 +137,15 @@ const TagsPage = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const fetchCategories = () => {
|
||||
const fetchCategories = (setCurrent?: boolean) => {
|
||||
setIsLoading(true);
|
||||
getTagCategories('usageCount')
|
||||
.then((res) => {
|
||||
if (res.data) {
|
||||
setCategoreis(res.data);
|
||||
if (setCurrent) {
|
||||
setCurrentCategory(res.data[0]);
|
||||
}
|
||||
} else {
|
||||
throw jsonData['api-error-messages']['unexpected-server-response'];
|
||||
}
|
||||
@ -424,19 +427,21 @@ const TagsPage = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchCategories();
|
||||
fetchCategories(true);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setCurrentCategory(categories[0]);
|
||||
if (currentCategory) {
|
||||
setCurrentCategory(currentCategory);
|
||||
fetchCurrentCategoryPermission();
|
||||
}
|
||||
}, [categories, currentCategory]);
|
||||
}, [currentCategory]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchCurrentCategory(tagCategoryName);
|
||||
if (tagCategoryName) {
|
||||
fetchCurrentCategory(tagCategoryName);
|
||||
} else {
|
||||
setCurrentCategory(categories[0]);
|
||||
}
|
||||
}, [tagCategoryName]);
|
||||
|
||||
const fetchLeftPanel = () => {
|
||||
@ -455,7 +460,7 @@ const TagsPage = () => {
|
||||
: NO_PERMISSION_FOR_ACTION
|
||||
}>
|
||||
<button
|
||||
className="tw--mt-1 tw-w-full tw-flex-center tw-gap-2 tw-py-1 tw-text-primary tw-border tw-rounded-md"
|
||||
className="tw--mt-1 tw-w-full tw-flex-center tw-gap-2 tw-py-1 tw-text-primary tw-border tw-rounded-md tw-text-center"
|
||||
data-testid="add-category"
|
||||
disabled={!createCategoryPermission}
|
||||
onClick={() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user