setFilterStatusStorage(options)}
/>
+ setSortStorage(val as ProjectListSort)}
+ />
+
{isFetchingProjects && }
- {showViewToggle && viewMode && setViewMode && (
+ {viewMode && setViewMode && (
void
+}
+
+export const SortDropdown = ({ options, value, setValue }: SortDropdownProps) => {
+ const [sortColumn, sortOrder] = value.split('_')
+ const columnLabel = options.find((x) => x.value === sortColumn)?.label
+
+ return (
+
+
+ : }
+ >
+ Sorted by {columnLabel ?? sortColumn}
+
+
+
+
+
+ {options.map((option) => {
+ return (
+
+ Sort by {option.label}
+
+
+ Ascending
+
+
+ Descending
+
+
+
+ )
+ })}
+
+
+
+ )
+}
diff --git a/apps/studio/data/auth/auth-config-query.ts b/apps/studio/data/auth/auth-config-query.ts
index 514157b29d16b..78629c57d95f5 100644
--- a/apps/studio/data/auth/auth-config-query.ts
+++ b/apps/studio/data/auth/auth-config-query.ts
@@ -4,6 +4,7 @@ import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
import { useCallback } from 'react'
import type { ResponseError, UseCustomQueryOptions } from 'types'
+
import { authKeys } from './keys'
export type AuthConfigVariables = {
@@ -40,7 +41,7 @@ export const useAuthConfigQuery = (
useQuery({
queryKey: authKeys.authConfig(projectRef),
queryFn: ({ signal }) => getProjectAuthConfig({ projectRef }, signal),
- enabled: enabled && IS_PLATFORM && typeof projectRef !== 'undefined',
+ enabled: enabled && IS_PLATFORM && typeof projectRef !== 'undefined' && projectRef !== '_',
...options,
})
diff --git a/apps/studio/data/config/project-storage-config-query.ts b/apps/studio/data/config/project-storage-config-query.ts
index 1b4e60bbc9a1a..49f78d1fdda0f 100644
--- a/apps/studio/data/config/project-storage-config-query.ts
+++ b/apps/studio/data/config/project-storage-config-query.ts
@@ -1,9 +1,9 @@
import { useQuery } from '@tanstack/react-query'
-
import { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
import type { ResponseError, UseCustomQueryOptions } from 'types'
+
import { configKeys } from './keys'
export type ProjectStorageConfigVariables = {
@@ -48,7 +48,7 @@ export const useProjectStorageConfigQuery = (
useQuery({
queryKey: configKeys.storage(projectRef),
queryFn: ({ signal }) => getProjectStorageConfig({ projectRef }, signal),
- enabled: enabled && IS_PLATFORM && typeof projectRef !== 'undefined',
+ enabled: enabled && IS_PLATFORM && typeof projectRef !== 'undefined' && projectRef !== '_',
...options,
})
diff --git a/apps/studio/pages/org/[slug]/index.tsx b/apps/studio/pages/org/[slug]/index.tsx
index bb42b54ccc196..b223258fe7175 100644
--- a/apps/studio/pages/org/[slug]/index.tsx
+++ b/apps/studio/pages/org/[slug]/index.tsx
@@ -1,5 +1,3 @@
-import Link from 'next/link'
-
import { useIsMFAEnabled } from 'common'
import { ProjectList } from 'components/interfaces/Home/ProjectList/ProjectList'
import { HomePageActions } from 'components/interfaces/HomePageActions'
@@ -8,6 +6,7 @@ import OrganizationLayout from 'components/layouts/OrganizationLayout'
import { PageLayout } from 'components/layouts/PageLayout/PageLayout'
import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
+import Link from 'next/link'
import type { NextPageWithLayout } from 'types'
import { Button } from 'ui'
import { Admonition } from 'ui-patterns'
@@ -40,7 +39,7 @@ const ProjectsPage: NextPageWithLayout = () => {
/>
) : (
)}
diff --git a/apps/studio/pages/project/_/[[...routeSlug]].tsx b/apps/studio/pages/project/_/[[...routeSlug]].tsx
index e80b6cc3bf730..97fd1241512d4 100644
--- a/apps/studio/pages/project/_/[[...routeSlug]].tsx
+++ b/apps/studio/pages/project/_/[[...routeSlug]].tsx
@@ -1,8 +1,3 @@
-import { AlertTriangleIcon } from 'lucide-react'
-import { NextPage } from 'next'
-import { useRouter } from 'next/router'
-import { useEffect, useState } from 'react'
-
import { IS_PLATFORM, LOCAL_STORAGE_KEYS, useParams } from 'common'
import {
Header,
@@ -16,6 +11,10 @@ import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold'
import { useOrganizationsQuery } from 'data/organizations/organizations-query'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
import { withAuth } from 'hooks/misc/withAuth'
+import { AlertTriangleIcon } from 'lucide-react'
+import { NextPage } from 'next'
+import { useRouter } from 'next/router'
+import { useEffect, useState } from 'react'
import {
Alert_Shadcn_,
AlertDescription_Shadcn_,
diff --git a/packages/common/constants/local-storage.ts b/packages/common/constants/local-storage.ts
index 55d7e1ecc113a..174d43c24504b 100644
--- a/packages/common/constants/local-storage.ts
+++ b/packages/common/constants/local-storage.ts
@@ -8,6 +8,7 @@ export const LOCAL_STORAGE_KEYS = {
EDITOR_PANEL_STATE: 'supabase-editor-panel-state',
PROJECTS_VIEW: 'projects-view',
PROJECTS_FILTER: 'projects-filter',
+ PROJECTS_SORT: 'projects-sort',
FEEDBACK_WIDGET_CONTENT: 'feedback-widget-content',
FEEDBACK_WIDGET_SCREENSHOT: 'feedback-widget-screenshot',
INCIDENT_BANNER_DISMISSED: (id: string) => `incident-banner-dismissed-${id}`,