Navigation: show breadcrumbs correctly when on the home page (#55759)

* show breadcrumbs correctly when on the home page

* adjust breadcrumb unit tests

* update betterer

* fix backend tests

* update getSectionRoot to look at the home nav id

* remove redundant setting of home dashboard

* construct a home navmodelitem in the backend

* fix cases when the feature toggle is off

* fix unit test

* fix more unit tests

* refactor how buildBreadcrumbs works

* use HOME_NAV_ID

* move homeNav useSelector into NavToolbar

* remove unnecesary cloneDeep

* don't need locationUtil here

* restore using getUrlForPartial in DashboardPage

* special case for the editview query param

* remove commented out code

* add comment to clarify splice behaviour

* slightly cleaner syntax
This commit is contained in:
Ashley Harrison
2022-10-03 15:05:19 +01:00
committed by GitHub
parent 0d348dc0b1
commit 8984507291
14 changed files with 158 additions and 51 deletions
-1
View File
@@ -538,7 +538,6 @@ func (hs *HTTPServer) GetHomeDashboard(c *models.ReqContext) response.Response {
}()
dash := dtos.DashboardFullWithMeta{}
dash.Meta.IsHome = true
dash.Meta.CanEdit = c.SignedInUser.HasRole(org.RoleEditor)
dash.Meta.FolderTitle = "General"
dash.Dashboard = simplejson.New()
-1
View File
@@ -78,7 +78,6 @@ func TestGetHomeDashboard(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
dash := dtos.DashboardFullWithMeta{}
dash.Meta.IsHome = true
dash.Meta.FolderTitle = "General"
homeDashJSON, err := os.ReadFile(tc.expectedDashboardPath)
-1
View File
@@ -8,7 +8,6 @@ import (
type DashboardMeta struct {
IsStarred bool `json:"isStarred,omitempty"`
IsHome bool `json:"isHome,omitempty"`
IsSnapshot bool `json:"isSnapshot,omitempty"`
Type string `json:"type,omitempty"`
CanSave bool `json:"canSave"`