Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add login issues to the support form.

Ivan Vasilov93c0921de1bb
diff --git a/studio/components/interfaces/SignIn/SignInMfaForm.tsx b/studio/components/interfaces/SignIn/SignInMfaForm.tsx
index 126dc9d7767..990635907b3 100644
--- a/studio/components/interfaces/SignIn/SignInMfaForm.tsx
+++ b/studio/components/interfaces/SignIn/SignInMfaForm.tsx
@@ -154,7 +154,7 @@ const SignInMfaForm = () => {
<div className="self-center my-8 text-sm">
<span className="text-scale-1000">Unable to log in?</span>{' '}
- <Link href="/support/new?subject=Unable%20to%20log%20in%20via%20MFA">
+ <Link href="/support/new?subject=Unable+to+log+in+via+MFA&category=Login_issues">
<a className="underline transition text-scale-1100 hover:text-scale-1200">
Reach out via support
</a>
diff --git a/studio/components/interfaces/Support/Success.tsx b/studio/components/interfaces/Support/Success.tsx
index a9835a912e1..c690d0fa9dd 100644
--- a/studio/components/interfaces/Support/Success.tsx
+++ b/studio/components/interfaces/Support/Success.tsx
@@ -70,9 +70,9 @@ const Success = ({ sentCategory = '' }: SuccessProps) => {
<Divider light />
</div>
<div className="w-full pb-4 px-4 flex items-center justify-end">
- <Link href="/projects">
+ <Link href="/">
<a>
- <Button>Go back to dashboard</Button>
+ <Button>Go back</Button>
</a>
</Link>
</div>
diff --git a/studio/components/interfaces/Support/Support.constants.ts b/studio/components/interfaces/Support/Support.constants.ts
index d5922d09182..0e14297fb64 100644
--- a/studio/components/interfaces/Support/Support.constants.ts
+++ b/studio/components/interfaces/Support/Support.constants.ts
@@ -49,6 +49,12 @@ export const CATEGORY_OPTIONS = [
description: 'Formal enquiry form for requesting refunds',
query: undefined,
},
+ {
+ value: SupportCategories.LOGIN_ISSUES,
+ label: 'Issues with logging in',
+ description: 'Issues with logging in and MFA',
+ query: undefined,
+ },
]
export const SEVERITY_OPTIONS = [
diff --git a/studio/components/interfaces/Support/SupportForm.tsx b/studio/components/interfaces/Support/SupportForm.tsx
index 54d68cc43e2..9655d767525 100644
--- a/studio/components/interfaces/Support/SupportForm.tsx
+++ b/studio/components/interfaces/Support/SupportForm.tsx
@@ -21,22 +21,20 @@ import Divider from 'components/ui/Divider'
import InformationBox from 'components/ui/InformationBox'
import MultiSelect from 'components/ui/MultiSelect'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
+import { getProjectAuthConfig } from 'data/auth/auth-config-query'
import { useSendSupportTicketMutation } from 'data/feedback/support-ticket-send'
import { useOrganizationsQuery } from 'data/organizations/organizations-query'
import { useProjectsQuery } from 'data/projects/projects-query'
import { useProjectSubscriptionV2Query } from 'data/subscriptions/project-subscription-v2-query'
import { useFlag, useStore } from 'hooks'
import useLatest from 'hooks/misc/useLatest'
-import { get } from 'lib/common/fetch'
-import { API_URL } from 'lib/constants'
import { detectBrowser } from 'lib/helpers'
import { useProfile } from 'lib/profile'
+import { useRouter } from 'next/router'
import { Project } from 'types'
import DisabledStateForFreeTier from './DisabledStateForFreeTier'
import { CATEGORY_OPTIONS, SERVICE_OPTIONS, SEVERITY_OPTIONS } from './Support.constants'
import { formatMessage, uploadAttachments } from './SupportForm.utils'
-import { useRouter } from 'next/router'
-import { getProjectAuthConfig } from 'data/auth/auth-config-query'
const MAX_ATTACHMENTS = 5
const INCLUDE_DISCUSSIONS = ['Problem', 'Database_unresponsive']
@@ -286,6 +284,7 @@ const SupportForm = ({ setSentCategory }: SupportFormProps) => {
resetForm({ values: updatedValues, initialValues: updatedValues })
}
}, [isReady])
+ console.log(values)
return (
<div className="space-y-8 w-[620px]">
@@ -314,80 +313,82 @@ const SupportForm = ({ setSentCategory }: SupportFormProps) => {
</Listbox>
</div>
- <div className="px-6">
- <div className="grid grid-cols-2 gap-4">
- {isLoadingProjects && (
- <div className="space-y-2">
- <p className="text-sm prose">Which project is affected?</p>
- <ShimmeringLoader className="!py-[19px]" />
- </div>
- )}
- {isErrorProjects && (
- <div className="space-y-2">
- <p className="text-sm prose">Which project is affected?</p>
- <div className="border rounded-md px-4 py-2 flex items-center space-x-2">
- <IconAlertCircle strokeWidth={2} className="text-scale-1000" />
- <p className="text-sm prose">Failed to retrieve projects</p>
+ {values.category !== 'Login_issues' && (
+ <div className="px-6">
+ <div className="grid grid-cols-2 gap-4">
+ {isLoadingProjects && (
+ <div className="space-y-2">
+ <p className="text-sm prose">Which project is affected?</p>
+ <ShimmeringLoader className="!py-[19px]" />
</div>
- </div>
- )}
- {isSuccessProjects && (
- <Listbox
- id="projectRef"
- layout="vertical"
- label="Which project is affected?"
- onChange={(val) => {
- setSelectedProjectRef(val)
- }}
- >
- {projects.map((option) => {
- const organization = organizations?.find(
- (x) => x.id === option.organization_id
- )
+ )}
+ {isErrorProjects && (
+ <div className="space-y-2">
+ <p className="text-sm prose">Which project is affected?</p>
+ <div className="border rounded-md px-4 py-2 flex items-center space-x-2">
+ <IconAlertCircle strokeWidth={2} className="text-scale-1000" />
+ <p className="text-sm prose">Failed to retrieve projects</p>
+ </div>
+ </div>
+ )}
+ {isSuccessProjects && (
+ <Listbox
+ id="projectRef"
+ layout="vertical"
+ label="Which project is affected?"
+ onChange={(val) => {
+ setSelectedProjectRef(val)
+ }}
+ >
+ {projects.map((option) => {
+ const organization = organizations?.find(
+ (x) => x.id === option.organization_id
+ )
+ return (
+ <Listbox.Option
+ key={`option-${option.ref}`}
+ label={option.name || ''}
+ value={option.ref}
+ >
+ <span>{option.name}</span>
+ <span className="block text-xs opacity-50">{organization?.name}</span>
+ </Listbox.Option>
+ )
+ })}
+ </Listbox>
+ )}
+ <Listbox id="severity" layout="vertical" label="Severity">
+ {SEVERITY_OPTIONS.map((option: any) => {
return (
<Listbox.Option
- key={`option-${option.ref}`}
- label={option.name || ''}
- value={option.ref}
+ key={`option-${option.value}`}
+ label={option.label}
+ value={option.value}
+ disabled={option.value === 'Critical' && isFreeProject}
>
- <span>{option.name}</span>
- <span className="block text-xs opacity-50">{organization?.name}</span>
+ <span>{option.label}</span>
+ <span className="block text-xs opacity-50">{option.description}</span>
</Listbox.Option>
)
})}
</Listbox>
+ </div>
+
+ {values.projectRef !== 'no-project' && subscription && isSuccessProjects ? (
+ <p className="text-sm text-scale-1000 mt-2">
+ This project is on the{' '}
+ <span className="text-scale-1100">{subscription.plan.name} plan</span>
+ </p>
+ ) : isLoadingSubscription && selectedProjectRef !== 'no-project' ? (
+ <div className="flex items-center space-x-2 mt-2">
+ <IconLoader size={14} className="animate-spin" />
+ <p className="text-sm text-scale-1000">Checking project's plan</p>
+ </div>
+ ) : (
+ <></>
)}
- <Listbox id="severity" layout="vertical" label="Severity">
- {SEVERITY_OPTIONS.map((option: any) => {
- return (
- <Listbox.Option
- key={`option-${option.value}`}
- label={option.label}
- value={option.value}
- disabled={option.value === 'Critical' && isFreeProject}
- >
- <span>{option.label}</span>
- <span className="block text-xs opacity-50">{option.description}</span>
- </Listbox.Option>
- )
- })}
- </Listbox>
</div>
-
- {values.projectRef !== 'no-project' && subscription && isSuccessProjects ? (
- <p className="text-sm text-scale-1000 mt-2">
- This project is on the{' '}
- <span className="text-scale-1100">{subscription.plan.name} plan</span>
- </p>
- ) : isLoadingSubscription && selectedProjectRef !== 'no-project' ? (
- <div className="flex items-center space-x-2 mt-2">
- <IconLoader size={14} className="animate-spin" />
- <p className="text-sm text-scale-1000">Checking project's plan</p>
- </div>
- ) : (
- <></>
- )}
- </div>
+ )}
{isSuccessProjects && values.projectRef === 'no-project' && (
<div className="px-6">
@@ -428,7 +429,7 @@ const SupportForm = ({ setSentCategory }: SupportFormProps) => {
</div>
)}
- {subscription?.plan.id === 'free' && (
+ {subscription?.plan.id === 'free' && values.category !== 'Login_issues' && (
<div className="px-6">
<InformationBox
icon={<IconAlertCircle strokeWidth={2} />}
@@ -603,16 +604,18 @@ const SupportForm = ({ setSentCategory }: SupportFormProps) => {
</div>
)}
- <div className="px-6 space-y-2">
- <p className="text-sm text-scale-1100">Which services are affected?</p>
- <MultiSelect
- options={SERVICE_OPTIONS}
- value={selectedServices}
- placeholder="No particular service"
- searchPlaceholder="Search for a service"
- onChange={setSelectedServices}
- />
- </div>
+ {values.category !== 'Login_issues' && (
+ <div className="px-6 space-y-2">
+ <p className="text-sm text-scale-1100">Which services are affected?</p>
+ <MultiSelect
+ options={SERVICE_OPTIONS}
+ value={selectedServices}
+ placeholder="No particular service"
+ searchPlaceholder="Search for a service"
+ onChange={setSelectedServices}
+ />
+ </div>
+ )}
<div className="text-area-text-sm px-6">
<Input.TextArea
id="message"