Files
zeekayandHanzo Dev f888991a7a drop the Sentry wordmark from the react app
FSL-1.0-Apache-2.0 grants us the code, not the name. "Sentry" is
Functional Software's trademark, so every place the running app says it
to a user -- page titles, onboarding, empty states, toasts, settings
copy, the self-hosted footer -- now says Sentinel.

Attribution is the other half of the deal and stays untouched: upstream
copyright headers, LICENSE, NOTICE. So does anything where the mark is a
fact rather than a brand -- @sentry/* packages, sentry-cli, the wizard
and bundler plugins, docs.sentry.io, the whole gettingStartedDocs tree.
Renaming those would leave instructions that no longer work.

Nothing structural moved. No import, identifier, route path, feature
flag, API field or test id changed; the diff is 312 lines in and 312
out. Colocated specs were updated in lockstep with the copy they assert.
Marketing and community links point at hanzo.ai, only where a real page
exists to point at.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-10 18:01:22 -07:00

130 lines
4.1 KiB
TypeScript

import type {RouteComponentProps} from 'react-router';
import styled from '@emotion/styled';
import * as Sentry from '@sentry/react';
import Access from 'sentry/components/acl/access';
import {Button} from 'sentry/components/button';
import Form from 'sentry/components/forms/form';
import JsonForm from 'sentry/components/forms/jsonForm';
import formGroups from 'sentry/data/forms/userFeedback';
import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import type {Organization, Project} from 'sentry/types';
import routeTitleGen from 'sentry/utils/routeTitle';
import withOrganization from 'sentry/utils/withOrganization';
import DeprecatedAsyncView from 'sentry/views/deprecatedAsyncView';
import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';
import TextBlock from 'sentry/views/settings/components/text/textBlock';
import PermissionAlert from 'sentry/views/settings/project/permissionAlert';
type RouteParams = {
projectId: string;
};
type Props = RouteComponentProps<RouteParams, {}> & {
organization: Organization;
project: Project;
};
class ProjectUserFeedbackSettings extends DeprecatedAsyncView<Props> {
submitTimeout: number | undefined = undefined;
componentDidMount() {
super.componentDidMount();
window.sentryEmbedCallback = function (embed) {
// Mock the embed's submit xhr to always be successful
// NOTE: this will not have errors if the form is empty
embed.submit = function (_body) {
this._submitInProgress = true;
window.setTimeout(() => {
this._submitInProgress = false;
this.onSuccess();
}, 500);
};
};
}
componentWillUnmount() {
window.sentryEmbedCallback = null;
}
getEndpoints(): ReturnType<DeprecatedAsyncView['getEndpoints']> {
const {organization} = this.props;
const {projectId} = this.props.params;
return [
['keyList', `/projects/${organization.slug}/${projectId}/keys/`],
['project', `/projects/${organization.slug}/${projectId}/`],
];
}
getTitle(): string {
const {projectId} = this.props.params;
return routeTitleGen(t('User Feedback'), projectId, false);
}
handleClick = () => {
Sentry.showReportDialog({
// should never make it to the Sentry API, but just in case, use throwaway id
eventId: '00000000000000000000000000000000',
});
};
renderBody() {
const {organization, project} = this.props;
const {projectId} = this.props.params;
return (
<div>
<SettingsPageHeader
title={t('User Feedback')}
action={
<ButtonList>
<Button external href="https://docs.sentry.io/product/user-feedback/">
{t('Read the docs')}
</Button>
<Button priority="primary" onClick={this.handleClick}>
{t('Open the report dialog')}
</Button>
</ButtonList>
}
/>
<TextBlock>
{t(
`Don't rely on stack traces and graphs alone to understand
the cause and impact of errors. Enable User Feedback to collect
your users' comments when they encounter a crash or bug.`
)}
</TextBlock>
<TextBlock>
{t(
`When configured, your users will be presented with a dialog prompting
them for additional information. That information will get attached to
the issue in Sentinel.`
)}
</TextBlock>
<PermissionAlert project={project} />
<Form
saveOnBlur
apiMethod="PUT"
apiEndpoint={`/projects/${organization.slug}/${projectId}/`}
initialData={this.state.project.options}
>
<Access access={['project:write']} project={project}>
{({hasAccess}) => <JsonForm disabled={!hasAccess} forms={formGroups} />}
</Access>
</Form>
</div>
);
}
}
const ButtonList = styled('div')`
display: inline-grid;
grid-auto-flow: column;
gap: ${space(1)};
`;
export default withOrganization(ProjectUserFeedbackSettings);