From 085039c9224c44527faf7b0409522b9638d7b5d2 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Wed, 30 Aug 2023 16:41:35 +0800 Subject: [PATCH 1/2] Fix support form not populating fields on a fresh session --- .../interfaces/Support/SupportForm.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/studio/components/interfaces/Support/SupportForm.tsx b/studio/components/interfaces/Support/SupportForm.tsx index bf2bddef769..614b49cd147 100644 --- a/studio/components/interfaces/Support/SupportForm.tsx +++ b/studio/components/interfaces/Support/SupportForm.tsx @@ -35,6 +35,7 @@ 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' const MAX_ATTACHMENTS = 5 const INCLUDE_DISCUSSIONS = ['Problem', 'Database_unresponsive'] @@ -45,6 +46,7 @@ export interface SupportFormProps { const SupportForm = ({ setSentCategory }: SupportFormProps) => { const { ui } = useStore() + const { isReady } = useRouter() const { ref, subject, category, message } = useParams() const uploadButtonRef = useRef() @@ -270,6 +272,21 @@ const SupportForm = ({ setSentCategory }: SupportFormProps) => { } }, [isSuccessProjects, isSuccessOrganizations]) + // Populate fields when router is ready, required when navigating to + // support form on a refresh browser session + // eslint-disable-next-line react-hooks/rules-of-hooks + useEffect(() => { + if (isReady) { + const updatedValues = { + projectRef: ref, + subject, + category: selectedCategoryFromUrl?.value, + message, + } + resetForm({ values: updatedValues, initialValues: updatedValues }) + } + }, [isReady]) + return (
From 0816d976e90b6db4d94f9533b2c90cc7dec12760 Mon Sep 17 00:00:00 2001 From: Francesco Sansalvadore Date: Wed, 30 Aug 2023 11:50:09 +0200 Subject: [PATCH 2/2] revert badge global color change --- apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx | 6 +++++- packages/ui/src/lib/theme/defaultTheme.ts | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx index 0cf04315a69..e94da27828e 100644 --- a/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/HomeMenu.tsx @@ -50,7 +50,11 @@ const NavigationMenuHome = () => { > {link?.icon && } {link.label} - {link.community && Community} + {link.community && ( + + Community + + )} diff --git a/packages/ui/src/lib/theme/defaultTheme.ts b/packages/ui/src/lib/theme/defaultTheme.ts index 52376c4be5c..832713fae83 100644 --- a/packages/ui/src/lib/theme/defaultTheme.ts +++ b/packages/ui/src/lib/theme/defaultTheme.ts @@ -216,8 +216,7 @@ export default { }, dot: '-ml-0.5 mr-1.5 h-2 w-2 rounded-full', color: { - brand: 'bg-brand bg-opacity-100 text-background border border-brand-400', - alt: 'bg-brand-500 text-brand-600 border border-brand-400', + brand: 'bg-brand-500 text-brand-600 border border-brand-400', scale: 'bg-scale-200 text-scale-1100 border border-scale-700', tomato: `bg-tomato-200 text-tomato-1100 border border-tomato-700`, red: `bg-red-200 text-red-1100 border border-red-700`,