Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Ui): Remove export to flamegraph.com #3729

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions public/app/components/ExportData.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,6 @@ describe('ExportData', () => {
render(<ExportData exportHTML flamebearer={TestData} />);
screen.getByRole('button', { name: /html/i });
});

describe('the "flamegraph.com" export button', () => {
it('is enabled by default"', () => {
render(<ExportData flamebearer={TestData} />);
screen.getByRole('button', { name: /flamegraph\.com/i });
});

it('can be enabled"', () => {
render(<ExportData exportFlamegraphDotCom flamebearer={TestData} />);
screen.getByRole('button', { name: /flamegraph\.com/i });
});

it('can be disabled"', () => {
render(
<ExportData exportFlamegraphDotCom={false} flamebearer={TestData} />
);
expect(
screen.queryByRole('button', { name: /flamegraph\.com/i })
).not.toBeInTheDocument();
});
});
});

describe('filename', () => {
Expand Down
45 changes: 0 additions & 45 deletions public/app/components/ExportData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -346,16 +311,6 @@ function ExportData(props: ExportDataProps) {
html
</button>
)}
{exportFlamegraphDotCom && (
<button
className={styles.dropdownMenuItem}
type="button"
onClick={downloadFlamegraphDotCom}
>
{' '}
flamegraph.com
</button>
)}
</div>
</OutsideClickHandler>
</div>
Expand Down
Loading