From adb63cc982e4be7af7450a215f8f2950b2ddc08c Mon Sep 17 00:00:00 2001 From: darth-coder00 <86726556+darth-coder00@users.noreply.github.com> Date: Tue, 11 Jan 2022 18:54:59 +0530 Subject: [PATCH] Fix: Feeds UI adjustments and existing name restriction (#2154) --- .../resources/ui/src/pages/tags/index.tsx | 8 +++-- .../ui/src/utils/EntityVersionUtils.tsx | 34 +++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx index 40696d4aa5b..bd3420032b4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx @@ -13,7 +13,7 @@ import { AxiosError, AxiosResponse } from 'axios'; import classNames from 'classnames'; -import { isUndefined } from 'lodash'; +import { isUndefined, toLower } from 'lodash'; import { EntityTags, FormErrorData } from 'Models'; import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; @@ -108,7 +108,9 @@ const TagsPage = () => { } else if (/\s/g.test(data.name)) { errData['name'] = 'Name with space is not allowed'; } 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'; } @@ -155,7 +157,7 @@ const TagsPage = () => { } else if ( !isUndefined( currentCategory?.children?.find( - (item) => (item as TagClass)?.name === data.name + (item) => toLower((item as TagClass)?.name) === toLower(data.name) ) ) ) { diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx index 2083436df7c..883e76c42a2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityVersionUtils.tsx @@ -388,7 +388,7 @@ export const feedSummaryFromatter = ( ); summary = (
- {`Assigned Ownership to`} + {`Assigned ownership to`} {ownerText}
); @@ -416,7 +416,7 @@ export const feedSummaryFromatter = ( case fieldChange?.name === 'followers': { summary = ({`${ - fieldChange?.newValue ? 'Started Following' : 'Unfollowed' + fieldChange?.newValue ? 'Started following' : 'Unfollowed' } ${_entityName}`}
); @@ -443,6 +443,21 @@ export const getFeedSummary = ( return (