Skip to content

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

chore(studio): clean up support form (#41424)

Danny White2fbb6cb9a7d6
diff --git a/apps/studio/components/interfaces/Support/HighlightContext.tsx b/apps/studio/components/interfaces/Support/HighlightContext.tsx
deleted file mode 100644
index f0b2c9aad83..00000000000
--- a/apps/studio/components/interfaces/Support/HighlightContext.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import { parseAsBoolean, useQueryState } from 'nuqs'
-import {
- createContext,
- useCallback,
- useContext,
- useMemo,
- useRef,
- type PropsWithChildren,
-} from 'react'
-
-interface HighlightProjectRefContextValue<T extends HTMLElement = HTMLDivElement> {
- ref: React.RefObject<T>
- shouldHighlightRef: boolean
- setShouldHighlightRef: (value: boolean) => void
- scrollToRef: () => void
-}
-
-const HighlightProjectRefContext = createContext<HighlightProjectRefContextValue | undefined>(
- undefined
-)
-
-export function HighlightProjectRefProvider({ children }: PropsWithChildren) {
- const projectRefContainerRef = useRef<HTMLDivElement>(null)
- const [shouldHighlightRef, setShouldHighlightRef] = useQueryState(
- 'highlightRef',
- parseAsBoolean.withDefault(false).withOptions({ clearOnDefault: true })
- )
-
- const scrollToRef = useCallback(() => {
- projectRefContainerRef.current?.scrollIntoView({
- behavior: 'smooth',
- block: 'center',
- inline: 'center',
- })
- }, [])
-
- const ctx = useMemo(
- () => ({
- ref: projectRefContainerRef,
- shouldHighlightRef,
- setShouldHighlightRef,
- scrollToRef,
- }),
- [shouldHighlightRef, setShouldHighlightRef, scrollToRef]
- )
-
- return (
- <HighlightProjectRefContext.Provider value={ctx}>
- {children}
- </HighlightProjectRefContext.Provider>
- )
-}
-
-export function useHighlightProjectRefContext() {
- const context = useContext(HighlightProjectRefContext)
- if (!context) {
- throw new Error(
- 'useHighlightProjectRefContext must be used within a HighlightProjectRefProvider'
- )
- }
- return context
-}
diff --git a/apps/studio/components/interfaces/Support/LinkSupportTicketPage.tsx b/apps/studio/components/interfaces/Support/LinkSupportTicketPage.tsx
index 420b1a5662a..0e687e54552 100644
--- a/apps/studio/components/interfaces/Support/LinkSupportTicketPage.tsx
+++ b/apps/studio/components/interfaces/Support/LinkSupportTicketPage.tsx
@@ -5,17 +5,12 @@ import { useState } from 'react'
import { Button, cn, DialogSectionSeparator } from 'ui'
import { Admonition } from 'ui-patterns'
-import { HighlightProjectRefProvider } from './HighlightContext'
import { LinkSupportTicketForm } from './LinkSupportTicketForm'
export function LinkSupportTicketPage() {
return (
- <div className="h-full relative overflow-y-auto overflow-x-hidden">
- <div className="h-full flex flex-col gap-y-8 items-center justify-center mx-auto max-w-2xl w-full px-4 lg:px-6">
- <HighlightProjectRefProvider>
- <LinkSupportTicketPageContent />
- </HighlightProjectRefProvider>
- </div>
+ <div className="mx-auto my-16 max-w-2xl w-full px-4 lg:px-6">
+ <LinkSupportTicketPageContent />
</div>
)
}
@@ -65,11 +60,11 @@ function LinkSupportTicketSuccess() {
<div className="relative">
<Mail strokeWidth={1.5} size={60} className="text-brand" />
<div className="h-6 w-6 rounded-full bg-brand absolute bottom-1 -right-1.5 flex items-center justify-center">
- <Check strokeWidth={4} size={18} />
+ <Check strokeWidth={4} size={16} className="text-contrast" />
</div>
</div>
<div className="flex items-center flex-col gap-y-2 text-center">
- <h3 className="text-xl">Support ticket linked successfully!</h3>
+ <h3 className="text-xl">Support ticket linked</h3>
<p className="text-sm text-foreground-light">
Your support conversation has been linked to your account.
</p>
@@ -77,9 +72,9 @@ function LinkSupportTicketSuccess() {
</div>
<DialogSectionSeparator />
<div className="w-full py-4 px-4 flex items-center justify-end">
- <Link href="/">
- <Button>Go back</Button>
- </Link>
+ <Button asChild type="default">
+ <Link href="/">Finish</Link>
+ </Button>
</div>
</div>
)
diff --git a/apps/studio/components/interfaces/Support/MessageField.tsx b/apps/studio/components/interfaces/Support/MessageField.tsx
index 7fb4208442c..da390930cf1 100644
--- a/apps/studio/components/interfaces/Support/MessageField.tsx
+++ b/apps/studio/components/interfaces/Support/MessageField.tsx
@@ -34,7 +34,7 @@ export function MessageField({ form, originalError }: MessageFieldProps) {
{...field}
rows={4}
maxLength={5000}
- placeholder="Describe the issue you're facing, along with any relevant information. Please be as detailed and specific as possible."
+ placeholder="Describe the issue you’re facing, along with any relevant information. Please be as detailed and specific as possible."
/>
</FormControl_Shadcn_>
{originalError && (
diff --git a/apps/studio/components/interfaces/Support/ProjectAndPlanInfo.tsx b/apps/studio/components/interfaces/Support/ProjectAndPlanInfo.tsx
index 75f1257da9d..307d29e6c73 100644
--- a/apps/studio/components/interfaces/Support/ProjectAndPlanInfo.tsx
+++ b/apps/studio/components/interfaces/Support/ProjectAndPlanInfo.tsx
@@ -1,5 +1,5 @@
import { AnimatePresence, motion } from 'framer-motion'
-import { AlertCircle, Check, ChevronsUpDown, ExternalLink } from 'lucide-react'
+import { Check, ChevronsUpDown, ExternalLink } from 'lucide-react'
import Link from 'next/link'
import type { UseFormReturn } from 'react-hook-form'
import { toast } from 'sonner'
@@ -7,12 +7,11 @@ import { toast } from 'sonner'
import { useParams } from 'common'
import CopyButton from 'components/ui/CopyButton'
-import InformationBox from 'components/ui/InformationBox'
import { OrganizationProjectSelector } from 'components/ui/OrganizationProjectSelector'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import {
- Button,
cn,
+ Button,
CommandGroup_Shadcn_,
CommandItem_Shadcn_,
FormControl_Shadcn_,
@@ -20,8 +19,7 @@ import {
} from 'ui'
import { Admonition } from 'ui-patterns'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
-import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
-import { useHighlightProjectRefContext } from './HighlightContext'
+import ShimmeringLoader from 'ui-patterns/ShimmeringLoader'
import type { ExtendedSupportCategories } from './Support.constants'
import type { SupportFormValues } from './SupportForm.schema'
import { NO_ORG_MARKER, NO_PROJECT_MARKER } from './SupportForm.utils'
@@ -43,17 +41,14 @@ export function ProjectAndPlanInfo({
subscriptionPlanId,
showPlanExpectationInfo = true,
}: ProjectAndPlanProps) {
- const { ref } = useHighlightProjectRefContext()
const hasProjectSelected = projectRef && projectRef !== NO_PROJECT_MARKER
return (
- <div ref={ref} className={'flex flex-col gap-y-2'}>
+ <div className="flex flex-col gap-y-2">
<ProjectSelector form={form} orgSlug={orgSlug} projectRef={projectRef} />
<ProjectRefHighlighted projectRef={projectRef} />
- {!hasProjectSelected && (
- <Admonition type="default" title="Please note that no project has been selected" />
- )}
+ {!hasProjectSelected && <Admonition type="default" title="No project has been selected" />}
{showPlanExpectationInfo &&
orgSlug &&
@@ -125,7 +120,7 @@ function ProjectSelector({ form, orgSlug, projectRef }: ProjectSelectorProps) {
}}
>
{field.value === NO_PROJECT_MARKER && <Check size={16} />}
- <p className={field.value !== NO_PROJECT_MARKER ? 'ml-6' : ''}>
+ <p className={cn(field.value !== NO_PROJECT_MARKER && 'ml-6')}>
No specific project
</p>
</CommandItem_Shadcn_>
@@ -146,9 +141,6 @@ interface ProjectRefHighlightedProps {
function ProjectRefHighlighted({ projectRef }: ProjectRefHighlightedProps) {
const isVisible = !!projectRef && projectRef !== NO_PROJECT_MARKER
- const { shouldHighlightRef, setShouldHighlightRef: setHighlight } =
- useHighlightProjectRefContext()
-
return (
<AnimatePresence>
{isVisible && (
@@ -159,32 +151,15 @@ function ProjectRefHighlighted({ projectRef }: ProjectRefHighlightedProps) {
transition={{ duration: 0.3 }}
className="flex items-center gap-x-1"
>
- <p
- className={cn(
- 'text-sm prose transition',
- shouldHighlightRef ? 'text-foreground' : 'text-foreground-lighter'
- )}
- >
+ <p className="text-sm transition text-foreground-lighter">
Project ID:{' '}
- <code
- className={cn(
- 'transition',
- shouldHighlightRef
- ? 'text-brand font-medium border-brand-500 animate-pulse'
- : 'text-foreground-light'
- )}
- >
- {projectRef}
- </code>
+ <code className="text-code-inline !text-foreground-light">{projectRef}</code>
</p>
<CopyButton
iconOnly
type="text"
text={projectRef}
- onClick={() => {
- toast.success('Copied to clipboard')
- setHighlight(false)
- }}
+ onClick={() => toast.success('Copied project ID to clipboard')}
/>
</motion.div>
)}
@@ -199,63 +174,58 @@ interface PlanExpectationInfoBoxProps {
const PlanExpectationInfoBox = ({ orgSlug, planId }: PlanExpectationInfoBoxProps) => {
const { billingAll } = useIsFeatureEnabled(['billing:all'])
+ const shouldShowUpgradeActions = billingAll && planId !== 'enterprise'
return (
- <InformationBox
- icon={<AlertCircle size={18} strokeWidth={2} />}
- defaultVisibility={true}
- hideCollapse={true}
- title="Expected response times are based on your organization's plan"
+ <Admonition
+ type="default"
+ title="Expected response times are based on your organization’s plan"
description={
- <div className="flex flex-col gap-y-4 mb-1">
+ <>
{planId === 'free' && (
<p>
- Free Plan support is available within the community and officially by the team on a
- best efforts basis. For a guaranteed response we recommend upgrading to the Pro Plan.
- Enhanced SLAs for support are available on our Enterprise Plan.
+ Support on the Free plan is provided through the community and by the team on a
+ best-effort basis. For a guaranteed response time, we recommend upgrading to the Pro
+ plan. Enhanced support SLAs are available on the Enterprise plan.
</p>
)}
{planId === 'pro' && (
<p>
- Pro Plan includes email-based support. You can expect an answer within 1 business day
- in most situations for all severities. We recommend upgrading to the Team Plan for
- prioritized ticketing on all issues and prioritized escalation to product engineering
- teams. Enhanced SLAs for support are available on our Enterprise Plan.
+ The Pro plan includes email support. In most cases, you can expect a response within 1
+ business day for all severities. For prioritized ticketing on all issues and
+ prioritized escalation to product engineering, we recommend upgrading to the Team
+ plan. Enhanced support SLAs are available on the Enterprise plan.
</p>
)}
{planId === 'team' && (
<p>
- Team Plan includes email-based support. You get prioritized ticketing on all issues
- and prioritized escalation to product engineering teams. Low, Normal, and High
- severity tickets will generally be handled within 1 business day, while Urgent issues,
- we respond within 1 day, 365 days a year. Enhanced SLAs for support are available on
- our Enterprise Plan.
+ The Team plan includes email support with prioritized ticketing and escalation to
+ product engineering. Low, normal, and high-severity tickets are typically handled
+ within 1 business day. Urgent issues are handled within 1 day, 365 days a year.
+ Enhanced support SLAs are available on the Enterprise plan.
</p>
)}
-
- {billingAll && planId !== 'enterprise' && (
- <div className="flex flex-col sm:flex-row items-start sm:items-center gap-y-2 sm:gap-x-2">
- <Button asChild>
- <Link
- href={`/org/${orgSlug}/billing?panel=subscriptionPlan&source=planSupportExpectationInfoBox`}
- >
- Upgrade project
- </Link>
- </Button>
- <Button asChild type="default" icon={<ExternalLink />}>
- <Link
- href="https://supabase.com/contact/enterprise"
- target="_blank"
- rel="noreferrer"
- >
- Enquire about Enterprise
- </Link>
- </Button>
- </div>
- )}
- </div>
+ </>
+ }
+ actions={
+ shouldShowUpgradeActions && (
+ <>
+ <Button asChild>
+ <Link
+ href={`/org/${orgSlug}/billing?panel=subscriptionPlan&source=planSupportExpectationInfoBox`}
+ >
+ Upgrade plan
+ </Link>
+ </Button>
+ <Button asChild type="default" icon={<ExternalLink />}>
+ <Link href="https://supabase.com/contact/enterprise" target="_blank" rel="noreferrer">
+ Enquire about Enterprise
+ </Link>
+ </Button>
+ </>
+ )
}
/>
)
diff --git a/apps/studio/components/interfaces/Support/SubmitButton.tsx b/apps/studio/components/interfaces/Support/SubmitButton.tsx
index 3403baa7051..f7d654be9bc 100644
--- a/apps/studio/components/interfaces/Support/SubmitButton.tsx
+++ b/apps/studio/components/interfaces/Support/SubmitButton.tsx
@@ -1,4 +1,3 @@
-import { Mail } from 'lucide-react'
import type { MouseEventHandler } from 'react'
// End of third-party imports
@@ -12,27 +11,21 @@ interface SubmitButtonProps {
export function SubmitButton({ isSubmitting, userEmail, onClick }: SubmitButtonProps) {
return (
- <div className={'flex flex-col items-end gap-3'}>
+ <div className="flex flex-col gap-3">
<Button
htmlType="submit"
- size="large"
+ size="small"
block
- icon={<Mail />}
disabled={isSubmitting}
loading={isSubmitting}
onClick={onClick}
>
Send support request
</Button>
- <div className="flex flex-col items-end gap-1">
- <div className="space-x-1 text-xs">
- <span className="text-foreground-light">We will contact you at</span>
- <span className="text-foreground font-medium">{userEmail}</span>
- </div>
- <span className="text-foreground-light text-xs">
- Please ensure emails from supabase.com are allowed
- </span>
- </div>
+ <p className="text-xs text-foreground-lighter text-balance pr-4">
+ We will contact you at <span className="text-foreground font-medium">{userEmail}</span>.
+ Please ensure emails from supabase.com are allowed.
+ </p>
</div>
)
}
diff --git a/apps/studio/components/interfaces/Support/Success.tsx b/apps/studio/components/interfaces/Support/Success.tsx
index 488e4f0655f..bc0e14775e3 100644
--- a/apps/studio/components/interfaces/Support/Success.tsx
+++ b/apps/studio/components/interfaces/Support/Success.tsx
@@ -1,11 +1,8 @@
-import { Check, ExternalLink, Mail, Search } from 'lucide-react'
-import Link from 'next/link'
-import { useState } from 'react'
-
import { useProjectDetailQuery } from 'data/projects/project-detail-query'
import { useProfile } from 'lib/profile'
-import { Button, Input, Separator } from 'ui'
-import { CATEGORY_OPTIONS } from './Support.constants'
+import { Check, Mail } from 'lucide-react'
+import Link from 'next/link'
+import { Button, IconDiscord, Separator } from 'ui'
import { NO_PROJECT_MARKER } from './SupportForm.utils'
interface SuccessProps {
@@ -28,29 +25,28 @@ export const Success = ({
const categoriesToShowAdditionalResources = ['Problem', 'Unresponsive', 'Performance']
- const selectedCategory = CATEGORY_OPTIONS.find((option) => option.value === sentCategory)
- const [searchValue, setSearchValue] = useState<string>(selectedCategory?.query ?? '')
-
return (
- <div className="mt-10 w-[620px] flex flex-col items-center space-y-4">
+ <div className="mt-10 max-w-[620px] flex flex-col items-center space-y-4">
<div className="relative">
<Mail strokeWidth={1.5} size={60} className="text-brand" />
<div className="h-6 w-6 rounded-full bg-brand absolute bottom-1 -right-1.5 flex items-center justify-center">
- <Check strokeWidth={4} size={18} />
+ <Check strokeWidth={4} size={16} className="text-contrast" />
</div>
</div>
<div className="flex items-center flex-col space-y-2 text-center p-4">
- <h3 className="text-xl">Support request successfully sent!</h3>
- <p className="text-sm text-foreground-light">
- We will reach out to you at <span className="text-foreground">{respondToEmail}</span>.
+ <h3 className="text-xl">Support request sent</h3>
+
+ <p className="text-sm text-foreground-light text-balance">
+ {selectedProject !== NO_PROJECT_MARKER && (
+ <>
+ Your ticket has been logged for the project{' '}
+ <span className="text-foreground font-medium">{projectName}</span> with project ID:{' '}
+ <span className="text-foreground font-medium">{selectedProject}</span>.
+ </>
+ )}{' '}
+ We will reach out to you at{' '}
+ <span className="text-foreground font-medium">{respondToEmail}</span>.
</p>
- {selectedProject !== NO_PROJECT_MARKER && (
- <p className="text-sm text-foreground-light">
- Your ticket has been logged for the project{' '}
- <span className="text-foreground">{projectName}</span> with Project ID:{' '}
- <span className="text-foreground">{selectedProject}</span>.
- </p>
- )}
</div>
{categoriesToShowAdditionalResources.includes(sentCategory) && (
<>
@@ -58,45 +54,30 @@ export const Success = ({
<Separator />
</div>
<div className="flex flex-col items-center px-12 space-y-2 text-center">
- <p>In the meantime, tap into our community</p>
- <p className="text-sm text-foreground-light">
- Find the answers you need with fellow developers building with Supabase by joining our
- GitHub discussions or on Discord - build the next best thing together
+ <h4 className="text-lg font-normal">Tap into our community</h4>
+ <p className="text-sm text-foreground-light text-balance">
+ Our Discord community can help with code-related issues. Many questions are answered
+ in minutes.
</p>
</div>
- <div className="w-full px-12 !mt-8">
- <Input
- value={searchValue}
- onChange={(e) => setSearchValue(e.target.value)}
- icon={<Search />}
- actions={[
- <Button
- asChild
- key="search"
- className="mr-1"
- type="default"
- icon={<ExternalLink />}
- >
- <Link
- href={`https://github.com/supabase/supabase/discussions?discussions_q=${searchValue}`}
- target="_blank"
- rel="noreferrer"
- >
- Search on GitHub discussions
- </Link>
- </Button>,
- ]}
- />
- </div>
+ <Button
+ asChild
+ type="default"
+ icon={<IconDiscord size={16} fill="hsl(var(--background-default))" />}
+ >
+ <Link href={'https://discord.supabase.com/'} target="_blank">
+ Join us on Discord
+ </Link>
+ </Button>
</>
)}
<div className="!mt-10 w-full">
<Separator />
</div>
<div className="w-full pb-4 px-4 flex items-center justify-end">
- <Link href="/">
- <Button>Go back</Button>
- </Link>
+ <Button asChild type="default">
+ <Link href="/">Finish</Link>
+ </Button>
</div>
</div>
)
diff --git a/apps/studio/components/interfaces/Support/SupportFormPage.tsx b/apps/studio/components/interfaces/Support/SupportFormPage.tsx
index 2944f24749b..a0a73db04c9 100644
--- a/apps/studio/components/interfaces/Support/SupportFormPage.tsx
+++ b/apps/studio/components/interfaces/Support/SupportFormPage.tsx
@@ -8,17 +8,15 @@ import { toast } from 'sonner'
// End of third-party imports
import CopyButton from 'components/ui/CopyButton'
-import InformationBox from 'components/ui/InformationBox'
-import { InlineLink, InlineLinkClassName } from 'components/ui/InlineLink'
import { useOrganizationsQuery } from 'data/organizations/organizations-query'
import { usePlatformStatusQuery } from 'data/platform/platform-status-query'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useStateTransition } from 'hooks/misc/useStateTransition'
import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { Button, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
+import { Admonition } from 'ui-patterns/admonition'
import { AIAssistantOption } from './AIAssistantOption'
import { DiscordCTACard } from './DiscordCTACard'
-import { HighlightProjectRefProvider, useHighlightProjectRefContext } from './HighlightContext'
import { Success } from './Success'
import type { ExtendedSupportCategories } from './Support.constants'
import type { SupportFormValues } from './SupportForm.schema'
@@ -28,6 +26,7 @@ import {
supportFormReducer,
type SupportFormState,
} from './SupportForm.state'
+import { NO_PROJECT_MARKER } from './SupportForm.utils'
import { SupportFormV2 } from './SupportFormV2'
import { useSupportForm } from './useSupportForm'
@@ -59,11 +58,7 @@ function useSupportFormTelemetry() {
}
export function SupportFormPage() {
- return (
- <HighlightProjectRefProvider>
- <SupportFormPageContent />
- </HighlightProjectRefProvider>
- )
+ return <SupportFormPageContent />
}
function SupportFormPageContent() {
@@ -90,14 +85,18 @@ function SupportFormPageContent() {
dispatch({ type: 'RETURN_TO_EDITING' })
})
+ const isSuccess = state.type === 'success'
+
return (
<SupportFormWrapper>
<SupportFormHeader />
- <div className="flex flex-col gap-y-4">
- <AIAssistantOption projectRef={projectRef} organizationSlug={orgSlug} />
- <DiscordCTACard organizationSlug={orgSlug} />
- </div>
+ {!isSuccess && (
+ <div className="flex flex-col gap-y-4">
+ <AIAssistantOption projectRef={projectRef} organizationSlug={orgSlug} />
+ <DiscordCTACard organizationSlug={orgSlug} />
+ </div>
+ )}
<SupportFormBody
form={form}
@@ -106,7 +105,7 @@ function SupportFormPageContent() {
initialError={initialError}
selectedProjectRef={projectRef}
/>
- <SupportFormDirectEmailInfo />
+ {!isSuccess && <SupportFormDirectEmailInfo projectRef={projectRef} />}
</SupportFormWrapper>
)
}
@@ -177,44 +176,57 @@ function SupportFormHeader() {
)
}
-function SupportFormDirectEmailInfo() {
- const { scrollToRef, setShouldHighlightRef: setHighlight } = useHighlightProjectRefContext()
+interface SupportFormDirectEmailInfoProps {
+ projectRef: string | null
+}
+
+function SupportFormDirectEmailInfo({ projectRef }: SupportFormDirectEmailInfoProps) {
+ const hasProjectRef = projectRef && projectRef !== NO_PROJECT_MARKER
return (
- <InformationBox
+ <Admonition
+ type="default"
title="Having trouble submitting the form?"
description={
- <div className="flex flex-col gap-y-4">
- <p className="flex items-center gap-x-1 ">
- Email us directly at{' '}
- <InlineLink href="mailto:[email protected]" className="font-mono">
- </InlineLink>
- <CopyButton
- type="text"
- iconOnly
- onClick={() => toast.success('Copied to clipboard')}
- />
+ <>
+ <p className="!mb-2.5">
+ Please email us directly. Include your project ID and as much information as possible.
</p>
- <p>
- Please, make sure to{' '}
- <button
- type="button"
- className={cn(InlineLinkClassName, 'cursor-pointer')}
- onClick={() => {
- scrollToRef()
- setHighlight(true)
- }}
- >
- include your project ID
- </button>{' '}
- and as much information as possible.
+ <p className="flex items-center gap-x-1.5 flex-wrap">
+ Email:{' '}
+ <span className="inline-flex items-center gap-x-1">
+ <a
+ href={`mailto:[email protected]?subject=${encodeURIComponent('Support Request')}${hasProjectRef ? `${encodeURIComponent(' for Project ID: ')}${encodeURIComponent(projectRef)}` : ''}&body=${encodeURIComponent('Here is a detailed description of the problem I am experiencing and any other information that might be helpful...')}`}
+ className="hover:text-foreground transition-colors duration-100"
+ >
+ <code className="text-code-inline !text-foreground-light underline decoration-foreground-lighter/50 hover:decoration-foreground-lighter/80 transition-colors duration-100">
+ </code>
+ </a>
+ <CopyButton
+ type="text"
+ iconOnly
+ onClick={() => toast.success('Copied email address to clipboard')}
+ />
+ </span>
</p>
- </div>
+ {hasProjectRef && (
+ <p className="flex items-center gap-x-1.5 flex-wrap">
+ Project ID:{' '}
+ <span className="inline-flex items-center gap-x-1">
+ <code className="text-code-inline !text-foreground-light">{projectRef}</code>
+ <CopyButton
+ iconOnly
+ type="text"
+ text={projectRef}
+ onClick={() => toast.success('Copied project ID to clipboard')}
+ />
+ </span>
+ </p>
+ )}
+ </>
}
- defaultVisibility={true}
- hideCollapse={true}
/>
)
}
@@ -234,17 +246,17 @@ function SupportFormBody({
initialError,
selectedProjectRef,
}: SupportFromBodyProps) {
- const showSuccessMessage = state.type === 'success'
+ const isSuccess = state.type === 'success'
return (
<div
className={cn(
'min-w-full w-full space-y-12 rounded border bg-panel-body-light shadow-md',
- `${showSuccessMessage ? 'pt-8' : 'py-8'}`,
+ `${isSuccess ? 'pt-8' : 'py-8'}`,
'border-default'
)}
>
- {showSuccessMessage ? (
+ {isSuccess ? (
<Success
selectedProject={selectedProjectRef ?? undefined}
sentCategory={state.sentCategory}
diff --git a/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx b/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx
index 2d2e3d9ddb4..95aafd1b5b4 100644
--- a/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx
+++ b/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx
@@ -771,7 +771,7 @@ describe('SupportFormPage', () => {
await selectLibraryOption(screen, 'JavaScript')
await waitFor(() => {
- expect(getLibrarySelector(screen)).toHaveTextContent('Javascript')
+ expect(getLibrarySelector(screen)).toHaveTextContent('JavaScript')
})
const summaryField = getSummaryField(screen)
@@ -816,7 +816,7 @@ describe('SupportFormPage', () => {
expect(payload.message).toBe(expectedMessage)
await waitFor(() => {
- expect(screen.getByRole('heading', { name: /success/i })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: /support request sent/i })).toBeInTheDocument()
})
}, 10_000)
@@ -906,7 +906,7 @@ describe('SupportFormPage', () => {
expect(payload.message).toBe(expectedMessage)
await waitFor(() => {
- expect(screen.getByRole('heading', { name: /success/i })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: /support request sent/i })).toBeInTheDocument()
})
}, 10_000)
@@ -1009,7 +1009,7 @@ describe('SupportFormPage', () => {
)
await waitFor(() => {
- expect(screen.getByRole('heading', { name: /success/i })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: /support request sent/i })).toBeInTheDocument()
})
}, 10_000)
@@ -1147,7 +1147,7 @@ describe('SupportFormPage', () => {
expect(submitSpy).toHaveBeenCalledTimes(1)
})
await waitFor(() => {
- expect(screen.getByRole('heading', { name: /success/i })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: /support request sent/i })).toBeInTheDocument()
})
}
}, 10_000)
@@ -1464,7 +1464,7 @@ describe('SupportFormPage', () => {
expect(toastSuccessSpy).toHaveBeenCalledWith('Support request sent. Thank you!')
})
await waitFor(() => {
- expect(screen.getByRole('heading', { name: /success/i })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: /support request sent/i })).toBeInTheDocument()
})
}, 10_000)
@@ -1610,7 +1610,7 @@ describe('SupportFormPage', () => {
expect(payload.message).toContain(signedUrls[1])
await waitFor(() => {
- expect(screen.getByRole('heading', { name: /success/i })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: /support request sent/i })).toBeInTheDocument()
})
} finally {
unmount?.()
@@ -1689,7 +1689,7 @@ describe('SupportFormPage', () => {
expect(payload.message).toBe(expectedMessage)
await waitFor(() => {
- expect(screen.getByRole('heading', { name: /success/i })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: /support request sent/i })).toBeInTheDocument()
})
}, 10_000)
})
diff --git a/apps/studio/components/ui/InformationBox.tsx b/apps/studio/components/ui/InformationBox.tsx
index c79f3d52319..d5029d7a1c1 100644
--- a/apps/studio/components/ui/InformationBox.tsx
+++ b/apps/studio/components/ui/InformationBox.tsx
@@ -17,6 +17,8 @@ interface InformationBoxProps {
block?: boolean
}
+/** @deprecated Use `Admonition` from 'ui-patterns' instead. */
+
const InformationBox = forwardRef<HTMLDivElement, InformationBoxProps>(
(
{
diff --git a/packages/common/constants/client-libraries.ts b/packages/common/constants/client-libraries.ts
index 9a6cef23d9f..2fd7c636644 100644
--- a/packages/common/constants/client-libraries.ts
+++ b/packages/common/constants/client-libraries.ts
@@ -1,6 +1,6 @@
export const CLIENT_LIBRARIES = [
{
- language: 'Javascript',
+ language: 'JavaScript',
key: 'javascript',
is_officially_supported: true,
libraries: [
diff --git a/packages/ui/src/components/shadcn/ui/text-area.tsx b/packages/ui/src/components/shadcn/ui/text-area.tsx
index 3c24ef458c0..7549db0755e 100644
--- a/packages/ui/src/components/shadcn/ui/text-area.tsx
+++ b/packages/ui/src/components/shadcn/ui/text-area.tsx
@@ -11,7 +11,7 @@ const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(
return (
<textarea
className={cn(
- 'flex min-h-10 w-full rounded-md border border-control focus:border-control bg-control px-3 py-2 text-base md:text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-foreground-muted',
+ 'flex min-h-10 w-full rounded-md border border-control focus:border-control bg-control px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-foreground-muted',
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-background-control focus-visible:ring-offset-2 focus-visible:ring-offset-foreground-muted disabled:cursor-not-allowed disabled:opacity-50',
...customClasses,
className