mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-20 23:18:01 +00:00
Fix: Feeds UI adjustments and existing name restriction (#2154)
This commit is contained in:
parent
cf2381482d
commit
adb63cc982
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
import { AxiosError, AxiosResponse } from 'axios';
|
import { AxiosError, AxiosResponse } from 'axios';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isUndefined } from 'lodash';
|
import { isUndefined, toLower } from 'lodash';
|
||||||
import { EntityTags, FormErrorData } from 'Models';
|
import { EntityTags, FormErrorData } from 'Models';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
@ -108,7 +108,9 @@ const TagsPage = () => {
|
|||||||
} else if (/\s/g.test(data.name)) {
|
} else if (/\s/g.test(data.name)) {
|
||||||
errData['name'] = 'Name with space is not allowed';
|
errData['name'] = 'Name with space is not allowed';
|
||||||
} else if (
|
} else if (
|
||||||
!isUndefined(categories.find((item) => item.name === data.name))
|
!isUndefined(
|
||||||
|
categories.find((item) => toLower(item.name) === toLower(data.name))
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
errData['name'] = 'Name already exists';
|
errData['name'] = 'Name already exists';
|
||||||
}
|
}
|
||||||
@ -155,7 +157,7 @@ const TagsPage = () => {
|
|||||||
} else if (
|
} else if (
|
||||||
!isUndefined(
|
!isUndefined(
|
||||||
currentCategory?.children?.find(
|
currentCategory?.children?.find(
|
||||||
(item) => (item as TagClass)?.name === data.name
|
(item) => toLower((item as TagClass)?.name) === toLower(data.name)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
@ -388,7 +388,7 @@ export const feedSummaryFromatter = (
|
|||||||
);
|
);
|
||||||
summary = (
|
summary = (
|
||||||
<p key={uniqueId()}>
|
<p key={uniqueId()}>
|
||||||
{`Assigned Ownership to`}
|
{`Assigned ownership to`}
|
||||||
{ownerText}
|
{ownerText}
|
||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
@ -416,7 +416,7 @@ export const feedSummaryFromatter = (
|
|||||||
case fieldChange?.name === 'followers': {
|
case fieldChange?.name === 'followers': {
|
||||||
summary = (
|
summary = (
|
||||||
<p key={uniqueId()}>{`${
|
<p key={uniqueId()}>{`${
|
||||||
fieldChange?.newValue ? 'Started Following' : 'Unfollowed'
|
fieldChange?.newValue ? 'Started following' : 'Unfollowed'
|
||||||
} ${_entityName}`}</p>
|
} ${_entityName}`}</p>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -443,6 +443,21 @@ export const getFeedSummary = (
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
{fieldsDeleted?.length ? (
|
||||||
|
<div className="tw-mb-2">
|
||||||
|
{fieldsDeleted?.map((d) => (
|
||||||
|
<Fragment key={uniqueId()}>
|
||||||
|
{feedSummaryFromatter(
|
||||||
|
d,
|
||||||
|
ChangeType.REMOVED,
|
||||||
|
entityName,
|
||||||
|
entityType,
|
||||||
|
entityFQN
|
||||||
|
)}
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
{fieldsAdded?.length > 0 ? (
|
{fieldsAdded?.length > 0 ? (
|
||||||
<div className="tw-mb-2">
|
<div className="tw-mb-2">
|
||||||
{fieldsAdded?.map((a) => (
|
{fieldsAdded?.map((a) => (
|
||||||
@ -473,21 +488,6 @@ export const getFeedSummary = (
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{fieldsDeleted?.length ? (
|
|
||||||
<div className="tw-mb-2">
|
|
||||||
{fieldsDeleted?.map((d) => (
|
|
||||||
<Fragment key={uniqueId()}>
|
|
||||||
{feedSummaryFromatter(
|
|
||||||
d,
|
|
||||||
ChangeType.REMOVED,
|
|
||||||
entityName,
|
|
||||||
entityType,
|
|
||||||
entityFQN
|
|
||||||
)}
|
|
||||||
</Fragment>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user