chore: isHosted -> isCloudHosted for clarity

This commit is contained in:
Tom Moor
2022-05-21 13:34:52 +01:00
parent f2be756cf4
commit 6c8b127ff9
10 changed files with 28 additions and 25 deletions

View File

@@ -9,7 +9,7 @@ import CenteredContent from "~/components/CenteredContent";
import PageTitle from "~/components/PageTitle";
import Text from "~/components/Text";
import env from "~/env";
import isHosted from "~/utils/isHosted";
import isCloudHosted from "~/utils/isCloudHosted";
import Logger from "~/utils/logger";
type Props = WithTranslation & {
@@ -59,7 +59,7 @@ class ErrorBoundary extends React.Component<Props> {
if (this.error) {
const error = this.error;
const isReported = !!env.SENTRY_DSN && isHosted;
const isReported = !!env.SENTRY_DSN && isCloudHosted;
const isChunkError = this.error.message.match(/chunk/);
if (isChunkError) {

View File

@@ -8,7 +8,7 @@ import styled from "styled-components";
import Flex from "~/components/Flex";
import Scrollable from "~/components/Scrollable";
import useAuthorizedSettingsConfig from "~/hooks/useAuthorizedSettingsConfig";
import isHosted from "~/utils/isHosted";
import isCloudHosted from "~/utils/isCloudHosted";
import Sidebar from "./Sidebar";
import Header from "./components/Header";
import Section from "./components/Section";
@@ -51,7 +51,7 @@ function SettingsSidebar() {
</Header>
</Section>
))}
{!isHosted && (
{!isCloudHosted && (
<Section>
<Header title={t("Installation")} />
<Version />

View File

@@ -29,7 +29,7 @@ import Zapier from "~/scenes/Settings/Zapier";
import SlackIcon from "~/components/SlackIcon";
import ZapierIcon from "~/components/ZapierIcon";
import env from "~/env";
import isHosted from "~/utils/isHosted";
import isCloudHosted from "~/utils/isCloudHosted";
import useCurrentTeam from "./useCurrentTeam";
import usePolicy from "./usePolicy";
@@ -163,7 +163,7 @@ const useAuthorizedSettingsConfig = () => {
name: "Slack",
path: "/settings/integrations/slack",
component: Slack,
enabled: can.update && (!!env.SLACK_CLIENT_ID || isHosted),
enabled: can.update && (!!env.SLACK_CLIENT_ID || isCloudHosted),
group: t("Integrations"),
icon: SlackIcon,
},
@@ -171,7 +171,7 @@ const useAuthorizedSettingsConfig = () => {
name: "Zapier",
path: "/settings/integrations/zapier",
component: Zapier,
enabled: can.update && isHosted,
enabled: can.update && isCloudHosted,
group: t("Integrations"),
icon: ZapierIcon,
},

View File

@@ -21,7 +21,7 @@ import env from "~/env";
import useQuery from "~/hooks/useQuery";
import useStores from "~/hooks/useStores";
import { isCustomDomain } from "~/utils/domains";
import isHosted from "~/utils/isHosted";
import isCloudHosted from "~/utils/isCloudHosted";
import { changeLanguage, detectLanguage } from "~/utils/language";
import AuthenticationProvider from "./AuthenticationProvider";
import Notices from "./Notices";
@@ -30,7 +30,7 @@ function Header({ config }: { config?: Config | undefined }) {
const { t } = useTranslation();
const isSubdomain = !!config?.hostname;
if (!isHosted || isCustomDomain()) {
if (!isCloudHosted || isCustomDomain()) {
return null;
}
@@ -103,7 +103,7 @@ function Login() {
<PageTitle title={t("Login")} />
<NoticeAlert>
{t("Failed to load configuration.")}
{!isHosted && (
{!isCloudHosted && (
<p>
{t(
"Check the network requests and server logs for full details of the error."
@@ -158,7 +158,7 @@ function Login() {
<Centered align="center" justify="center" gap={12} column auto>
<PageTitle title={t("Login")} />
<Logo>
{env.TEAM_LOGO && !isHosted ? (
{env.TEAM_LOGO && !isCloudHosted ? (
<TeamLogo src={env.TEAM_LOGO} />
) : (
<OutlineLogo size={38} fill="currentColor" />

View File

@@ -13,7 +13,7 @@ import env from "~/env";
import useCurrentTeam from "~/hooks/useCurrentTeam";
import useStores from "~/hooks/useStores";
import useToasts from "~/hooks/useToasts";
import isHosted from "~/utils/isHosted";
import isCloudHosted from "~/utils/isCloudHosted";
import ImageInput from "./components/ImageInput";
import SettingRow from "./components/SettingRow";
@@ -134,7 +134,7 @@ function Details() {
/>
</SettingRow>
<SettingRow
visible={env.SUBDOMAINS_ENABLED && isHosted}
visible={env.SUBDOMAINS_ENABLED && isCloudHosted}
label={t("Subdomain")}
name="subdomain"
description={

View File

@@ -13,7 +13,7 @@ import env from "~/env";
import useCurrentUser from "~/hooks/useCurrentUser";
import useStores from "~/hooks/useStores";
import useToasts from "~/hooks/useToasts";
import isHosted from "~/utils/isHosted";
import isCloudHosted from "~/utils/isCloudHosted";
import SettingRow from "./components/SettingRow";
function Notifications() {
@@ -48,7 +48,7 @@ function Notifications() {
separator: true,
},
{
visible: isHosted,
visible: isCloudHosted,
event: "emails.onboarding",
title: t("Getting started"),
description: t(
@@ -56,7 +56,7 @@ function Notifications() {
),
},
{
visible: isHosted,
visible: isCloudHosted,
event: "emails.features",
title: t("New features"),
description: t("Receive an email when new features of note are added"),

View File

@@ -21,7 +21,7 @@ import env from "~/env";
import useCurrentTeam from "~/hooks/useCurrentTeam";
import useStores from "~/hooks/useStores";
import useToasts from "~/hooks/useToasts";
import isHosted from "~/utils/isHosted";
import isCloudHosted from "~/utils/isCloudHosted";
import SettingRow from "./components/SettingRow";
function Security() {
@@ -212,7 +212,7 @@ function Security() {
onChange={handleChange}
/>
</SettingRow>
{isHosted && (
{isCloudHosted && (
<SettingRow
label={t("Allow authorized signups")}
name="allowSignups"

View File

@@ -4,7 +4,7 @@ import { trim } from "lodash";
import queryString from "query-string";
import EDITOR_VERSION from "@shared/editor/version";
import stores from "~/stores";
import isHosted from "~/utils/isHosted";
import isCloudHosted from "~/utils/isCloudHosted";
import download from "./download";
import {
AuthorizationError,
@@ -107,7 +107,7 @@ class ApiClient {
// not needed for authentication this offers a performance increase.
// For self-hosted we include them to support a wide variety of
// authenticated proxies, e.g. Pomerium, Cloudflare Access etc.
credentials: isHosted ? "omit" : "same-origin",
credentials: isCloudHosted ? "omit" : "same-origin",
cache: "no-cache",
});
} catch (err) {

View File

@@ -0,0 +1,8 @@
import env from "~/env";
/**
* True if the current installation is the cloud hosted version at getoutline.com
*/
const isCloudHosted = env.DEPLOYMENT === "hosted";
export default isCloudHosted;

View File

@@ -1,5 +0,0 @@
import env from "~/env";
const isHosted = env.DEPLOYMENT === "hosted";
export default isHosted;