Skip to content

Commit

Permalink
🪟 🔧 Remove demo mode from UI (#15746)
Browse files Browse the repository at this point in the history
* remove demo mode from UI

* remove merge conflict
  • Loading branch information
lmossman authored Aug 23, 2022
1 parent 3134619 commit 874d02a
Show file tree
Hide file tree
Showing 21 changed files with 4 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ services:
- AIRBYTE_ROLE=${AIRBYTE_ROLE:-}
- AIRBYTE_VERSION=${VERSION}
- API_URL=${API_URL:-}
- IS_DEMO=${IS_DEMO:-}
- FULLSTORY=${FULLSTORY:-}
- TRACKING_STRATEGY=${TRACKING_STRATEGY}
- INTERNAL_API_HOST=${INTERNAL_API_HOST}
Expand Down
6 changes: 3 additions & 3 deletions airbyte-webapp/docs/HowTo-EnvVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Dynamic env variables in our cases are injected into app by nginx
window.FULLSTORY = "$FULLSTORY";
window.AIRBYTE_VERSION = "$AIRBYTE_VERSION";
window.API_URL = "$API_URL";
window.IS_DEMO = "$IS_DEMO";
</script>;
</script>
;
```

later we can use any of the declared variables from window
later we can use any of the declared variables from window
1 change: 0 additions & 1 deletion airbyte-webapp/nginx/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ server {
window.FULLSTORY = "$FULLSTORY";
window.AIRBYTE_VERSION = "$AIRBYTE_VERSION";
window.API_URL = "$API_URL";
window.IS_DEMO = "$IS_DEMO";
</script>';
sub_filter_once on;
}
Expand Down
1 change: 0 additions & 1 deletion airbyte-webapp/src/config/configProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const windowConfigProvider: ConfigProvider = async () => {
},
apiUrl: window.API_URL,
version: window.AIRBYTE_VERSION,
isDemo: window.IS_DEMO === "true",
// cloud only start
// TODO: remove when infra team supports proper webapp building
cloud: window.CLOUD === "true",
Expand Down
1 change: 0 additions & 1 deletion airbyte-webapp/src/config/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const defaultConfig: Config = {
apiUrl: `${window.location.protocol}//${window.location.hostname}:8001/api`,
integrationUrl: "/docs",
oauthRedirectUrl: `${window.location.protocol}//${window.location.host}`,
isDemo: false,
};

