Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,24 @@ const EntityRightPanel = <T extends ExtentionEntitiesKeys>({
}>();

const { domains, dataProducts, id: entityId } = data ?? {};

const hasClassificationTags = selectedTags.some(
(tag) => tag.source === TagSource.Classification
);
const hasGlossaryTags = selectedTags.some(
(tag) => tag.source === TagSource.Glossary
);

const shouldShowTags = editTagPermission || hasClassificationTags;
const shouldShowGlossaryTerms =
editGlossaryTermsPermission || hasGlossaryTags;
const shouldShowDataProducts =
showDataProductContainer &&
(editDataProductPermission || Boolean(dataProducts?.length));
return (
<>
{beforeSlot}
<Space className="w-full" direction="vertical" size="large">
{showDataProductContainer && (
{shouldShowDataProducts && (
<div data-testid="KnowledgePanel.DataProducts">
<DataProductsContainer
newLook
Expand All @@ -92,7 +104,7 @@ const EntityRightPanel = <T extends ExtentionEntitiesKeys>({
/>
</div>
)}

{shouldShowTags && (
<div data-testid="KnowledgePanel.Tags">
<TagsContainerV2
newLook
Expand All @@ -106,7 +118,8 @@ const EntityRightPanel = <T extends ExtentionEntitiesKeys>({
onSelectionChange={onTagSelectionChange}
/>
</div>

)}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Inconsistent indentation of conditional )} closings

The closing )} on lines 121 and 136 are heavily indented with ~15 spaces, which is inconsistent with the opening {shouldShowTags && ( and {shouldShowGlossaryTerms && ( that follow the surrounding indentation level. This makes the JSX tree harder to read and will likely be flagged by a linter/formatter.

Suggested fix:

Run the project's formatter (e.g., Prettier) to normalize indentation, or manually align the closing `)}` to match the indentation of the corresponding opening `{shouldShow… && (`.

Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion

{shouldShowGlossaryTerms && (
<div data-testid="KnowledgePanel.GlossaryTerms">
<TagsContainerV2
newLook
Expand All @@ -120,6 +133,7 @@ const EntityRightPanel = <T extends ExtentionEntitiesKeys>({
onSelectionChange={onTagSelectionChange}
/>
</div>
)}
{KnowledgeArticles && (
<KnowledgeArticles entityId={entityId} entityType={entityType} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ const TagsContainerV2 = ({
setTags(getFilterTags(selectedTags));
}, [selectedTags]);

if (newLook && !permission && isEmpty(tags?.[tagType]) && !isEditTags) {
return null;
}

if (newLook) {
return (
<ExpandableCard
Expand Down
Loading