Navigation: Display Starred dashboards in the Navbar (#51038)
* remove feature toggle, add empty state and fix bug with initial starring * Extract empty message into lingui * remove full stop * add empty message in the backend * remove unused import * translate starred + empty starred states * betterer changes
This commit is contained in:
@@ -74,6 +74,7 @@ type NavLink struct {
|
||||
Children []*NavLink `json:"children,omitempty"`
|
||||
HighlightText string `json:"highlightText,omitempty"`
|
||||
HighlightID string `json:"highlightId,omitempty"`
|
||||
EmptyMessageId string `json:"emptyMessageId,omitempty"`
|
||||
}
|
||||
|
||||
// NavIDCfg is the id for org configuration navigation node
|
||||
|
||||
+13
-14
@@ -163,22 +163,21 @@ func (hs *HTTPServer) getNavTree(c *models.ReqContext, hasEditPerm bool, prefs *
|
||||
hasAccess := ac.HasAccess(hs.AccessControl, c)
|
||||
navTree := []*dtos.NavLink{}
|
||||
|
||||
if hs.Features.IsEnabled(featuremgmt.FlagSavedItems) {
|
||||
starredItemsLinks, err := hs.buildStarredItemsNavLinks(c, prefs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
navTree = append(navTree, &dtos.NavLink{
|
||||
Text: "Starred",
|
||||
Id: "starred",
|
||||
Icon: "star",
|
||||
SortWeight: dtos.WeightSavedItems,
|
||||
Section: dtos.NavSectionCore,
|
||||
Children: starredItemsLinks,
|
||||
})
|
||||
starredItemsLinks, err := hs.buildStarredItemsNavLinks(c, prefs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
navTree = append(navTree, &dtos.NavLink{
|
||||
Text: "Starred",
|
||||
Id: "starred",
|
||||
Icon: "star",
|
||||
SortWeight: dtos.WeightSavedItems,
|
||||
Section: dtos.NavSectionCore,
|
||||
Children: starredItemsLinks,
|
||||
EmptyMessageId: "starred-empty",
|
||||
})
|
||||
|
||||
dashboardChildLinks := hs.buildDashboardNavLinks(c, hasEditPerm)
|
||||
|
||||
dashboardsUrl := "/dashboards"
|
||||
|
||||
@@ -178,11 +178,6 @@ var (
|
||||
Description: "Enable command palette",
|
||||
State: FeatureStateAlpha,
|
||||
},
|
||||
{
|
||||
Name: "savedItems",
|
||||
Description: "Enable Saved Items in the navbar.",
|
||||
State: FeatureStateAlpha,
|
||||
},
|
||||
{
|
||||
Name: "cloudWatchDynamicLabels",
|
||||
Description: "Use dynamic labels instead of alias patterns in CloudWatch datasource",
|
||||
|
||||
@@ -131,10 +131,6 @@ const (
|
||||
// Enable command palette
|
||||
FlagCommandPalette = "commandPalette"
|
||||
|
||||
// FlagSavedItems
|
||||
// Enable Saved Items in the navbar.
|
||||
FlagSavedItems = "savedItems"
|
||||
|
||||
// FlagCloudWatchDynamicLabels
|
||||
// Use dynamic labels instead of alias patterns in CloudWatch datasource
|
||||
FlagCloudWatchDynamicLabels = "cloudWatchDynamicLabels"
|
||||
|
||||
Reference in New Issue
Block a user