diff --git a/studio/components/interfaces/BillingV2/Billing.constants.ts b/studio/components/interfaces/BillingV2/Billing.constants.ts index 519a1ca2afc..c4a48de2d74 100644 --- a/studio/components/interfaces/BillingV2/Billing.constants.ts +++ b/studio/components/interfaces/BillingV2/Billing.constants.ts @@ -10,7 +10,7 @@ export const CANCELLATION_REASONS = [ 'Dashboard is too complicated', 'Postgres is too complicated', 'Problem not solved', - 'Bug issues', + 'Too many bugs/issues', 'I decided to use something else', 'My work has finished/discontinued', 'I’m migrating to/starting a new project', diff --git a/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx b/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx index e968c6e115e..60f651d3c52 100644 --- a/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx +++ b/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx @@ -21,7 +21,7 @@ const EdgeFunctionsListItem: FC = ({ function: item }) => { const { project } = useProjectContext() // get the .co or .net TLD from the restUrl const restUrl = project?.restUrl - const restUrlTld = new URL(restUrl as string).hostname.split('.').pop() + const restUrlTld = restUrl !== undefined ? new URL(restUrl as string).hostname.split('.').pop() : 'co' const functionUrl = `https://${ref}.supabase.${restUrlTld}/functions/v1/${item.slug}` return ( diff --git a/studio/components/interfaces/Organization/BillingSettingsV2/BillingSettings.constants.ts b/studio/components/interfaces/Organization/BillingSettingsV2/BillingSettings.constants.ts index 3e16e7b2138..d2f5238e5f4 100644 --- a/studio/components/interfaces/Organization/BillingSettingsV2/BillingSettings.constants.ts +++ b/studio/components/interfaces/Organization/BillingSettingsV2/BillingSettings.constants.ts @@ -8,7 +8,7 @@ export const CANCELLATION_REASONS = [ 'Dashboard is too complicated', 'Postgres is too complicated', 'Problem not solved', - 'Bug issues', + 'Too many bugs/issues', 'I decided to use something else', 'My work has finished/discontinued', 'I’m migrating to/starting a new project', diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.constants.ts b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.constants.ts index 407f2798911..16c4174ddee 100644 --- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.constants.ts +++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.constants.ts @@ -31,6 +31,11 @@ const defaultTextBasedValues: Suggestion[] = [ // using meta-store's extensions to generate this partially on top of vanilla expressions export const typeExpressionSuggestions: Dictionary = { uuid: [ + { + name: 'auth.uid()', + value: 'auth.uid()', + description: "Returns the user's ID when rows are added or updated through the API", + }, { name: 'gen_random_uuid()', value: 'gen_random_uuid()', diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx index 3a6fb96cc55..65871c80afd 100644 --- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx +++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx @@ -1,16 +1,16 @@ -import React, { FC, useEffect, useState } from 'react' -import { get, find, isEmpty, sortBy } from 'lodash' +import type { PostgresColumn, PostgresSchema, PostgresTable } from '@supabase/postgres-meta' import { Dictionary } from 'components/grid' -import { SidePanel, Input, Listbox, IconHelpCircle, IconDatabase, Toggle } from 'ui' -import type { PostgresTable, PostgresColumn, PostgresSchema } from '@supabase/postgres-meta' +import { find, get, isEmpty, sortBy } from 'lodash' +import { FC, useEffect, useState } from 'react' +import { IconDatabase, IconHelpCircle, Input, Listbox, SidePanel } from 'ui' -import { useStore } from 'hooks' -import ActionBar from '../ActionBar' -import { ForeignKey } from './ForeignKeySelector.types' -import { ColumnField } from '../SidePanelEditor.types' import InformationBox from 'components/ui/InformationBox' import { FOREIGN_KEY_DELETION_ACTION } from 'data/database/database-query-constants' +import { useStore } from 'hooks' +import ActionBar from '../ActionBar' +import { ColumnField } from '../SidePanelEditor.types' import { FOREIGN_KEY_DELETION_OPTIONS } from './ForeignKeySelector.constants' +import { ForeignKey } from './ForeignKeySelector.types' import { generateDeletionActionDescription } from './ForeignKeySelector.utils' interface Props { @@ -98,10 +98,13 @@ const ForeignKeySelector: FC = ({ column, visible = false, closePanel, sa } const table = find(tables, { id: tableId }) if (table) { + const primaryColumn = table.primary_keys[0].name + const firstColumn = table.columns?.length ? table.columns[0].name : undefined + setSelectedForeignKey({ schema: table.schema, table: table.name, - column: table.columns?.length ? table.columns[0].name : undefined, + column: primaryColumn ?? firstColumn, deletionAction: FOREIGN_KEY_DELETION_ACTION.NO_ACTION, }) } diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.constants.ts b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.constants.ts index d0dac2adb38..7b924cffdbe 100644 --- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.constants.ts +++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.constants.ts @@ -24,7 +24,7 @@ export const DEFAULT_COLUMNS: ColumnField[] = [ defaultValue: 'now()', check: null, foreignKey: undefined, - isNullable: true, + isNullable: false, isUnique: false, isArray: false, isPrimaryKey: false, diff --git a/studio/components/layouts/AppLayout/SettingsButton.tsx b/studio/components/layouts/AppLayout/SettingsButton.tsx index 32c34939225..ed5eb2f3a77 100644 --- a/studio/components/layouts/AppLayout/SettingsButton.tsx +++ b/studio/components/layouts/AppLayout/SettingsButton.tsx @@ -11,7 +11,7 @@ const SettingsButton = () => { - + diff --git a/studio/components/layouts/AppLayout/UserSettingsDropdown.tsx b/studio/components/layouts/AppLayout/UserSettingsDropdown.tsx index 51bba7ff4d7..19871d5866f 100644 --- a/studio/components/layouts/AppLayout/UserSettingsDropdown.tsx +++ b/studio/components/layouts/AppLayout/UserSettingsDropdown.tsx @@ -35,8 +35,13 @@ const UserSettingsDropdown = () => { return ( setOpen(!open)} modal={false}> - - {profile?.first_name ? profile?.first_name?.[0] : } + + diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx index 05f28ff10ef..411eee235f6 100644 --- a/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx +++ b/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx @@ -33,6 +33,7 @@ const HelpPopover = ({ alt = false }: HelpPopoverProps) => {