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(() => {
|
const widgetBody = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -163,7 +167,7 @@ const MyFeedWidgetInternal = ({
|
|||||||
EntityTabs.ACTIVITY_FEED
|
EntityTabs.ACTIVITY_FEED
|
||||||
)}
|
)}
|
||||||
moreButtonText={t('label.view-more-count', {
|
moreButtonText={t('label.view-more-count', {
|
||||||
count: String(entityThread.length > 0 ? entityThread.length : ''),
|
count: showMoreCount,
|
||||||
})}
|
})}
|
||||||
showMoreButton={Boolean(!loading) && !isEmpty(entityThread)}
|
showMoreButton={Boolean(!loading) && !isEmpty(entityThread)}
|
||||||
/>
|
/>
|
||||||
|
@ -260,6 +260,11 @@ const MyDataWidgetInternal = ({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}, [data, isExpanded]);
|
}, [data, isExpanded]);
|
||||||
|
|
||||||
|
const showMoreCount = useMemo(() => {
|
||||||
|
return String(data.length > 0 ? data.length : '');
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
const widgetContent = useMemo(() => {
|
const widgetContent = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
<div className="my-data-widget-container">
|
<div className="my-data-widget-container">
|
||||||
@ -284,8 +289,8 @@ const MyDataWidgetInternal = ({
|
|||||||
EntityTabs.ACTIVITY_FEED
|
EntityTabs.ACTIVITY_FEED
|
||||||
)}
|
)}
|
||||||
moreButtonText={t('label.view-more-count', {
|
moreButtonText={t('label.view-more-count', {
|
||||||
count: String(data.length > 0 ? data.length : ''),
|
count: showMoreCount,
|
||||||
})} // if data is empty then show view more
|
})}
|
||||||
showMoreButton={Boolean(!isLoading) && !isEmpty(data)}
|
showMoreButton={Boolean(!isLoading) && !isEmpty(data)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -301,6 +306,7 @@ const MyDataWidgetInternal = ({
|
|||||||
widgetKey,
|
widgetKey,
|
||||||
widgetData,
|
widgetData,
|
||||||
isEditView,
|
isEditView,
|
||||||
|
showMoreCount,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -179,6 +179,11 @@ function FollowingWidget({
|
|||||||
),
|
),
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const showMoreCount = useMemo(() => {
|
||||||
|
return String(followedData.length > 0 ? followedData.length : '');
|
||||||
|
}, [followedData]);
|
||||||
|
|
||||||
const followingContent = useMemo(() => {
|
const followingContent = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
<div className="entity-list-body">
|
<div className="entity-list-body">
|
||||||
@ -271,7 +276,7 @@ function FollowingWidget({
|
|||||||
EntityTabs.ACTIVITY_FEED
|
EntityTabs.ACTIVITY_FEED
|
||||||
)}
|
)}
|
||||||
moreButtonText={t('label.view-more-count', {
|
moreButtonText={t('label.view-more-count', {
|
||||||
count: String(followedData.length > 0 ? followedData.length : ''),
|
count: showMoreCount,
|
||||||
})}
|
})}
|
||||||
showMoreButton={
|
showMoreButton={
|
||||||
Boolean(!isLoadingOwnedData) && !isEmpty(followedData)
|
Boolean(!isLoadingOwnedData) && !isEmpty(followedData)
|
||||||
@ -292,6 +297,7 @@ function FollowingWidget({
|
|||||||
widgetKey,
|
widgetKey,
|
||||||
widgetData,
|
widgetData,
|
||||||
isEditView,
|
isEditView,
|
||||||
|
showMoreCount,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user