From e63105522393c096feceb3f0a66cd9e1e0934a56 Mon Sep 17 00:00:00 2001 From: "Marc M." <146180665+grafakus@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:18:37 +0100 Subject: [PATCH] feat(Export): Disable export to flame graph.com (#280) --- e2e/tests/settings-view/settings-view.spec.ts | 25 ----------------- .../SceneExportMenu/SceneExportMenu.tsx | 5 +--- src/pages/SettingsView/SettingsView.tsx | 28 ------------------- .../FlameGraph/components/ExportMenu.tsx | 6 +--- 4 files changed, 2 insertions(+), 62 deletions(-) diff --git a/e2e/tests/settings-view/settings-view.spec.ts b/e2e/tests/settings-view/settings-view.spec.ts index 0e822447..5b1678e8 100644 --- a/e2e/tests/settings-view/settings-view.spec.ts +++ b/e2e/tests/settings-view/settings-view.spec.ts @@ -19,11 +19,6 @@ test.describe('Plugin Settings', () => { await expect(flamegraphSettings).toBeVisible(); await expect(flamegraphSettings.getByText('Collapsed flame graphs')).toBeVisible(); await expect(flamegraphSettings.getByText('Maximum number of nodes')).toBeVisible(); - - const exportSettings = settingsPage.getExportSettings(); - - await expect(exportSettings).toBeVisible(); - await expect(exportSettings.getByText('Enable flamegraph.com')).toBeVisible(); }); test.describe('Flame graph settings', () => { @@ -60,24 +55,4 @@ test.describe('Plugin Settings', () => { }); }); }); - - test.describe('Export settings', () => { - test('Can be modified', async ({ settingsPage, exploreProfilesPage }) => { - await settingsPage.getEnableFlamegraphDotComCheckbox().click(); - await settingsPage.getSaveSettingsButton().click(); - await expect(settingsPage.getSuccessAlertDialog()).toBeVisible(); - - // flame graph - await exploreProfilesPage.goto(ExplorationType.FlameGraph); - await exploreProfilesPage.getExportDataButton().click(); - - await expect(exploreProfilesPage.getByText('flamegraph.com (public URL)')).not.toBeVisible(); - - // diff flame graph - await exploreProfilesPage.goto(ExplorationType.DiffFlameGraph, EXPLORE_PROFILES_DIFF_RANGES_URL_PARAMS); - await exploreProfilesPage.getExportDataButton().click(); - - await expect(exploreProfilesPage.getByText('flamegraph.com (public URL)')).not.toBeVisible(); - }); - }); }); diff --git a/src/pages/ProfilesExplorerView/components/SceneExploreServiceFlameGraph/components/SceneExportMenu/SceneExportMenu.tsx b/src/pages/ProfilesExplorerView/components/SceneExploreServiceFlameGraph/components/SceneExportMenu/SceneExportMenu.tsx index 4e0ff213..327bfee9 100644 --- a/src/pages/ProfilesExplorerView/components/SceneExploreServiceFlameGraph/components/SceneExportMenu/SceneExportMenu.tsx +++ b/src/pages/ProfilesExplorerView/components/SceneExploreServiceFlameGraph/components/SceneExportMenu/SceneExportMenu.tsx @@ -172,7 +172,7 @@ export class SceneExportMenu extends SceneObjectBase { }; static Component = ({ model, query, timeRange }: SceneComponentProps & ExtraProps) => { - const { data, actions } = model.useSceneExportMenu({ query, timeRange }); + const { actions } = model.useSceneExportMenu({ query, timeRange }); return ( { - {data.shouldDisplayFlamegraphDotCom && ( - - )} } > diff --git a/src/pages/SettingsView/SettingsView.tsx b/src/pages/SettingsView/SettingsView.tsx index 0e78a991..32e62d36 100644 --- a/src/pages/SettingsView/SettingsView.tsx +++ b/src/pages/SettingsView/SettingsView.tsx @@ -47,34 +47,6 @@ export function SettingsView() { -
- - -

- When enabled, this option allows users to export profiles to{' '} - - flamegraph.com - {' '} - and share interactive flamegraphs via a public URL. -

-

Disable this option if data privacy is a concern.

- - } - interactive - > - -
-
-
- {/* no pprof export, as the underlying API only accepts a single query (see PprofApiClient) */} - {data.shouldDisplayFlamegraphDotCom && ( - - )} ); }