Skip to content

Rename to self-hosted in (most of) frontend #30558

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

Closed
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
3 changes: 2 additions & 1 deletion src/sentry/web/client_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def get_client_config(request=None):
"statuspage": _get_statuspage(),
"messages": [{"message": msg.message, "level": msg.tags} for msg in messages],
"apmSampling": float(settings.SENTRY_FRONTEND_APM_SAMPLING or 0),
"isOnPremise": settings.SENTRY_SELF_HOSTED,
"isOnPremise": settings.SENTRY_SELF_HOSTED, # deprecated, use ...
"isSelfHosted": settings.SENTRY_SELF_HOSTED, # ... this instead
"invitesEnabled": settings.SENTRY_ENABLE_INVITES,
"gravatarBaseUrl": settings.SENTRY_GRAVATAR_BASE_URL,
"termsUrl": settings.TERMS_URL,
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/web/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def get_default_context(request, existing_context=None, team=None):
"URL_PREFIX": options.get("system.url-prefix"),
"SINGLE_ORGANIZATION": settings.SENTRY_SINGLE_ORGANIZATION,
"PLUGINS": plugins,
"ONPREMISE": settings.SENTRY_SELF_HOSTED,
"ONPREMISE": settings.SENTRY_SELF_HOSTED, # deprecated, use ...
"SELF_HOSTED": settings.SENTRY_SELF_HOSTED, # ... this instead
}

if existing_context:
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function BaseFooter({className}: Props) {
return (
<footer className={className}>
<LeftLinks>
{config.isOnPremise && (
{config.isSelfHosted && (
<Fragment>
{'Sentry '}
{getDynamicText({
Expand Down Expand Up @@ -47,7 +47,7 @@ function BaseFooter({className}: Props) {
<FooterLink href="https://github.com/getsentry/sentry">
{t('Contribute')}
</FooterLink>
{config.isOnPremise && !config.demoMode && (
{config.isSelfHosted && !config.demoMode && (
<FooterLink href="/out/">{t('Migrate to SaaS')}</FooterLink>
)}
</RightLinks>
Expand Down
3 changes: 2 additions & 1 deletion static/app/types/system.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export interface Config {
invitesEnabled: boolean;
privacyUrl: string | null;
termsUrl: string | null;
isOnPremise: boolean;
isOnPremise: boolean; // deprecated, use ...
isSelfHosted: boolean; // ... this instead
lastOrganization: string | null;
gravatarBaseUrl: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class SetupAlertIntegrationButton extends AsyncComponent<Props, S
const config = ConfigStore.getConfig();
// link to docs to set up Slack for on-prem folks
const referrerQuery = '?referrer=issue-alert-builder';
const buttonProps = config.isOnPremise
const buttonProps = config.isSelfHosted
? {
href: `https://develop.sentry.dev/integrations/slack/${referrerQuery}`,
}
Expand Down
12 changes: 6 additions & 6 deletions static/app/views/settings/settingsIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ class SettingsIndex extends React.Component<Props> {
render() {
const {organization} = this.props;
const user = ConfigStore.get('user');
const isOnPremise = ConfigStore.get('isOnPremise');
const isSelfHosted = ConfigStore.get('isSelfHosted');

const organizationSettingsUrl =
(organization && `/settings/${organization.slug}/`) || '';

const supportLinkProps = {
isOnPremise,
isSelfHosted,
href: LINKS.FORUM,
to: `${organizationSettingsUrl}support`,
};
const supportText = isOnPremise ? t('Community Forums') : t('Contact Support');
const supportText = isSelfHosted ? t('Community Forums') : t('Contact Support');

return (
<SentryDocumentTitle
Expand Down Expand Up @@ -340,7 +340,7 @@ const ExternalHomeLink = styled(
`;

type SupportLinkProps<T extends boolean> = {
isOnPremise: T;
isSelfHosted: T;
href: string;
to: string;
isCentered?: boolean;
Expand All @@ -350,12 +350,12 @@ type SupportLinkProps<T extends boolean> = {

const SupportLinkComponent = <T extends boolean>({
isCentered,
isOnPremise,
isSelfHosted,
href,
to,
...props
}: SupportLinkProps<T>) =>
isOnPremise ? (
isSelfHosted ? (
<ExternalHomeLink isCentered={isCentered} href={href} {...props} />
) : (
<HomeLink to={to} {...props} />
Expand Down
3 changes: 2 additions & 1 deletion tests/fixtures/js-stubs/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export function Config(params = {}) {
invitesEnabled: false,
privacyUrl: null,
termsUrl: null,
isOnPremise: false,
isOnPremise: false, // deprecated, use ...
isSelfHosted: false, // ... this instead
lastOrganization: null,
gravatarBaseUrl: 'https://gravatar.com',
dsn: 'test-dsn',
Expand Down
6 changes: 3 additions & 3 deletions tests/js/spec/views/settings/settingsIndex.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ describe('SettingsIndex', function () {
expect(wrapper.find('LoadingIndicator')).toHaveLength(1);
});

it('has different links for on premise users', function () {
ConfigStore.set('isOnPremise', true);
it('has different links for self-hosted users', function () {
ConfigStore.set('isSelfHosted', true);

wrapper = mountWithTheme(
<SettingsIndex
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('SettingsIndex', function () {
api = MockApiClient.addMockResponse({
url: `/organizations/${organization.slug}/`,
});
ConfigStore.config.isOnPremise = false;
ConfigStore.config.isSelfHosted = false;
wrapper = mountWithTheme(
<SettingsIndex router={TestStubs.router()} params={{}} />,
TestStubs.routerContext()
Expand Down