Skip to content

Commit f0c3861

Browse files
authored
Scenes: Remove old scenes stuff (grafana#79760)
* Scenes: Remove old scenes stuff * Fixes * Fixes * update
1 parent 692e895 commit f0c3861

33 files changed

+23
-1931
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ cypress.config.js @grafana/grafana-frontend-platform
413413
/public/app/features/runtime/ @ryantxu
414414
/public/app/features/query/ @grafana/dashboards-squad
415415
/public/app/features/sandbox/ @grafana/grafana-frontend-platform
416-
/public/app/features/scenes/ @grafana/dashboards-squad
417416
/public/app/features/browse-dashboards/ @grafana/grafana-frontend-platform
418417
/public/app/features/search/ @grafana/grafana-frontend-platform
419418
/public/app/features/serviceaccounts/ @grafana/identity-access-team

pkg/services/navtree/navtreeimpl/navtree.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,6 @@ func (s *ServiceImpl) buildDashboardNavLinks(c *contextmodel.ReqContext) []*navt
368368
}
369369
}
370370

371-
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagScenes) {
372-
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
373-
Text: "Scenes",
374-
Id: "scenes",
375-
Url: s.cfg.AppSubURL + "/scenes",
376-
Icon: "apps",
377-
})
378-
}
379-
380371
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagDatatrails) {
381372
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
382373
Text: "Data trails",

public/app/features/dashboard-scene/panel-edit/PanelEditor.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ export class PanelEditor extends SceneObjectBase<PanelEditorState> {
121121
getDashboardUrl({
122122
uid: this.state.dashboardRef.resolve().state.uid,
123123
currentQueryParams: locationService.getLocation().search,
124-
useExperimentalURL: true,
125124
})
126125
);
127126
}

public/app/features/dashboard-scene/scene/DashboardScene.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as H from 'history';
22
import { Unsubscribable } from 'rxjs';
33

44
import { CoreApp, DataQueryRequest, NavIndex, NavModelItem } from '@grafana/data';
5-
import { config, locationService } from '@grafana/runtime';
5+
import { locationService } from '@grafana/runtime';
66
import {
77
getUrlSyncManager,
88
SceneFlexLayout,
@@ -195,7 +195,6 @@ export class DashboardScene extends SceneObjectBase<DashboardSceneState> {
195195
uid: this.state.uid,
196196
currentQueryParams: location.search,
197197
updateQuery: { viewPanel: null, inspect: null, editview: null },
198-
useExperimentalURL: Boolean(config.featureToggles.dashboardSceneForViewers && meta.canEdit),
199198
}),
200199
};
201200

public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('panelMenuBehavior', () => {
5454
});
5555

5656
beforeAll(() => {
57-
locationService.push('/scenes/dashboard/dash-1?from=now-5m&to=now');
57+
locationService.push('/d/dash-1?from=now-5m&to=now');
5858
});
5959

6060
it('Given standard panel', async () => {
@@ -71,9 +71,9 @@ describe('panelMenuBehavior', () => {
7171

7272
expect(menu.state.items?.length).toBe(6);
7373
// verify view panel url keeps url params and adds viewPanel=<panel-key>
74-
expect(menu.state.items?.[0].href).toBe('/scenes/dashboard/dash-1?from=now-5m&to=now&viewPanel=panel-12');
74+
expect(menu.state.items?.[0].href).toBe('/d/dash-1?from=now-5m&to=now&viewPanel=panel-12');
7575
// verify edit url keeps url time range
76-
expect(menu.state.items?.[1].href).toBe('/scenes/dashboard/dash-1/panel-edit/12?from=now-5m&to=now');
76+
expect(menu.state.items?.[1].href).toBe('/d/dash-1/panel-edit/12?from=now-5m&to=now');
7777
// verify share
7878
expect(menu.state.items?.[2].text).toBe('Share');
7979
// verify explore url
@@ -86,7 +86,7 @@ describe('panelMenuBehavior', () => {
8686
expect(getExploreArgs.scopedVars?.__sceneObject?.value).toBe(panel);
8787

8888
// verify inspect url keeps url params and adds inspect=<panel-key>
89-
expect(menu.state.items?.[4].href).toBe('/scenes/dashboard/dash-1?from=now-5m&to=now&inspect=panel-12');
89+
expect(menu.state.items?.[4].href).toBe('/d/dash-1?from=now-5m&to=now&inspect=panel-12');
9090
expect(menu.state.items?.[4].subMenu).toBeDefined();
9191

9292
expect(menu.state.items?.[4].subMenu?.length).toBe(3);

public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export function panelMenuBehavior(menu: VizPanelMenu) {
7171
uid: dashboard.state.uid,
7272
subPath: `/panel-edit/${panelId}`,
7373
currentQueryParams: location.search,
74-
useExperimentalURL: true,
7574
}),
7675
});
7776
}

public/app/features/dashboard-scene/sharing/ShareLinkTab.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ describe('ShareLinkTab', () => {
3030
config.rendererAvailable = true;
3131
config.bootData.user.orgId = 1;
3232
config.featureToggles.dashboardSceneForViewers = true;
33-
locationService.push('/scenes/dashboard/dash-1?from=now-6h&to=now');
33+
locationService.push('/d/dash-1?from=now-6h&to=now');
3434
});
3535

3636
describe('with locked time range (absolute) range', () => {
3737
it('should generate share url absolute time', async () => {
3838
buildAndRenderScenario({});
3939

4040
expect(await screen.findByRole('textbox', { name: 'Link URL' })).toHaveValue(
41-
'http://dashboards.grafana.com/grafana/scenes/dashboard/dash-1?from=2019-02-11T13:00:00.000Z&to=2019-02-11T19:00:00.000Z&viewPanel=panel-12'
41+
'http://dashboards.grafana.com/grafana/d/dash-1?from=2019-02-11T13:00:00.000Z&to=2019-02-11T19:00:00.000Z&viewPanel=panel-12'
4242
);
4343
});
4444
});
@@ -49,7 +49,7 @@ describe('ShareLinkTab', () => {
4949
act(() => tab.onToggleLockedTime());
5050

5151
expect(await screen.findByRole('textbox', { name: 'Link URL' })).toHaveValue(
52-
'http://dashboards.grafana.com/grafana/scenes/dashboard/dash-1?from=now-6h&to=now&viewPanel=panel-12'
52+
'http://dashboards.grafana.com/grafana/d/dash-1?from=now-6h&to=now&viewPanel=panel-12'
5353
);
5454
});
5555
});
@@ -59,7 +59,7 @@ describe('ShareLinkTab', () => {
5959
act(() => tab.onThemeChange('light'));
6060

6161
expect(await screen.findByRole('textbox', { name: 'Link URL' })).toHaveValue(
62-
'http://dashboards.grafana.com/grafana/scenes/dashboard/dash-1?from=2019-02-11T13:00:00.000Z&to=2019-02-11T19:00:00.000Z&viewPanel=panel-12&theme=light'
62+
'http://dashboards.grafana.com/grafana/d/dash-1?from=2019-02-11T13:00:00.000Z&to=2019-02-11T19:00:00.000Z&viewPanel=panel-12&theme=light'
6363
);
6464
});
6565

