App Plugins: support react pages in nav (#22428)

This commit is contained in:
Ryan McKinley 2020-02-27 09:10:21 -08:00 committed by GitHub
parent 2b6a88bf59
commit 0606555ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -230,9 +230,20 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
}
if include.Type == "page" && include.AddToNav {
link := &dtos.NavLink{
Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/page/" + include.Slug,
Text: include.Name,
var link *dtos.NavLink
if len(include.Path) > 0 {
link = &dtos.NavLink{
Url: setting.AppSubUrl + include.Path,
Text: include.Name,
}
if include.DefaultNav {
appLink.Url = link.Url // Overwrite the hardcoded page logic
}
} else {
link = &dtos.NavLink{
Url: setting.AppSubUrl + "/plugins/" + plugin.Id + "/page/" + include.Slug,
Text: include.Name,
}
}
appLink.Children = append(appLink.Children, link)
}