(cherry picked from commit 6423485061)
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
This commit is contained in:
co-authored by
Ivan Ortega Alba
parent
c1fe453a53
commit
4d2005311a
+1
-2
@@ -3012,8 +3012,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/core/components/SharedPreferences/SharedPreferences.tsx:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"]
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/core/components/TagFilter/TagBadge.tsx:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
|
||||
@@ -111,27 +111,13 @@ export class SharedPreferences extends PureComponent<Props, State> {
|
||||
|
||||
async componentDidMount() {
|
||||
const prefs = await this.service.load();
|
||||
const dashboards = (await backendSrv.search({ starred: true })) as DashboardSearchItem[];
|
||||
const dashboards = await backendSrv.search({ starred: true });
|
||||
|
||||
if (prefs.homeDashboardUID && !dashboards.find((d) => d.uid === prefs.homeDashboardUID)) {
|
||||
const missingDash = await backendSrv.getDashboardByUid(prefs.homeDashboardUID);
|
||||
const missingDash = await backendSrv.search({ dashboardUIDs: prefs.homeDashboardUID });
|
||||
|
||||
if (missingDash?.dashboard) {
|
||||
dashboards.push({
|
||||
title: missingDash.dashboard.title,
|
||||
tags: [],
|
||||
type: DashboardSearchItemType.DashDB,
|
||||
uid: missingDash.dashboard.uid,
|
||||
uri: '', // uri is not part of dashboard metadata
|
||||
url: missingDash.meta.url || '',
|
||||
folderId: missingDash.meta.folderId,
|
||||
folderTitle: missingDash.meta.folderTitle,
|
||||
folderUid: missingDash.meta.folderUid,
|
||||
folderUrl: missingDash.meta.folderUrl,
|
||||
isStarred: missingDash.meta.isStarred || false,
|
||||
slug: missingDash.meta.slug,
|
||||
items: [],
|
||||
});
|
||||
if (missingDash.length > 0) {
|
||||
dashboards.push(missingDash[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user