From 55077a5ceca3c0820b1cb9e604b3b9b2ae7bab24 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Thu, 27 Jun 2024 03:39:33 -0230 Subject: [PATCH 1/4] Chore/add lint (#27572) * Handle lint 17 * Update icons * Remove usage of id property from Project where not needed * Update package lock --------- Co-authored-by: Joshen Lim --- .../interfaces/Integrations/ProjectLinker.tsx | 1 - .../interfaces/Linter/Linter.utils.tsx | 10 ++++++ .../Subscription/DowngradeModal.tsx | 2 +- .../SidePanelGitHubRepoLinker.tsx | 3 +- .../SidePanelVercelProjectLinker.tsx | 3 +- .../[slug]/marketplace/choose-project.tsx | 3 +- apps/studio/pages/new/[slug].tsx | 2 +- package-lock.json | 34 +++++++++---------- 8 files changed, 32 insertions(+), 26 deletions(-) diff --git a/apps/studio/components/interfaces/Integrations/ProjectLinker.tsx b/apps/studio/components/interfaces/Integrations/ProjectLinker.tsx index 03b17fab877..8a2cc393f85 100644 --- a/apps/studio/components/interfaces/Integrations/ProjectLinker.tsx +++ b/apps/studio/components/interfaces/Integrations/ProjectLinker.tsx @@ -29,7 +29,6 @@ import { } from 'ui' export interface Project { - id: string name: string ref: string } diff --git a/apps/studio/components/interfaces/Linter/Linter.utils.tsx b/apps/studio/components/interfaces/Linter/Linter.utils.tsx index 0a0991fe19f..5eb57131661 100644 --- a/apps/studio/components/interfaces/Linter/Linter.utils.tsx +++ b/apps/studio/components/interfaces/Linter/Linter.utils.tsx @@ -168,6 +168,16 @@ export const lintInfoMap: LintInfo[] = [ docsLink: 'https://supabase.com/docs/guides/database/database-advisors?lint=0016_materialized_view_in_api', }, + { + name: 'foreign_table_in_api', + title: 'Foreign Table in API', + icon: , + link: () => + `https://supabase.com/docs/guides/database/database-linter?lint=0017_foreign_table_in_api`, + linkText: 'View docs', + docsLink: + 'https://supabase.com/docs/guides/database/database-linter?lint=0017_foreign_table_in_api', + }, ] export const LintCTA = ({ diff --git a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx index 3a6514e1c56..4c882e3b67a 100644 --- a/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx +++ b/apps/studio/components/interfaces/Organization/BillingSettings/Subscription/DowngradeModal.tsx @@ -94,7 +94,7 @@ const DowngradeModal = ({ {projects .filter((it) => it.infra_compute_size === 'micro') .map((project) => ( -
  • +
  • {project.name}: Compute will be downgraded. Project will also{' '} need to be restarted.
  • diff --git a/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelGitHubRepoLinker.tsx b/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelGitHubRepoLinker.tsx index 9ec66da24f9..3eccf231323 100644 --- a/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelGitHubRepoLinker.tsx +++ b/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelGitHubRepoLinker.tsx @@ -54,8 +54,7 @@ const SidePanelGitHubRepoLinker = ({ projectRef }: SidePanelGitHubRepoLinkerProp () => supabaseProjectsData ?.filter((project) => project.organization_id === selectedOrganization?.id) - .map((project) => ({ id: project.id.toString(), name: project.name, ref: project.ref })) ?? - EMPTY_ARR, + .map((project) => ({ name: project.name, ref: project.ref })) ?? EMPTY_ARR, [selectedOrganization?.id, supabaseProjectsData] ) diff --git a/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelVercelProjectLinker.tsx b/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelVercelProjectLinker.tsx index eb883e15110..b3350fd2cb6 100644 --- a/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelVercelProjectLinker.tsx +++ b/apps/studio/components/interfaces/Organization/IntegrationSettings/SidePanelVercelProjectLinker.tsx @@ -52,8 +52,7 @@ const SidePanelVercelProjectLinker = () => { () => supabaseProjectsData ?.filter((project) => project.organization_id === selectedOrganization?.id) - .map((project) => ({ id: project.id.toString(), name: project.name, ref: project.ref })) ?? - EMPTY_ARR, + .map((project) => ({ name: project.name, ref: project.ref })) ?? EMPTY_ARR, [selectedOrganization?.id, supabaseProjectsData] ) diff --git a/apps/studio/pages/integrations/vercel/[slug]/marketplace/choose-project.tsx b/apps/studio/pages/integrations/vercel/[slug]/marketplace/choose-project.tsx index d22d3a1f4ba..3cbfdb35052 100644 --- a/apps/studio/pages/integrations/vercel/[slug]/marketplace/choose-project.tsx +++ b/apps/studio/pages/integrations/vercel/[slug]/marketplace/choose-project.tsx @@ -65,8 +65,7 @@ const VercelIntegration: NextPageWithLayout = () => { project.status === PROJECT_STATUS['COMING_UP'] || project.status === PROJECT_STATUS['RESTORING']) ) - .map((project) => ({ id: project.id.toString(), name: project.name, ref: project.ref })) ?? - EMPTY_ARR, + .map((project) => ({ name: project.name, ref: project.ref })) ?? EMPTY_ARR, [organization?.id, supabaseProjectsData] ) diff --git a/apps/studio/pages/new/[slug].tsx b/apps/studio/pages/new/[slug].tsx index becbd70eb8f..dcb945491c3 100644 --- a/apps/studio/pages/new/[slug].tsx +++ b/apps/studio/pages/new/[slug].tsx @@ -812,7 +812,7 @@ const Wizard: NextPageWithLayout = () => { {organizationProjects.map((project) => ( - + {project.name} {instanceLabel(project.infra_compute_size)} diff --git a/package-lock.json b/package-lock.json index 676b2fb6eda..373ff1b938a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13947,9 +13947,9 @@ } }, "node_modules/@testing-library/jest-dom": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.4.2.tgz", - "integrity": "sha512-CzqH0AFymEMG48CpzXFriYYkOjk6ZGPCLMhW9e9jg3KMCn5OfJecF8GtGW7yGfR/IgCe3SX8BSwjdzI6BBbZLw==", + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.4.5.tgz", + "integrity": "sha512-AguB9yvTXmCnySBP1lWjfNNUwpbElsaQ567lt2VdGqAdHtpieLgjmcVyv1q7PMIvLbgpDdkWV5Ydv3FEejyp2A==", "dev": true, "dependencies": { "@adobe/css-tools": "^4.3.2", @@ -13958,7 +13958,7 @@ "chalk": "^3.0.0", "css.escape": "^1.5.1", "dom-accessibility-api": "^0.6.3", - "lodash": "^4.17.15", + "lodash": "^4.17.21", "redent": "^3.0.0" }, "engines": { @@ -15322,6 +15322,19 @@ "vite": "^4.2.0 || ^5.0.0" } }, + "node_modules/@vitest/expect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "dependencies": { + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/@vitest/runner": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", @@ -41740,19 +41753,6 @@ } } }, - "node_modules/vitest/node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", - "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", - "chai": "^4.3.10" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, "node_modules/vitest/node_modules/execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", From 02b09e6232db469a120f095e1a0f6b13c7cc810c Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Jun 2024 16:53:42 +0800 Subject: [PATCH 2/4] Remove usage of id for projects or org where unnecessary (#27583) --- .../Home/ProjectList/ProjectList.tsx | 4 ++-- .../OrganizationSettingsMenu.tsx | 22 ------------------- apps/studio/pages/authorize.tsx | 2 +- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx index 1c4d4546a40..4667b6fe65c 100644 --- a/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx +++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectList.tsx @@ -71,7 +71,7 @@ const ProjectList = ({ search, rewriteHref }: ProjectListProps) => { {organizations?.map((organization) => { return ( 0 && filteredProjects.length === 0) return null return ( -
    +

    {organization.name}

    diff --git a/apps/studio/components/layouts/SettingsLayout/OrganizationSettingsMenu.tsx b/apps/studio/components/layouts/SettingsLayout/OrganizationSettingsMenu.tsx index 702d31f9ee8..9dbf270d151 100644 --- a/apps/studio/components/layouts/SettingsLayout/OrganizationSettingsMenu.tsx +++ b/apps/studio/components/layouts/SettingsLayout/OrganizationSettingsMenu.tsx @@ -18,9 +18,6 @@ const OrganizationSettingsMenu = () => { { label: 'Legal Documents', pathname: `/org/[slug]/documents` }, ] - // const { data: allProjects } = useProjectsQuery() - // const projects = allProjects?.filter((project) => project.organization_id === organization?.id) - return (
    @@ -36,25 +33,6 @@ const OrganizationSettingsMenu = () => { /> ))}
    - - {/* [Joshen] Hiding below until we figure out a better UX for consolidating settings on projects */} - {/*
    -

    Projects

    - - {projects?.map((project) => ( - - ))} - -
    - */}
    ) } diff --git a/apps/studio/pages/authorize.tsx b/apps/studio/pages/authorize.tsx index 95b98c602cf..0f6573987ef 100644 --- a/apps/studio/pages/authorize.tsx +++ b/apps/studio/pages/authorize.tsx @@ -180,7 +180,7 @@ const APIAuthorizationPage: NextPageWithLayout = () => { > {(organizations ?? []).map((organization) => ( From fe17d1a2c4b5c6e37d24c92b78e96d66a7617363 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Thu, 27 Jun 2024 12:20:32 +0200 Subject: [PATCH 3/4] chore(storage): product description update (#27251) chore(storage): product description update --- apps/www/components/Sections/ProductHeader.tsx | 2 +- apps/www/pages/storage/Storage.tsx | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/www/components/Sections/ProductHeader.tsx b/apps/www/components/Sections/ProductHeader.tsx index 4e9f32c0ffe..2f6b11a4164 100644 --- a/apps/www/components/Sections/ProductHeader.tsx +++ b/apps/www/components/Sections/ProductHeader.tsx @@ -5,7 +5,7 @@ import ProductIcon from '../ProductIcon' type subheader = string interface Types { h1: string | React.ReactNode - subheader: string[] + subheader: (string | React.ReactNode)[] icon?: string title?: string image?: React.ReactNode diff --git a/apps/www/pages/storage/Storage.tsx b/apps/www/pages/storage/Storage.tsx index ffc166b805b..852d32ea5e5 100644 --- a/apps/www/pages/storage/Storage.tsx +++ b/apps/www/pages/storage/Storage.tsx @@ -26,7 +26,7 @@ function StoragePage() { const meta_title = 'Storage | Store any digital content' const meta_description = - 'An open source Object store with unlimited scalability, for any file type.' + 'An open source S3 Compatible Object Store with unlimited scalability, for any file type.' return ( <> @@ -56,7 +56,10 @@ function StoragePage() { , ]} subheader={[ - 'An open source Object store with unlimited scalability, for any file type.', + <> + An open source S3 Compatible Object Store, with unlimited scalability, for any + file type. + , 'With custom policies and permissions that are familiar and easy to implement.', ]} image={[ @@ -86,7 +89,6 @@ function StoragePage() {

    Interoperable

    -

    Integrates well with the rest of Supabase ecosystem, including Auth and Postgres.

    @@ -112,8 +114,11 @@ function StoragePage() { } />
    -

    Dependable

    -

    Enterprise-level scalability and durability.

    +

    Multiple Protocol Support

    + +

    + S3, Resumable Uploads and Standard Uploads. Enterprise-level scalability. +

    From f094813b3e503047121fd1bf213943f51f4aa68f Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Thu, 27 Jun 2024 19:39:39 +0800 Subject: [PATCH 4/4] Add some sentry filters (#27588) * Add some sentry filters * Add some sentry filters * Add ? in copyCellValue --- apps/studio/components/grid/components/grid/Grid.tsx | 3 ++- apps/studio/components/grid/utils/common.ts | 2 +- apps/studio/sentry.client.config.ts | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/studio/components/grid/components/grid/Grid.tsx b/apps/studio/components/grid/components/grid/Grid.tsx index dfd01db594a..49472b8ee28 100644 --- a/apps/studio/components/grid/components/grid/Grid.tsx +++ b/apps/studio/components/grid/components/grid/Grid.tsx @@ -102,7 +102,8 @@ export const Grid = memo( const selectedCellRef = useRef<{ rowIdx: number; row: any; column: any } | null>(null) function copyCellValue() { - const selectedCellValue = selectedCellRef.current?.row[selectedCellRef.current?.column?.key] + const selectedCellValue = + selectedCellRef.current?.row?.[selectedCellRef.current?.column?.key] const text = formatClipboardValue(selectedCellValue) if (!text) return copyToClipboard(text) diff --git a/apps/studio/components/grid/utils/common.ts b/apps/studio/components/grid/utils/common.ts index 15b4a5e73fb..ad22480813b 100644 --- a/apps/studio/components/grid/utils/common.ts +++ b/apps/studio/components/grid/utils/common.ts @@ -7,7 +7,7 @@ export function deepClone(obj: unknown) { } export function formatClipboardValue(value: any) { - if (value === null) return '' + if (!value) return '' if (typeof value == 'object' || Array.isArray(value)) { return JSON.stringify(value) } diff --git a/apps/studio/sentry.client.config.ts b/apps/studio/sentry.client.config.ts index a7a1d4be1eb..331dee293b4 100644 --- a/apps/studio/sentry.client.config.ts +++ b/apps/studio/sentry.client.config.ts @@ -42,6 +42,8 @@ Sentry.init({ ignoreErrors: [ // Used exclusively in Monaco Editor. 'ResizeObserver', + 's.getModifierState is not a function', + /^Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope'/, // [Joshen] We currently use stripe-js for customers to save their credit card data // I'm unable to reproduce this error on local, staging nor prod across chrome, safari or firefox // Based on https://github.com/stripe/stripe-js/issues/26, it seems like this error is safe to ignore,