mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-21 06:53:34 +00:00
fix(ui): count localisation for widgets (#22475)
* fix count localisation string * minor fix * minor fix * dependency array fix
This commit is contained in:
parent
dfc9672016
commit
bd338c0c96
@ -105,6 +105,10 @@ const MyFeedWidgetInternal = ({
|
||||
);
|
||||
}, []);
|
||||
|
||||
const showMoreCount = useMemo(() => {
|
||||
return String(entityThread.length > 0 ? entityThread.length : '');
|
||||
}, [entityThread]);
|
||||
|
||||
const widgetBody = useMemo(() => {
|
||||
return (
|
||||
<>
|
||||
@ -163,7 +167,7 @@ const MyFeedWidgetInternal = ({
|
||||
EntityTabs.ACTIVITY_FEED
|
||||
)}
|
||||
moreButtonText={t('label.view-more-count', {
|
||||
count: String(entityThread.length > 0 ? entityThread.length : ''),
|
||||
count: showMoreCount,
|
||||
})}
|
||||
showMoreButton={Boolean(!loading) && !isEmpty(entityThread)}
|
||||
/>
|
||||
|
@ -260,6 +260,11 @@ const MyDataWidgetInternal = ({
|
||||
</div>
|
||||
);
|
||||
}, [data, isExpanded]);
|
||||
|
||||
const showMoreCount = useMemo(() => {
|
||||
return String(data.length > 0 ? data.length : '');
|
||||
}, [data]);
|
||||
|
||||
const widgetContent = useMemo(() => {
|
||||
return (
|
||||
<div className="my-data-widget-container">
|
||||
@ -284,8 +289,8 @@ const MyDataWidgetInternal = ({
|
||||
EntityTabs.ACTIVITY_FEED
|
||||
)}
|
||||
moreButtonText={t('label.view-more-count', {
|
||||
count: String(data.length > 0 ? data.length : ''),
|
||||
})} // if data is empty then show view more
|
||||
count: showMoreCount,
|
||||
})}
|
||||
showMoreButton={Boolean(!isLoading) && !isEmpty(data)}
|
||||
/>
|
||||
</div>
|
||||
@ -301,6 +306,7 @@ const MyDataWidgetInternal = ({
|
||||
widgetKey,
|
||||
widgetData,
|
||||
isEditView,
|
||||
showMoreCount,
|
||||
]);
|
||||
|
||||
return (
|
||||
|
@ -179,6 +179,11 @@ function FollowingWidget({
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
const showMoreCount = useMemo(() => {
|
||||
return String(followedData.length > 0 ? followedData.length : '');
|
||||
}, [followedData]);
|
||||
|
||||
const followingContent = useMemo(() => {
|
||||
return (
|
||||
<div className="entity-list-body">
|
||||
@ -271,7 +276,7 @@ function FollowingWidget({
|
||||
EntityTabs.ACTIVITY_FEED
|
||||
)}
|
||||
moreButtonText={t('label.view-more-count', {
|
||||
count: String(followedData.length > 0 ? followedData.length : ''),
|
||||
count: showMoreCount,
|
||||
})}
|
||||
showMoreButton={
|
||||
Boolean(!isLoadingOwnedData) && !isEmpty(followedData)
|
||||
@ -292,6 +297,7 @@ function FollowingWidget({
|
||||
widgetKey,
|
||||
widgetData,
|
||||
isEditView,
|
||||
showMoreCount,
|
||||
]);
|
||||
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user