fix(ui): tag updataion with derived tags (#14281)

* fix(ui): tag updataion with derived tags

* fix pagination issue
This commit is contained in:
Chirag Madlani 2023-12-07 07:44:05 +05:30 committed by GitHub
parent 4ade6fd39f
commit 5a3c3a159c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 13 deletions

View File

@ -828,10 +828,15 @@ const AssetsTabs = forwardRef(
useImperativeHandle(ref, () => ({
refreshAssets() {
fetchAssets({
index: isEmpty(activeFilter) ? [SearchIndex.ALL] : activeFilter,
page: 1,
});
// Reset page to one and trigger fetchAssets
handlePageChange(1);
// If current page is already 1 it won't trigger fetchAset from useEffect
// Hence need to manually trigger it for this case
currentPage === 1 &&
fetchAssets({
index: isEmpty(activeFilter) ? [SearchIndex.ALL] : activeFilter,
page: 1,
});
fetchCountsByEntity();
},
closeSummaryPanel() {

View File

@ -80,6 +80,14 @@
}
}
.domain-asset-page-layout {
.asset-tab-delete-notification {
.ant-affix {
left: 50%;
}
}
}
.asset-tab-delete-notification {
&.visible {
.ant-affix {

View File

@ -24,6 +24,7 @@ import { ReactComponent as IconRequest } from '../../../assets/svg/request-icon.
import { TableTagsProps } from '../../../components/TableTags/TableTags.interface';
import { DE_ACTIVE_COLOR } from '../../../constants/constants';
import { TAG_CONSTANT, TAG_START_WITH } from '../../../constants/Tag.constants';
import { LabelType } from '../../../generated/entity/data/table';
import { TagSource } from '../../../generated/type/tagLabel';
import { getEntityFeedLink } from '../../../utils/EntityUtils';
import { getFilterTags } from '../../../utils/TableTags/TableTags.utils';
@ -106,6 +107,7 @@ const TagsContainerV2 = ({
let tagData: EntityTags = {
tagFQN: typeof tag === 'string' ? tag : tag.value,
source: tagType,
labelType: LabelType.Manual,
};
if (tag.data) {
@ -114,8 +116,8 @@ const TagsContainerV2 = ({
name: tag.data?.name,
displayName: tag.data?.displayName,
description: tag.data?.description,
style: tag.data?.style,
labelType: tag.data?.labelType,
style: tag.data?.style ?? {},
labelType: tag.data?.labelType ?? LabelType.Manual,
};
}

View File

@ -353,11 +353,13 @@ export const updateTierTag = (oldTags: Tag[] | TagLabel[], newTier?: Tag) => {
};
export const createTagObject = (tags: EntityTags[]) => {
return tags.map((tag) => ({
...omit(tag, 'isRemovable'),
labelType: LabelType.Manual,
state: State.Confirmed,
source: tag.source,
tagFQN: tag.tagFQN,
}));
return tags.map(
(tag) =>
({
...omit(tag, 'isRemovable'),
state: State.Confirmed,
source: tag.source,
tagFQN: tag.tagFQN,
} as TagLabel)
);
};