public/app/features/dashboard-scene/sharing/ShareLinkTab.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export class ShareLinkTab extends SceneObjectBase<ShareLinkTabState> {
7676
currentQueryParams: location.search,
7777
updateQuery: urlParamsUpdate,
7878
absolute: true,
79-
useExperimentalURL: Boolean(config.featureToggles.dashboardSceneForViewers && dashboard.state.meta.canEdit),
8079
});
8180

8281
if (useShortUrl) {

public/app/features/dashboard-scene/utils/urlBuilders.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,28 @@ import { getDashboardUrl } from './urlBuilders';
22

33
describe('dashboard utils', () => {
44
it('Can getUrl', () => {
5-
const url = getDashboardUrl({ uid: 'dash-1', currentQueryParams: '?orgId=1&filter=A', useExperimentalURL: true });
5+
const url = getDashboardUrl({ uid: 'dash-1', currentQueryParams: '?orgId=1&filter=A' });
66

7-
expect(url).toBe('/scenes/dashboard/dash-1?orgId=1&filter=A');
7+
expect(url).toBe('/d/dash-1?orgId=1&filter=A');
88
});
99

1010
it('Can getUrl with subpath', () => {
1111
const url = getDashboardUrl({
1212
uid: 'dash-1',
1313
subPath: '/panel-edit/2',
1414
currentQueryParams: '?orgId=1&filter=A',
15-
useExperimentalURL: true,
1615
});
1716

18-
expect(url).toBe('/scenes/dashboard/dash-1/panel-edit/2?orgId=1&filter=A');
17+
expect(url).toBe('/d/dash-1/panel-edit/2?orgId=1&filter=A');
1918
});
2019

2120
it('Can getUrl with params removed and addded', () => {
2221
const url = getDashboardUrl({
2322
uid: 'dash-1',
2423
currentQueryParams: '?orgId=1&filter=A',
2524
updateQuery: { filter: null, new: 'A' },
26-
useExperimentalURL: true,
2725
});
2826

29-
expect(url).toBe('/scenes/dashboard/dash-1?orgId=1&new=A');
27+
expect(url).toBe('/d/dash-1?orgId=1&new=A');
3028
});
3129
});

public/app/features/dashboard-scene/utils/urlBuilders.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,10 @@ export interface DashboardUrlOptions {
2121
absolute?: boolean;
2222
// Add tz to query params
2323
timeZone?: string;
24-
25-
// Add tz to query params
26-
useExperimentalURL?: boolean;
2724
}
2825

2926
export function getDashboardUrl(options: DashboardUrlOptions) {
30-
let path = options.useExperimentalURL
31-
? `/scenes/dashboard/${options.uid}${options.subPath ?? ''}`
32-
: `/d/${options.uid}${options.subPath ?? ''}`;
27+
let path = `/d/${options.uid}${options.subPath ?? ''}`;
3328

3429
if (options.soloRoute) {
3530
path = `/d-solo/${options.uid}${options.subPath ?? ''}`;

0 commit comments

Comments
 (0)