From 90a228109a4811017192c21d8c13feef00de8360 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Thu, 28 Mar 2024 15:46:40 +0100 Subject: [PATCH] fix(ui): environment settings title (#1920) ## Describe your changes Fixes NAN-556 - Correct title and reference for environment settings --- docs-v2/host/self-host/self-hosting-instructions.mdx | 4 ++-- docs-v2/reference/api/authentication.mdx | 4 ++-- docs-v2/reference/cli.mdx | 12 ++++++------ packages/cli/lib/cli.ts | 2 +- packages/cli/lib/index.ts | 2 +- packages/webapp/src/App.tsx | 7 ++++--- packages/webapp/src/components/LeftNavBar.tsx | 8 ++++---- .../{ProjectSettings.tsx => EnvironmentSettings.tsx} | 8 ++++---- packages/webapp/src/pages/NotFound.tsx | 1 + 9 files changed, 25 insertions(+), 23 deletions(-) rename packages/webapp/src/pages/{ProjectSettings.tsx => EnvironmentSettings.tsx} (99%) diff --git a/docs-v2/host/self-host/self-hosting-instructions.mdx b/docs-v2/host/self-host/self-hosting-instructions.mdx index 0102b9aa0e..eb0811ba28 100644 --- a/docs-v2/host/self-host/self-hosting-instructions.mdx +++ b/docs-v2/host/self-host/self-hosting-instructions.mdx @@ -20,7 +20,7 @@ SERVER_PORT= The resulting callback URL for OAuth will be `/oauth/callback`. -You can customize the callback URL by updating "Callback URL" field in the "Project Settings" tab in the Nango admin. +You can customize the callback URL by updating "Callback URL" field in the "Environment Settings" tab in the Nango admin. If you are using a custom domain, you should change the `NANGO_SERVER_URL` server environment variable accordingly (in the `.env` file or directly on @@ -87,7 +87,7 @@ encryption key once you have set it. ### Custom websockets path[](#custom-websockets-path 'Direct link to Custom websockets path') -The Nango server serves websockets from the `/` path by default for use by `@nangohq/frontend` during the login flow. +The Nango server serves websockets from the `/` path by default for use by `@nangohq/frontend` during the login flow. If you want more isolation between websockets and the dashboard (also served from `/`), then you can set the `NANGO_SERVER_WEBSOCKETS_PATH` environment variable to serve websockets from a different path: ``` diff --git a/docs-v2/reference/api/authentication.mdx b/docs-v2/reference/api/authentication.mdx index 6c2cc6a822..6dac61722a 100644 --- a/docs-v2/reference/api/authentication.mdx +++ b/docs-v2/reference/api/authentication.mdx @@ -2,8 +2,8 @@ title: 'Authentication' --- -Use the Nango Secret Key available in your [Project Settings](https://app.nango.dev/project-settings) as Bearer token in the `Authorization` header: +Use the Nango Secret Key available in your [Environment Settings](https://app.nango.dev/environment-settings) as Bearer token in the `Authorization` header: ``` Authorization: Bearer {nango-secret-key} -``` \ No newline at end of file +``` diff --git a/docs-v2/reference/cli.mdx b/docs-v2/reference/cli.mdx index 525a203e81..831d8501c6 100644 --- a/docs-v2/reference/cli.mdx +++ b/docs-v2/reference/cli.mdx @@ -6,7 +6,7 @@ icon: 'terminal' ### Install the Nango CLI -Install the Nango CLI globally: +Install the Nango CLI globally: ```bash npm install nango -g ``` @@ -24,7 +24,7 @@ NANGO_SECRET_KEY_PROD='' NANGO_SECRET_KEY_DEV='' ``` -Get your `prod` and `dev` secret keys from the [Project Settings tab](https://app.nango.dev/project-settings) (toggle between the `prod` and `dev` environment in the left nav bar). +Get your `prod` and `dev` secret keys from the [Environment Settings tab](https://app.nango.dev/environment-settings) (toggle between the `prod` and `dev` environment in the left nav bar). For self-hosting, set the `NANGO_HOSTPORT` env variable to `http://localhost:3003` (for local development) or your instance's URL. @@ -32,12 +32,12 @@ For self-hosting, set the `NANGO_HOSTPORT` env variable to `http://localhost:300 ## All CLI commands & command details -Check out all CLI commands by running: +Check out all CLI commands by running: ```bash nango ``` -Get details about a specific command by running: +Get details about a specific command by running: ```bash nango [command] --help ``` @@ -57,14 +57,14 @@ Global command flags: ```bash # Command flag to auto-confirm all prompts (useful for CI). ---auto-confirm +--auto-confirm ``` Environment variables: ```bash # Recommendation: in a ".env" file in ./nango-integrations. -# Authenticates the CLI (get the keys in the dashboard's Projects Settings). +# Authenticates the CLI (get the keys in the dashboard's Environment Settings). NANGO_SECRET_KEY_DEV=xxxx-xxx-xxxx NANGO_SECRET_KEY_PROD=xxxx-xxx-xxxx diff --git a/packages/cli/lib/cli.ts b/packages/cli/lib/cli.ts index 21e709421c..03b58b9311 100644 --- a/packages/cli/lib/cli.ts +++ b/packages/cli/lib/cli.ts @@ -231,7 +231,7 @@ export const init = async (debug = false) => { } fs.writeFileSync( envFileLocation, - `# Authenticates the CLI (get the keys in the dashboard's Projects Settings). + `# Authenticates the CLI (get the keys in the dashboard's Environment Settings). #NANGO_SECRET_KEY_DEV=xxxx-xxx-xxxx #NANGO_SECRET_KEY_PROD=xxxx-xxx-xxxx diff --git a/packages/cli/lib/index.ts b/packages/cli/lib/index.ts index 387420876a..e4bc0e1bc7 100644 --- a/packages/cli/lib/index.ts +++ b/packages/cli/lib/index.ts @@ -57,7 +57,7 @@ Available environment variables available: # Recommendation: in a ".env" file in ./nango-integrations. -# Authenticates the CLI (get the keys in the dashboard's Projects Settings). +# Authenticates the CLI (get the keys in the dashboard's Environment Settings). NANGO_SECRET_KEY_DEV=xxxx-xxx-xxxx NANGO_SECRET_KEY_PROD=xxxx-xxx-xxxx diff --git a/packages/webapp/src/App.tsx b/packages/webapp/src/App.tsx index 56f139baa6..67f02cec12 100644 --- a/packages/webapp/src/App.tsx +++ b/packages/webapp/src/App.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { SWRConfig } from 'swr'; -import { Routes, Route, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes } from 'react-router-dom'; +import { Routes, Route, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes, Navigate } from 'react-router-dom'; import { MantineProvider } from '@mantine/core'; import * as Sentry from '@sentry/react'; import { useSignout } from './utils/user'; @@ -20,7 +20,7 @@ import ShowIntegration from './pages/Integration/Show'; import ConnectionList from './pages/Connection/List'; import Connection from './pages/Connection/Show'; import ConnectionCreate from './pages/Connection/Create'; -import ProjectSettings from './pages/ProjectSettings'; +import { EnvironmentSettings } from './pages/EnvironmentSettings'; import PrivateRoute from './components/PrivateRoute'; import ForgotPassword from './pages/ForgotPassword'; import ResetPassword from './pages/ResetPassword'; @@ -103,7 +103,8 @@ const App = () => { } /> } /> } /> - } /> + } /> + } /> {AUTH_ENABLED && ( <> } /> diff --git a/packages/webapp/src/components/LeftNavBar.tsx b/packages/webapp/src/components/LeftNavBar.tsx index 72622c31f9..37379578e4 100644 --- a/packages/webapp/src/components/LeftNavBar.tsx +++ b/packages/webapp/src/components/LeftNavBar.tsx @@ -22,7 +22,7 @@ import { useEnvironment } from '../hooks/useEnvironment'; export enum LeftNavBarItems { Integrations = 0, Connections, - ProjectSettings, + EnvironmentSettings, Activity, Syncs, AccountSettings, @@ -172,13 +172,13 @@ export default function LeftNavBar(props: LeftNavBarProps) {

Activity

Environment Settings

diff --git a/packages/webapp/src/pages/ProjectSettings.tsx b/packages/webapp/src/pages/EnvironmentSettings.tsx similarity index 99% rename from packages/webapp/src/pages/ProjectSettings.tsx rename to packages/webapp/src/pages/EnvironmentSettings.tsx index a3d60cc78b..7751aa638b 100644 --- a/packages/webapp/src/pages/ProjectSettings.tsx +++ b/packages/webapp/src/pages/EnvironmentSettings.tsx @@ -23,7 +23,7 @@ import { useStore } from '../store'; import Button from '../components/ui/button/Button'; import { useEnvironment } from '../hooks/useEnvironment'; -export default function ProjectSettings() { +export const EnvironmentSettings: React.FC = () => { const [secretKey, setSecretKey] = useState(''); const [secretKeyRotatable, setSecretKeyRotatable] = useState(true); const [hasPendingSecretKey, setHasPendingSecretKey] = useState(false); @@ -386,7 +386,7 @@ export default function ProjectSettings() { }; return ( - +
@@ -437,7 +437,7 @@ export default function ProjectSettings() { {secretKey && (
-

Project Settings

+

Environment Settings

@@ -947,4 +947,4 @@ export default function ProjectSettings() { )} ); -} +}; diff --git a/packages/webapp/src/pages/NotFound.tsx b/packages/webapp/src/pages/NotFound.tsx index 4a64b29989..3a873b7d05 100644 --- a/packages/webapp/src/pages/NotFound.tsx +++ b/packages/webapp/src/pages/NotFound.tsx @@ -10,6 +10,7 @@ const VALID_PATHS = [ 'connections', 'activity', 'project-settings', + 'environment-settings', 'user-settings', 'account-settings' ];