Skip to content

Commit

Permalink
Fix(UI) #8555: Tags removal issue (#9055)
Browse files Browse the repository at this point in the history
* Fixed Error thrown while removing tags from data asset details page

* Fixed bug where user were not able to remove the tags on Dashboard Details page

* Changes in MlModelFeaturesList component:
- Tag removal bug fix
- Removed tailwind use and replaced with antd
- Code optimisation
- Localisation changes

* Moved height and width styling from app.less to size.less

* Moved tags sorting functionality to a common util function

* Removed redundant labels in en-us and replaced with common reusable label

* Removed unnecessary code

* localisation changes

* Added unit tests for added functions in CommonUtils and DashboardDetailsUtils

* Added missing localisation changes for MlModelFeaturesList
  • Loading branch information
aniketkatkar97 authored Nov 30, 2022
1 parent 2b2eadf commit 9c8492c
Show file tree
Hide file tree
Showing 23 changed files with 920 additions and 409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ const DashboardDetails = ({
<Tooltip
title={
dashboardPermissions.EditAll
? t('label.edit-description')
? t('label.edit-entity', { entity: t('label.description') })
: t('message.no-permission-for-action')
}>
<button
Expand All @@ -606,43 +606,46 @@ const DashboardDetails = ({
),
},
{
title: t('label.tags'),
title: t('label.tag-plural'),
dataIndex: 'tags',
key: 'tags',
width: 300,
render: (text, record, index) => (
<div
className="relative tableBody-cell"
data-testid="tags-wrapper"
onClick={() => handleTagContainerClick(record, index)}>
{deleted ? (
<div className="tw-flex tw-flex-wrap">
<TagsViewer sizeCap={-1} tags={text || []} />
</div>
) : (
<TagsContainer
editable={editChartTags?.index === index}
isLoading={isTagLoading && editChartTags?.index === index}
selectedTags={text as EntityTags[]}
showAddTagButton={
dashboardPermissions.EditAll || dashboardPermissions.EditTags
}
size="small"
tagList={tagList}
type="label"
onCancel={() => {
handleChartTagSelection();
}}
onSelectionChange={(tags) => {
handleChartTagSelection(tags, {
chart: record,
index,
});
}}
/>
)}
</div>
),
render: (tags: Dashboard['tags'], record, index) => {
return (
<div
className="relative tableBody-cell"
data-testid="tags-wrapper"
onClick={() => handleTagContainerClick(record, index)}>
{deleted ? (
<Space>
<TagsViewer sizeCap={-1} tags={tags || []} />
</Space>
) : (
<TagsContainer
editable={editChartTags?.index === index}
isLoading={isTagLoading && editChartTags?.index === index}
selectedTags={tags || []}
showAddTagButton={
dashboardPermissions.EditAll ||
dashboardPermissions.EditTags
}
size="small"
tagList={tagList}
type="label"
onCancel={() => {
handleChartTagSelection();
}}
onSelectionChange={(tags) => {
handleChartTagSelection(tags, {
chart: record,
index,
});
}}
/>
)}
</div>
);
},
},
],
[
Expand All @@ -652,6 +655,7 @@ const DashboardDetails = ({
tagList,
deleted,
isTagLoading,
charts,
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const CustomControls: FC<ControlProps> = ({
disabled={!hasEditAccess}
title={
hasEditAccess
? t('label.edit-lineage')
? t('label.edit-entity', { entity: t('label.lineage') })
: NO_PERMISSION_FOR_ACTION
}
onClick={onEditLinageClick}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ const EntityTable = ({
render: renderDescription,
},
{
title: t('label.tags'),
title: t('label.tag-plural'),
dataIndex: 'tags',
key: 'tags',
accessor: 'tags',
Expand Down Expand Up @@ -702,7 +702,9 @@ const EntityTable = ({
/>
{editColumn && (
<ModalWithMarkdownEditor
header={`${t('label:edit-column')}: "${editColumn.column.name}"`}
header={`${t('label.edit-entity', { entity: t('label.column') })}: "${
editColumn.column.name
}"`}
placeholder={t('label.enter-column-description')}
value={editColumn.column.description as string}
onCancel={closeEditColumnModal}
Expand Down
Loading

0 comments on commit 9c8492c

Please sign in to comment.