From 9ac9e47d5a95b20cf1f7ecb39be1480692dd6771 Mon Sep 17 00:00:00 2001 From: "Marc M." <146180665+grafakus@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:01:42 +0100 Subject: [PATCH] feat(Ui): Remove export to flamegraph.com (#3729) --- public/app/components/ExportData.spec.tsx | 21 ----------- public/app/components/ExportData.tsx | 45 ----------------------- 2 files changed, 66 deletions(-) diff --git a/public/app/components/ExportData.spec.tsx b/public/app/components/ExportData.spec.tsx index 6512da47b9..2a83a9c746 100644 --- a/public/app/components/ExportData.spec.tsx +++ b/public/app/components/ExportData.spec.tsx @@ -71,27 +71,6 @@ describe('ExportData', () => { render(); screen.getByRole('button', { name: /html/i }); }); - - describe('the "flamegraph.com" export button', () => { - it('is enabled by default"', () => { - render(); - screen.getByRole('button', { name: /flamegraph\.com/i }); - }); - - it('can be enabled"', () => { - render(); - screen.getByRole('button', { name: /flamegraph\.com/i }); - }); - - it('can be disabled"', () => { - render( - - ); - expect( - screen.queryByRole('button', { name: /flamegraph\.com/i }) - ).not.toBeInTheDocument(); - }); - }); }); describe('filename', () => { diff --git a/public/app/components/ExportData.tsx b/public/app/components/ExportData.tsx index 9904f5bf96..67ea8b27d0 100644 --- a/public/app/components/ExportData.tsx +++ b/public/app/components/ExportData.tsx @@ -14,7 +14,6 @@ import { createBiggestInterval } from '@pyroscope/util/timerange'; import { downloadWithOrgID } from '@pyroscope/services/base'; import { faShareSquare } from '@fortawesome/free-solid-svg-icons/faShareSquare'; import { Field, Message } from 'protobufjs/light'; -import { flameGraphUpload } from '@pyroscope/services/flamegraphcom'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { format } from 'date-fns'; import { isRouteActive, ROUTES } from '@pyroscope/pages/routes'; @@ -173,40 +172,6 @@ function ExportData(props: ExportDataProps) { } }; - const downloadFlamegraphDotCom = async () => { - if (!exportFlamegraphDotCom) { - return; - } - - const { flamebearer } = props; - - const defaultExportName = getFilename( - flamebearer.metadata.appName, - flamebearer.metadata.startTime, - flamebearer.metadata.endTime - ); - // get user input from modal - const customExportName = await getCustomExportName(defaultExportName); - // return if user cancels the modal - if (!customExportName) { - return; - } - - const url = await flameGraphUpload(customExportName, flamebearer); - if (url.isErr) { - handleError(dispatch, 'Failed to export to flamegraph.com', url.error); - return; - } - - const dlLink = document.createElement('a'); - dlLink.target = '_blank'; - dlLink.href = url.value; - - document.body.appendChild(dlLink); - dlLink.click(); - document.body.removeChild(dlLink); - }; - const downloadPNG = async () => { if (exportPNG) { const { flamebearer } = props; @@ -346,16 +311,6 @@ function ExportData(props: ExportDataProps) { html )} - {exportFlamegraphDotCom && ( - - )}