export { defaultConfig };
2 changes: 0 additions & 2 deletions airbyte-webapp/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ declare global {
TRACKING_STRATEGY?: string;
AIRBYTE_VERSION?: string;
API_URL?: string;
IS_DEMO?: string;
CLOUD?: string;
REACT_APP_SENTRY_DSN?: string;
REACT_APP_WEBAPP_TAG?: string;
Expand All @@ -25,7 +24,6 @@ export interface Config {
apiUrl: string;
oauthRedirectUrl: string;
healthCheckInterval: number;
isDemo: boolean;
version?: string;
integrationUrl: string;
launchDarkly?: string;
Expand Down
3 changes: 0 additions & 3 deletions airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,6 @@
"credits.creditUsage": "Credit Usage",
"credits.totalUsage": "Total usage",

"demo.message.title": "This Airbyte demo is read-only",
"demo.message.body": "You cannot add or edit any connectors. You will see error messages on purpose if you try to do so.",

"docs.notFoundError": "We were not able to receive docs. Please click the link above to open docs on our website",
"errorView.notFound": "Resource not found.",
"errorView.notAuthorized": "You don’t have permission to access this page.",
Expand Down
21 changes: 0 additions & 21 deletions airbyte-webapp/src/pages/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import React, { useMemo } from "react";
import { useIntl } from "react-intl";
import { Navigate, Route, Routes, useLocation } from "react-router-dom";
import { useEffectOnce } from "react-use";

import ApiErrorBoundary from "components/ApiErrorBoundary";

import { useConfig } from "config";
import { useAnalyticsIdentifyUser, useAnalyticsRegisterValues } from "hooks/services/Analytics";
import { useTrackPageAnalytics } from "hooks/services/Analytics/useTrackPageAnalytics";
import { useApiHealthPoll } from "hooks/services/Health";
import { useNotificationService } from "hooks/services/Notification";
import { OnboardingServiceProvider } from "hooks/services/Onboarding";
import { useCurrentWorkspace } from "hooks/services/useWorkspace";
import { useListWorkspaces } from "services/workspaces/WorkspacesService";
Expand All @@ -26,23 +23,6 @@ import { RoutePaths } from "./routePaths";
import SettingsPage from "./SettingsPage";
import SourcesPage from "./SourcesPage";

function useDemo() {
const { formatMessage } = useIntl();
const config = useConfig();

const demoNotification = useMemo(
() => ({
id: "demo.message",
title: formatMessage({ id: "demo.message.title" }),
text: formatMessage({ id: "demo.message.body" }),
nonClosable: true,
}),
[formatMessage]
);

useNotificationService(config.isDemo ? demoNotification : undefined);
}

const useAddAnalyticsContextForWorkspace = (workspace: WorkspaceRead): void => {
const analyticsContext = useMemo(
() => ({
Expand Down Expand Up @@ -103,7 +83,6 @@ const RoutingWithWorkspace: React.FC = () => {
useAddAnalyticsContextForWorkspace(workspace);
useTrackPageAnalytics();
useApiHealthPoll();
useDemo();

return (
<OnboardingServiceProvider>
Expand Down
1 change: 0 additions & 1 deletion charts/airbyte-webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Helm chart to deploy airbyte-webapp
| ingress.enabled | bool | `false` | |
| ingress.hosts | list | `[]` | |
| ingress.tls | list | `[]` | |
| isDemo | bool | `false` | |
| livenessProbe.enabled | bool | `true` | |
| livenessProbe.failureThreshold | int | `3` | |
| livenessProbe.initialDelaySeconds | int | `30` | |
Expand Down
5 changes: 0 additions & 5 deletions charts/airbyte-webapp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ spec:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: FULLSTORY
- name: IS_DEMO
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-airbyte-env
key: IS_DEMO
- name: INTERNAL_API_HOST
valueFrom:
configMapKeyRef:
Expand Down
5 changes: 0 additions & 5 deletions charts/airbyte-webapp/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

global:
serviceAccountName: placeholderServiceAccount
deploymentMode: oss
Expand All @@ -11,7 +10,6 @@ global:
host: "example.com"
port: "5432"


enabled: true
## @param webapp.replicaCount Number of webapp replicas
replicaCount: 1
Expand Down Expand Up @@ -138,9 +136,6 @@ ingress:
api:
url: /api/v1/

## @param webapp.isDemo Set to true if this is a demo
isDemo: false

## @param webapp.fullstory.enabled Whether or not to enable fullstory
fullstory:
enabled: false
Expand Down
1 change: 0 additions & 1 deletion charts/airbyte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ Helm chart to deploy airbyte
| webapp.ingress.enabled | bool | `false` | |
| webapp.ingress.hosts | list | `[]` | |
| webapp.ingress.tls | list | `[]` | |
| webapp.isDemo | bool | `false` | |
| webapp.livenessProbe.enabled | bool | `true` | |
| webapp.livenessProbe.failureThreshold | int | `3` | |
| webapp.livenessProbe.initialDelaySeconds | int | `30` | |
Expand Down
1 change: 0 additions & 1 deletion charts/airbyte/templates/env-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ data:
GCS_LOG_BUCKET: {{ .Values.global.logs.gcs.bucket | quote }}
GOOGLE_APPLICATION_CREDENTIALS: {{ include "airbyte.gcpLogCredentialsPath" . | quote }}
INTERNAL_API_HOST: {{ .Release.Name }}-server-svc:{{ .Values.server.service.port }}
IS_DEMO: {{ ternary "true" "false" .Values.webapp.isDemo | quote }}
{{- if $.Values.global.jobs.kube.annotations }}
JOB_KUBE_ANNOTATIONS: {{ $.Values.global.jobs.kube.annotations | include "airbyte.flattenMap" | quote }}
{{- end }}
Expand Down
3 changes: 0 additions & 3 deletions charts/airbyte/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,6 @@ webapp:
api:
url: /api/v1/

## @param webapp.isDemo Set to true if this is a demo
isDemo: false

## @param webapp.fullstory.enabled Whether or not to enable fullstory
fullstory:
enabled: false
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ services:
- API_URL=${API_URL:-}
- FULLSTORY=${FULLSTORY:-}
- INTERNAL_API_HOST=${INTERNAL_API_HOST}
- IS_DEMO=${IS_DEMO:-}
- OPENREPLAY=${OPENREPLAY:-}
- PAPERCUPS_STORYTIME=${PAPERCUPS_STORYTIME:-}
- TRACKING_STRATEGY=${TRACKING_STRATEGY}
Expand Down
1 change: 0 additions & 1 deletion kube/overlays/dev-integration-test/.env
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ INTERNAL_API_HOST=airbyte-server-svc:8001

WORKER_ENVIRONMENT=kubernetes
FULLSTORY=disabled
IS_DEMO=false
LOG_LEVEL=INFO

# S3/Minio Log Configuration
Expand Down
1 change: 0 additions & 1 deletion kube/overlays/dev/.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ INTERNAL_API_HOST=airbyte-server-svc:8001

WORKER_ENVIRONMENT=kubernetes
FULLSTORY=disabled
IS_DEMO=false
LOG_LEVEL=INFO

# S3/Minio Log Configuration
Expand Down
1 change: 0 additions & 1 deletion kube/overlays/stable-with-resource-limits/.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ INTERNAL_API_HOST=airbyte-server-svc:8001

WORKER_ENVIRONMENT=kubernetes
FULLSTORY=enabled
IS_DEMO=false
LOG_LEVEL=INFO

# S3/Minio Log Configuration
Expand Down
1 change: 0 additions & 1 deletion kube/overlays/stable/.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ INTERNAL_API_HOST=airbyte-server-svc:8001

WORKER_ENVIRONMENT=kubernetes
FULLSTORY=enabled
IS_DEMO=false
LOG_LEVEL=INFO

# S3/Minio Log Configuration
Expand Down
5 changes: 0 additions & 5 deletions kube/resources/webapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ spec:
configMapKeyRef:
name: airbyte-env
key: FULLSTORY
- name: IS_DEMO
valueFrom:
configMapKeyRef:
name: airbyte-env
key: IS_DEMO
- name: INTERNAL_API_HOST
valueFrom:
configMapKeyRef:
Expand Down
2 changes: 1 addition & 1 deletion terraform/aws/demo/core/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ install_docker_compose() {
install_airbyte() {
mkdir airbyte && cd airbyte
wget https://raw.githubusercontent.com/airbytehq/airbyte/master/{.env,docker-compose.yaml}
API_URL=/api/v1/ AIRBYTE_ROLE=demo IS_DEMO=true docker-compose up -d
API_URL=/api/v1/ AIRBYTE_ROLE=demo docker-compose up -d
}

install_demo_pg() {
Expand Down

0 comments on commit 874d02a

Please sign in to comment.