RecentlyViewedDashboards: Hide entire section when there is no recently view item (#115905)
* RecentlyViewedDashboards: Hide entire section when there is no recently view item
This commit is contained in:
@@ -39,7 +39,7 @@ export function RecentlyViewedDashboards() {
|
||||
retry();
|
||||
};
|
||||
|
||||
if (!evaluateBooleanFlag('recentlyViewedDashboards', false)) {
|
||||
if (!evaluateBooleanFlag('recentlyViewedDashboards', false) || recentDashboards.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -76,10 +76,6 @@ export function RecentlyViewedDashboards() {
|
||||
</>
|
||||
)}
|
||||
{loading && <Spinner />}
|
||||
{/* TODO: Better empty state https://github.com/grafana/grafana/issues/114804 */}
|
||||
{!loading && recentDashboards.length === 0 && (
|
||||
<Text>{t('browse-dashboards.recently-viewed.empty', 'Nothing viewed yet')}</Text>
|
||||
)}
|
||||
|
||||
{!loading && recentDashboards.length > 0 && (
|
||||
<ul className={styles.list}>
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "Clear history",
|
||||
"empty": "Nothing viewed yet",
|
||||
"error": "Recently viewed dashboards couldn’t be loaded.",
|
||||
"retry": "Retry",
|
||||
"title": "Recently viewed"
|
||||
|
||||
Reference in New Issue
Block a user