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, () => ({ useImperativeHandle(ref, () => ({
refreshAssets() { refreshAssets() {
fetchAssets({ // Reset page to one and trigger fetchAssets
index: isEmpty(activeFilter) ? [SearchIndex.ALL] : activeFilter, handlePageChange(1);
page: 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(); fetchCountsByEntity();
}, },
closeSummaryPanel() { closeSummaryPanel() {

View File

@ -80,6 +80,14 @@
} }
} }
.domain-asset-page-layout {
.asset-tab-delete-notification {
.ant-affix {
left: 50%;
}
}
}
.asset-tab-delete-notification { .asset-tab-delete-notification {
&.visible { &.visible {
.ant-affix { .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 { TableTagsProps } from '../../../components/TableTags/TableTags.interface';
import { DE_ACTIVE_COLOR } from '../../../constants/constants'; import { DE_ACTIVE_COLOR } from '../../../constants/constants';
import { TAG_CONSTANT, TAG_START_WITH } from '../../../constants/Tag.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 { TagSource } from '../../../generated/type/tagLabel';
import { getEntityFeedLink } from '../../../utils/EntityUtils'; import { getEntityFeedLink } from '../../../utils/EntityUtils';
import { getFilterTags } from '../../../utils/TableTags/TableTags.utils'; import { getFilterTags } from '../../../utils/TableTags/TableTags.utils';
@ -106,6 +107,7 @@ const TagsContainerV2 = ({
let tagData: EntityTags = { let tagData: EntityTags = {
tagFQN: typeof tag === 'string' ? tag : tag.value, tagFQN: typeof tag === 'string' ? tag : tag.value,
source: tagType, source: tagType,
labelType: LabelType.Manual,
}; };
if (tag.data) { if (tag.data) {
@ -114,8 +116,8 @@ const TagsContainerV2 = ({
name: tag.data?.name, name: tag.data?.name,
displayName: tag.data?.displayName, displayName: tag.data?.displayName,
description: tag.data?.description, description: tag.data?.description,
style: tag.data?.style, style: tag.data?.style ?? {},
labelType: tag.data?.labelType, 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[]) => { export const createTagObject = (tags: EntityTags[]) => {
return tags.map((tag) => ({ return tags.map(
...omit(tag, 'isRemovable'), (tag) =>
labelType: LabelType.Manual, ({
state: State.Confirmed, ...omit(tag, 'isRemovable'),
source: tag.source, state: State.Confirmed,
tagFQN: tag.tagFQN, source: tag.source,
})); tagFQN: tag.tagFQN,
} as TagLabel)
);
}; };