Skip to content

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

Move smtp settings to auth settings

Terry Suttonb880227efce7
diff --git a/studio/components/interfaces/Reports/Reports.constants.ts b/studio/components/interfaces/Reports/Reports.constants.ts
index 64e209f1a45..ac4492a7075 100644
--- a/studio/components/interfaces/Reports/Reports.constants.ts
+++ b/studio/components/interfaces/Reports/Reports.constants.ts
@@ -30,10 +30,10 @@ export const REPORTS_DATEPICKER_HELPERS: DatetimeHelper[] = [
export const PRESET_CONFIG = {
[Presets.OVERVIEW]: {
- title: 'API Usage',
+ title: '',
sql: {
statusCodes: `
- select
+ select
timestamp_trunc(timestamp, hour) as timestamp,
r.status_code as status_code,
count(status_code) as count
@@ -82,9 +82,9 @@ ORDER BY
method,
status_code
ORDER BY
- sum DESC,
- count desc,
- avg_origin_time DESC
+ sum DESC,
+ count desc,
+ avg_origin_time DESC
LIMIT 50
`,
},
diff --git a/studio/components/layouts/LogsLayout/LogsMenu.utils.ts b/studio/components/layouts/LogsLayout/LogsMenu.utils.ts
index d67625440fa..4bf8454c05a 100644
--- a/studio/components/layouts/LogsLayout/LogsMenu.utils.ts
+++ b/studio/components/layouts/LogsLayout/LogsMenu.utils.ts
@@ -1,14 +1,10 @@
import { Project } from 'types'
import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
-import { useFlag } from 'hooks'
export const generateLogsMenu = (project?: Project): ProductMenuGroup[] => {
const ref = project?.ref ?? 'default'
- const productReports = useFlag('productReports')
-
return [
{
- title: 'Logs',
items: [
{
name: 'Logs Explorer',
@@ -47,17 +43,6 @@ export const generateLogsMenu = (project?: Project): ProductMenuGroup[] => {
url: `/project/${ref}/logs/realtime-logs`,
items: [],
},
-
- ...(productReports
- ? [
- {
- name: 'Usage (used to be "API usage") move to reports',
- key: 'api-usage',
- url: `/project/${ref}/logs/api-usage`,
- items: [],
- },
- ]
- : []),
],
},
]
diff --git a/studio/pages/project/[ref]/auth/templates.tsx b/studio/pages/project/[ref]/auth/templates.tsx
index 56a21f3dee6..6d4db080b1d 100644
--- a/studio/pages/project/[ref]/auth/templates.tsx
+++ b/studio/pages/project/[ref]/auth/templates.tsx
@@ -5,7 +5,7 @@ import { PermissionAction } from '@supabase/shared-types/out/constants'
import { NextPageWithLayout } from 'types'
import { useStore, checkPermissions } from 'hooks'
import { AuthLayout } from 'components/layouts'
-import { EmailTemplates, SmtpForm } from 'components/interfaces'
+import { EmailTemplates } from 'components/interfaces'
import { FormsContainer } from 'components/ui/Forms'
import NoPermission from 'components/ui/NoPermission'
@@ -23,7 +23,6 @@ const PageLayout: NextPageWithLayout = () => {
} else if (authConfig) {
return (
<FormsContainer>
- <SmtpForm />
<EmailTemplates />
</FormsContainer>
)
diff --git a/studio/pages/project/[ref]/reports/[id].tsx b/studio/pages/project/[ref]/reports/[id].tsx
index 9afcfa08e0a..8687314216c 100644
--- a/studio/pages/project/[ref]/reports/[id].tsx
+++ b/studio/pages/project/[ref]/reports/[id].tsx
@@ -7,7 +7,7 @@ import ReportsLayout from 'components/layouts/ReportsLayout/ReportsLayout'
const PageLayout: NextPageWithLayout = () => (
<>
- <div className="mx-auto my-8 w-full max-w-7xl h-full">
+ <div className="1xl:px-28 mx-auto flex flex-col gap-4 px-5 py-6 lg:px-16 xl:px-24 2xl:px-32">
<Reports />
</div>
<EditReportModal />
diff --git a/studio/pages/project/[ref]/reports/database.tsx b/studio/pages/project/[ref]/reports/database.tsx
index 42da85a7c12..426285d268d 100644
--- a/studio/pages/project/[ref]/reports/database.tsx
+++ b/studio/pages/project/[ref]/reports/database.tsx
@@ -1,39 +1,25 @@
import dayjs from 'dayjs'
-import useSWR from 'swr'
-import * as Tooltip from '@radix-ui/react-tooltip'
-import { FC, useState, useRef, useEffect } from 'react'
-import { toJS } from 'mobx'
import { observer } from 'mobx-react-lite'
-import { useRouter } from 'next/router'
-import { debounce } from 'lodash'
-import generator from 'generate-password'
-import { Input, Button, IconDownload, IconArrowRight, Tabs, Modal } from 'ui'
-import { PermissionAction } from '@supabase/shared-types/out/constants'
+import { FC, useState } from 'react'
+import { IconArrowRight } from 'ui'
+import { useStore } from 'hooks'
+import { TIME_PERIODS_INFRA } from 'lib/constants'
import { NextPageWithLayout } from 'types'
-import { checkPermissions, useFlag, useStore } from 'hooks'
-import { get, patch } from 'lib/common/fetch'
-import { pluckObjectFields, passwordStrength } from 'lib/helpers'
-import { API_URL, DEFAULT_MINIMUM_PASSWORD_STRENGTH, TIME_PERIODS_INFRA } from 'lib/constants'
import ReportsLayout from 'components/layouts/ReportsLayout/ReportsLayout'
-import PasswordStrengthBar from 'components/ui/PasswordStrengthBar'
-import Panel from 'components/ui/Panel'
-import DateRangePicker from 'components/to-be-cleaned/DateRangePicker'
import ChartHandler from 'components/to-be-cleaned/Charts/ChartHandler'
-import ProjectUsageMinimal from 'components/interfaces/Settings/ProjectUsageBars/ProjectUsageMinimal'
-
-const ProjectSettings: NextPageWithLayout = () => {
- const router = useRouter()
- const { ref } = router.query
+import DateRangePicker from 'components/to-be-cleaned/DateRangePicker'
+import Panel from 'components/ui/Panel'
+const DatabaseReport: NextPageWithLayout = () => {
const { ui } = useStore()
const project = ui.selectedProject
return (
- <div>
+ <div className="1xl:px-28 mx-auto flex flex-col gap-4 px-5 py-6 lg:px-16 xl:px-24 2xl:px-32">
<div className="content h-full w-full overflow-y-auto">
- <div className="w-full max-w-5xl px-4 py-4">
+ <div className="w-full">
<DatabaseUsage project={project} />
</div>
</div>
@@ -41,26 +27,18 @@ const ProjectSettings: NextPageWithLayout = () => {
)
}
-ProjectSettings.getLayout = (page) => <ReportsLayout title="Database">{page}</ReportsLayout>
+DatabaseReport.getLayout = (page) => <ReportsLayout title="Database">{page}</ReportsLayout>
-export default observer(ProjectSettings)
+export default observer(DatabaseReport)
-const DatabaseUsage: FC<any> = ({ project }) => {
+const DatabaseUsage: FC<any> = () => {
const [dateRange, setDateRange] = useState<any>(undefined)
- const router = useRouter()
- const ref = router.query.ref as string
return (
<>
<div>
<section className="">
- <Panel
- title={
- <h5 key="panel-title" className="mb-0">
- Database health
- </h5>
- }
- >
+ <Panel>
<Panel.Content>
<div className="mb-4 flex items-center space-x-3">
<DateRangePicker
diff --git a/studio/pages/project/[ref]/settings/auth.tsx b/studio/pages/project/[ref]/settings/auth.tsx
index 89878a14aff..87f50db0883 100644
--- a/studio/pages/project/[ref]/settings/auth.tsx
+++ b/studio/pages/project/[ref]/settings/auth.tsx
@@ -8,6 +8,7 @@ import AutoSchemaForm from 'components/interfaces/Auth/AutoSchemaForm'
import { SettingsLayout } from 'components/layouts'
import { FormsContainer } from 'components/ui/Forms'
import NoPermission from 'components/ui/NoPermission'
+import { SmtpForm } from 'components/interfaces'
const PageLayout: NextPageWithLayout = () => {
const { ui, authConfig } = useStore()
@@ -24,6 +25,7 @@ const PageLayout: NextPageWithLayout = () => {
return (
<FormsContainer>
<AutoSchemaForm />
+ <SmtpForm />
</FormsContainer>
)
} else {
diff --git a/studio/tests/pages/projects/logs-query.test.js b/studio/tests/pages/projects/logs-query.test.js
index 4d0a286664d..3ae3b637d34 100644
--- a/studio/tests/pages/projects/logs-query.test.js
+++ b/studio/tests/pages/projects/logs-query.test.js
@@ -8,7 +8,6 @@ import { logDataFixture } from '../../fixtures'
import { clickDropdown } from 'tests/helpers'
import dayjs from 'dayjs'
import { useProjectSubscription } from 'hooks'
-import UpgradePrompt from 'components/interfaces/Settings/Logs/UpgradePrompt'
const defaultRouterMock = () => {
const router = jest.fn()