mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
## Problem The support form's "What issue are you having?" dropdown has no option for permission problems. Users who are blocked by a permission error can't tell us that's what they're hitting, so the backend can't treat those submissions differently. Linear: https://linear.app/supabase/issue/FE-5101 ## Solution Adds a `Permission issue` option to the category dropdown. It is sent to `POST /platform/feedback/send` as `category: 'Permission_issue'`, the same way the other categories are. - `@supabase/shared-types` is an external package, so I followed the existing `Plan_upgrade` and `Others` approach and added the value to the local `ExtendedSupportCategories` type instead of the shared enum. - Added the new value to the assistant handoff zod schema so a handoff carrying this category passes validation. - Added a component test that selects the option and checks the submitted payload. This PR is frontend only. No backend behavior changes here. ## Review instructions 1. Open the support form (`/support/new`). 2. Open the "What issue are you having?" dropdown and check that `Permission issue` is listed after "Issues with logging in", with the description "Issues accessing an organization or project you should have access to". 3. Select it, fill in the summary and message, and submit. In the browser network tab, check the `POST /platform/feedback/send` request body contains "category": "Permission_issue"`.
189 lines
4.3 KiB
TypeScript
189 lines
4.3 KiB
TypeScript
import { SupportCategories } from '@supabase/shared-types/out/constants'
|
|
import { isFeatureEnabled } from 'common'
|
|
|
|
const billingEnabled = isFeatureEnabled('billing:all')
|
|
|
|
export type ExtendedSupportCategories =
|
|
| SupportCategories
|
|
| 'Plan_upgrade'
|
|
| 'Permission_issue'
|
|
| 'Others'
|
|
|
|
export const CATEGORY_OPTIONS: {
|
|
value: ExtendedSupportCategories
|
|
label: string
|
|
description: string
|
|
query?: string
|
|
}[] = [
|
|
{
|
|
value: SupportCategories.PROBLEM,
|
|
label: 'APIs and client libraries',
|
|
description: "Issues with your project's API and client libraries",
|
|
query: undefined,
|
|
},
|
|
{
|
|
value: SupportCategories.DASHBOARD_BUG,
|
|
label: 'Dashboard bug',
|
|
description: 'Issues with the Supabase dashboard',
|
|
query: undefined,
|
|
},
|
|
{
|
|
value: SupportCategories.DATABASE_UNRESPONSIVE,
|
|
label: 'Database unresponsive',
|
|
description: 'Issues with connecting to your database',
|
|
query: 'Unable to connect',
|
|
},
|
|
{
|
|
value: SupportCategories.PERFORMANCE_ISSUES,
|
|
label: 'Performance issues',
|
|
description: 'Reporting of performance issues is only available on the Pro Plan',
|
|
query: 'Performance',
|
|
},
|
|
{
|
|
value: SupportCategories.ABUSE,
|
|
label: 'Abuse report',
|
|
description: 'Report abuse of a Supabase project or Supabase brand',
|
|
query: undefined,
|
|
},
|
|
{
|
|
value: SupportCategories.LOGIN_ISSUES,
|
|
label: 'Issues with logging in',
|
|
description: 'Issues with logging in and MFA',
|
|
query: undefined,
|
|
},
|
|
{
|
|
value: 'Permission_issue' as const,
|
|
label: 'Permission issue',
|
|
description: 'Issues accessing an organization or project you should have access to',
|
|
query: undefined,
|
|
},
|
|
...(billingEnabled
|
|
? [
|
|
{
|
|
value: SupportCategories.SALES_ENQUIRY,
|
|
label: 'Sales enquiry',
|
|
description: 'Questions about pricing, paid plans and Enterprise plans',
|
|
query: undefined,
|
|
},
|
|
{
|
|
value: SupportCategories.BILLING,
|
|
label: 'Billing',
|
|
description: 'Issues with credit card charges | invoices | overcharging',
|
|
query: undefined,
|
|
},
|
|
{
|
|
value: SupportCategories.REFUND,
|
|
label: 'Refund enquiry',
|
|
description: 'Formal enquiry form for requesting refunds',
|
|
query: undefined,
|
|
},
|
|
]
|
|
: [
|
|
// [Joshen] Ideally shift this to shared-types, although not critical as API isn't validating the category
|
|
{
|
|
value: 'Plan_upgrade' as const,
|
|
label: 'Plan upgrade',
|
|
description: 'Enquire a plan upgrade for your organization',
|
|
query: undefined,
|
|
},
|
|
]),
|
|
{
|
|
// Must stay 'Others' (plural). The backend lowercases this before writing
|
|
// it to Front's `Type` custom field, which is a fixed, case-sensitive
|
|
// enum containing 'others' — not 'other'.
|
|
value: 'Others' as const,
|
|
label: 'Other',
|
|
description: "An issue that doesn't fit the categories above",
|
|
query: undefined,
|
|
},
|
|
]
|
|
|
|
export const SEVERITY_OPTIONS = [
|
|
{
|
|
value: 'Low',
|
|
label: 'Low',
|
|
description: 'General guidance',
|
|
},
|
|
{
|
|
value: 'Normal',
|
|
label: 'Normal',
|
|
description: 'System impaired',
|
|
},
|
|
{
|
|
value: 'High',
|
|
label: 'High',
|
|
description: 'Production system impaired',
|
|
},
|
|
{
|
|
value: 'Urgent',
|
|
label: 'Urgent',
|
|
description: 'Production system down',
|
|
},
|
|
]
|
|
|
|
export const SERVICE_OPTIONS = [
|
|
{
|
|
id: 1,
|
|
name: 'Authentication',
|
|
value: 'Authentication',
|
|
disabled: false,
|
|
},
|
|
{
|
|
id: 2,
|
|
name: 'Dashboard',
|
|
value: 'Dashboard',
|
|
disabled: false,
|
|
},
|
|
{
|
|
id: 3,
|
|
name: 'Database',
|
|
value: 'Database',
|
|
disabled: false,
|
|
},
|
|
{
|
|
id: 4,
|
|
name: 'Edge Functions',
|
|
value: 'Edge Functions',
|
|
disabled: false,
|
|
},
|
|
{
|
|
id: 5,
|
|
name: 'Multigres',
|
|
value: 'Multigres',
|
|
disabled: false,
|
|
},
|
|
{
|
|
id: 6,
|
|
name: 'Realtime',
|
|
value: 'Realtime',
|
|
disabled: false,
|
|
},
|
|
{
|
|
id: 7,
|
|
name: 'Storage',
|
|
value: 'Storage',
|
|
disabled: false,
|
|
},
|
|
{
|
|
id: 8,
|
|
name: 'Others',
|
|
value: 'Others',
|
|
disabled: false,
|
|
},
|
|
]
|
|
|
|
export const IPV4_MIGRATION_STRINGS = [
|
|
'ipv4',
|
|
'ipv6',
|
|
'supavisor',
|
|
'pgbouncer',
|
|
'5432',
|
|
'ENETUNREACH',
|
|
'ECONNREFUSED',
|
|
'P1001',
|
|
'connect: no route to',
|
|
'network is unreac',
|
|
'could not translate host name',
|
|
'address family not supported by protocol',
|
|
]
|