Skip to content

πŸ“ˆ Open source, privacy-first web analytics β€” a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Improve project settings text copy

Blue Mouseab582f198a32
diff --git a/docs/content/docs/analytics-dashboard/revenue-tracking.mdx b/docs/content/docs/analytics-dashboard/revenue-tracking.mdx
index 64c9f833c..543a4df7e 100644
--- a/docs/content/docs/analytics-dashboard/revenue-tracking.mdx
+++ b/docs/content/docs/analytics-dashboard/revenue-tracking.mdx
@@ -15,8 +15,9 @@ Once connected, revenue appears as a metric in your [Traffic Analytics](/analyti
<Steps>
<Step>
- ### Connect a source Open **Project Settings &gt; Revenue** and pick Stripe, Paddle, or the API.
- Choose the display currency Swetrix should report in (USD, EUR, or GBP).
+ ### Connect a source Open **Project Settings &gt; Revenue** and connect Stripe or Paddle from
+ its provider section, or use the API by sending your first transaction. Choose the reporting
+ currency Swetrix should use in your analytics (USD, EUR, or GBP).
</Step>
<Step>
### Send or sync transactions Stripe and Paddle are pulled automatically every 30 minutes via
@@ -173,7 +174,7 @@ Use this option to track revenue from any platform β€” JTL Shop, Shopify, WooCom
| `pid` | string | yes | Your Swetrix project ID. |
| `type` | `sale` \| `refund` \| `subscription` | yes | Transaction type. Use `refund` for refunds β€” the amount sign is handled automatically. |
| `amount` | number | yes | Amount in major units (e.g. `49.99` for €49.99). Always send a positive number. |
-| `currency` | string | yes | ISO 4217 currency code (e.g. `USD`, `EUR`). Converted to your project's display currency automatically. |
+| `currency` | string | yes | ISO 4217 currency code (e.g. `USD`, `EUR`). Converted to your project's reporting currency automatically. |
| `transactionId` | string | no | Stable unique identifier. Re-sending the same `transactionId` replaces the previous version (idempotent). If omitted, a UUID is generated. |
| `productId` | string | no | Optional SKU / product identifier. |
| `productName` | string | no | Optional human-readable product name shown in the transactions table. |
@@ -194,12 +195,12 @@ Use this option to track revenue from any platform β€” JTL Shop, Shopify, WooCom
<Steps>
<Step>
### Open the Revenue settings
- Go to your project dashboard and open **Project Settings &gt; Revenue**, then select **Stripe** as the provider.
+ Go to your project dashboard and open **Project Settings &gt; Revenue**. The Stripe section shows whether Stripe is connected and includes the API key field.
</Step>
<Step>
### Create a restricted API key
- The settings page includes a direct link to create a Stripe restricted key with the correct permissions pre-selected β€” just click "Create key on Stripe" and confirm.
+ The settings page includes a direct link to create a Stripe restricted key with the correct permissions pre-selected. Click **Create a key in Stripe** and confirm it in Stripe.
Swetrix needs the following read-only permissions:
@@ -210,7 +211,7 @@ Use this option to track revenue from any platform β€” JTL Shop, Shopify, WooCom
<Step>
### Connect
- Paste the restricted key (starts with `rk_live_`) into the API key field, choose your display currency, and click **Connect**. Swetrix converts all transactions to this currency automatically.
+ Paste the restricted key (starts with `rk_live_`) into the Stripe API key field and click **Connect**. Use **Reporting settings** on the same page to choose the currency Swetrix should use in analytics.
</Step>
</Steps>
@@ -221,7 +222,7 @@ Use this option to track revenue from any platform β€” JTL Shop, Shopify, WooCom
<Steps>
<Step>
### Open the Revenue settings
- Go to your project dashboard and open **Project Settings &gt; Revenue**, then select **Paddle** as the provider.
+ Go to your project dashboard and open **Project Settings &gt; Revenue**. The Paddle section shows whether Paddle is connected and includes the API key field.
</Step>
<Step>
### Generate a Paddle API key
@@ -234,7 +235,7 @@ Use this option to track revenue from any platform β€” JTL Shop, Shopify, WooCom
<Step>
### Connect
- Paste the API key (starts with `pdl_live_`) into the API key field, choose your display currency, and click **Connect**.
+ Paste the API key (starts with `pdl_live_`) into the Paddle API key field and click **Connect**. Use **Reporting settings** on the same page to choose the currency Swetrix should use in analytics.
</Step>
</Steps>
@@ -339,9 +340,9 @@ If a profile ID is found, the transaction is linked to that visitor's profile in
## Managing your connection
-You can disconnect or change your revenue source at any time from **Project Settings &gt; Revenue**. Disconnecting removes the API key (or disables API ingestion) but keeps previously recorded revenue data in your dashboard.
+You can disconnect or change your connected provider at any time from **Project Settings &gt; Revenue**. Disconnecting removes the API key (or disables API ingestion) but keeps previously recorded revenue data in your dashboard.
-To change the display currency after connecting, use the currency selector on the same settings page. Currency conversion is applied to all transactions (past and future) based on exchange rates at sync time.
+To change the reporting currency after connecting, use **Reporting settings** on the same settings page. Currency conversion is applied to all transactions (past and future) based on exchange rates at sync time.
<Callout type="info">
A project can only have one active revenue source at a time. If a Stripe or Paddle key is
diff --git a/docs/content/docs/api/admin.mdx b/docs/content/docs/api/admin.mdx
index e1a3b7a8f..2f5513d29 100644
--- a/docs/content/docs/api/admin.mdx
+++ b/docs/content/docs/api/admin.mdx
@@ -31,18 +31,18 @@ If you have special needs for more requests, please [contact us](https://swetrix
#### 'Update project' payload
-| Name | Type | Description |
-| --------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `name` | `string` | A display name for your project, max length is 50 chars. |
-| `isCaptcha` | `boolean` | (Only supported when creating a new project). Set to `true` if your project is a [CAPTCHA](/captcha/introduction) project. `false` by default. |
-| `active` | `boolean` | Set to `true` if your project should be active and accept incoming traffic. |
-| `public` | `boolean` | Set to `true` if your project should have a publicly available dashboard. |
-| `isPasswordProtected` | `boolean` | Set to `true` if your project's dashboard should be password protected. `false` by default. |
-| `password` | `string` | Required only if `isPasswordProtected` is set to `true`. That is the password unauthorised people will have to enter to access your project's dashboard. |
-| `origins` | `Array<string>` | An array of origins (domains) which are allowed to use script with your ProjectID. For example: `['cornell.edu', 'app.example.com', '*.gov.ua']`. By default all origins are allowed. |
-| `ipBlacklist` | `Array<string>` | An aeeay of IP addresses from which no analytics will be collected on this project. This functionality is handy if you want to ignore analytics from your IP. For example: `['172.126.10.16', '192.168.0.1/32', '::1']` |
-| `botsProtectionLevel` | `off` or `basic` | Set to `basic` or `off`. `basic` will block common bots by user agent and `off` will allow all traffic. `basic` by default. |
-| `organisationId` | `string` | Organisation you want to add this project to. You must be an owner or admin of the organisation to add a project to it. |
+| Name | Type | Description |
+| --------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `name` | `string` | A display name for your project, max length is 50 chars. |
+| `isCaptcha` | `boolean` | (Only supported when creating a new project). Set to `true` if your project is a [CAPTCHA](/captcha/introduction) project. `false` by default. |
+| `active` | `boolean` | Set to `true` to collect analytics data. Set to `false` to stop collecting new events while keeping existing data and settings available. |
+| `public` | `boolean` | Set to `true` if your project should have a publicly available dashboard. |
+| `isPasswordProtected` | `boolean` | Set to `true` if your project's dashboard should be password protected. `false` by default. |
+| `password` | `string` | Required only if `isPasswordProtected` is set to `true`. That is the password unauthorised people will have to enter to access your project's dashboard. |
+| `origins` | `Array<string>` | Domains allowed to send analytics using this Project ID. Traffic from all other domains is blocked. Supports wildcards, for example: `['cornell.edu', 'app.example.com', '*.gov.uk']`. An empty array allows all domains. |
+| `ipBlacklist` | `Array<string>` | IP addresses or CIDR ranges whose traffic should be ignored for this project. Useful for excluding your own visits. For example: `['172.126.10.16', '192.168.0.1/32', '::1']`. |
+| `botsProtectionLevel` | `off`, `basic`, or `strict` | Choose how aggressively bot and automated traffic should be filtered. `off` tracks all traffic, `basic` filters common bots, and `strict` adds stronger automated-traffic checks. `basic` by default. |
+| `organisationId` | `string` | Organisation you want to add this project to. You must be an owner or admin of the organisation to add a project to it. |
### Organisations manipulation
diff --git a/docs/content/docs/api/events.mdx b/docs/content/docs/api/events.mdx
index 05e263ec2..edaa60dba 100644
--- a/docs/content/docs/api/events.mdx
+++ b/docs/content/docs/api/events.mdx
@@ -118,7 +118,7 @@ All of the values are numbers in milliseconds.
| `pid` | `string` | `true` | A project ID to record the revenue event for |
| `type` | `'sale' \| 'refund' \| 'subscription'` | `true` | Transaction type. Use `refund` for refunds β€” the amount sign is handled automatically. |
| `amount` | `number` | `true` | Amount in major units (e.g. `49.99` for €49.99). Always send a positive number; the sign is flipped server-side for refunds. |
-| `currency` | `string` | `true` | ISO 4217 currency code (e.g. `USD`, `EUR`). Converted to your project's display currency automatically. |
+| `currency` | `string` | `true` | ISO 4217 currency code (e.g. `USD`, `EUR`). Converted to your project's reporting currency automatically. |
| `transactionId` | `string` | `false` | Stable unique identifier. Re-sending the same `transactionId` replaces the previous version (idempotent). If omitted, a UUID is generated. |
| `productId` | `string` | `false` | Optional SKU / product identifier. |
| `productName` | `string` | `false` | Optional human-readable product name shown in the transactions table. |
@@ -243,7 +243,7 @@ This endpoint records revenue transactions (sales, subscription charges, and ref
public `pid`-only auth model of the other `/log/*` endpoints). Never call it from the browser.
</Callout>
-The first call against a project automatically enables API revenue tracking and locks in the `currency` you sent as the project's display currency. You can change it later from **Project Settings &gt; Revenue**.
+The first call against a project automatically enables API revenue tracking and locks in the `currency` you sent as the project's reporting currency. You can change it later from **Project Settings &gt; Revenue**.
```bash title="Request"
curl -i -X POST https://api.swetrix.com/log/revenue \
diff --git a/docs/content/docs/sitesettings/bot-protection.mdx b/docs/content/docs/sitesettings/bot-protection.mdx
index 948801e19..4795c0c0b 100644
--- a/docs/content/docs/sitesettings/bot-protection.mdx
+++ b/docs/content/docs/sitesettings/bot-protection.mdx
@@ -13,8 +13,8 @@ The bot protection settings live in **Project Settings β†’ Shields**. You can le
The page contains:
-- A **Bot protection level** selector (`Off`, `Basic`, `Strict`)
-- A **Bot protection report** showing how many requests were blocked over the last 7 / 30 / 90 days, broken down by classification and by country
+- A **Bot traffic filtering** selector (`Off`, `Basic`, `Strict`)
+- A **Blocked traffic** report showing how many requests were filtered out over the last 7 / 30 / 90 days, broken down by classification and by country
## Protection levels
@@ -165,7 +165,7 @@ No. Bot detection runs **before** the event is recorded, so you only pay for rea
### Can I add my own UA rules or IP ranges?
-Not yet. The current detection logic is fixed. The existing **IP Blacklist** and **Country Blacklist** in the Shields tab let you block specific IPs and countries, which works for most allowlist/denylist use cases.
+Not yet. The current detection logic is fixed. The existing **Blocked IP addresses** and **Blocked countries** settings in the Shields tab let you block specific IPs and countries, which works for most allowlist/denylist use cases.
### My GoogleBot / SEO crawler stats disappeared after I enabled Basic. Is that a bug?
diff --git a/docs/content/docs/sitesettings/how-to-invite-users-to-your-website.mdx b/docs/content/docs/sitesettings/how-to-invite-users-to-your-website.mdx
index f11f23d70..ad16ec1a3 100644
--- a/docs/content/docs/sitesettings/how-to-invite-users-to-your-website.mdx
+++ b/docs/content/docs/sitesettings/how-to-invite-users-to-your-website.mdx
@@ -58,7 +58,7 @@ Once you confirm the action, the user will no longer have access to your website
## How to transfer ownership of your website
-To transfer ownership, navigate to your site settings, click on the "Transfer project" button (it's located in general settings of the website) and enter the email address of the person you want to transfer ownership to.
+To transfer ownership, open the project's **Danger Zone** settings, click **Transfer ownership**, and enter the email address of the person you want to transfer the project to.
You will receive an email to confirm the transfer. Once you confirm it, the other person will become the owner of the website and will be responsible for billing.
diff --git a/docs/content/docs/sitesettings/project-configuration.mdx b/docs/content/docs/sitesettings/project-configuration.mdx
index 7b2f54657..25fbe8d35 100644
--- a/docs/content/docs/sitesettings/project-configuration.mdx
+++ b/docs/content/docs/sitesettings/project-configuration.mdx
@@ -11,56 +11,55 @@ To access these settings, go to your **Project Settings** page. You can learn ho
The **General** tab allows you to configure the basic identity of your project.
-- **Project Name**: A friendly name for your project (e.g., "My Personal Blog").
+- **Project name**: A friendly name for your project (e.g., "My Personal Blog").
- **Website URL**: The main URL of the website you are tracking.
- **Project ID**: A unique identifier for your project (read-only).
-- **Sharable Link**: A direct link to your public or password-protected dashboard (read-only).
## Security (Shields)
The **Shields** tab provides powerful tools to protect your analytics from spam, bots, and unwanted traffic.
-### Origins
+### Allowed origins
-By default, Swetrix accepts events from any domain. If you want to restrict tracking to specific domains only, you can add them here.
+By default, Swetrix accepts events from any domain. If you want to restrict tracking to specific domains, add the domains that are allowed to send analytics using this Project ID.
-- Enter one domain per line.
+- Separate multiple domains with commas.
- Requests from domains not listed here will be rejected.
-- Leave empty to allow all domains (default).
+- Leave the field empty to allow all domains.
+- Wildcards are supported, for example `cornell.edu`, `app.example.com`, or `*.gov.uk`.
-### IP Blacklist
+### Blocked IP addresses
-You can block traffic from specific IP addresses to exclude them from your analytics (e.g., your own office IP).
+You can ignore traffic from specific IP addresses or CIDR ranges, which is useful for excluding your own visits from analytics.
-- Enter one IP address per line.
-- Supports both IPv4 and IPv6.
+- Separate multiple values with commas.
+- Supports IPv4, IPv6, and CIDR ranges, for example `172.126.10.16`, `192.168.0.1/32`, or `::1`.
-### Country Blacklist
+### Blocked countries
-If you want to completely ignore traffic from specific countries, you can add them to the blacklist.
+Choose the countries you don't want to track. Traffic from these countries will be ignored in your analytics.
-- Select countries from the dropdown menu.
-- Traffic from these countries will not be recorded.
+- Select countries from the country dropdown.
-### Bot Protection Level
+### Bot traffic filtering
-Swetrix has built-in bot detection. You can adjust the strictness of this protection:
+Swetrix has built-in bot detection. You can choose how aggressively bot and automated traffic should be filtered from your analytics:
-- **Off**: No bot detection. All traffic is recorded.
-- **Basic** _(default)_: Filters traffic by user-agent string and headless-browser fingerprints.
-- **Strict**: Adds suspicious-header, probe-path, referrer-spam, and (on cloud) datacenter-IP checks.
+- **Off**: Tracks all incoming traffic, including bots and automated requests.
+- **Basic** _(default)_: Ignores common bots detected by their user agent and known headless-browser fingerprints.
+- **Strict**: Ignores more automated traffic, including suspicious headers, vulnerability-scan paths, referrer spam, and (on cloud) datacenter IPs.
-Below the dropdown you'll find a per-project report showing how many requests were blocked, broken down by classification and country. See the dedicated [Bot Protection](/bot-protection) page for the full list of detection methods, privacy notes, and FAQ.
+Below the dropdown you'll find a per-project **Blocked traffic** report showing how many requests were filtered out, broken down by classification and country. See the dedicated [Bot Protection](/bot-protection) page for the full list of detection methods, privacy notes, and FAQ.
## Access Control
-The **Access** tab manages who can see your data and which team owns the project.
+The **Access** tab manages who can see your dashboard and which organisation the project belongs to.
### Visibility Settings
-- **Enabled**: Toggles data collection on or off. If disabled, no new events will be recorded.
-- **Public Dashboard**: If enabled, anyone with the link can view your analytics dashboard. No login required.
-- **Password Protected**: If enabled, visitors must enter a password to view the dashboard. Useful for sharing stats with clients without requiring them to create an account.
+- **Sharable Link**: A direct link to your public or password-protected dashboard (read-only).
+- **Public dashboard**: If enabled, anyone with the link can view your analytics dashboard. No login required.
+- **Password protected**: If enabled, visitors must enter a password to view the dashboard. Useful for sharing stats with clients without requiring them to create an account.
### Organisation Assignment
@@ -68,8 +67,9 @@ If you are a member of an Organisation (Team), you can transfer the project to t
## Danger Zone
-The **Danger Zone** contains destructive actions. Proceed with caution.
+The **Danger Zone** contains project status controls and destructive actions. Proceed with caution.
-- **Transfer Project**: Move ownership of the project to another user. See [Transfer Ownership](/how-to-transfer-ownership-of-your-website) for details.
-- **Reset Data**: Clear all or some of your analytics data. See [Reset Site Data](/reset-sites-data) for details.
-- **Delete Project**: Permanently delete the project and all associated data. **This action cannot be undone.**
+- **Collect analytics data**: Turn this off to stop collecting new analytics data. Existing data and project settings stay available.
+- **Transfer ownership**: Move ownership of the project to another user. See [Transfer Ownership](/how-to-transfer-ownership-of-your-website) for details.
+- **Reset project**: Delete analytics data while keeping project settings and Project ID. See [Reset project data](/reset-sites-data) for details.
+- **Delete project**: Permanently delete the project and all associated data. **This action cannot be undone.**
diff --git a/docs/content/docs/sitesettings/reset-sites-data.mdx b/docs/content/docs/sitesettings/reset-sites-data.mdx
index b3a3ee603..6148bc3f1 100644
--- a/docs/content/docs/sitesettings/reset-sites-data.mdx
+++ b/docs/content/docs/sitesettings/reset-sites-data.mdx
@@ -1,21 +1,21 @@
---
-title: Reset your site's data
+title: Reset your project's data
slug: /reset-sites-data
---
-On your [site settings](/how-to-access-site-settings) page, you can reset your site's data. This will delete all analytics data, but keep your settings and site ID intact.
+On your [site settings](/how-to-access-site-settings) page, you can reset your project's data. This permanently deletes analytics data while keeping the project, its settings, and Project ID intact.
<Callout type="warn">
-This action is irreversible. Once you reset your site's data, all analytics data will be permanently deleted and cannot be recovered.
+This action is irreversible. Once you reset your project's data, all analytics data will be permanently deleted and cannot be recovered.
</Callout>
-To reset your site's data, click on the "Reset project" button:
+To reset your project's data, click **Reset project**:
<img alt="Invite user" src="/docs/img/sitesettings/reset_settings.png" />
In the confirmation dialog, you will find 3 options:
-1. **Reset all**: This will permanently delete all analytics data for all time, but the site ID and it's settings will remain intact.
-2. **Reset partially**: Partial reset allows you to delete data for a specific time range.
-3. **Reset via filters**: This allows you to delete data based on specific filters (e.g. delete all data for a specific referrer, country, etc.).
+1. **Reset all analytics data**: Permanently deletes all analytics data for this project. The project itself, its settings, and Project ID will remain.
+2. **Reset by date range**: Deletes analytics data from a specific start and end date.
+3. **Reset by filters**: Deletes only the analytics data that matches the filters you select, such as a specific referrer, country, or page.
diff --git a/docs/content/docs/sitesettings/transfer-ownership.mdx b/docs/content/docs/sitesettings/transfer-ownership.mdx
index f50531300..f3e5e17e7 100644
--- a/docs/content/docs/sitesettings/transfer-ownership.mdx
+++ b/docs/content/docs/sitesettings/transfer-ownership.mdx
@@ -5,21 +5,21 @@ slug: /how-to-transfer-ownership-of-your-website
Swetrix lets you hand over control of a website (project) to another account.
-This is useful for freelancers, consultants, and agencies: you can set everything up - tracking code, custom events, spike alerts, etc. and then transfer project to the client.
+This is useful for freelancers, consultants, and agencies: you can set everything up - tracking code, custom events, spike alerts, etc. - and then transfer the project to the client.
Keep in mind that your subscription does not transfer with the website. After the hand-off, the new owner must subscribe to a plan to keep access to the stats.
## How to transfer a project to a different user
-To transfer a project to a different Swetrix user, you need to log into your swetrix account and go to the Project settings page of a project you want to transfer.
+To transfer a project to a different Swetrix user, log into your Swetrix account and open the Project Settings page for the project you want to transfer.
The user you want to transfer the project to needs to be already registered on the platform.
-On the Project settings page, scroll down to and click on the Transfer project button.
+On the Project Settings page, open the **Danger Zone** tab and click **Transfer ownership**.
-Enter the email address of a user you want to transfer your project to. We'll send them an email to confirm the transfer. Once they confirm it, they'll become the owner of the project and be able to perform any actions including adding new members and become responsible for billing.
+Enter the email address of the user you want to transfer the project to. We'll send them an email to confirm the transfer. Once they confirm it, they'll become the project owner and can manage settings, members, invitations, and billing.
-You will be assigned an Administrator role to the project, meaning that you can still access and edit it's settings, but the new owner would be able to remove your access at any time.
+You will stay on the project as an administrator, so you can still access and edit its settings. The new owner can remove your access later.
## Sharing project access without giving up ownership
diff --git a/web/app/components/NotificationChannels/NotificationChannels.tsx b/web/app/components/NotificationChannels/NotificationChannels.tsx
index b138aedc1..a5bcae69b 100644
--- a/web/app/components/NotificationChannels/NotificationChannels.tsx
+++ b/web/app/components/NotificationChannels/NotificationChannels.tsx
@@ -319,7 +319,12 @@ const NotificationChannels = ({
<Text as='h3' size='lg' weight='bold'>
{headingTitle}
</Text>
- <Text as='p' size='sm' colour='muted' className='mt-1 max-w-prose'>
+ <Text
+ as='p'
+ size='sm'
+ colour='secondary'
+ className='mt-1 max-w-prose'
+ >
{headingDescription}
</Text>
</div>
diff --git a/web/app/lib/constants/index.ts b/web/app/lib/constants/index.ts
index a2c07e38e..30983171a 100644
--- a/web/app/lib/constants/index.ts
+++ b/web/app/lib/constants/index.ts
@@ -537,7 +537,7 @@ export const localisePath = (pathname: string, lang: string): string => {
// Increase this counter every time some major change is done within localisation files
// This will prevent cached version or raw locale strings being displayed in production
-export const I18N_CACHE_BREAKER = 38
+export const I18N_CACHE_BREAKER = 39
export const roles: Role[] = ['admin', 'viewer']
diff --git a/web/app/pages/Dashboard/Dashboard.tsx b/web/app/pages/Dashboard/Dashboard.tsx
index 2de8fbc47..93a232a5d 100644
--- a/web/app/pages/Dashboard/Dashboard.tsx
+++ b/web/app/pages/Dashboard/Dashboard.tsx
@@ -530,6 +530,7 @@ const Dashboard = () => {
<Input
name='project-name-input'
label={t('project.settings.name')}
+ hint={t('project.settings.nameHint')}
value={newProjectName}
placeholder='My awesome website'
onChange={(e) => setNewProjectName(e.target.value)}
@@ -553,6 +554,7 @@ const Dashboard = () => {
setNewProjectOrganisationId(item.id)
}}
label={t('project.settings.organisation')}
+ hint={t('project.settings.organisationHint')}
title={
organisations.find(
(org) => org.id === newProjectOrganisationId,
diff --git a/web/app/pages/Onboarding/Onboarding.tsx b/web/app/pages/Onboarding/Onboarding.tsx
index 069f5d2bd..1c8df2f51 100644
--- a/web/app/pages/Onboarding/Onboarding.tsx
+++ b/web/app/pages/Onboarding/Onboarding.tsx
@@ -853,6 +853,7 @@ const Onboarding = () => {
<div className='w-full sm:max-w-1/2'>
<Input
label={t('project.settings.name')}
+ hint={t('project.settings.nameHint')}
placeholder={t(
'onboarding.createProject.placeholder',
)}
diff --git a/web/app/pages/Organisations/Settings/People.tsx b/web/app/pages/Organisations/Settings/People.tsx
index c5b8d13ae..97fcf8372 100644
--- a/web/app/pages/Organisations/Settings/People.tsx
+++ b/web/app/pages/Organisations/Settings/People.tsx
@@ -13,6 +13,7 @@ import _map from 'lodash/map'
import {
TrashIcon,
UserCirclePlusIcon,
+ UsersThreeIcon,
CaretDownIcon,
CheckIcon,
} from '@phosphor-icons/react'
@@ -35,15 +36,35 @@ import { isValidEmail } from '~/utils/validator'
type InviteRole = Exclude<Role, 'owner'>
-const NoPeople = () => {
+const NoPeople = ({ onInvite }: { onInvite: () => void }) => {
const { t } = useTranslation('common')
return (
- <div className='flex flex-col py-6 sm:px-6 lg:px-8'>
- <div className='mx-auto w-full max-w-7xl'>
- <Text as='h2' size='xl' className='mb-8 px-4 text-center leading-snug'>
- {t('project.settings.noPeople')}
- </Text>
+ <div className='mt-6 rounded-lg border border-dashed border-gray-300 bg-gray-50/40 p-8 text-center dark:border-slate-700 dark:bg-slate-900/30'>
+ <div className='mx-auto flex size-12 items-center justify-center rounded-lg bg-white ring-1 ring-gray-200 ring-inset dark:bg-slate-950 dark:ring-slate-700'>
+ <UsersThreeIcon
+ className='size-6 text-slate-500 dark:text-slate-400'
+ weight='duotone'
+ />
+ </div>
+ <Text as='p' size='base' weight='semibold' className='mt-4'>
+ {t('organisations.peopleEmptyTitle')}
+ </Text>
+ <Text
+ as='p'
+ size='sm'
+ colour='secondary'
+ className='mx-auto mt-1 max-w-md'
+ >
+ {t('organisations.peopleEmptyDescription')}
+ </Text>
+ <div className='mt-5 flex justify-center'>
+ <Button onClick={onInvite}>
+ <span className='inline-flex items-center gap-1'>
+ <UserCirclePlusIcon className='size-4' aria-hidden='true' />
+ {t('project.settings.invite')}
+ </span>
+ </Button>
</div>
</div>
)
@@ -343,7 +364,7 @@ const People = ({ organisation }: PeopleProps) => {
</div>
<div>
{_isEmpty(members) ? (
- <NoPeople />
+ <NoPeople onInvite={() => setShowModal(true)} />
) : (
<div className='overflow-hidden rounded-lg border border-gray-200 dark:border-slate-800'>
<table className='min-w-full divide-y divide-gray-200 dark:divide-slate-800'>
diff --git a/web/app/pages/Project/Settings/Alerts/AlertTemplateEditor.tsx b/web/app/pages/Project/Settings/Alerts/AlertTemplateEditor.tsx
index 8e483f5d6..f7e108f9b 100644
--- a/web/app/pages/Project/Settings/Alerts/AlertTemplateEditor.tsx
+++ b/web/app/pages/Project/Settings/Alerts/AlertTemplateEditor.tsx
@@ -235,13 +235,13 @@ const AlertTemplateEditor = ({
)
return (
- <div className='mt-6 rounded-lg border border-gray-200 p-4 dark:border-slate-800'>
+ <section className='mt-6'>
<div className='flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between'>
<div>
- <Text as='h3' size='base' weight='bold'>
+ <Text as='h3' size='lg' weight='medium'>
{t('alert.template.heading')}
</Text>
- <Text as='p' size='sm' colour='secondary' className='mt-0.5'>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
{t('alert.template.description')}
</Text>
</div>
@@ -344,7 +344,7 @@ const AlertTemplateEditor = ({
</div>
</div>
)}
- </div>
+ </section>
)
}
diff --git a/web/app/pages/Project/Settings/Alerts/ProjectAlertsSettings.tsx b/web/app/pages/Project/Settings/Alerts/ProjectAlertsSettings.tsx
index b3daec728..d3defa4b2 100644
--- a/web/app/pages/Project/Settings/Alerts/ProjectAlertsSettings.tsx
+++ b/web/app/pages/Project/Settings/Alerts/ProjectAlertsSettings.tsx
@@ -43,10 +43,6 @@ import {
import AlertTemplateEditor from './AlertTemplateEditor'
import { BackButton } from '../../View/components/BackButton'
-const CHANNELS_TAB = `?tab=channels`
-const PROJECT_CHANNELS_LINK = (projectId: string) =>
- `/projects/${projectId}/settings${CHANNELS_TAB}`
-
interface ProjectAlertsSettingsProps {
alertId?: string | null
projectId: string
@@ -470,7 +466,7 @@ const ProjectAlertsSettings = ({
components={{
url: (
<Link
- to={PROJECT_CHANNELS_LINK(projectId)}
+ to={`/projects/settings/${projectId}?tab=channels`}
className='font-medium underline hover:text-amber-900 dark:hover:text-amber-100'
/>
),
@@ -496,11 +492,11 @@ const ProjectAlertsSettings = ({
value={form.emailSubjectTemplate || ''}
/>
- <div className='mt-6 rounded-lg border border-gray-200 p-4 dark:border-slate-800'>
- <Text as='h3' size='base' weight='bold'>
+ <section className='mt-6'>
+ <Text as='h3' size='lg' weight='medium'>
{t('alert.sections.basics')}
</Text>
- <Text as='p' size='sm' colour='secondary' className='mt-0.5'>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
{t('alert.sections.basicsDescription')}
</Text>
<div className='mt-4 max-w-md'>
@@ -526,13 +522,13 @@ const ProjectAlertsSettings = ({
}
label={t('alert.enabled')}
/>
- </div>
+ </section>
- <div className='mt-6 rounded-lg border border-gray-200 p-4 dark:border-slate-800'>
- <Text as='h3' size='base' weight='bold'>
+ <section className='mt-6'>
+ <Text as='h3' size='lg' weight='medium'>
{t('alert.sections.trigger')}
</Text>
- <Text as='p' size='sm' colour='secondary' className='mt-0.5'>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
{t('alert.sections.triggerDescription')}
</Text>
@@ -679,13 +675,13 @@ const ProjectAlertsSettings = ({
/>
</div>
) : null}
- </div>
+ </section>
- <div className='mt-6 rounded-lg border border-gray-200 p-4 dark:border-slate-800'>
- <Text as='h3' size='base' weight='bold'>
+ <section className='mt-6'>
+ <Text as='h3' size='lg' weight='medium'>
{t('alert.channels.heading')}
</Text>
- <Text as='p' size='sm' colour='secondary' className='mt-0.5'>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
{t('alert.channels.description')}
</Text>
<div className='mt-3'>
@@ -700,11 +696,11 @@ const ProjectAlertsSettings = ({
return { ...prev, channelIds: Array.from(ids) }
})
}}
- projectChannelsLink={PROJECT_CHANNELS_LINK(projectId)}
+ projectChannelsLink={`/projects/settings/${projectId}?tab=channels`}
t={t}
/>
</div>
- </div>
+ </section>
<AlertTemplateEditor
projectId={projectId}
diff --git a/web/app/pages/Project/Settings/Alerts/ProjectAlertsView.tsx b/web/app/pages/Project/Settings/Alerts/ProjectAlertsView.tsx
index d96d82f28..60b7d2b19 100644
--- a/web/app/pages/Project/Settings/Alerts/ProjectAlertsView.tsx
+++ b/web/app/pages/Project/Settings/Alerts/ProjectAlertsView.tsx
@@ -17,7 +17,7 @@ import {
BellSlashIcon,
} from '@phosphor-icons/react'
import { useMemo, useState, useEffect, useRef } from 'react'
-import { useTranslation } from 'react-i18next'
+import { Trans, useTranslation } from 'react-i18next'
import { Link } from '~/ui/Link'
import { useSearchParams, useFetcher } from 'react-router'
import { toast } from 'sonner'
@@ -36,33 +36,7 @@ import { Text } from '~/ui/Text'
import routes from '~/utils/routes'
import ProjectAlertsSettings from './ProjectAlertsSettings'
-
-const NoNotificationChannelSet = ({
- channelsLink,
-}: {
- channelsLink: string
-}) => {
- const { t } = useTranslation('common')
-
- return (
- <div className='mb-4 flex flex-col gap-3 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 sm:flex-row sm:items-center dark:border-amber-500/20 dark:bg-amber-500/10'>
- <WarningOctagonIcon className='size-5 shrink-0 text-amber-600 dark:text-amber-400' />
- <Text
- as='p'
- size='sm'
- className='flex-1 text-amber-800 dark:text-amber-200'
- >
- {t('alert.noNotificationChannel')}
- </Text>
- <Link
- to={channelsLink}
- className='shrink-0 self-start rounded-md bg-amber-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-amber-700 sm:self-auto dark:bg-amber-600 dark:hover:bg-amber-500'
- >
- {t('common.fixIt')}
- </Link>
- </div>
- )
-}
+import Alert from '~/ui/Alert'
const COLOUR_QUERY_METRIC_MAPPING: Record<
(typeof QUERY_METRIC)[keyof typeof QUERY_METRIC],
@@ -191,7 +165,12 @@ const AlertRow = ({
className='text-[10px]'
/>
{/* Mobile: Show last triggered */}
- <Text as='span' size='xs' colour='muted' className='sm:hidden'>
+ <Text
+ as='span'
+ size='xs'
+ colour='secondary'
+ className='sm:hidden'
+ >
{lastTriggeredText
? `β€’ ${lastTriggeredText}`
: `β€’ ${t('alert.never')}`}
@@ -204,13 +183,13 @@ const AlertRow = ({
<div className='flex shrink-0 items-center gap-3'>
{/* Desktop: Last triggered */}
<div className='hidden text-right sm:block'>
- <Text as='p' size='xs' colour='muted'>
+ <Text as='p' size='xs' colour='secondary'>
{t('alert.lastTriggered')}
</Text>
<Text
as='p'
size='sm'
- colour={lastTriggeredText ? 'primary' : 'muted'}
+ colour={lastTriggeredText ? 'primary' : 'secondary'}
>
{lastTriggeredText || t('alert.never')}
</Text>
@@ -522,14 +501,25 @@ const ProjectAlertsInner = ({
) : (
<>
{!hasAnyAlertWithChannels ? (
- <NoNotificationChannelSet
- channelsLink={`/projects/${projectId}/settings?tab=channels`}
- />
+ <Alert variant='warning' className='mb-4'>
+ <Trans
+ t={t}
+ i18nKey='alert.noChannels'
+ components={{
+ url: (
+ <Link
+ to={`/projects/settings/${projectId}?tab=channels`}
+ className='font-medium underline hover:text-amber-900 dark:hover:text-amber-100'
+ />
+ ),
+ }}
+ />
+ </Alert>
) : null}
{/* Header with add button */}
<div className='mb-4 flex items-center justify-between'>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
{t('alert.totalCount', { count: total })}
</Text>
<Button onClick={handleNewAlert}>
diff --git a/web/app/pages/Project/Settings/Alerts/RichTemplateInput.tsx b/web/app/pages/Project/Settings/Alerts/RichTemplateInput.tsx
index 3fe494e83..c7f3bf362 100644
--- a/web/app/pages/Project/Settings/Alerts/RichTemplateInput.tsx
+++ b/web/app/pages/Project/Settings/Alerts/RichTemplateInput.tsx
@@ -11,6 +11,7 @@ import {
useState,
} from 'react'
+import { Text } from '~/ui/Text'
import { cn } from '~/utils/generic'
export interface TemplateVariableInfo {
@@ -22,7 +23,7 @@ interface RichTemplateInputProps {
value: string
onChange: (value: string) => void
variables: TemplateVariableInfo[]
- label?: string
+ label?: React.ReactNode
hint?: React.ReactNode
rows?: number
placeholder?: string
@@ -459,12 +460,32 @@ const RichTemplateInput = forwardRef<
}
return (
- <Field as='div' className={className}>
+ <Field as='div' className={cn('flex flex-col gap-1', className)}>
{label ? (
- <Label className='mb-1 flex text-sm font-medium text-gray-900 dark:text-gray-200'>
- {label}
+ <Label>
+ <Text
+ as='span'
+ className='flex leading-tight whitespace-pre-line'
+ size='sm'
+ weight='medium'
+ colour='primary'
+ >
+ {label}
+ </Text>
</Label>
) : null}
+ {hint ? (
+ <Description as='div'>
+ <Text
+ as='span'
+ className='block leading-tight whitespace-pre-line'
+ size='sm'
+ colour='secondary'
+ >
+ {hint}
+ </Text>
+ </Description>
+ ) : null}
<div ref={wrapperRef} className='relative'>
<div
ref={mirrorRef}
@@ -520,11 +541,6 @@ const RichTemplateInput = forwardRef<
/>
) : null}
</div>
- {hint ? (
- <Description className='mt-2 text-xs whitespace-pre-line text-gray-500 dark:text-gray-300'>
- {hint}
- </Description>
- ) : null}
</Field>
)
},
@@ -584,13 +600,18 @@ const SuggestionMenu = ({
: 'text-gray-800 hover:bg-gray-100 dark:text-gray-100 dark:hover:bg-slate-800',
)}
>
- <span className='font-mono text-xs'>
+ <Text as='span' size='xs' colour='inherit' className='font-mono'>
{`{{`}
- <span className='font-semibold'>{v.name}</span>
+ <Text as='span' size='xs' weight='semibold' colour='inherit'>
+ {v.name}
+ </Text>
{`}}`}
- </span>
+ </Text>
{v.description ? (
- <span
+ <Text
+ as='span'
+ size='xxs'
+ colour='inherit'
className={cx(
'text-[11px] leading-snug',
i === activeIndex
@@ -599,7 +620,7 @@ const SuggestionMenu = ({
)}
>
{v.description}
- </span>
+ </Text>
) : null}
</button>
))}
@@ -631,10 +652,22 @@ const HoverTooltip = ({
className='pointer-events-none absolute z-40 -translate-x-1/2 -translate-y-full rounded-md bg-slate-900 px-3 py-1.5 text-xs text-white ring-1 ring-slate-900/80 dark:bg-slate-800'
style={{ top, left }}
>
- <div className='font-mono text-[11px] text-slate-300'>{`{{${name}}}`}</div>
- <div className='mt-0.5 max-w-64 leading-snug'>
+ <Text
+ as='div'
+ size='xxs'
+ colour='inherit'
+ className='font-mono text-[11px] text-slate-300'
+ >
+ {`{{${name}}}`}
+ </Text>
+ <Text
+ as='div'
+ size='xs'
+ colour='inherit'
+ className='mt-0.5 max-w-64 leading-snug'
+ >
{description || 'Unknown variable'}
- </div>
+ </Text>
</div>
)
}
diff --git a/web/app/pages/Project/Settings/Annotations.tsx b/web/app/pages/Project/Settings/Annotations.tsx
index 0c4fa8020..97e35c79c 100644
--- a/web/app/pages/Project/Settings/Annotations.tsx
+++ b/web/app/pages/Project/Settings/Annotations.tsx
@@ -173,7 +173,12 @@ const Annotations = ({ projectId, allowedToManage }: AnnotationsProps) => {
<Text as='h3' size='lg' weight='bold'>
{t('project.settings.annotations.title')}
</Text>
- <Text as='p' size='sm' colour='muted' className='mt-1 max-w-prose'>
+ <Text
+ as='p'
+ size='sm'
+ colour='secondary'
+ className='mt-1 max-w-prose'
+ >
{t('project.settings.annotations.description')}
</Text>
</div>
@@ -187,7 +192,7 @@ const Annotations = ({ projectId, allowedToManage }: AnnotationsProps) => {
{_isEmpty(annotations) ? (
<div className='rounded-lg border border-dashed border-gray-300 p-8 text-center dark:border-slate-700'>
- <Text as='p' colour='muted'>
+ <Text as='p' colour='secondary'>
{t('project.settings.annotations.empty')}
</Text>
{allowedToManage ? (
diff --git a/web/app/pages/Project/Settings/Emails/Emails.tsx b/web/app/pages/Project/Settings/Emails/Emails.tsx
index 9cb63a979..666bd64ec 100644
--- a/web/app/pages/Project/Settings/Emails/Emails.tsx
+++ b/web/app/pages/Project/Settings/Emails/Emails.tsx
@@ -239,15 +239,35 @@ const EmailList = ({ data, onRemove, setEmails }: EmailListProps) => {
)
}
-const NoSubscribers = () => {
+const NoSubscribers = ({ onAdd }: { onAdd: () => void }) => {
const { t } = useTranslation('common')
return (
- <div className='flex flex-col py-6 sm:px-6 lg:px-8'>
- <div className='mx-auto w-full max-w-7xl'>
- <Text as='h2' size='xl' className='mb-8 px-4 text-center leading-snug'>
- {t('project.settings.noPeople')}
- </Text>
+ <div className='mt-6 rounded-lg border border-dashed border-gray-300 bg-gray-50/40 p-8 text-center dark:border-slate-700 dark:bg-slate-900/30'>
+ <div className='mx-auto flex size-12 items-center justify-center rounded-lg bg-white ring-1 ring-gray-200 ring-inset dark:bg-slate-950 dark:ring-slate-700'>
+ <EnvelopeSimpleIcon
+ className='size-6 text-slate-500 dark:text-slate-400'
+ weight='duotone'
+ />
+ </div>
+ <Text as='p' size='base' weight='semibold' className='mt-4'>
+ {t('project.emails.emptyTitle')}
+ </Text>
+ <Text
+ as='p'
+ size='sm'
+ colour='secondary'
+ className='mx-auto mt-1 max-w-md'
+ >
+ {t('project.emails.emptyDescription')}
+ </Text>
+ <div className='mt-5 flex justify-center'>
+ <Button onClick={onAdd}>
+ <span className='inline-flex items-center gap-1'>
+ <EnvelopeSimpleIcon className='size-4' aria-hidden />
+ {t('project.emails.add')}
+ </span>
+ </Button>
</div>
</div>
)
@@ -455,7 +475,12 @@ const Emails = ({ projectId }: { projectId: string }) => {
<Text as='h3' size='lg' weight='bold'>
{t('project.emails.title')}
</Text>
- <Text as='p' size='sm' colour='muted' className='mt-1 max-w-prose'>
+ <Text
+ as='p'
+ size='sm'
+ colour='secondary'
+ className='mt-1 max-w-prose'
+ >
{t('project.emails.description')}
</Text>
</div>
@@ -470,7 +495,7 @@ const Emails = ({ projectId }: { projectId: string }) => {
<Loader />
</div>
) : _isEmpty(emails) ? (
- <NoSubscribers />
+ <NoSubscribers onAdd={() => setShowModal(true)} />
) : (
<div className='overflow-hidden rounded-lg border border-gray-200 dark:border-slate-800'>
<table className='min-w-full divide-y divide-gray-200 dark:divide-slate-800'>
diff --git a/web/app/pages/Project/Settings/People/People.tsx b/web/app/pages/Project/Settings/People/People.tsx
index 523b135fc..76747045c 100644
--- a/web/app/pages/Project/Settings/People/People.tsx
+++ b/web/app/pages/Project/Settings/People/People.tsx
@@ -34,15 +34,35 @@ import { Text } from '~/ui/Text'
import { cn } from '~/utils/generic'
import { isValidEmail } from '~/utils/validator'
-const NoPeople = () => {
+const NoPeople = ({ onInvite }: { onInvite: () => void }) => {
const { t } = useTranslation('common')
return (
- <div className='flex flex-col py-6 sm:px-6 lg:px-8'>
- <div className='mx-auto w-full max-w-7xl'>
- <Text as='h2' size='xl' className='mb-8 px-4 text-center leading-snug'>
- {t('project.settings.noPeople')}
- </Text>
+ <div className='mt-6 rounded-lg border border-dashed border-gray-300 bg-gray-50/40 p-8 text-center dark:border-slate-700 dark:bg-slate-900/30'>
+ <div className='mx-auto flex size-12 items-center justify-center rounded-lg bg-white ring-1 ring-gray-200 ring-inset dark:bg-slate-950 dark:ring-slate-700'>
+ <UserCirclePlusIcon
+ className='size-6 text-slate-500 dark:text-slate-400'
+ weight='duotone'
+ />
+ </div>
+ <Text as='p' size='base' weight='semibold' className='mt-4'>
+ {t('project.settings.peopleEmptyTitle')}
+ </Text>
+ <Text
+ as='p'
+ size='sm'
+ colour='secondary'
+ className='mx-auto mt-1 max-w-md'
+ >
+ {t('project.settings.peopleEmptyDescription')}
+ </Text>
+ <div className='mt-5 flex justify-center'>
+ <Button onClick={onInvite}>
+ <span className='inline-flex items-center gap-1'>
+ <UserCirclePlusIcon className='size-4' aria-hidden />
+ {t('project.settings.invite')}
+ </span>
+ </Button>
</div>
</div>
)
@@ -347,7 +367,7 @@ const People = ({ project }: PeopleProps) => {
</div>
<div>
{_isEmpty(share) ? (
- <NoPeople />
+ <NoPeople onInvite={() => setShowModal(true)} />
) : (
<div className='overflow-hidden rounded-lg border border-gray-200 dark:border-slate-800'>
<table className='min-w-full divide-y divide-gray-200 dark:divide-slate-800'>
diff --git a/web/app/pages/Project/Settings/ProjectSettings.tsx b/web/app/pages/Project/Settings/ProjectSettings.tsx
index fef894d6d..f5d5d6b34 100644
--- a/web/app/pages/Project/Settings/ProjectSettings.tsx
+++ b/web/app/pages/Project/Settings/ProjectSettings.tsx
@@ -1088,7 +1088,6 @@ const ProjectSettings = () => {
errors={errors}
beenSubmitted={beenSubmitted}
handleInput={handleInput}
- sharableLink={sharableLink}
/>
) : null}
@@ -1123,6 +1122,8 @@ const ProjectSettings = () => {
organisations={organisations}
onAssignOrganisation={assignOrganisation}
openPasswordModal={() => setShowProtected(true)}
+ handleInput={handleInput}
+ sharableLink={sharableLink}
/>
) : null}
@@ -1139,7 +1140,7 @@ const ProjectSettings = () => {
<Text as='h3' size='lg' weight='bold'>
{t('project.settings.blockedTraffic')}
</Text>
- <Text as='p' size='sm' colour='muted' className='mt-1'>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
{t('project.settings.blockedTrafficHint')}
</Text>
<div className='mt-2'>
@@ -1217,31 +1218,168 @@ const ProjectSettings = () => {
description={activeTabConfig.description}
iconColorClass={activeTabConfig.iconColor}
/>
- <div className='rounded-lg border border-gray-200 p-4 dark:border-slate-800'>
- <Text
- as='h3'
- size='lg'
- weight='medium'
- className='mb-2 flex items-center gap-2'
- >
- <GoogleSearchConsoleSVG className='size-6' />
- Google Search Console
- </Text>
- {gscConnected === null ? (
- <Loader />
- ) : !gscAvailable ? (
- <div className='rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-100'>
+ <Text
+ as='h3'
+ size='lg'
+ weight='medium'
+ className='mb-2 flex items-center gap-2'
+ >
+ <GoogleSearchConsoleSVG className='size-6' />
+ Google Search Console
+ </Text>
+ {gscConnected === null ? (
+ <Loader />
+ ) : !gscAvailable ? (
+ <div className='rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-100'>
+ <Trans
+ t={t}
+ i18nKey='project.settings.gsc.notConfigured'
+ defaults='Google Search Console is not configured on this server. To enable it, set <code>GOOGLE_GSC_CLIENT_ID</code>, <code>GOOGLE_GSC_CLIENT_SECRET</code> and <code>BASE_URL</code> in your API container environment, then restart it. <url>See the self-hosting guide</url>.'
+ components={{
+ code: (
+ <code className='rounded bg-amber-100 px-1 py-0.5 font-mono text-xs dark:bg-amber-900/60' />
+ ),
+ url: (
+ <a
+ href='https://docs.swetrix.com/selfhosting/google-search-console'
+ target='_blank'
+ rel='noopener noreferrer'
+ className='font-medium underline decoration-dashed hover:decoration-solid'
+ />
+ ),
+ }}
+ />
+ </div>
+ ) : !gscConnected ? (
+ <div className='flex flex-col items-center justify-between gap-4 md:flex-row'>
+ <Text
+ as='p'
+ size='sm'
+ className='text-gray-800 dark:text-gray-200'
+ >
+ {t('project.settings.gsc.connect')}
+ </Text>
+ <Button
+ className='flex items-center gap-2'
+ type='button'
+ onClick={() => {
+ gscFetcher.submit(
+ { intent: 'gsc-connect' },
+ { method: 'post' },
+ )
+ }}
+ loading={
+ gscFetcher.state !== 'idle'
+ ? gscFetcher.formData?.get('intent') === 'gsc-connect'
+ : undefined
+ }
+ >
+ <GoogleGSVG className='size-4' />
+ {t('common.connect')}
+ </Button>
+ </div>
+ ) : (
+ <div className='flex flex-col gap-3'>
+ <Input
+ className='lg:w-1/2'
+ label={t('project.settings.gsc.linkedGoogleAccount')}
+ value={gscEmail || ''}
+ disabled
+ />
+
+ <Button
+ variant='danger-outline'
+ type='button'
+ className='max-w-max'
+ onClick={() => {
+ gscFetcher.submit(
+ { intent: 'gsc-disconnect' },
+ { method: 'post' },
+ )
+ }}
+ loading={
+ gscFetcher.state !== 'idle'
+ ? gscFetcher.formData?.get('intent') ===
+ 'gsc-disconnect'
+ : undefined
+ }
+ >
+ {t('common.disconnect')}
+ </Button>
+
+ <Select
+ fieldLabelClassName='mt-4 max-w-max'
+ className='lg:w-1/2'
+ hintClassName='lg:w-2/3'
+ label={t('project.settings.gsc.websiteProperty')}
+ hint={t('project.settings.gsc.websitePropertyHint')}
+ items={_map(gscProperties, (p) => ({
+ key: p.siteUrl,
+ label: p.siteUrl,
+ }))}
+ keyExtractor={(item) => item.key}
+ labelExtractor={(item) => item.label}
+ onSelect={(item: { key: string; label: string }) => {
+ setForm((prevForm) => ({
+ ...prevForm,
+ gscPropertyUri: item.key,
+ }))
+ }}
+ title={
+ form.gscPropertyUri ||
+ t('project.settings.gsc.selectProperty')
+ }
+ selectedItem={
+ form.gscPropertyUri
+ ? {
+ key: form.gscPropertyUri,
+ label: form.gscPropertyUri,
+ }
+ : undefined
+ }
+ />
+
+ <Button
+ type='button'
+ className='max-w-max'
+ onClick={() => {
+ if (!form.gscPropertyUri) return
+ gscFetcher.submit(
+ {
+ intent: 'gsc-set-property',
+ propertyUri: form.gscPropertyUri,
+ },
+ { method: 'post' },
+ )
+ }}
+ loading={
+ gscFetcher.state !== 'idle'
+ ? gscFetcher.formData?.get('intent') ===
+ 'gsc-set-property'
+ : undefined
+ }
+ >
+ {t('common.save')}
+ </Button>
+ </div>
+ )}
+
+ {gscConnected || !gscAvailable ? null : (
+ <>
+ <hr className='-mx-4 mt-4 mb-4 border-gray-200 dark:border-slate-800' />
+
+ <Text
+ as='p'
+ size='sm'
+ className='text-gray-800 dark:text-gray-200'
+ >
<Trans
t={t}
- i18nKey='project.settings.gsc.notConfigured'
- defaults='Google Search Console is not configured on this server. To enable it, set <code>GOOGLE_GSC_CLIENT_ID</code>, <code>GOOGLE_GSC_CLIENT_SECRET</code> and <code>BASE_URL</code> in your API container environment, then restart it. <url>See the self-hosting guide</url>.'
+ i18nKey='project.settings.gsc.connectDisclaimer'
components={{
- code: (
- <code className='rounded bg-amber-100 px-1 py-0.5 font-mono text-xs dark:bg-amber-900/60' />
- ),
url: (
<a
- href='https://docs.swetrix.com/selfhosting/google-search-console'
+ href='https://search.google.com/search-console/about'
target='_blank'
rel='noopener noreferrer'
className='font-medium underline decoration-dashed hover:decoration-solid'
@@ -1249,149 +1387,9 @@ const ProjectSettings = () => {
),
}}
/>
- </div>
- ) : !gscConnected ? (
- <div className='flex flex-col items-center justify-between gap-4 md:flex-row'>
- <Text
- as='p'
- size='sm'
- className='text-gray-800 dark:text-gray-200'
- >
- {t('project.settings.gsc.connect')}
- </Text>
- <Button
- className='flex items-center gap-2'
- type='button'
- onClick={() => {
- gscFetcher.submit(
- { intent: 'gsc-connect' },
- { method: 'post' },
- )
- }}
- loading={
- gscFetcher.state !== 'idle'
- ? gscFetcher.formData?.get('intent') ===
- 'gsc-connect'
- : undefined
- }
- >
- <GoogleGSVG className='size-4' />
- {t('common.connect')}
- </Button>
- </div>
- ) : (
- <div className='flex flex-col gap-3'>
- <Input
- className='lg:w-1/2'
- label={t('project.settings.gsc.linkedGoogleAccount')}
- value={gscEmail || ''}
- disabled
- />
-
- <Button
- variant='danger-outline'
- type='button'
- className='max-w-max'
- onClick={() => {
- gscFetcher.submit(
- { intent: 'gsc-disconnect' },
- { method: 'post' },
- )
- }}
- loading={
- gscFetcher.state !== 'idle'
- ? gscFetcher.formData?.get('intent') ===
- 'gsc-disconnect'
- : undefined
- }
- >
- {t('common.disconnect')}
- </Button>
-
- <Select
- fieldLabelClassName='mt-4 max-w-max'
- className='lg:w-1/2'
- hintClassName='lg:w-2/3'
- label={t('project.settings.gsc.websiteProperty')}
- hint={t('project.settings.gsc.websitePropertyHint')}
- items={_map(gscProperties, (p) => ({
- key: p.siteUrl,
- label: p.siteUrl,
- }))}
- keyExtractor={(item) => item.key}
- labelExtractor={(item) => item.label}
- onSelect={(item: { key: string; label: string }) => {
- setForm((prevForm) => ({
- ...prevForm,
- gscPropertyUri: item.key,
- }))
- }}
- title={
- form.gscPropertyUri ||
- t('project.settings.gsc.selectProperty')
- }
- selectedItem={
- form.gscPropertyUri
- ? {
- key: form.gscPropertyUri,
- label: form.gscPropertyUri,
- }
- : undefined
- }
- />
-
- <Button
- type='button'
- className='max-w-max'
- onClick={() => {
- if (!form.gscPropertyUri) return
- gscFetcher.submit(
- {
- intent: 'gsc-set-property',
- propertyUri: form.gscPropertyUri,
- },
- { method: 'post' },
- )
- }}
- loading={
- gscFetcher.state !== 'idle'
- ? gscFetcher.formData?.get('intent') ===
- 'gsc-set-property'
- : undefined
- }
- >
- {t('common.save')}
- </Button>
- </div>
- )}
-
- {gscConnected || !gscAvailable ? null : (
- <>
- <hr className='-mx-4 mt-4 mb-4 border-gray-200 dark:border-slate-800' />
-
- <Text
- as='p'
- size='sm'
- className='text-gray-800 dark:text-gray-200'
- >
- <Trans
- t={t}
- i18nKey='project.settings.gsc.connectDisclamer'
- components={{
- url: (
- <a
- href='https://search.google.com/search-console/about'
- target='_blank'
- rel='noopener noreferrer'
- className='font-medium underline decoration-dashed hover:decoration-solid'
- />
- ),
- }}
- />
- </Text>
- </>
- )}
- </div>
+ </Text>
+ </>
+ )}
</div>
) : null}
@@ -1442,98 +1440,104 @@ const ProjectSettings = () => {
description={activeTabConfig.description}
iconColorClass={activeTabConfig.iconColor}
/>
- <div className='rounded-lg border border-gray-200 p-4 dark:border-slate-800'>
- <Text as='h3' size='lg' weight='medium' className='mb-2'>
- {t('project.settings.captcha.title')}
- </Text>
- <Text as='p' size='sm' colour='muted' className='mb-4'>
- {t('project.settings.captcha.description')}
- </Text>
-
- {captchaSecretKey ? (
- <>
- <Input
- label={t('project.settings.captcha.secretKey')}
- hint={t('project.settings.captcha.learnMore')}
- name='captchaSecretKey'
- type='password'
- className='mt-4 lg:w-1/2'
- value={captchaSecretKey}
- readOnly
- />
- <div className='mt-4 flex gap-2'>
- <Button
- variant='danger'
- type='button'
- onClick={() => setShowRegenerateSecret(true)}
- >
- {t('project.settings.captcha.regenerateKey')}
- </Button>
- </div>
-
- <div className='mt-6'>
- <Select
- label={t('project.settings.captcha.difficulty')}
- hint={
- captchaDifficultyMode === 'auto'
- ? t('project.settings.captcha.difficultyAutoHint')
- : t('project.settings.captcha.difficultyHint')
- }
- className='lg:w-1/2'
- hintClassName='lg:w-2/3'
- items={captchaDifficultyItems}
- keyExtractor={(item) => String(item.value)}
- labelExtractor={(item) => item.label}
- selectedItem={selectedCaptchaDifficultyItem}
- onSelect={(item: {
- value: number | 'auto'
- label: string
- }) => {
- if (item.value === 'auto') {
- setCaptchaDifficultyMode('auto')
- return
- }
-
- setCaptchaDifficultyMode('manual')
- setCaptchaDifficulty(item.value)
+ {captchaSecretKey ? (
+ <>
+ <Input
+ label={t('project.settings.captcha.secretKey')}
+ hint={
+ <Trans
+ t={t}
+ i18nKey='project.settings.captcha.keyHint'
+ components={{
+ url: (
+ <a
+ href='https://swetrix.com/docs/captcha/server-side-validation'
+ target='_blank'
+ rel='noopener noreferrer'
+ className='font-medium underline decoration-dashed hover:decoration-solid'
+ />
+ ),
}}
- title={selectedCaptchaDifficultyItem.label}
/>
- <Button
- type='button'
- className='mt-4'
- loading={fetcher.state === 'submitting'}
- onClick={() => {
- const formData = new FormData()
- formData.set('intent', 'update-project')
- if (captchaDifficultyMode === 'manual') {
- formData.set(
- 'captchaDifficulty',
- captchaDifficulty.toString(),
- )
- }
+ }
+ name='captchaSecretKey'
+ type='password'
+ className='mt-4 lg:w-1/2'
+ value={captchaSecretKey}
+ readOnly
+ />
+ <div className='mt-4 flex gap-2'>
+ <Button
+ variant='danger'
+ type='button'
+ onClick={() => setShowRegenerateSecret(true)}
+ >
+ {t('project.settings.captcha.regenerateKey')}
+ </Button>
+ </div>
+
+ <div className='mt-6'>
+ <Select
+ label={t('project.settings.captcha.difficulty')}
+ hint={
+ captchaDifficultyMode === 'auto'
+ ? t('project.settings.captcha.difficultyAutoHint')
+ : t('project.settings.captcha.difficultyHint')
+ }
+ className='lg:w-1/2'
+ hintClassName='lg:w-1/2'
+ items={captchaDifficultyItems}
+ keyExtractor={(item) => String(item.value)}
+ labelExtractor={(item) => item.label}
+ selectedItem={selectedCaptchaDifficultyItem}
+ onSelect={(item: {
+ value: number | 'auto'
+ label: string
+ }) => {
+ if (item.value === 'auto') {
+ setCaptchaDifficultyMode('auto')
+ return
+ }
+
+ setCaptchaDifficultyMode('manual')
+ setCaptchaDifficulty(item.value)
+ }}
+ title={selectedCaptchaDifficultyItem.label}
+ />
+ <Button
+ type='button'
+ className='mt-4'
+ loading={fetcher.state === 'submitting'}
+ onClick={() => {
+ const formData = new FormData()
+ formData.set('intent', 'update-project')
+ if (captchaDifficultyMode === 'manual') {
formData.set(
- 'captchaDifficultyMode',
- captchaDifficultyMode,
+ 'captchaDifficulty',
+ captchaDifficulty.toString(),
)
- fetcher.submit(formData, { method: 'post' })
- }}
- >
- {t('common.save')}
- </Button>
- </div>
- </>
- ) : (
- <>
- <Text as='p' size='sm' colour='muted' className='mb-4'>
- {t('project.settings.captcha.noKeyGenerated')}
- </Text>
- <Button type='button' onClick={onRegenerateCaptchaKey}>
- {t('project.settings.captcha.generateKey')}
+ }
+ formData.set(
+ 'captchaDifficultyMode',
+ captchaDifficultyMode,
+ )
+ fetcher.submit(formData, { method: 'post' })
+ }}
+ >
+ {t('common.save')}
</Button>
- </>
- )}
- </div>
+ </div>
+ </>
+ ) : (
+ <>
+ <Text as='p' size='sm' colour='secondary' className='mb-4'>
+ {t('project.settings.captcha.noKeyGenerated')}
+ </Text>
+ <Button type='button' onClick={onRegenerateCaptchaKey}>
+ {t('project.settings.captcha.generateKey')}
+ </Button>
+ </>
+ )}
</div>
) : null}
diff --git a/web/app/pages/Project/Settings/components/BotProtectionReport.tsx b/web/app/pages/Project/Settings/components/BotProtectionReport.tsx
index 7caf50799..83b4d3d05 100644
--- a/web/app/pages/Project/Settings/components/BotProtectionReport.tsx
+++ b/web/app/pages/Project/Settings/components/BotProtectionReport.tsx
@@ -99,7 +99,7 @@ const BotProtectionReport = ({ pid }: BotProtectionReportProps) => {
formattedTotal
)}
</Text>
- <Text as='p' size='sm' colour='muted' className='mt-1'>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
{t('project.settings.botProtectionReport.subtitle', {
count: total,
})}
@@ -153,7 +153,7 @@ const BotProtectionReport = ({ pid }: BotProtectionReportProps) => {
isLoading && 'opacity-60',
)}
>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
{t('project.settings.botProtectionReport.empty')}
</Text>
</div>
@@ -246,13 +246,13 @@ const ReportColumn = ({
as='p'
size='xs'
weight='semibold'
- colour='muted'
+ colour='secondary'
className='tracking-[0.08em] uppercase'
>
{label}
</Text>
{isEmpty ? (
- <Text as='p' size='sm' colour='muted' className='mt-3'>
+ <Text as='p' size='sm' colour='secondary' className='mt-3'>
{emptyText}
</Text>
) : (
diff --git a/web/app/pages/Project/Settings/components/DataImportTab.tsx b/web/app/pages/Project/Settings/components/DataImportTab.tsx
index d79a1c97a..2a3caeba7 100644
--- a/web/app/pages/Project/Settings/components/DataImportTab.tsx
+++ b/web/app/pages/Project/Settings/components/DataImportTab.tsx
@@ -406,7 +406,7 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {
<Text as='h3' size='base' weight='semibold' colour='primary'>
{t('project.settings.dataImport.importFrom')}
</Text>
- <Text as='p' size='sm' colour='muted' className='mt-1'>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
{t('project.settings.dataImport.importFromDesc')}
</Text>
@@ -443,12 +443,12 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {
<Text as='p' size='sm' weight='semibold' colour='primary'>
{name}
</Text>
- <Text as='p' size='xs' colour='muted'>
+ <Text as='p' size='xs' colour='secondary'>
{subtitle}
</Text>
</div>
</div>
- <Text as='p' size='xs' colour='muted' className='mt-2'>
+ <Text as='p' size='xs' colour='secondary' className='mt-2'>
{t(`project.settings.dataImport.${provider}.description`)}
</Text>
</button>
@@ -469,7 +469,7 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {
) : imports.length === 0 ? (
<div className='mt-4 rounded-lg border border-dashed border-gray-300 py-8 text-center dark:border-slate-700'>
<UploadIcon className='mx-auto size-8 text-gray-400 dark:text-gray-500' />
- <Text as='p' size='sm' colour='muted' className='mt-2'>
+ <Text as='p' size='sm' colour='secondary' className='mt-2'>
{t('project.settings.dataImport.noImports')}
</Text>
</div>
@@ -592,7 +592,7 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {
size='medium'
message={
<div className='space-y-4'>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
<Trans
i18nKey='project.settings.dataImport.uploadInstructions'
t={t}
@@ -617,7 +617,7 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {
uploading ? (
t('project.settings.dataImport.uploadingProcessing')
) : (
- <Text as='span' size='sm' colour='muted'>
+ <Text as='span' size='sm' colour='secondary'>
<Text as='span' weight='medium' colour='primary'>
{t('project.settings.dataImport.clickToUpload')}
</Text>{' '}
@@ -663,7 +663,7 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {
<div className='space-y-4'>
{!ga4Connected ? (
<>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
{t(
'project.settings.dataImport.google-analytics.connectDesc',
)}
@@ -700,7 +700,7 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {
<Text
as='p'
size='sm'
- colour='muted'
+ colour='secondary'
className='py-4 text-center'
>
{t('project.settings.dataImport.google-analytics.noProperties')}
@@ -724,7 +724,7 @@ export default function DataImportTab({ projectId }: DataImportTabProps) {
}
onSelect={(prop) => setGa4SelectedProperty(prop.propertyId)}
/>
- <Text as='p' size='xs' colour='muted'>
+ <Text as='p' size='xs' colour='secondary'>
{t('project.settings.dataImport.google-analytics.importNote')}
</Text>
</>
diff --git a/web/app/pages/Project/Settings/components/ProxyDomainsTab.tsx b/web/app/pages/Project/Settings/components/ProxyDomainsTab.tsx
index 17fe0978c..eb74774bd 100644
--- a/web/app/pages/Project/Settings/components/ProxyDomainsTab.tsx
+++ b/web/app/pages/Project/Settings/components/ProxyDomainsTab.tsx
@@ -170,7 +170,7 @@ function DnsRecordTable({ domain }: { domain: ProxyDomain }) {
as='span'
size='xs'
weight='semibold'
- colour='muted'
+ colour='secondary'
tracking='wide'
className='uppercase'
>
@@ -481,7 +481,7 @@ export default function ProxyDomainsTab({ projectId }: ProxyDomainsTabProps) {
<Text as='h4' size='sm' weight='semibold' colour='primary'>
{t('project.settings.proxy.installSnippetTitle')}
</Text>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
{t('project.settings.proxy.installSnippetDescription')}
</Text>
<div>
@@ -521,7 +521,7 @@ export default function ProxyDomainsTab({ projectId }: ProxyDomainsTabProps) {
<Text as='h4' size='sm' weight='semibold' colour='primary'>
{t('project.settings.proxy.almostThere')}
</Text>
- <Text as='p' size='sm' colour='muted' className='mt-1'>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
<Trans
i18nKey='project.settings.proxy.cnameInstructions'
t={t}
@@ -553,7 +553,7 @@ export default function ProxyDomainsTab({ projectId }: ProxyDomainsTabProps) {
{t('project.settings.proxy.issuingTitle')}
</Text>
</div>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
{t('project.settings.proxy.issuingDescription')}
</Text>
</div>
@@ -562,7 +562,7 @@ export default function ProxyDomainsTab({ projectId }: ProxyDomainsTabProps) {
return (
<div className='space-y-6'>
<div>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
<Trans
i18nKey='project.settings.proxy.descriptionWithDocs'
t={t}
@@ -572,7 +572,7 @@ export default function ProxyDomainsTab({ projectId }: ProxyDomainsTabProps) {
href={DOCS_URL}
target='_blank'
rel='noreferrer'
- className='font-medium text-indigo-600 underline decoration-dashed underline-offset-2 hover:decoration-solid dark:text-indigo-400'
+ className='font-medium underline decoration-dashed hover:decoration-solid'
>
{''}
</a>
@@ -607,7 +607,7 @@ export default function ProxyDomainsTab({ projectId }: ProxyDomainsTabProps) {
</div>
) : domains.length === 0 ? (
<div className='mt-4 rounded-lg border border-dashed border-gray-300 py-8 text-center dark:border-slate-700'>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
{t('project.settings.proxy.noDomains')}
</Text>
</div>
@@ -646,7 +646,7 @@ export default function ProxyDomainsTab({ projectId }: ProxyDomainsTabProps) {
<Text
as='p'
size='xs'
- colour='muted'
+ colour='secondary'
className='mt-0.5 truncate'
>
{domain.liveSince
diff --git a/web/app/pages/Project/Settings/tabs/AccessSettings.tsx b/web/app/pages/Project/Settings/tabs/AccessSettings.tsx
index 3f35678f3..e8956c73d 100644
--- a/web/app/pages/Project/Settings/tabs/AccessSettings.tsx
+++ b/web/app/pages/Project/Settings/tabs/AccessSettings.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next'
import { isSelfhosted } from '~/lib/constants'
import Checkbox from '~/ui/Checkbox'
+import Input from '~/ui/Input'
import Select from '~/ui/Select'
import { Text } from '~/ui/Text'
@@ -16,6 +17,8 @@ interface AccessSettingsProps {
organisations: { id?: string; name: string }[]
onAssignOrganisation: (id?: string) => Promise<void>
openPasswordModal: () => void
+ handleInput: (e: React.ChangeEvent<HTMLInputElement>) => void
+ sharableLink: string
}
const AccessSettings = ({
@@ -24,6 +27,8 @@ const AccessSettings = ({
organisations,
onAssignOrganisation,
openPasswordModal,
+ handleInput,
+ sharableLink,
}: AccessSettingsProps) => {
const { t } = useTranslation('common')
@@ -32,6 +37,16 @@ const AccessSettings = ({
<Text as='h3' size='lg' weight='bold'>
{t('project.settings.access')}
</Text>
+ <Input
+ name='sharableLink'
+ label={t('project.settings.sharableLink')}
+ hint={t('project.settings.sharableDesc')}
+ value={sharableLink}
+ className='mt-4'
+ onChange={handleInput}
+ error={null}
+ disabled
+ />
<Checkbox
checked={Boolean(form.public)}
onChange={(checked) => {
@@ -91,6 +106,7 @@ const AccessSettings = ({
}))
}}
label={t('project.settings.organisation')}
+ hint={t('project.settings.organisationHint')}
title={
organisations.find((org) => org.id === form.organisationId)?.name
}
diff --git a/web/app/pages/Project/Settings/tabs/DangerZone.tsx b/web/app/pages/Project/Settings/tabs/DangerZone.tsx
index 218af5b78..c47437aae 100644
--- a/web/app/pages/Project/Settings/tabs/DangerZone.tsx
+++ b/web/app/pages/Project/Settings/tabs/DangerZone.tsx
@@ -1,9 +1,30 @@
+import type { ReactNode } from 'react'
import { useTranslation } from 'react-i18next'
import Button from '~/ui/Button'
import Checkbox from '~/ui/Checkbox'
import { Text } from '~/ui/Text'
+interface DangerActionProps {
+ title: string
+ description: string
+ action: ReactNode
+}
+
+const DangerAction = ({ title, description, action }: DangerActionProps) => (
+ <div className='flex flex-col items-start gap-4 py-5 sm:flex-row sm:items-center sm:justify-between'>
+ <div>
+ <Text as='h4' size='sm' weight='medium'>
+ {title}
+ </Text>
+ <Text as='p' size='sm' colour='secondary' className='mt-1'>
+ {description}
+ </Text>
+ </div>
+ <div className='shrink-0'>{action}</div>
+ </div>
+)
+
interface DangerZoneProps {
isActive: boolean
onToggleActive: (active: boolean) => void
@@ -29,91 +50,75 @@ const DangerZone = ({
return (
<div>
- <Text as='h3' size='lg' weight='bold'>
- {t('project.settings.tabs.danger')}
- </Text>
-
- <div className='mt-6 mb-8'>
- <Checkbox
- checked={isActive}
- onChange={onToggleActive}
- name='active'
- label={t('project.settings.enabled')}
- hint={t('project.settings.enabledHint')}
- />
- <div className='mt-4 flex'>
+ <section>
+ <Text as='h3' size='lg' weight='bold'>
+ {t('project.settings.projectStatus')}
+ </Text>
+ <div className='mt-2'>
+ <Checkbox
+ checked={isActive}
+ onChange={onToggleActive}
+ name='active'
+ label={t('project.settings.enabled')}
+ hint={t('project.settings.enabledHint')}
+ classes={{ hint: 'max-w-prose' }}
+ />
+ </div>
+ <div className='mt-4'>
<Button type='submit' loading={isSaving}>
{t('common.save')}
</Button>
</div>
- </div>
+ </section>
- <hr className='my-6 border-gray-200 dark:border-gray-800' />
-
- <div className='flex flex-col gap-6'>
- <div className='flex flex-col items-start gap-4 sm:flex-row sm:items-center sm:justify-between'>
- <div>
- <Text as='div' size='sm' weight='medium'>
- {t('project.settings.transfer')}
- </Text>
- <Text as='p' size='sm' colour='muted' className='mt-1'>
- {t('project.settings.transferShort')}
- </Text>
- </div>
- <Button
- variant='danger-outline'
- type='button'
- onClick={() => setShowTransfer(true)}
- className='shrink-0'
- >
- {t('project.settings.transfer')}
- </Button>
- </div>
-
- <hr className='border-gray-200 dark:border-gray-800' />
-
- <div className='flex flex-col items-start gap-4 sm:flex-row sm:items-center sm:justify-between'>
- <div>
- <Text as='div' size='sm' weight='medium'>
- {t('project.settings.reset')}
- </Text>
- <Text as='p' size='sm' colour='muted' className='mt-1'>
- {t('project.settings.resetShort')}
- </Text>
- </div>
- <Button
- variant='danger-outline'
- type='button'
- onClick={() => !setResetting && setShowReset(true)}
- loading={setResetting}
- className='shrink-0'
- >
- {t('project.settings.reset')}
- </Button>
- </div>
-
- <hr className='border-gray-200 dark:border-gray-800' />
-
- <div className='flex flex-col items-start gap-4 sm:flex-row sm:items-center sm:justify-between'>
- <div>
- <Text as='div' size='sm' weight='medium'>
- {t('project.settings.delete')}
- </Text>
- <Text as='p' size='sm' colour='muted' className='mt-1'>
- {t('project.settings.deleteShort')}
- </Text>
- </div>
- <Button
- variant='danger'
- type='button'
- onClick={() => !isDeleting && setShowDelete(true)}
- loading={isDeleting}
- className='shrink-0'
- >
- {t('project.settings.delete')}
- </Button>
+ <section className='mt-8'>
+ <Text as='h3' size='lg' weight='bold'>
+ {t('project.settings.destructiveActions')}
+ </Text>
+ <div className='mt-2 divide-y divide-gray-200 dark:divide-gray-800'>
+ <DangerAction
+ title={t('project.settings.transfer')}
+ description={t('project.settings.transferShort')}
+ action={
+ <Button
+ variant='danger-outline'
+ type='button'
+ onClick={() => setShowTransfer(true)}
+ >
+ {t('project.settings.transfer')}
+ </Button>
+ }
+ />
+ <DangerAction
+ title={t('project.settings.reset')}
+ description={t('project.settings.resetShort')}
+ action={
+ <Button
+ variant='danger-outline'
+ type='button'
+ onClick={() => !setResetting && setShowReset(true)}
+ loading={setResetting}
+ >
+ {t('project.settings.reset')}
+ </Button>
+ }
+ />
+ <DangerAction
+ title={t('project.settings.delete')}
+ description={t('project.settings.deleteShort')}
+ action={
+ <Button
+ variant='danger'
+ type='button'
+ onClick={() => !isDeleting && setShowDelete(true)}
+ loading={isDeleting}
+ >
+ {t('project.settings.delete')}
+ </Button>
+ }
+ />
</div>
- </div>
+ </section>
</div>
)
}
diff --git a/web/app/pages/Project/Settings/tabs/General.tsx b/web/app/pages/Project/Settings/tabs/General.tsx
index 801947230..b73098e10 100644
--- a/web/app/pages/Project/Settings/tabs/General.tsx
+++ b/web/app/pages/Project/Settings/tabs/General.tsx
@@ -17,7 +17,6 @@ interface GeneralProps {
}
beenSubmitted: boolean
handleInput: (e: React.ChangeEvent<HTMLInputElement>) => void
- sharableLink: string
}
const General = ({
@@ -25,7 +24,6 @@ const General = ({
errors,
beenSubmitted,
handleInput,
- sharableLink,
}: GeneralProps) => {
const { t } = useTranslation('common')
@@ -37,6 +35,7 @@ const General = ({
<Input
name='name'
label={t('project.settings.name')}
+ hint={t('project.settings.nameHint')}
value={form.name}
placeholder='My awesome project'
className='mt-2'
@@ -72,16 +71,6 @@ const General = ({
onChange={handleInput}
error={null}
/>
- <Input
- name='sharableLink'
- label={t('project.settings.sharableLink')}
- hint={t('project.settings.sharableDesc')}
- value={sharableLink}
- className='mt-4'
- onChange={handleInput}
- error={null}
- disabled
- />
</>
)
}
diff --git a/web/app/pages/Project/Settings/tabs/Revenue.tsx b/web/app/pages/Project/Settings/tabs/Revenue.tsx
index f3843ff0c..3062f86fd 100644
--- a/web/app/pages/Project/Settings/tabs/Revenue.tsx
+++ b/web/app/pages/Project/Settings/tabs/Revenue.tsx
@@ -1,8 +1,4 @@
-import {
- ArrowUpRightIcon,
- ArrowSquareOutIcon,
- CheckCircleIcon,
-} from '@phosphor-icons/react'
+import { ArrowUpRightIcon, ArrowSquareOutIcon } from '@phosphor-icons/react'
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useFetcher } from 'react-router'
@@ -13,6 +9,7 @@ import type {
ProjectSettingsActionData,
RevenueStatus,
} from '~/routes/projects.settings.$id'
+import { Badge } from '~/ui/Badge'
import Button from '~/ui/Button'
import PaddleSVG from '~/ui/icons/Paddle'
import StripeSVG from '~/ui/icons/Stripe'
@@ -22,8 +19,15 @@ import Select from '~/ui/Select'
import { Text } from '~/ui/Text'
type RevenueProvider = 'stripe' | 'paddle'
+type RevenueCurrency = 'USD' | 'EUR' | 'GBP'
-const SUPPORTED_CURRENCIES = [
+interface CurrencyOption {
+ code: RevenueCurrency
+ symbol: string
+ name: string
+}
+
+const SUPPORTED_CURRENCIES: CurrencyOption[] = [
{ code: 'USD', symbol: '$', name: 'US Dollar' },
{ code: 'EUR', symbol: '€', name: 'Euro' },
{ code: 'GBP', symbol: 'Β£', name: 'British Pound' },
@@ -53,14 +57,14 @@ interface ProviderConfig {
const PROVIDER_CONFIG: Record<RevenueProvider, ProviderConfig> = {
stripe: {
label: 'Stripe',
- icon: <StripeSVG className='h-5 w-5' />,
+ icon: <StripeSVG className='size-6' />,
apiKeyPrefix: 'rk_live_',
apiKeyCreateUrl: STRIPE_API_KEY_CREATE_URL,
docsUrl: `${DOCS_URL}/revenue/stripe`,
},
paddle: {
label: 'Paddle',
- icon: <PaddleSVG className='h-5 w-5' />,
+ icon: <PaddleSVG className='size-6' />,
apiKeyPrefix: 'pdl_live_',
docsUrl: `${DOCS_URL}/revenue/paddle`,
},
@@ -68,18 +72,6 @@ const PROVIDER_CONFIG: Record<RevenueProvider, ProviderConfig> = {
const REVENUE_PROVIDERS: RevenueProvider[] = ['stripe', 'paddle']
-interface ProviderItem {
- id: RevenueProvider
- label: string
- icon: React.ReactNode
-}
-
-const PROVIDER_ITEMS: ProviderItem[] = REVENUE_PROVIDERS.map((p) => ({
- id: p,
- label: PROVIDER_CONFIG[p].label,
- icon: PROVIDER_CONFIG[p].icon,
-}))
-
interface Props {
projectId: string
}
@@ -90,16 +82,17 @@ const Revenue = ({ projectId }: Props) => {
const [status, setStatus] = useState<RevenueStatus | null>(null)
const [isLoading, setIsLoading] = useState(true)
- const [apiKey, setApiKey] = useState('')
- const [selectedProvider, setSelectedProvider] =
- useState<RevenueProvider>('stripe')
- const [selectedCurrency, setSelectedCurrency] = useState<
- 'USD' | 'EUR' | 'GBP'
- >('USD')
+ const [apiKeys, setApiKeys] = useState<Record<RevenueProvider, string>>({
+ stripe: '',
+ paddle: '',
+ })
+ const [selectedCurrency, setSelectedCurrency] =
+ useState<RevenueCurrency>('USD')
const isConnecting =
fetcher.state !== 'idle' &&
fetcher.formData?.get('intent') === 'connect-revenue'
+ const connectingProvider = fetcher.formData?.get('provider')?.toString()
const isDisconnecting =
fetcher.state !== 'idle' &&
fetcher.formData?.get('intent') === 'disconnect-revenue'
@@ -123,12 +116,6 @@ const Revenue = ({ projectId }: Props) => {
setIsLoading(false)
if (success && revenueStatus) {
setStatus(revenueStatus)
- if (
- revenueStatus.provider === 'stripe' ||
- revenueStatus.provider === 'paddle'
- ) {
- setSelectedProvider(revenueStatus.provider)
- }
if (
revenueStatus.currency === 'USD' ||
revenueStatus.currency === 'EUR' ||
@@ -142,7 +129,7 @@ const Revenue = ({ projectId }: Props) => {
} else if (intent === 'connect-revenue') {
if (success) {
toast.success(t('project.settings.revenue.connected'))
- setApiKey('')
+ setApiKeys({ stripe: '', paddle: '' })
fetcher.submit(
{ intent: 'get-revenue-status' },
{ method: 'POST', action: `/projects/settings/${projectId}` },
@@ -170,8 +157,14 @@ const Revenue = ({ projectId }: Props) => {
}
}, [fetcher.state, fetcher.data, t, projectId, selectedCurrency, fetcher])
- const handleConnect = () => {
- if (!apiKey.trim()) {
+ const handleApiKeyChange = (provider: RevenueProvider, value: string) => {
+ setApiKeys((prev) => ({ ...prev, [provider]: value }))
+ }
+
+ const handleConnect = (provider: RevenueProvider) => {
+ const apiKey = apiKeys[provider].trim()
+
+ if (!apiKey) {
toast.error(t('project.settings.revenue.apiKeyRequired'))
return
}
@@ -179,7 +172,7 @@ const Revenue = ({ projectId }: Props) => {
fetcher.submit(
{
intent: 'connect-revenue',
- provider: selectedProvider,
+ provider,
apiKey,
currency: selectedCurrency,
},
@@ -203,6 +196,9 @@ const Revenue = ({ projectId }: Props) => {
)
}
+ const isConnectingProvider = (provider: RevenueProvider) =>
+ isConnecting && connectingProvider === provider
+
if (isLoading) {
return (
<div className='flex min-h-[200px] items-center justify-center'>
@@ -211,182 +207,170 @@ const Revenue = ({ projectId }: Props) => {
)
}
- const providerConfig = PROVIDER_CONFIG[selectedProvider]
- const isConnected = Boolean(status?.connected)
- const connectedProvider = status?.provider as RevenueProvider | undefined
- const connectedProviderConfig = connectedProvider
- ? PROVIDER_CONFIG[connectedProvider]
- : null
- const selectedProviderItem = PROVIDER_ITEMS.find(
- (p) => p.id === selectedProvider,
- )
+ const connectedProvider =
+ status?.provider === 'stripe' || status?.provider === 'paddle'
+ ? status.provider
+ : undefined
+ const isConnected = Boolean(status?.connected && connectedProvider)
+ const selectedCurrencyItem =
+ SUPPORTED_CURRENCIES.find((c) => c.code === selectedCurrency) ||
+ SUPPORTED_CURRENCIES[0]
+ const currencyTitle = `${selectedCurrencyItem.code} – ${selectedCurrencyItem.name} (${selectedCurrencyItem.symbol})`
+
+ const renderProviderSection = (provider: RevenueProvider) => {
+ const config = PROVIDER_CONFIG[provider]
+ const providerConnected = isConnected && connectedProvider === provider
+ const providerHelpUrl = config.apiKeyCreateUrl || config.docsUrl
+ const providerHelpLabel = config.apiKeyCreateUrl
+ ? t('project.settings.revenue.createApiKeyLink', {
+ provider: config.label,
+ })
+ : t('project.settings.revenue.setupGuideLink', {
+ provider: config.label,
+ })
- return (
- <div>
- <Text as='h3' size='lg' weight='bold' colour='primary'>
- {t('project.settings.revenue.title')}
- </Text>
- <Text as='p' size='sm' colour='secondary' className='mt-1'>
- {t('project.settings.revenue.description')}
- </Text>
+ return (
+ <section key={provider} className={provider === 'paddle' ? 'mt-6' : ''}>
+ <Text
+ as='h3'
+ size='lg'
+ weight='medium'
+ className='mb-2 flex items-center gap-2'
+ >
+ {config.icon}
+ {config.label}
+ <Badge
+ colour={providerConnected ? 'green' : 'slate'}
+ size='sm'
+ label={
+ providerConnected
+ ? t('common.connected')
+ : t('common.notConnected')
+ }
+ />
+ </Text>
- {/* Provider Connection Card */}
- <div className='mt-4 rounded-lg border border-gray-200 p-4 dark:border-slate-800'>
- <div className='flex items-center gap-2'>
- <div>{connectedProviderConfig?.icon || providerConfig.icon}</div>
- <Text as='h4' size='base' weight='medium' colour='primary'>
- {t('project.settings.revenue.paymentProvider')}
+ <Input
+ name={`${provider}ApiKey`}
+ type='password'
+ label={t('project.settings.revenue.providerApiKey', {
+ provider: config.label,
+ })}
+ hint={
+ <>
+ {t(`project.settings.revenue.apiKeyHints.${provider}`)}{' '}
+ {providerHelpUrl ? (
+ <a
+ href={providerHelpUrl}
+ target='_blank'
+ rel='noreferrer noopener'
+ className='inline-flex items-center font-medium underline decoration-dashed hover:decoration-solid'
+ >
+ {providerHelpLabel}
+ <ArrowUpRightIcon className='ml-0.5 h-3 w-3' />
+ </a>
+ ) : null}
+ </>
+ }
+ value={apiKeys[provider]}
+ className='lg:w-1/2'
+ placeholder={
+ providerConnected
+ ? t('project.settings.revenue.storedKeyPlaceholder')
+ : `${config.apiKeyPrefix}********************`
+ }
+ onChange={(e) => handleApiKeyChange(provider, e.target.value)}
+ disabled={isConnecting || isDisconnecting}
+ />
+
+ {providerConnected && status?.lastSyncAt ? (
+ <Text as='p' size='sm' colour='secondary' className='mt-2'>
+ {t('project.settings.revenue.lastSync', {
+ date: new Date(status.lastSyncAt).toLocaleString(),
+ })}
</Text>
- {isConnected ? (
- <Text
- size='sm'
- colour='success'
- className='ml-auto flex items-center gap-1'
- >
- <CheckCircleIcon className='h-4 w-4' />
- {t('common.connected')}
- </Text>
- ) : null}
- </div>
-
- {isConnected && connectedProviderConfig ? (
- <div className='mt-4 flex flex-col gap-4'>
- <Input
- label={t('project.settings.revenue.connectedTo')}
- value={connectedProviderConfig.label}
- className='lg:w-1/2'
- disabled
- />
-
- {status?.lastSyncAt ? (
- <Text as='p' size='sm' colour='muted'>
- {t('project.settings.revenue.lastSync', {
- date: new Date(status.lastSyncAt).toLocaleString(),
- })}{' '}
- </Text>
- ) : null}
+ ) : null}
+ <div className='mt-4 flex flex-wrap gap-2'>
+ <Button
+ type='button'
+ className='max-w-max'
+ onClick={() => handleConnect(provider)}
+ loading={isConnectingProvider(provider)}
+ disabled={
+ (isConnecting && !isConnectingProvider(provider)) ||
+ isDisconnecting
+ }
+ >
+ {providerConnected
+ ? t('project.settings.revenue.updateKey')
+ : t('common.connect')}
+ </Button>
+ {providerConnected ? (
<Button
variant='danger-outline'
type='button'
className='max-w-max'
onClick={handleDisconnect}
loading={isDisconnecting}
+ disabled={isConnecting}
>
{t('common.disconnect')}
</Button>
- </div>
- ) : (
- <div className='mt-4 flex flex-col gap-4'>
- <Select
- label={t('project.settings.revenue.provider')}
- className='lg:w-1/2'
- title={providerConfig.label}
- items={PROVIDER_ITEMS}
- labelExtractor={(item) => (
- <div className='flex items-center gap-2'>
- {item.icon}
- <Text>{item.label}</Text>
- </div>
- )}
- keyExtractor={(item) => item.id}
- selectedItem={selectedProviderItem}
- onSelect={(item: ProviderItem) => {
- setSelectedProvider(item.id)
- }}
- />
-
- <div>
- <Input
- name='apiKey'
- type='password'
- label={t('project.settings.revenue.apiKey')}
- hint={
- providerConfig.apiKeyCreateUrl ? (
- <Text as='span' size='sm' colour='muted'>
- {t('project.settings.revenue.createApiKeyHint')}{' '}
- <a
- href={providerConfig.apiKeyCreateUrl}
- target='_blank'
- rel='noreferrer noopener'
- className='inline-flex items-center font-medium underline decoration-dashed hover:decoration-solid'
- >
- {providerConfig.label}{' '}
- {t('project.settings.revenue.dashboard')}
- <ArrowUpRightIcon className='ml-0.5 h-3 w-3' />
- </a>
- </Text>
- ) : undefined
- }
- value={apiKey}
- className='lg:w-1/2'
- placeholder={`${providerConfig.apiKeyPrefix}********************`}
- onChange={(e) => setApiKey(e.target.value)}
- disabled={isConnecting}
- />
- </div>
-
- <Button
- type='button'
- className='max-w-max'
- onClick={handleConnect}
- loading={isConnecting}
- >
- {t('common.connect')}
- </Button>
- </div>
- )}
- </div>
-
- {/* Currency Settings */}
- <div className='mt-6 rounded-lg border border-gray-200 p-4 dark:border-slate-800'>
- <Text as='h4' size='base' weight='medium' colour='primary'>
- {t('project.settings.revenue.currency')}
- </Text>
- <Text as='p' size='sm' colour='secondary' className='mt-1'>
- {t('project.settings.revenue.currencyDescription')}
- </Text>
-
- <div className='mt-4 flex flex-col gap-4'>
- <Select
- className='lg:w-1/2'
- title={`${selectedCurrency} – ${SUPPORTED_CURRENCIES.find((c) => c.code === selectedCurrency)?.name} (${SUPPORTED_CURRENCIES.find((c) => c.code === selectedCurrency)?.symbol})`}
- items={SUPPORTED_CURRENCIES}
- keyExtractor={(item) => item.code}
- labelExtractor={(item) =>
- `${item.code} – ${item.name} (${item.symbol})`
- }
- selectedItem={SUPPORTED_CURRENCIES.find(
- (c) => c.code === selectedCurrency,
- )}
- onSelect={(item: { code: string; name: string; symbol: string }) =>
- setSelectedCurrency(item.code as 'USD' | 'EUR' | 'GBP')
- }
- />
- <Button
- type='button'
- className='max-w-max'
- onClick={handleCurrencyChange}
- loading={isSavingCurrency}
- disabled={!isConnected}
- >
- {t('common.save')}
- </Button>
+ ) : null}
</div>
- </div>
+ </section>
+ )
+ }
+
+ return (
+ <div>
+ {REVENUE_PROVIDERS.map(renderProviderSection)}
+
+ <Text
+ as='h3'
+ size='lg'
+ weight='medium'
+ colour='primary'
+ className='mt-6 mb-2'
+ >
+ {t('project.settings.revenue.settingsTitle')}
+ </Text>
- {/* Documentation Link */}
- <div className='mt-6'>
- <a
- href={DOCS_URL}
- target='_blank'
- rel='noreferrer noopener'
- className='inline-flex items-center text-sm font-medium underline decoration-dashed hover:decoration-solid'
+ <div className='flex flex-col gap-4'>
+ <Select<CurrencyOption>
+ label={t('project.settings.revenue.currency')}
+ hint={t('project.settings.revenue.currencyDescription')}
+ className='lg:w-1/2'
+ title={currencyTitle}
+ items={SUPPORTED_CURRENCIES}
+ keyExtractor={(item) => item.code}
+ labelExtractor={(item) =>
+ `${item.code} – ${item.name} (${item.symbol})`
+ }
+ selectedItem={selectedCurrencyItem}
+ onSelect={(item) => setSelectedCurrency(item.code)}
+ />
+ <Button
+ type='button'
+ className='max-w-max'
+ onClick={handleCurrencyChange}
+ loading={isSavingCurrency}
+ disabled={!isConnected}
>
- <ArrowSquareOutIcon className='mr-1.5 h-4 w-4' />
- {t('project.settings.revenue.learnMore')}
- </a>
+ {t('common.save')}
+ </Button>
</div>
+
+ <a
+ href={`${DOCS_URL}/revenue`}
+ target='_blank'
+ rel='noreferrer noopener'
+ className='mt-6 inline-flex items-center text-sm font-medium underline decoration-dashed hover:decoration-solid'
+ >
+ <ArrowSquareOutIcon className='mr-1.5 h-4 w-4' />
+ {t('project.settings.revenue.learnMore')}
+ </a>
</div>
)
}
diff --git a/web/app/pages/Project/Settings/tabs/Shields.tsx b/web/app/pages/Project/Settings/tabs/Shields.tsx
index 7aa4c6c26..b39f3bd82 100644
--- a/web/app/pages/Project/Settings/tabs/Shields.tsx
+++ b/web/app/pages/Project/Settings/tabs/Shields.tsx
@@ -115,6 +115,7 @@ const Shields = ({
name='origins'
label={t('project.settings.origins')}
hint={t('project.settings.originsHint')}
+ placeholder={t('project.settings.originsPlaceholder')}
value={form.origins || ''}
className='mt-2'
onChange={handleInput}
@@ -124,6 +125,7 @@ const Shields = ({
name='ipBlacklist'
label={t('project.settings.ipBlacklist')}
hint={t('project.settings.ipBlacklistHint')}
+ placeholder={t('project.settings.ipBlacklistPlaceholder')}
value={form.ipBlacklist || ''}
className='mt-4'
onChange={handleInput}
@@ -147,7 +149,7 @@ const Shields = ({
keyExtractor={(cc) => cc}
label={countryBlacklist}
onSearch={handleCountrySearch}
- placeholder={t('project.settings.selectCountry')}
+ placeholder={t('project.settings.countryBlacklistPlaceholder')}
onSelect={handleCountrySelect}
onRemove={handleCountryRemove}
hint={t('project.settings.countryBlacklistHint')}
@@ -157,6 +159,7 @@ const Shields = ({
<Select<BotsProtectionLevelOption>
id='botsProtectionLevel'
label={t('project.settings.botsProtectionLevel.title')}
+ hint={t('project.settings.botsProtectionLevel.hint')}
items={botsProtectionLevels}
title={
botsProtectionLevels.find(
diff --git a/web/app/ui/TabHeader.tsx b/web/app/ui/TabHeader.tsx
index fe492f241..1b0dbff8d 100644
--- a/web/app/ui/TabHeader.tsx
+++ b/web/app/ui/TabHeader.tsx
@@ -28,7 +28,7 @@ export const TabHeader = ({
<Text as='h2' size='lg' weight='semibold'>
{label}
</Text>
- <Text as='p' size='sm' colour='muted'>
+ <Text as='p' size='sm' colour='secondary'>
{description}
</Text>
</div>
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index 00216de88..794b56be3 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -1020,6 +1020,8 @@
"title": "Invite a user to {{organisation}}",
"desc": "Enter an email address and a role of the person registered on Swetrix that you want to invite to the organisation. The invitation will expire in {{expiresIn}} hours."
},
+ "peopleEmptyTitle": "No organisation members yet",
+ "peopleEmptyDescription": "Invite teammates to give them access to this organisation and the projects linked to it.",
"role": {
"owner": {
"name": "Owner",
@@ -2099,24 +2101,27 @@
"barChart": "Bar chart",
"lineChart": "Line chart",
"settings": {
- "transferShort": "Transfer ownership to another user.",
- "resetShort": "Clear analytics data. Keep project settings.",
- "deleteShort": "Permanently delete the project and all data.",
+ "projectStatus": "Project status",
+ "destructiveActions": "Destructive actions",
+ "transferShort": "Move ownership of this project to another user.",
+ "resetShort": "Delete analytics data while keeping project settings and Project ID.",
+ "deleteShort": "Permanently delete the project, settings, and all data.",
"organisation": "Organisation",
+ "organisationHint": "Link this project to an organisation to give its members view access. Organisation administrators can manage project settings, while the project owners remain responsible for billing.",
"shields": "Shields",
"blockedTraffic": "Blocked traffic",
"blockedTrafficHint": "Insights into the bot requests we filtered out before they reached your dashboard.",
"access": "Access settings",
"resetSuccess": "The project has been reset",
"gsc": {
- "connect": "Connect your project to your Google Search Console account to get stats like what keywords people are using to find your website.",
- "disconnected": "The project has been disconnected from your Google Search Console account.",
+ "connect": "Connect Google Search Console to see which search queries bring people to your website.",
+ "disconnected": "Google Search Console has been disconnected from this project.",
"selectProperty": "Select a property",
- "connectDisclamer": "For the integration to work, make sure you have set up your website on the <url>Google Search Console</url> first.",
- "propertyConnected": "Selected property saved to your project",
+ "connectDisclaimer": "Make sure your website is added and verified in <url>Google Search Console</url> before connecting.",
+ "propertyConnected": "Website property saved",
"websiteProperty": "Website property",
- "websitePropertyHint": "Select the Google Search Console property you want to see the keywords for. If you don't see your domain here, make sure you have added and verified it on the Google Search Console.",
- "linkedGoogleAccount": "Linked Google account"
+ "websitePropertyHint": "Choose the Google Search Console property Swetrix should use for search query data. If your domain is not listed, add and verify it in Google Search Console first.",
+ "linkedGoogleAccount": "Connected Google account"
},
"tabs": {
"general": "General",
@@ -2156,26 +2161,23 @@
"integrations": "Integrations"
},
"revenue": {
- "title": "Revenue Tracking",
- "description": "Connect your payment provider to track revenue and attribute sales to marketing channels.",
- "connectPaddle": "Connect Paddle",
- "connectPaddleDesc": "Enter your Paddle API key to start tracking revenue. We will automatically sync transactions from your Paddle account.",
- "paddleDocsLink": "Learn how to get your Paddle API key",
- "paymentProvider": "Payment provider",
- "provider": "Provider",
- "apiKey": "API Key",
- "apiKeyHint": "Your Paddle API key for read-only access to transactions.",
- "createApiKeyHint": "Create a restricted API key from your",
- "dashboard": "dashboard",
- "apiKeyRequired": "API key is required",
- "currency": "Reporting Currency",
- "currencyDescription": "Used for all revenue reporting and payment conversion.",
- "currencyHint": "All revenue will be converted and displayed in this currency.",
+ "providerApiKey": "{{provider}} API key",
+ "apiKeyHints": {
+ "stripe": "Paste a restricted Stripe key so Swetrix can sync payments and match revenue to traffic sources.",
+ "paddle": "Paste a Paddle API key so Swetrix can sync transactions and match revenue to traffic sources."
+ },
+ "createApiKeyLink": "Create a key in {{provider}}",
+ "setupGuideLink": "View {{provider}} setup guide",
+ "storedKeyPlaceholder": "Key stored securely, paste a new one to replace it",
+ "apiKeyRequired": "Enter an API key to connect this provider.",
+ "updateKey": "Update key",
+ "settingsTitle": "Reporting settings",
+ "currency": "Reporting currency",
+ "currencyDescription": "Choose the currency Swetrix should use when showing revenue across your analytics.",
"currencyUpdated": "Reporting currency updated",
- "learnMore": "Learn how to link revenue with traffic sources",
- "connected": "Revenue tracking connected",
- "connectedTo": "Connected to",
- "disconnected": "Revenue tracking disconnected",
+ "learnMore": "Learn how revenue attribution works",
+ "connected": "Payment provider connected",
+ "disconnected": "Payment provider disconnected",
"synced": "Synced {{count}} transactions",
"syncNow": "Sync now",
"lastSync": "Last synced: {{date}}",
@@ -2290,17 +2292,15 @@
"errorPrefix": "Error: "
},
"captcha": {
- "title": "CAPTCHA Integration",
- "description": "Enable CAPTCHA protection for your forms and actions. Generate a secret key to integrate Swetrix CAPTCHA with your application.",
"secretKey": "Secret key",
- "generateKey": "Generate secret key",
- "regenerateKey": "Regenerate secret key",
+ "generateKey": "Generate key",
+ "regenerateKey": "Regenerate key",
"keyGenerated": "Secret key has been generated",
"keyRegenerated": "Secret key has been regenerated",
"regenerateKeyTitle": "Regenerate secret key?",
"regenerateKeyWarning": "Are you sure you want to regenerate the secret key? This will invalidate the current key and all applications using it will need to be updated.",
- "noKeyGenerated": "No secret key has been generated yet. Generate one to enable CAPTCHA for this project.",
- "learnMore": "Use this secret key in your backend to verify CAPTCHA tokens. Learn more in our documentation.",
+ "noKeyGenerated": "No secret key yet. Generate one to start using CAPTCHA on this project.",
+ "keyHint": "Keep this key private. Use it on your backend to verify CAPTCHA tokens. Learn more in the <url>documentation</url>.",
"difficulty": "CAPTCHA difficulty",
"difficultyHint": "Higher difficulty levels provide better bot protection but may be more challenging for users to solve.",
"difficultyAutoHint": "Auto picks the challenge difficulty dynamically based on traffic spikes, replay attempts, hosting IPs, and other risk signals.",
@@ -2325,19 +2325,20 @@
"deleteConfirm": "Are you sure you want to delete this annotation? This action cannot be undone."
},
"botsProtectionLevel": {
- "title": "Bots protection level",
+ "title": "Bot traffic filtering",
+ "hint": "Choose how aggressively bot and automated traffic should be filtered from your analytics.",
"levels": {
"off": {
"title": "Off",
- "description": "We allow all incoming traffic."
+ "description": "Track all incoming traffic, including bots and automated requests."
},
"basic": {
"title": "Basic",
- "description": "We detect bots based on their user agent (Googlebot, Bingbot, curl, etc.)."
+ "description": "Ignore common bots detected by their user agent, such as Googlebot, Bingbot, curl, and similar crawlers."
},
"strict": {
"title": "Strict",
- "description": "On top of user agent checks, we also block headless browsers, datacenter IPs, vulnerability scanners, known referrer-spam sources, and requests with suspicious headers."
+ "description": "Ignore more automated traffic, including headless browsers, datacenter IPs, vulnerability scanners, referrer spam, and requests with suspicious headers."
}
}
},
@@ -2373,22 +2374,24 @@
"create": "Create a new project",
"settings": "Settings of",
"name": "Project name",
+ "nameHint": "Used for display purposes only.",
"sharableLink": "Sharable link",
- "sharableDesc": "To share your dashboard with others, only available if you make your dashboard public or password protected.",
+ "sharableDesc": "Makes the project accessible to the public, only available if you make your dashboard public or password protected.",
"pid": "Project ID",
"websiteUrl": "Website URL",
"websiteUrlPlaceholder": "https://example.com",
- "websiteUrlHint": "Optional. Your website URL is used to display a favicon next to your project name and to make page paths clickable in analytics.",
+ "websiteUrlHint": "Optional. Used to display a favicon next to your project name and to make page paths clickable in analytics.",
"brandKeywords": "Brand keywords",
"brandKeywordsPlaceholder": "swetrix, swetrix analytics",
"brandKeywordsHint": "Comma-separated keywords to classify search queries as branded traffic. If empty, auto-detected from your website URL and project name.",
"invalidUrl": "Please enter a valid URL (e.g., https://example.com)",
"origins": "Allowed origins",
- "originsHint": "A list of origins (domains) which are allowed to use script with your ProjectID, separated by commas.\nLeave it empty to allow all origins (default setting).\nExample: cornell.edu, app.example.com, *.gov.ua",
- "enabled": "Project enabled",
+ "originsHint": "Choose which domains are allowed to send analytics using this Project ID. Traffic from all other domains will be blocked. Separate multiple domains with commas. Leave empty to allow all domains. You can use wildcards, for example: cornell.edu, app.example.com, *.gov.uk.",
+ "originsPlaceholder": "Allowing all origins by default",
+ "enabled": "Collect analytics data",
"public": "Public dashboard",
- "enabledHint": "Disabled projects will not count any newly incoming events or pageviews.\nYou will still be able to access the project's analytics in dashboard.",
- "publicHint": "By checking this, anyone on the Internet (including Google) would be able to see this project's dashboard.\nOnly the project administrator can edit the settings.",
+ "enabledHint": "Turn this off to stop collecting new analytics data. Existing data and project settings will stay available.",
+ "publicHint": "If enabled, anyone on the Internet would be able to see this project's dashboard.\nOnly the project administrator can edit the settings.",
"createHint": "*you will be able to set up your project more thoroughly after you have created it",
"delete": "Delete project",
"reset": "Reset project",
@@ -2405,6 +2408,8 @@
"removeUser": "Remove {{user}}?",
"people": "People",
"inviteCoworkers": "Invite your coworkers",
+ "peopleEmptyTitle": "No project members yet",
+ "peopleEmptyDescription": "Invite teammates to share this project's analytics and manage their access with roles.",
"addARecipient": "Add a recipient",
"addARecipientDesc": "Enter an email address of the person you want to send reports to. They don't necessarily need to have an account on Swetrix.\nWe will send them your site's reports on a regular basis.",
"invite": "Invite a user",
@@ -2426,30 +2431,31 @@
}
},
"errorNoRole": "Please select a role.",
- "ipBlacklist": "IP's to blacklist",
- "ipBlacklistHint": "A list of IP addresses from which no analytics will be collected on this project.\nThis functionality is handy if you want to ignore analytics from your IP, for example.\nExample: 172.126.10.16, 192.168.0.1/32, ::1",
- "countryBlacklist": "Countries to exclude",
- "countryBlacklistHint": "Traffic from these countries will not be tracked. This is useful if you want to exclude specific regions from your analytics.",
+ "ipBlacklist": "Blocked IP addresses",
+ "ipBlacklistHint": "Traffic from these IP addresses will be ignored for this project. Separate multiple IP addresses or CIDR ranges with commas. Useful for excluding your own visits from analytics. Example: 172.126.10.16, 192.168.0.1/32, ::1.",
+ "ipBlacklistPlaceholder": "Not blocking any IP addresses by default",
+ "countryBlacklist": "Blocked countries",
+ "countryBlacklistHint": "Choose the countries you don't want to track. Traffic from these countries will be ignored in your analytics.",
+ "countryBlacklistPlaceholder": "Not blocking any countries by default",
"searchCountries": "Search countries...",
- "selectCountry": "Select a country to exclude...",
- "transfer": "Transfer project",
- "transferTo": "Transfer project",
- "transferHint": "You can transfer '{{name}}' project to another user.\nThis user will become the project's owner and will be able to manage the project's settings, add/remove members, and invite new users.\nYou will be assigned to the project as an administrator. However, the new owner will be able to remove you from the project.",
- "transfereeEmail": "Transferee email",
+ "transfer": "Transfer ownership",
+ "transferTo": "Transfer ownership",
+ "transferHint": "Transfer '{{name}}' to another Swetrix user. They will become the project owner and can manage settings, members, and invitations. You will stay on the project as an administrator, but the new owner can remove you later.",
+ "transfereeEmail": "New owner email",
"reseted": {
"selectFilters": "Select filters",
- "all": "Reset all",
- "allHint": "All of the project's related analytics data will be permanently removed from our servers, but the project itself, it's settings and the ID will still be available.",
- "partially": "Reset partially",
- "partiallyDesc": "The 'Reset partially' function allows you to reset the data of a specific project within a given date range.",
- "partiallyHint": "To reset the data of a specific project within a date range, select the start and end dates of the range and the project you wish to reset.\nDouble-check that you have selected the correct project and date range before clicking 'Reset'.\nOnce you click 'Reset', all the data associated with the selected project within the selected date range will be permanently deleted and cannot be recovered.",
- "viaFilters": "Reset via filters",
- "viaFiltersHint": "The 'Reset via filters' function allows you to reset the data of a specific project within a given date range and with specific filters.",
+ "all": "Reset all analytics data",
+ "allHint": "This permanently deletes all analytics data for this project from our servers. The project itself, its settings, and Project ID will remain.",
+ "partially": "Reset by date range",
+ "partiallyDesc": "Delete analytics data from a specific date range.",
+ "partiallyHint": "Choose the start and end dates, then confirm the reset. Analytics data in this date range will be permanently deleted and cannot be recovered.",
+ "viaFilters": "Reset by filters",
+ "viaFiltersHint": "Delete only the analytics data that matches your selected filters. Matching data will be permanently deleted and cannot be recovered.",
"filtersPlaceholder": "Select filters",
- "noFilters": "No filters selected or no data for the selected filter type"
+ "noFilters": "No filters selected, or no data found for this filter type"
},
"protected": "Password protected",
- "protectedHint": "You can protect your project with a password. That way, people who know the password can access it through a shareable link.",
+ "protectedHint": "You can protect your project with a password. Only the people who know the password can access it through a shareable link.",
"password": "Dashboard password"
},
"captcha": {
@@ -2465,6 +2471,8 @@
"title": "Email reports",
"description": "Send regular email reports to as many recipients as you want",
"add": "Add a recipient",
+ "emptyTitle": "No report recipients yet",
+ "emptyDescription": "Add people who should receive this project's scheduled email reports. They don't need a Swetrix account.",
"reportFrequency": "Report frequency"
},
"page": "Page",