mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Data trails: Move and rename to explore metrics (#80649)
* Move data trails to /explore/metrics * Fix breadcrumbs * Fix label option link
This commit is contained in:
parent
48a5c1e850
commit
6b37a887d5
@ -117,6 +117,7 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, prefs *pref.Prefere
|
||||
}
|
||||
|
||||
if setting.ExploreEnabled && hasAccess(ac.EvalPermission(ac.ActionDatasourcesExplore)) {
|
||||
exploreChildNavLinks := s.buildExploreNavLinks(c)
|
||||
treeRoot.AddSection(&navtree.NavLink{
|
||||
Text: "Explore",
|
||||
Id: navtree.NavIDExplore,
|
||||
@ -124,6 +125,7 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, prefs *pref.Prefere
|
||||
Icon: "compass",
|
||||
SortWeight: navtree.WeightExplore,
|
||||
Url: s.cfg.AppSubURL + "/explore",
|
||||
Children: exploreChildNavLinks,
|
||||
})
|
||||
}
|
||||
|
||||
@ -373,15 +375,6 @@ func (s *ServiceImpl) buildDashboardNavLinks(c *contextmodel.ReqContext) []*navt
|
||||
}
|
||||
}
|
||||
|
||||
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagDatatrails) {
|
||||
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
|
||||
Text: "Data trails",
|
||||
Id: "data-trails",
|
||||
Url: s.cfg.AppSubURL + "/data-trails",
|
||||
Icon: "code-branch",
|
||||
})
|
||||
}
|
||||
|
||||
if hasAccess(ac.EvalPermission(dashboards.ActionDashboardsCreate)) {
|
||||
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
|
||||
Text: "New dashboard", Icon: "plus", Url: s.cfg.AppSubURL + "/dashboard/new", HideFromTabs: true, Id: "dashboards/new", IsCreateAction: true,
|
||||
@ -528,3 +521,17 @@ func (s *ServiceImpl) buildDataConnectionsNavLink(c *contextmodel.ReqContext) *n
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *ServiceImpl) buildExploreNavLinks(c *contextmodel.ReqContext) []*navtree.NavLink {
|
||||
exploreChildNavs := []*navtree.NavLink{}
|
||||
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagDatatrails) {
|
||||
exploreChildNavs = append(exploreChildNavs, &navtree.NavLink{
|
||||
Text: "Metrics",
|
||||
SubTitle: "Queryless exploration of your metrics",
|
||||
Id: "explore/metrics",
|
||||
Url: s.cfg.AppSubURL + "/explore/metrics",
|
||||
Icon: "code-branch",
|
||||
})
|
||||
}
|
||||
return exploreChildNavs
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import PrometheusLanguageProvider from '../../../plugins/datasource/prometheus/l
|
||||
import { PromMetricsMetadataItem } from '../../../plugins/datasource/prometheus/types';
|
||||
import { getDatasourceSrv } from '../../plugins/datasource_srv';
|
||||
import { ALL_VARIABLE_VALUE } from '../../variables/constants';
|
||||
import { VAR_DATASOURCE_EXPR, VAR_GROUP_BY } from '../shared';
|
||||
import { TRAILS_ROUTE, VAR_DATASOURCE_EXPR, VAR_GROUP_BY } from '../shared';
|
||||
import { getMetricSceneFor } from '../utils';
|
||||
|
||||
import { getLabelOptions } from './utils';
|
||||
@ -109,7 +109,7 @@ export class MetricOverviewScene extends SceneObjectBase<MetricOverviewSceneStat
|
||||
key={l.label}
|
||||
href={sceneGraph.interpolate(
|
||||
model,
|
||||
`/data-trails/trail$\{__url.params:exclude:actionView,var-groupby}&actionView=breakdown&var-groupby=${encodeURIComponent(
|
||||
`${TRAILS_ROUTE}$\{__url.params:exclude:actionView,var-groupby}&actionView=breakdown&var-groupby=${encodeURIComponent(
|
||||
l.value!
|
||||
)}`
|
||||
)}
|
||||
|
@ -36,9 +36,9 @@ export class DataTrailsApp extends SceneObjectBase<DataTrailsAppState> {
|
||||
<Switch>
|
||||
<Route
|
||||
exact={true}
|
||||
path="/data-trails"
|
||||
path="/explore/metrics"
|
||||
render={() => (
|
||||
<Page navId="data-trails" layout={PageLayoutType.Custom}>
|
||||
<Page navId="explore/metrics" layout={PageLayoutType.Custom}>
|
||||
<div className={styles.customPage}>
|
||||
<home.Component model={home} />
|
||||
</div>
|
||||
@ -47,9 +47,9 @@ export class DataTrailsApp extends SceneObjectBase<DataTrailsAppState> {
|
||||
/>
|
||||
<Route
|
||||
exact={true}
|
||||
path="/data-trails/trail"
|
||||
path="/explore/metrics/trail"
|
||||
render={() => (
|
||||
<Page navId="data-trails" pageNav={{ text: 'Trail' }} layout={PageLayoutType.Custom}>
|
||||
<Page navId="explore/metrics" pageNav={{ text: 'Trail' }} layout={PageLayoutType.Custom}>
|
||||
<div className={styles.customPage}>
|
||||
<DataTrailView trail={trail} />
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@ export interface ActionViewDefinition {
|
||||
getScene: () => SceneObject;
|
||||
}
|
||||
|
||||
export const TRAILS_ROUTE = '/data-trails/trail';
|
||||
export const TRAILS_ROUTE = '/explore/metrics/trail';
|
||||
|
||||
export const VAR_METRIC_NAMES = 'metricNames';
|
||||
export const VAR_FILTERS = 'filters';
|
||||
|
@ -487,7 +487,7 @@ export function getAppRoutes(): RouteDescriptor[] {
|
||||
),
|
||||
},
|
||||
{
|
||||
path: '/data-trails',
|
||||
path: '/explore/metrics',
|
||||
chromeless: false,
|
||||
exact: false,
|
||||
component: SafeDynamicImport(
|
||||
|
Loading…
Reference in New Issue
Block a user