chore: upgrade prettier/eslint + autofix (#20785)

This commit is contained in:
Kevin Grüneberg
2024-01-30 10:54:02 +08:00
committed by GitHub
parent cad02fc3d4
commit f7e60bf324
148 changed files with 1511 additions and 866 deletions
+58
View File
@@ -0,0 +1,58 @@
name: Autofix Linting Checks
on:
pull_request:
types:
- labeled
# Cancel old builds on new commit for same workflow + branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
autofix:
runs-on: ubuntu-latest
permissions:
contents: write
if: ${{ github.event_name == 'pull_request' && (github.event.label.name == 'autofix') }}
steps:
- name: Calculate number of commits
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
sparse-checkout: apps
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# Installing all dependencies takes up to three minutes, hacking around to only installing prettier+deps
- name: Install required dependencies
run: |
rm package.json
rm package-lock.json
npm i prettier@4.0.0-alpha.8 prettier-plugin-sql-cst
- name: Run Prettier in fix mode
run: |
npx prettier --write 'apps/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'
- name: Commit changes and push to existing branch
run: |
git checkout -- package.json
git checkout -- package-lock.json
git config --global user.name 'github-tidy-bot'
git config --global user.email 'github-tidy-bot@supabase.com'
if [[ `git status --porcelain` ]]; then
echo "[bot] Changes detected, committing."
echo "[bot] Running in non-squash mode."
git commit -am "ci: Autofix updates from GitHub workflow"
git push
else
echo "[bot] No changes detected, nothing to commit."
fi
+3 -3
View File
@@ -27,7 +27,7 @@ jobs:
run: |
rm package.json
rm package-lock.json
npm i prettier@2 prettier-plugin-sql-cst
npm i prettier@4.0.0-alpha.8 prettier-plugin-sql-cst
- name: Run prettier
run: |-
npx prettier -c 'apps/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'
@@ -50,7 +50,7 @@ jobs:
run: |
rm package.json
rm package-lock.json
npm i prettier@2 prettier-plugin-sql-cst
npm i prettier@4.0.0-alpha.8 prettier-plugin-sql-cst
- name: Run prettier
run: |-
npx prettier -c 'i18n/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'
@@ -68,7 +68,7 @@ jobs:
run: |
rm package.json
rm package-lock.json
npm i prettier@2 prettier-plugin-sql-cst
npm i prettier@4.0.0-alpha.8 prettier-plugin-sql-cst
- name: Run prettier
run: |-
# Check mdx files which contain sql code blocks
@@ -138,8 +138,8 @@ const UserChat = ({ message, isLatest, times, run }: UserChatProps) => {
{replyDuration !== undefined
? ` with ${replyDuration}s response`
: isLoading
? ', generating response...'
: ''}
? ', generating response...'
: ''}
</p>
)}
</div>
+18 -9
View File
@@ -8,56 +8,64 @@
@font-face {
font-family: 'circular';
src: url(/fonts/custom/CustomFont-Book.woff2) format('woff2'),
src:
url(/fonts/custom/CustomFont-Book.woff2) format('woff2'),
url(/fonts/custom/CustomFont-Book.woff) format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'circular';
src: url(/fonts/custom/CustomFont-BookItalic.woff2) format('woff2'),
src:
url(/fonts/custom/CustomFont-BookItalic.woff2) format('woff2'),
url(/fonts/custom/CustomFont-BookItalic.woff) format('woff');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'circular';
src: url(/fonts/custom/CustomFont-Medium.woff2) format('woff2'),
src:
url(/fonts/custom/CustomFont-Medium.woff2) format('woff2'),
url(/fonts/custom/CustomFont-Medium.woff) format('woff');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'circular';
src: url(/fonts/custom/CustomFont-MediumItalic.woff2) format('woff2'),
src:
url(/fonts/custom/CustomFont-MediumItalic.woff2) format('woff2'),
url(/fonts/custom/CustomFont-MediumItalic.woff) format('woff');
font-weight: 500;
font-style: italic;
}
@font-face {
font-family: 'circular';
src: url(/fonts/custom/CustomFont-Bold.woff2) format('woff2'),
src:
url(/fonts/custom/CustomFont-Bold.woff2) format('woff2'),
url(/fonts/custom/CustomFont-Bold.woff) format('woff');
font-weight: 700;
font-style: 600;
}
@font-face {
font-family: 'circular';
src: url(/fonts/custom/CustomFont-BoldItalic.woff2) format('woff2'),
src:
url(/fonts/custom/CustomFont-BoldItalic.woff2) format('woff2'),
url(/fonts/custom/CustomFont-BoldItalic.woff) format('woff');
font-style: 600;
font-style: italic;
}
@font-face {
font-family: 'circular';
src: url(/fonts/custom/CustomFont-Black.woff2) format('woff2'),
src:
url(/fonts/custom/CustomFont-Black.woff2) format('woff2'),
url(/fonts/custom/CustomFont-Black.woff) format('woff');
font-weight: 800;
font-style: normal;
}
@font-face {
font-family: 'circular';
src: url(/fonts/custom/CustomFont-BlackItalic.woff2) format('woff2'),
src:
url(/fonts/custom/CustomFont-BlackItalic.woff2) format('woff2'),
url(/fonts/custom/CustomFont-BlackItalic.woff) format('woff');
font-weight: 800;
font-style: italic;
@@ -66,7 +74,8 @@
@font-face {
font-family: 'source code pro';
src: url('/fonts/source-code-pro/SourceCodePro-Regular.eot');
src: url('/fonts/source-code-pro/SourceCodePro-Regular.woff2') format('woff2'),
src:
url('/fonts/source-code-pro/SourceCodePro-Regular.woff2') format('woff2'),
url('/fonts/source-code-pro/SourceCodePro-Regular.woff') format('woff'),
url('/fonts/source-code-pro/SourceCodePro-Regular.ttf') format('truetype'),
url('/fonts/source-code-pro/SourceCodePro-Regular.svg#SourceCodePro-Regular') format('svg');
+1 -1
View File
@@ -17,7 +17,7 @@
"common": "*",
"config": "*",
"dayjs": "^1.11.10",
"eslint-config-next": "^14.0.3",
"eslint-config-next": "^14.1.0",
"lodash": "^4.17.21",
"lucide-react": "^0.292.0",
"next": "^14.0.3",
+5 -5
View File
@@ -15,15 +15,15 @@
"incremental": true,
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"paths": {
"@/*": ["./*"],
// handle ui package paths
"@ui/*": ["./../../packages/ui/src/*"]
}
"@ui/*": ["./../../packages/ui/src/*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
+3 -3
View File
@@ -46,7 +46,7 @@ export interface Database {
columns: ['user_id']
referencedRelation: 'users'
referencedColumns: ['id']
}
},
]
}
responses_ai: {
@@ -92,7 +92,7 @@ export interface Database {
columns: ['user_id']
referencedRelation: 'users'
referencedColumns: ['id']
}
},
]
}
threads: {
@@ -132,7 +132,7 @@ export interface Database {
columns: ['user_id']
referencedRelation: 'users'
referencedColumns: ['id']
}
},
]
}
}
@@ -64,8 +64,8 @@ export function ComboBox<Opt extends ComboBoxOption>({
{isLoading
? 'Loading...'
: options.length === 0
? `No ${name} found`
: selectedOptionDisplayName ?? `Select a ${name}...`}
? `No ${name} found`
: selectedOptionDisplayName ?? `Select a ${name}...`}
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
@@ -98,14 +98,14 @@ function OrgProjectSelector() {
const stateSummary: ProjectOrgDataState = isUserLoading
? 'userLoading'
: !isLoggedIn
? 'loggedOut'
: anyIsPending
? 'loggedIn.dataPending'
: anyIsError
? 'loggedIn.dataError'
: projects?.length === 0
? 'loggedIn.dataSuccess.hasNoData'
: 'loggedIn.dataSuccess.hasData'
? 'loggedOut'
: anyIsPending
? 'loggedIn.dataPending'
: anyIsError
? 'loggedIn.dataError'
: projects?.length === 0
? 'loggedIn.dataSuccess.hasNoData'
: 'loggedIn.dataSuccess.hasData'
const formattedData: ComboBoxOption[] = useMemo(
() =>
@@ -194,16 +194,16 @@ function BranchSelector() {
const stateSummary: BranchesDataState = userLoading
? 'userLoading'
: !isLoggedIn
? 'loggedOut'
: !hasBranches
? 'loggedIn.noBranches'
: isPending
? 'loggedIn.branches.dataPending'
: isError
? 'loggedIn.branches.dataError'
: data.length === 0
? 'loggedIn.branches.dataSuccess.noData'
: 'loggedIn.branches.dataSuccess.hasData'
? 'loggedOut'
: !hasBranches
? 'loggedIn.noBranches'
: isPending
? 'loggedIn.branches.dataPending'
: isError
? 'loggedIn.branches.dataError'
: data.length === 0
? 'loggedIn.branches.dataSuccess.noData'
: 'loggedIn.branches.dataSuccess.hasData'
const formattedData: ComboBoxOption[] =
stateSummary !== 'loggedIn.branches.dataSuccess.hasData'
@@ -282,14 +282,14 @@ function VariableView({ variable, className }: { variable: Variable; className?:
const stateSummary: VariableDataState = isUserLoading
? 'userLoading'
: !isLoggedIn
? 'loggedOut'
: !ref
? 'loggedIn.noSelectedProject'
: isPending
? 'loggedIn.selectedProject.dataPending'
: isError
? 'loggedIn.selectedProject.dataError'
: 'loggedIn.selectedProject.dataSuccess'
? 'loggedOut'
: !ref
? 'loggedIn.noSelectedProject'
: isPending
? 'loggedIn.selectedProject.dataPending'
: isError
? 'loggedIn.selectedProject.dataError'
: 'loggedIn.selectedProject.dataSuccess'
let variableValue: string = null
if (stateSummary === 'loggedIn.selectedProject.dataSuccess') {
@@ -319,8 +319,8 @@ function VariableView({ variable, className }: { variable: Variable; className?:
stateSummary === 'loggedIn.selectedProject.dataPending'
? 'Loading...'
: stateSummary === 'loggedIn.selectedProject.dataSuccess'
? variableValue
: `YOUR ${prettyFormatVariable[variable].toUpperCase()}`
? variableValue
: `YOUR ${prettyFormatVariable[variable].toUpperCase()}`
}
/>
<CopyToClipboard text={variableValue ?? ''}>
@@ -158,8 +158,8 @@ export default function RealtimeLimitsEstimater({}) {
{computeAddOn === 'micro'
? 'Micro'
: computeAddOn === 'small'
? 'Small to medium'
: 'Large to 16XL'}
? 'Small to medium'
: 'Large to 16XL'}
</h4>
<table className="table-auto">
<thead>
@@ -126,14 +126,14 @@ const RefFunctionSection: React.FC<IRefFunctionSection> = (props) => {
const codeBlockLang = example?.code?.startsWith('```js')
? 'js'
: example?.code?.startsWith('```ts')
? 'ts'
: example?.code?.startsWith('```dart')
? 'dart'
: example?.code?.startsWith('```c#')
? 'csharp'
: example?.code?.startsWith('```kotlin')
? 'kotlin'
: 'js'
? 'ts'
: example?.code?.startsWith('```dart')
? 'dart'
: example?.code?.startsWith('```c#')
? 'csharp'
: example?.code?.startsWith('```kotlin')
? 'kotlin'
: 'js'
// `
// import { createClient } from '@supabase/supabase-js'
+4 -4
View File
@@ -259,10 +259,10 @@ function extractParamTypeAsString(paramDefinition) {
x.value
? `<code>${x.value}</code>`
: x.name
? `<code>${x.name}</code>`
: x.type
? `<code>${x.type}</code>`
: ''
? `<code>${x.name}</code>`
: x.type
? `<code>${x.type}</code>`
: ''
)
.join(' | ')
}
+3 -3
View File
@@ -5,9 +5,9 @@
"noImplicitAny": false,
"baseUrl": ".",
"paths": {
"~/*": ["./*"]
}
"~/*": ["./*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
+1 -1
View File
@@ -53,7 +53,7 @@ async function generate() {
</urlset>
`
const formatted = prettier.format(sitemap, {
const formatted = await prettier.format(sitemap, {
...prettierConfig,
parser: 'html',
})
+3 -3
View File
@@ -7,9 +7,9 @@
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"~/*": ["./*"]
}
"~/*": ["./*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
+2 -2
View File
@@ -201,8 +201,8 @@ const MobileHeader = memo(function MobileHeader() {
{mobileMenuOpen
? 'Close'
: menuLevel
? levelsData[menuLevel].name
: levelsData['home'].name}
? levelsData[menuLevel].name
: levelsData['home'].name}
</span>
</div>
)
@@ -88,7 +88,6 @@ create table contacts (
id uuid default uuid_generate_v4(),
first_name text,
last_name text,
primary key (id)
);
```
@@ -13,7 +13,7 @@ Select a set of columns from a single table with where, order by, and limit clau
```sql
select first_name, last_name, team_id, age
from players
where age between 20 and 24 and team_id <> 'STL'
where age between 20 and 24 and team_id != 'STL'
order by last_name, first_name desc
limit 20;
```
@@ -52,7 +52,7 @@ Select all columns from a single table with a complex where clause: AND OR AND
```sql
select *
from players
where ((team_id = 'CHN' and age > 35) or (team_id <> 'CHN' and age is not null));
where ((team_id = 'CHN' and age > 35) or (team_id != 'CHN' and age is not null));
```
```js
@@ -230,7 +230,10 @@ export class AccountComponent implements OnInit {
avatar_url: '',
})
constructor(private readonly supabase: SupabaseService, private formBuilder: FormBuilder) {}
constructor(
private readonly supabase: SupabaseService,
private formBuilder: FormBuilder
) {}
async ngOnInit(): Promise<void> {
await this.getProfile()
@@ -421,7 +424,10 @@ export class AvatarComponent {
@Output() upload = new EventEmitter<string>()
constructor(private readonly supabase: SupabaseService, private readonly dom: DomSanitizer) {}
constructor(
private readonly supabase: SupabaseService,
private readonly dom: DomSanitizer
) {}
async downloadImage(path: string) {
try {
@@ -70,7 +70,10 @@ export interface Profile {
export class SupabaseService {
private supabase: SupabaseClient
constructor(private loadingCtrl: LoadingController, private toastCtrl: ToastController) {
constructor(
private loadingCtrl: LoadingController,
private toastCtrl: ToastController
) {
this.supabase = createClient(environment.supabaseUrl, environment.supabaseKey)
}
@@ -252,7 +255,10 @@ export class AccountPage implements OnInit {
email = ''
constructor(private readonly supabase: SupabaseService, private router: Router) {}
constructor(
private readonly supabase: SupabaseService,
private router: Router
) {}
ngOnInit() {
this.getEmail()
this.getProfile()
@@ -319,7 +325,10 @@ import { SupabaseService } from './supabase.service'
styleUrls: ['app.component.scss'],
})
export class AppComponent {
constructor(private supabase: SupabaseService, private router: Router) {
constructor(
private supabase: SupabaseService,
private router: Router
) {
this.supabase.authChanges((_, session) => {
console.log(session)
if (session?.user) {
@@ -474,7 +483,10 @@ export class AvatarComponent {
@Output() upload = new EventEmitter<string>()
constructor(private readonly supabase: SupabaseService, private readonly dom: DomSanitizer) {
constructor(
private readonly supabase: SupabaseService,
private readonly dom: DomSanitizer
) {
addIcons({ person })
}
@@ -121,11 +121,11 @@ Let's create a new component for that called `Account.svelte`.
```html src/lib/Account.svelte
<script lang="ts">
import { onMount } from "svelte";
import type { AuthSession } from "@supabase/supabase-js";
import { supabase } from "../supabaseClient";
import { onMount } from 'svelte'
import type { AuthSession } from '@supabase/supabase-js'
import { supabase } from '../supabaseClient'
export let session: AuthSession;
export let session: AuthSession
let loading = false
let username: string | null = null
@@ -191,23 +191,23 @@ Let's create a new component for that called `Account.svelte`.
}
</script>
<form on:submit|preventDefault={updateProfile} class="form-widget">
<form on:submit|preventDefault="{updateProfile}" class="form-widget">
<div>Email: {session.user.email}</div>
<div>
<label for="username">Name</label>
<input id="username" type="text" bind:value={username} />
<input id="username" type="text" bind:value="{username}" />
</div>
<div>
<label for="website">Website</label>
<input id="website" type="text" bind:value={website} />
<input id="website" type="text" bind:value="{website}" />
</div>
<div>
<button type="submit" class="button primary block" disabled={loading}>
<button type="submit" class="button primary block" disabled="{loading}">
{loading ? 'Saving ...' : 'Update profile'}
</button>
</div>
<button type="button" class="button block" on:click={() => supabase.auth.signOut()}>
Sign Out
<button type="button" class="button block" on:click="{()" ="">
supabase.auth.signOut()}> Sign Out
</button>
</form>
```
+8 -2
View File
@@ -12,7 +12,10 @@ export type Section = {
export abstract class BaseLoader {
type: string
constructor(public source: string, public path: string) {}
constructor(
public source: string,
public path: string
) {}
abstract load(): Promise<BaseSource[]>
}
@@ -23,7 +26,10 @@ export abstract class BaseSource {
meta?: Json
sections?: Section[]
constructor(public source: string, public path: string) {}
constructor(
public source: string,
public path: string
) {}
abstract process(): { checksum: string; meta?: Json; ragIgnore?: boolean; sections: Section[] }
@@ -77,7 +77,10 @@ export async function fetchDiscussions(owner: string, repo: string, categoryId:
export class GitHubDiscussionLoader extends BaseLoader {
type = 'github-discussions' as const
constructor(source: string, public discussion: Discussion) {
constructor(
source: string,
public discussion: Discussion
) {
super(source, discussion.url)
}
@@ -89,7 +92,11 @@ export class GitHubDiscussionLoader extends BaseLoader {
export class GitHubDiscussionSource extends BaseSource {
type = 'github-discussions' as const
constructor(source: string, path: string, public discussion: Discussion) {
constructor(
source: string,
path: string,
public discussion: Discussion
) {
super(source, path)
}
+9 -2
View File
@@ -192,7 +192,10 @@ export type ProcessedMdx = {
export class MarkdownLoader extends BaseLoader {
type = 'markdown' as const
constructor(source: string, public filePath: string) {
constructor(
source: string,
public filePath: string
) {
const path = filePath.replace(/^pages/, '').replace(/\.mdx?$/, '')
super(source, path)
}
@@ -206,7 +209,11 @@ export class MarkdownLoader extends BaseLoader {
export class MarkdownSource extends BaseSource {
type = 'markdown' as const
constructor(source: string, path: string, public contents: string) {
constructor(
source: string,
path: string,
public contents: string
) {
super(source, path)
}
@@ -34,7 +34,10 @@ export async function fetchPartners() {
export class IntegrationLoader extends BaseLoader {
type = 'partner-integration' as const
constructor(source: string, public partnerData: PartnerData) {
constructor(
source: string,
public partnerData: PartnerData
) {
const relPath = `/partners/integrations/${partnerData.slug}`
super(source, relPath)
}
@@ -47,7 +50,11 @@ export class IntegrationLoader extends BaseLoader {
export class IntegrationSource extends BaseSource {
type = 'partner-integration' as const
constructor(source: string, path: string, public partnerData: PartnerData) {
constructor(
source: string,
path: string,
public partnerData: PartnerData
) {
super(source, path)
}
+3 -3
View File
@@ -7,9 +7,9 @@
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"~/*": ["./*"]
}
"~/*": ["./*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
+1 -1
View File
@@ -25,7 +25,7 @@
"@types/lodash": "^4.14.202",
"json-stringify-safe": "^5.0.1",
"lodash": "^4.17.21",
"prettier": "^2.8.8",
"prettier": "^4.0.0-alpha.8",
"tsx": "^4.7.0"
},
"prettier": {
+3 -1
View File
@@ -91,7 +91,9 @@
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
transition:
color 0.15s ease,
border-color 0.15s ease;
max-width: 300px;
}
+4 -4
View File
@@ -5,7 +5,7 @@
"baseUrl": ".",
"paths": {
"~/*": ["./*"],
"@ui/*": ["./../../packages/ui/src/*"] // handle ui package paths
"@ui/*": ["./../../packages/ui/src/*"], // handle ui package paths
},
"target": "es2015",
"lib": ["dom", "dom.iterable", "esnext"],
@@ -19,14 +19,14 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"module": "esnext"
"module": "esnext",
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"pages/guides/append-test.js",
"jest.config.mjs"
"jest.config.mjs",
],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
+3 -3
View File
@@ -9,8 +9,8 @@ type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T
type OneOf<T extends any[]> = T extends [infer Only]
? Only
: T extends [infer A, infer B, ...infer Rest]
? OneOf<[XOR<A, B>, ...Rest]>
: never
? OneOf<[XOR<A, B>, ...Rest]>
: never
export interface paths {
'/platform/notifications': {
@@ -3846,7 +3846,7 @@ export interface components {
message?: string
status?: string
},
string
string,
]
>
result?: Record<string, never>[]
@@ -62,12 +62,12 @@ export function useKeyboardShortcuts(
return event.metaKey && event.shiftKey
? `Command+Shift+${event.key}`
: event.metaKey
? `Command+${event.key}`
: event.shiftKey && event.key === 'Enter'
? `Shift+${event.key}`
: event.ctrlKey && event.key
? `Control+${event.key}`
: event.key
? `Command+${event.key}`
: event.shiftKey && event.key === 'Enter'
? `Shift+${event.key}`
: event.ctrlKey && event.key
? `Control+${event.key}`
: event.key
}
React.useEffect(() => {
@@ -18,8 +18,8 @@ export function Shortcuts({ gridRef }: ShortcutsProps) {
return navigator?.appVersion.indexOf('Win') !== -1
? 'windows'
: navigator?.appVersion.indexOf('Mac') !== -1
? 'macos'
: 'unknown'
? 'macos'
: 'unknown'
}
const metakey = getClientOS() === 'windows' ? 'Control' : 'Command'
setMetaKey(metakey)
@@ -370,8 +370,8 @@ const RowHeader = ({ table, sorts, filters }: RowHeaderProps) => {
{allRowsSelected
? `${totalRows} rows selected`
: selectedRows.size > 1
? `${selectedRows.size} rows selected`
: `${selectedRows.size} row selected`}
? `${selectedRows.size} rows selected`
: `${selectedRows.size} row selected`}
</span>
{!allRowsSelected && totalRows > allRows.length && (
<Button type="link" onClick={() => onSelectAllRows()}>
@@ -404,8 +404,8 @@ const RowHeader = ({ table, sorts, filters }: RowHeaderProps) => {
{allRowsSelected
? `Delete ${totalRows} rows`
: selectedRows.size > 1
? `Delete ${selectedRows.size} rows`
: `Delete ${selectedRows.size} row`}
? `Delete ${selectedRows.size} rows`
: `Delete ${selectedRows.size} row`}
</Button>
</Tooltip.Trigger>
@@ -25,8 +25,8 @@ const FilterRow = ({ table, filter, filterIdx, onChange, onDelete, onKeyDown }:
column?.format === 'timestamptz'
? 'yyyy-mm-dd hh:mm:ss+zz'
: column?.format === 'timestamp'
? 'yyyy-mm-dd hh:mm:ss'
: 'Enter a value'
? 'yyyy-mm-dd hh:mm:ss'
: 'Enter a value'
return (
<div className="sb-grid-filter-row px-3">
@@ -56,8 +56,8 @@ export function getGridColumns(
const columnWidth = options?.defaultWidth
? options.defaultWidth
: columnDefaultWidth < columnWidthBasedOnName
? columnWidthBasedOnName
: columnDefaultWidth
? columnWidthBasedOnName
: columnDefaultWidth
const columnDefinition: CalculatedColumn<SupaRow> = {
key: x.name,
@@ -247,8 +247,8 @@ const AuditLogs = () => {
{project?.name
? 'Project: '
: organization?.name
? 'Organization: '
: null}
? 'Organization: '
: null}
{project?.name ?? organization?.name ?? '-'}
</p>
<p
@@ -258,8 +258,8 @@ const AuditLogs = () => {
{log.target.metadata.project_ref
? 'Ref: '
: log.target.metadata.org_slug
? 'Slug: '
: null}
? 'Slug: '
: null}
{log.target.metadata.project_ref ?? log.target.metadata.org_slug}
</p>
</Table.td>
@@ -59,8 +59,8 @@ const ProviderForm = ({ config, provider }: ProviderFormProps) => {
initialValues[key] = configValue
? configValue
: provider.properties[key].type === 'boolean'
? false
: ''
? false
: ''
}
}
})
@@ -22,8 +22,8 @@ export const createSQLPolicy = (
definition: definition
? definition.replace(/\s+/g, ' ').trim()
: definition === undefined
? null
: definition,
? null
: definition,
check: check ? check.replace(/\s+/g, ' ').trim() : check === undefined ? null : check,
}
@@ -89,8 +89,8 @@ const EnableExtensionModal = ({ visible, extension, onCancel }: EnableExtensionM
defaultSchema !== undefined && defaultSchema !== null
? defaultSchema
: values.schema === 'custom'
? values.name
: values.schema
? values.name
: values.schema
enableExtension({
projectRef: project.ref,
@@ -67,8 +67,8 @@ const HTTPRequestFields = ({
{type === 'http_request'
? 'HTTP Request'
: type === 'supabase_function'
? 'Edge Function'
: ''}
? 'Edge Function'
: ''}
</FormSectionLabel>
}
>
@@ -128,10 +128,10 @@ const RolesList = () => {
maxConnectionLimit === 0 || maxConnectionLimit === undefined
? 'bg-control'
: totalActiveConnections > 0.9 * maxConnectionLimit
? 'bg-red-800'
: totalActiveConnections > 0.75 * maxConnectionLimit
? 'bg-amber-900'
: 'bg-green-800'
? 'bg-red-800'
: totalActiveConnections > 0.75 * maxConnectionLimit
? 'bg-amber-900'
: 'bg-green-800'
}
labelTop={
Number.isInteger(maxConnectionLimit)
@@ -142,10 +142,10 @@ const APIKeys = () => {
!canReadAPIKeys
? 'You need additional permissions to view API keys'
: jwtSecretUpdateStatus === JwtSecretUpdateStatus.Failed
? 'JWT secret update failed, new API key may have issues'
: jwtSecretUpdateStatus === JwtSecretUpdateStatus.Updating
? 'Updating JWT secret...'
: apiService?.defaultApiKey
? 'JWT secret update failed, new API key may have issues'
: jwtSecretUpdateStatus === JwtSecretUpdateStatus.Updating
? 'Updating JWT secret...'
: apiService?.defaultApiKey
}
onChange={() => {}}
descriptionText={
@@ -73,8 +73,8 @@ export const ProjectCardStatus = ({
const alertType = isCritical
? 'destructive'
: projectStatus === 'isPaused'
? 'default'
: 'warning'
? 'default'
: 'warning'
if (
(activeWarnings.length === 0 || warningContent === undefined) &&
@@ -151,8 +151,8 @@ const ServiceStatus = () => {
{service.isLoading
? 'Checking status'
: service.isSuccess
? 'No issues'
: 'Unable to connect'}
? 'No issues'
: 'Unable to connect'}
</p>
</div>
{service.isLoading ? (
@@ -379,8 +379,8 @@ const AuditLogs = () => {
{project?.name
? 'Project: '
: organization?.name
? 'Organization: '
: null}
? 'Organization: '
: null}
{project?.name ?? organization?.name ?? 'Unknown'}
</p>
<p
@@ -392,8 +392,8 @@ const AuditLogs = () => {
{log.target.metadata.project_ref
? 'Ref: '
: log.target.metadata.org_slug
? 'Slug: '
: null}
? 'Slug: '
: null}
{log.target.metadata.project_ref ?? log.target.metadata.org_slug}
</p>
</Table.td>
@@ -112,10 +112,10 @@ const BillingMetric = ({
isUsageBillingEnabled
? 'text-gray-dark-800'
: isExceededLimit
? 'text-red-900'
: isApproachingLimit
? 'text-yellow-1000'
: 'text-gray-dark-800'
? 'text-red-900'
: isApproachingLimit
? 'text-yellow-1000'
: 'text-gray-dark-800'
}
/>
</svg>
@@ -134,8 +134,8 @@ const UpcomingInvoice = ({ slug }: UpcomingInvoiceProps) => {
{item.unit_price === 0
? 'FREE'
: item.unit_price
? formatCurrency(item.unit_price)
: null}
? formatCurrency(item.unit_price)
: null}
</td>
)}
<td className="py-2 text-sm text-right">{formatCurrency(item.amount)}</td>
@@ -195,15 +195,15 @@ const UpcomingInvoice = ({ slug }: UpcomingInvoiceProps) => {
{fee.usage_original
? `${formatUsage(fee.usage_metric!, fee.usage_original)}`
: fee.quantity
? fee.quantity
: null}
? fee.quantity
: null}
</td>
<td className="py-2 text-sm">
{fee.unit_price_desc
? `${fee.unit_price_desc}`
: fee.unit_price
? formatCurrency(fee.unit_price)
: null}
? formatCurrency(fee.unit_price)
: null}
</td>
<td className="py-2 text-sm text-right max-w-[70px]">
{formatCurrency(fee.amount) ?? formatCurrency(0)}
@@ -30,8 +30,8 @@ const ProjectUpdateDisabledTooltip = ({
{projectUpdateDisabled
? 'Subscription changes are currently disabled. Our engineers are working on a fix.'
: projectNotActive
? 'Unable to update subscription as project is currently not active'
: ''}
? 'Unable to update subscription as project is currently not active'
: ''}
</span>
</div>
</Tooltip.Content>
@@ -408,10 +408,10 @@ const PlanUpdateSidePanel = () => {
{item.unit_price_desc
? item.unit_price_desc
: item.unit_price === 0
? 'FREE'
: item.unit_price
? `${formatCurrency(item.unit_price)}`
: ''}
? 'FREE'
: item.unit_price
? `${formatCurrency(item.unit_price)}`
: ''}
</Table.td>
<Table.td className="text-right">
{formatCurrency(item.total_price)}
@@ -55,8 +55,8 @@ const GeneralSettings = () => {
values.isOptedIntoAi && !existingOptInTags.includes(OPT_IN_TAGS.AI_SQL)
? existingOptInTags.concat([OPT_IN_TAGS.AI_SQL])
: !values.isOptedIntoAi && existingOptInTags.includes(OPT_IN_TAGS.AI_SQL)
? existingOptInTags.filter((x) => x !== OPT_IN_TAGS.AI_SQL)
: existingOptInTags
? existingOptInTags.filter((x) => x !== OPT_IN_TAGS.AI_SQL)
: existingOptInTags
updateOrganization(
{ slug, name: values.name, opt_in_tags: updatedOptInTags },
@@ -159,9 +159,9 @@ const AttributeUsage = ({
? 'bg-foreground-light'
: 'bg-red-900'
: usageBasedBilling === false &&
usageRatio >= USAGE_APPROACHING_THRESHOLD
? 'bg-amber-900'
: 'bg-foreground-light'
usageRatio >= USAGE_APPROACHING_THRESHOLD
? 'bg-amber-900'
: 'bg-foreground-light'
)}
bgClass="bg-surface-300"
value={usageMeta?.usage ?? 0}
@@ -205,8 +205,8 @@ const AttributeUsage = ({
{(usageMeta?.pricing_free_units ?? 0) === -1 || usageExcess < 0
? `0${attribute.unit === 'bytes' ? ' GB' : ''}`
: attribute.unit === 'bytes'
? `${usageExcess.toFixed(2)} GB`
: usageExcess.toLocaleString()}
? `${usageExcess.toFixed(2)} GB`
: usageExcess.toLocaleString()}
</p>
</div>
)}
@@ -35,10 +35,10 @@ const Bucket = ({ language, apikey, endpoint }: ContentProps) => {
{allowedMimeTypes === null
? 'All types are allowed'
: (allowedMimeTypes ?? []).length === 0
? 'No types are allowed'
: (allowedMimeTypes ?? []).length > 1
? (allowedMimeTypes ?? []).join(', ')
: 'Unknown'}
? 'No types are allowed'
: (allowedMimeTypes ?? []).length > 1
? (allowedMimeTypes ?? []).join(', ')
: 'Unknown'}
</p>
<p className="text-sm text-foreground-light">
Max file size limit:{' '}
@@ -603,11 +603,11 @@ export const DOCS_RESOURCE_CONTENT: {
curl -X POST '${endpoint}/rest/v1/rpc/${rpcName}' \\${bashParams}
-H "Content-Type: application/json" \\
-H "apikey: ${apiKey}" ${
showBearer
? `\\
showBearer
? `\\
-H "Authorization: Bearer ${apiKey}"`
: ''
}
: ''
}
`,
js: `
let { data, error } = await supabase
@@ -121,7 +121,7 @@ const ReportFilterBar = ({
key: productFilter.filterKey,
compare: 'matches',
value: productFilter.filterValue,
} as ReportFilterItem)
}) as ReportFilterItem
)
onRemoveFilters(toRemove)
if (nextProductFilter) {
@@ -289,8 +289,8 @@ const RouteTdContent = (datum: RouteTdContentProps) => (
datum.status_code >= 400
? 'bg-orange-500'
: datum.status_code >= 300
? 'bg-yellow-500'
: 'bg-green-500'
? 'bg-yellow-500'
: 'bg-green-500'
}`}
value={String(datum.status_code)}
/>
@@ -112,10 +112,10 @@ const JWTSettings = () => {
!canReadJWTSecret
? 'You need additional permissions to view the JWT secret'
: isJwtSecretUpdateFailed
? 'JWT secret update failed'
: isUpdatingJwtSecret
? 'Updating JWT secret...'
: config?.jwt_secret || ''
? 'JWT secret update failed'
: isUpdatingJwtSecret
? 'Updating JWT secret...'
: config?.jwt_secret || ''
}
className="input-mono"
descriptionText={
@@ -78,8 +78,8 @@ const ServiceList = () => {
const endpoint = !showReadReplicasUI
? primaryEndpoint
: isCustomDomainActive && state.selectedDatabaseId === projectRef
? `https://${customDomainData.customDomain.hostname}`
: selectedDatabase?.restUrl
? `https://${customDomainData.customDomain.hostname}`
: selectedDatabase?.restUrl
return (
<div>
@@ -199,8 +199,8 @@ const ComputeInstanceSidePanel = () => {
isFreePlan
? 'Unable to update compute instance on a free plan'
: !canUpdateCompute
? 'You do not have permission to update compute instance'
: undefined
? 'You do not have permission to update compute instance'
: undefined
}
header={
<div className="flex items-center justify-between">
@@ -139,8 +139,8 @@ const CustomDomainSidePanel = () => {
isFreePlan
? 'Unable to enable custom domain on a free plan'
: !canUpdateCustomDomain
? 'You do not have permission to update custom domain'
: undefined
? 'You do not have permission to update custom domain'
: undefined
}
header={
<div className="flex items-center justify-between">
@@ -127,8 +127,8 @@ const IPv4SidePanel = () => {
isFreePlan
? 'Unable to enable IPv4 on a free plan'
: !canUpdateIPv4
? 'You do not have permission to update IPv4'
: undefined
? 'You do not have permission to update IPv4'
: undefined
}*/
header={
<div className="flex items-center justify-between">
@@ -173,10 +173,10 @@ const PITRSidePanel = () => {
hasHipaaAddon
? 'Unable to change PITR with HIPAA add-on'
: isFreePlan
? 'Unable to enable point in time recovery on a free plan'
: !canUpdatePitr
? 'You do not have permission to update PITR'
: undefined
? 'Unable to enable point in time recovery on a free plan'
: !canUpdatePitr
? 'You do not have permission to update PITR'
: undefined
}
header={
<div className="flex items-center justify-between">
@@ -135,8 +135,8 @@ const ResetDbPassword = ({ disabled = false }) => {
{!canResetDbPassword
? 'You need additional permissions to reset the database password'
: !isProjectActive
? 'Unable to reset database password as project is not active'
: ''}
? 'Unable to reset database password as project is not active'
: ''}
</span>
</div>
</Tooltip.Content>
@@ -159,8 +159,8 @@ const SSLConfiguration = () => {
{!canUpdateSSLEnforcement
? 'You need additional permissions to update SSL enforcement for your project'
: !hasAccessToSSLEnforcement
? 'Your project does not have access to SSL enforcement'
: ''}
? 'Your project does not have access to SSL enforcement'
: ''}
</span>
</div>
</Tooltip.Content>
@@ -136,8 +136,8 @@ export const UsePoolerCheckbox = ({
{checked
? 'Resolves to IPv4'
: resolvesToIpV6
? 'Resolves to IPv6'
: 'Will resolve to IPv6'}
? 'Resolves to IPv6'
: 'Will resolve to IPv6'}
</Badge>
)}
</div>
@@ -84,12 +84,12 @@ const PauseProjectButton = () => {
{isPaused
? 'Your project is already paused'
: !canPauseProject
? 'You need additional permissions to pause this project'
: !isProjectActive
? 'Unable to pause project as project is not active'
: !isFreePlan
? 'Projects on a paid plan will always be running'
: ''}
? 'You need additional permissions to pause this project'
: !isProjectActive
? 'Unable to pause project as project is not active'
: !isFreePlan
? 'Projects on a paid plan will always be running'
: ''}
</span>
</div>
</Tooltip.Content>
@@ -150,8 +150,8 @@ const RestartServerButton = () => {
{!canRestartProject
? 'You need additional permissions to restart this project'
: !isProjectActive
? 'Unable to restart project as project is not active'
: ''}
? 'Unable to restart project as project is not active'
: ''}
</span>
</div>
</Tooltip.Content>
@@ -71,8 +71,8 @@ const InfrastructureActivity = () => {
subscription === undefined
? `/`
: subscription.plan.id === 'free'
? `/org/${organization?.slug ?? '[slug]'}/billing#subscription`
: `/project/${projectRef}/settings/addons`
? `/org/${organization?.slug ?? '[slug]'}/billing#subscription`
: `/project/${projectRef}/settings/addons`
const categoryMeta = INFRA_ACTIVITY_METRICS.find((category) => category.key === 'infra')
@@ -159,14 +159,14 @@ const MapView = ({
name: hasNoDatabases
? undefined
: hasPrimary
? `Primary Database${
replicas.length > 0
? ` + ${replicas.length} replica${replicas.length > 1 ? 's' : ''} `
: ''
}`
: `${replicas.length} Read Replica${
replicas.length > 1 ? 's' : ''
} deployed`,
? `Primary Database${
replicas.length > 0
? ` + ${replicas.length} replica${replicas.length > 1 ? 's' : ''} `
: ''
}`
: `${replicas.length} Read Replica${
replicas.length > 1 ? 's' : ''
} deployed`,
},
})
}}
@@ -192,8 +192,8 @@ const MapView = ({
hasNoDatabases
? 'fill-background-surface-300 stroke-border-stronger'
: hasPrimary
? 'fill-brand stroke-brand-500'
: 'fill-brand-500 stroke-brand-400'
? 'fill-brand stroke-brand-500'
: 'fill-brand-500 stroke-brand-400'
}`}
/>
</Marker>
@@ -123,8 +123,8 @@ You can change the scope of the access for Supabase by configuring
process.env.NEXT_PUBLIC_ENVIRONMENT === 'prod'
? 'https://vercel.com/integrations/supabase'
: process.env.NEXT_PUBLIC_ENVIRONMENT === 'staging'
? `https://vercel.com/integrations/supabase-v2-staging`
: 'https://vercel.com/integrations/supabase-v2-local'
? `https://vercel.com/integrations/supabase-v2-staging`
: 'https://vercel.com/integrations/supabase-v2-local'
let connections =
(isProjectScoped
@@ -301,8 +301,8 @@ const LogTable = ({
queryType
? 'flex w-1/2 flex-col'
: focusedLog
? 'flex w-1/2 flex-col'
: 'hidden w-0'
? 'flex w-1/2 flex-col'
: 'hidden w-0'
}
>
<LogSelection
@@ -141,8 +141,8 @@ const EditBucketModal = ({ visible, bucket, onClose }: EditBucketModalProps) =>
!bucket?.public && values.public
? 'Warning: Making bucket public'
: bucket?.public && !values.public
? 'Warning: Making bucket private'
: ''
? 'Warning: Making bucket private'
: ''
}
variant="warning"
withIcon
@@ -151,8 +151,8 @@ const EditBucketModal = ({ visible, bucket, onClose }: EditBucketModalProps) =>
{!bucket?.public && values.public
? `This will make all objects in the bucket "${bucket?.name}" public`
: bucket?.public && !values.public
? `All objects in "${bucket?.name}" will be made private and will only be accessible via signed URLs or downloaded with the right authorisation headers`
: ''}
? `All objects in "${bucket?.name}" will be made private and will only be accessible via signed URLs or downloaded with the right authorisation headers`
: ''}
</p>
</Alert>
)}
@@ -99,19 +99,19 @@ const SupportForm = ({ setSentCategory }: SupportFormProps) => {
selectedProjectFromUrl !== undefined
? selectedProjectFromUrl.ref
: projects.length > 0
? projects[0].ref
: 'no-project'
? projects[0].ref
: 'no-project'
)
const selectedOrganizationSlug =
selectedOrganizationFromUrl !== undefined
? selectedOrganizationFromUrl.slug
: selectedProjectRef !== 'no-project'
? organizations?.find((org) => {
const project = projects.find((project) => project.ref === selectedProjectRef)
return org.id === project?.organization_id
})?.slug
: organizations?.[0]?.slug
? organizations?.find((org) => {
const project = projects.find((project) => project.ref === selectedProjectRef)
return org.id === project?.organization_id
})?.slug
: organizations?.[0]?.slug
const { data: subscription, isLoading: isLoadingSubscription } = useOrgSubscriptionQuery({
orgSlug: selectedOrganizationSlug,
@@ -41,8 +41,8 @@ const InputField = ({
field.defaultValue === null
? ''
: typeof field.defaultValue === 'string' && field.defaultValue.length === 0
? 'EMPTY'
: `Default: ${field.defaultValue}`
? 'EMPTY'
: `Default: ${field.defaultValue}`
}
onChange={(event: any) => onUpdateField({ [field.name]: event.target.value })}
/>
@@ -129,10 +129,10 @@ const InputField = ({
field.value === null && field.defaultValue === null
? 'NULL'
: field.value === ''
? 'EMPTY'
: typeof field.defaultValue === 'string' && field.defaultValue.length === 0
? 'EMPTY'
: `NULL (Default: ${field.defaultValue})`
? 'EMPTY'
: typeof field.defaultValue === 'string' && field.defaultValue.length === 0
? 'EMPTY'
: `NULL (Default: ${field.defaultValue})`
}
actions={
<div className="mr-1 mt-0.5">
@@ -253,8 +253,8 @@ const InputField = ({
field.isIdentity
? 'Automatically generated as identity'
: field.defaultValue !== null
? `Default: ${field.defaultValue}`
: 'NULL'
? `Default: ${field.defaultValue}`
: 'NULL'
}
disabled={!isEditable}
onChange={(event: any) => onUpdateField({ [field.name]: event.target.value })}
@@ -72,8 +72,8 @@ const DrilldownPane = ({ pane, jsonData, activeKey, onSelectKey = noop }: Drilld
{isNull(jsonData[key])
? 'null'
: typeof jsonData[key] === 'string'
? `"${jsonData[key]}"`
: jsonData[key].toString()}
? `"${jsonData[key]}"`
: jsonData[key].toString()}
</p>
</div>
))}
@@ -25,14 +25,14 @@ export const generateRowFields = (
isUndefined(row) && TEXT_TYPES.includes(column.format)
? null
: isUndefined(row) && column.format === 'bool' && !column.is_nullable
? column.default_value
: isUndefined(row) && column.format === 'bool' && column.is_nullable
? 'null'
: isUndefined(row)
? ''
: DATETIME_TYPES.includes(column.format)
? convertPostgresDatetimeToInputDatetime(column.format, row[column.name])
: parseValue(row[column.name], column.format)
? column.default_value
: isUndefined(row) && column.format === 'bool' && column.is_nullable
? 'null'
: isUndefined(row)
? ''
: DATETIME_TYPES.includes(column.format)
? convertPostgresDatetimeToInputDatetime(column.format, row[column.name])
: parseValue(row[column.name], column.format)
const foreignKey = find(relationships, (relationship) => {
return (
@@ -164,8 +164,8 @@ export const generateRowObjectFromFields = (
const value = TEXT_TYPES.includes(field.format)
? field.value
: (field?.value ?? '').length === 0
? null
: field.value
? null
: field.value
if (isArray && value !== null) {
rowObject[field.name] = tryParseJson(value)
@@ -332,11 +332,11 @@ const SidePanelEditor = ({
.filter((t: any) => t.id !== table.id)
.map((t: any) => `${t.schema}.${t.name}`)
: !isAlreadyEnabled && enabled
? // Toggle realtime on
[`${table.schema}.${table.name}`].concat(
publicationTables.map((t: any) => `${t.schema}.${t.name}`)
)
: null
? // Toggle realtime on
[`${table.schema}.${table.name}`].concat(
publicationTables.map((t: any) => `${t.schema}.${t.name}`)
)
: null
if (realtimeTables === null) return
await updatePublication({
id,
@@ -117,18 +117,18 @@ export const addForeignKey = async (
deletion_action === FOREIGN_KEY_CASCADE_ACTION.CASCADE
? 'ON DELETE CASCADE'
: deletion_action === FOREIGN_KEY_CASCADE_ACTION.RESTRICT
? 'ON DELETE RESTRICT'
: deletion_action === FOREIGN_KEY_CASCADE_ACTION.SET_DEFAULT
? 'ON DELETE SET DEFAULT'
: deletion_action === FOREIGN_KEY_CASCADE_ACTION.SET_NULL
? 'ON DELETE SET NULL'
: ''
? 'ON DELETE RESTRICT'
: deletion_action === FOREIGN_KEY_CASCADE_ACTION.SET_DEFAULT
? 'ON DELETE SET DEFAULT'
: deletion_action === FOREIGN_KEY_CASCADE_ACTION.SET_NULL
? 'ON DELETE SET NULL'
: ''
const updateAction =
update_action === FOREIGN_KEY_CASCADE_ACTION.CASCADE
? 'ON UPDATE CASCADE'
: update_action === FOREIGN_KEY_CASCADE_ACTION.RESTRICT
? 'ON UPDATE RESTRICT'
: ''
? 'ON UPDATE RESTRICT'
: ''
const query = `
ALTER TABLE "${relationship.source_schema}"."${relationship.source_table_name}"
@@ -107,8 +107,8 @@ const SpreadsheetImportPreview = ({
{previewHeaders.length === 0
? 'No headers have been selected'
: previewRows.length === 0
? 'Your CSV contains no data'
: ''}
? 'Your CSV contains no data'
: ''}
</p>
</div>
)}
@@ -61,8 +61,8 @@ const TableDefinition = ({ id }: TableDefinitionProps) => {
entityType?.type === ENTITY_TYPE.VIEW
? `create view ${entityType.schema}.${entityType.name} as\n`
: entityType?.type === ENTITY_TYPE.MATERIALIZED_VIEW
? `create materialized view ${entityType.schema}.${entityType.name} as\n`
: ''
? `create materialized view ${entityType.schema}.${entityType.name} as\n`
: ''
const formattedDefinition = useMemo(
() =>
@@ -118,7 +118,7 @@ const TableGridEditor = ({
result: any[]
}
| undefined
)
),
][]
}
@@ -49,8 +49,8 @@ const GithubRepositorySelection = ({
process.env.NEXT_PUBLIC_ENVIRONMENT === 'prod'
? `https://github.com/apps/supabase/installations/new?state=${ref}`
: process.env.NEXT_PUBLIC_ENVIRONMENT === 'staging'
? `https://github.com/apps/supabase-staging/installations/new?state=${ref}`
: `https://github.com/apps/supabase-local-testing/installations/new?state=${ref}`
? `https://github.com/apps/supabase-staging/installations/new?state=${ref}`
: `https://github.com/apps/supabase-local-testing/installations/new?state=${ref}`
function onSelectConnectRepo() {
if (integration) {
@@ -75,8 +75,8 @@ const OrganizationDropdown = ({ isNewNav = false }: OrganizationDropdownProps) =
const href = router.pathname.includes('[slug]')
? router.pathname.replace('[slug]', org.slug)
: isNewNav
? `/org/${org.slug}`
: `/org/${org.slug}/general`
? `/org/${org.slug}`
: `/org/${org.slug}/general`
return (
<CommandItem_Shadcn_
key={org.slug}
@@ -130,8 +130,8 @@ const NotificationRow: ItemRenderer<Notification, NotificationRowProps> = ({
const url = action.url.includes('[ref]')
? action.url.replace('[ref]', project?.ref ?? '_')
: action.url.includes('[slug]')
? action.url.replace('[slug]', organization?.slug ?? '_')
: action.url
? action.url.replace('[slug]', organization?.slug ?? '_')
: action.url
return (
<Button
key={key}
@@ -55,8 +55,8 @@ const NotificationsPopoverV2 = () => {
activeTab === 'archived'
? 'archived'
: snap.filterStatuses.includes('unread')
? 'new'
: undefined,
? 'new'
: undefined,
filters: {
priority: snap.filterPriorities,
organizations: snap.filterOrganizations,
@@ -100,8 +100,8 @@ const NotificationsPopoverV2 = () => {
hasCritical
? 'border-destructive-500 hover:border-destructive-600 hover:bg-destructive-300'
: hasWarning
? 'border-warning-500 hover:border-warning-600 hover:bg-warning-300'
: ''
? 'border-warning-500 hover:border-warning-600 hover:bg-warning-300'
: ''
)}
icon={
hasCritical ? (
@@ -228,10 +228,10 @@ const NotificationsPopoverV2 = () => {
: ''
}`
: snap.numFiltersApplied > 0
? `No notifications based on the ${snap.numFiltersApplied} filter${
snap.numFiltersApplied > 1 ? 's' : ''
} applied`
: 'All caught up'}
? `No notifications based on the ${snap.numFiltersApplied} filter${
snap.numFiltersApplied > 1 ? 's' : ''
} applied`
: 'All caught up'}
</p>
<p className="text-foreground-lighter text-xs w-60 mx-auto text-center">
{activeTab === 'archived'
@@ -92,12 +92,12 @@ const ProjectLayout = ({
{title
? `${title} | Supabase`
: selectedTable
? `${selectedTable} | ${projectName} | ${organizationName} | Supabase`
: projectName
? `${projectName} | ${organizationName} | Supabase`
: organizationName
? `${organizationName} | Supabase`
: 'Supabase'}
? `${selectedTable} | ${projectName} | ${organizationName} | Supabase`
: projectName
? `${projectName} | ${organizationName} | Supabase`
: organizationName
? `${organizationName} | Supabase`
: 'Supabase'}
</title>
<meta name="description" content="Supabase Studio" />
</Head>
@@ -161,8 +161,8 @@ const UpgradingState = () => {
(progressStage - 2 <= 0
? 0
: progressStage > 6
? 5
: progressStage - 2) * -28
? 5
: progressStage - 2) * -28
}px`,
}}
>
@@ -191,15 +191,15 @@ const UpgradingState = () => {
isCurrent
? 'text-foreground'
: isCompleted
? 'text-foreground-light'
: 'text-foreground-lighter'
? 'text-foreground-light'
: 'text-foreground-lighter'
} hover:text-foreground transition`}
>
{isCurrent
? message.progress
: isCompleted
? message.completed
: message.initial}
? message.completed
: message.initial}
</p>
</div>
)
@@ -111,12 +111,12 @@ const ChartHandler = ({
highlightedValue = highlightedValue
? highlightedValue
: provider === 'daily-stats' && !attribute.includes('ingress') && !attribute.includes('egress')
? chartData?.maximum
: provider === 'daily-stats'
? chartData?.total
: provider === 'log-stats'
? chartData?.totalGrouped?.[attribute]
: chartData?.data[chartData?.data.length - 1]?.[attribute]
? chartData?.maximum
: provider === 'daily-stats'
? chartData?.total
: provider === 'log-stats'
? chartData?.totalGrouped?.[attribute]
: chartData?.data[chartData?.data.length - 1]?.[attribute]
if (loading) {
return (
@@ -41,8 +41,8 @@ const Header = ({
let FOCUS_FORMAT = customDateFormat
? customDateFormat
: format == '%'
? DATE_FORMAT__WITH_TIME
: DATE_FORMAT__DATE_ONLY
? DATE_FORMAT__WITH_TIME
: DATE_FORMAT__DATE_ONLY
let title = ''
@@ -26,14 +26,14 @@ const ConfirmDeleteModal = ({
const title = multipleFiles
? `Confirm deletion of ${selectedItemsToDelete.length} items`
: selectedItemsToDelete.length === 1
? `Confirm deletion of ${selectedItemsToDelete[0].name}`
: ``
? `Confirm deletion of ${selectedItemsToDelete[0].name}`
: ``
const description = multipleFiles
? `Are you sure you want to delete the selected ${selectedItemsToDelete.length} items?`
: selectedItemsToDelete.length === 1
? `Are you sure you want to delete the selected ${selectedItemsToDelete[0].type.toLowerCase()}?`
: ``
? `Are you sure you want to delete the selected ${selectedItemsToDelete[0].type.toLowerCase()}?`
: ``
const onConfirmDelete = () => {
setDeleting(true)
@@ -53,8 +53,8 @@ export const RowIcon = ({ view, status, fileType, mimeType }: any) => {
fileType === STORAGE_ROW_TYPES.BUCKET
? `${BASE_PATH}/img/bucket-filled.svg`
: fileType === STORAGE_ROW_TYPES.FOLDER
? `${BASE_PATH}/img/folder-filled.svg`
: `${BASE_PATH}/img/file-filled.svg`
? `${BASE_PATH}/img/folder-filled.svg`
: `${BASE_PATH}/img/file-filled.svg`
return (
<SVG
src={iconSrc}
@@ -299,8 +299,8 @@ const FileExplorerRow: ItemRenderer<any, FileExplorerRowProps> = ({
view === STORAGE_VIEWS.LIST && item.isCorrupted
? `calc(100% - 60px)`
: view === STORAGE_VIEWS.LIST && !item.isCorrupted
? `calc(100% - 50px)`
: '100%'
? `calc(100% - 50px)`
: '100%'
if (item.status === STORAGE_ROW_STATUS.EDITING) {
return <FileExplorerRowEditing view={view} item={item} columnIndex={columnIndex} />
@@ -30,8 +30,8 @@ const MoveItemsModal = ({
const title = multipleFiles
? `Moving ${selectedItemsToMove.length} items within ${bucketName}`
: selectedItemsToMove.length === 1
? `Moving ${selectedItemsToMove[0]?.name} within ${bucketName}`
: ``
? `Moving ${selectedItemsToMove[0]?.name} within ${bucketName}`
: ``
const description = `Enter the path to where you'd like to move the file${
multipleFiles ? 's' : ''
@@ -74,9 +74,8 @@ const StorageConfig = ({ config, projectRef, organizationSlug }: any) => {
const onValidate = (values: any) => {
const errors = {} as any
if (values.fileSizeLimit > formattedMaxLimit) {
errors[
'fileSizeLimit'
] = `Maximum limit is up to ${formattedMaxLimit.toLocaleString()} ${selectedUnit}.`
errors['fileSizeLimit'] =
`Maximum limit is up to ${formattedMaxLimit.toLocaleString()} ${selectedUnit}.`
}
return errors
}
@@ -83,12 +83,11 @@ export const useChartSize = (
const minHeight = sizeMap[size]
const Container: React.FC<React.PropsWithChildren> = useMemo(
() =>
({ children }) =>
(
<ResponsiveContainer height={minHeight} minHeight={minHeight} width="100%">
{children as JSX.Element}
</ResponsiveContainer>
),
({ children }) => (
<ResponsiveContainer height={minHeight} minHeight={minHeight} width="100%">
{children as JSX.Element}
</ResponsiveContainer>
),
[size]
)
return {
@@ -111,17 +110,20 @@ export const useStacked = ({
} & Pick<CommonChartProps<Record<string, number>>, 'data'>) => {
const stackedData = useMemo(() => {
if (!data) return []
const mapping = data.reduce((acc, datum) => {
const x = datum[xAxisKey]
const y = datum[yAxisKey]
const s = datum[stackKey]
if (!acc[x]) {
acc[x] = {}
}
const mapping = data.reduce(
(acc, datum) => {
const x = datum[xAxisKey]
const y = datum[yAxisKey]
const s = datum[stackKey]
if (!acc[x]) {
acc[x] = {}
}
acc[x][s] = y
return acc
}, {} as Record<string, Record<string, number>>)
acc[x][s] = y
return acc
},
{} as Record<string, Record<string, number>>
)
const flattened = Object.entries(mapping).map(([x, sMap]) => ({
...sMap,
@@ -85,8 +85,8 @@ const ConfirmModal = ({
{buttonLoadingLabel && loading
? buttonLoadingLabel
: buttonLabel
? buttonLabel
: 'Confirm'}
? buttonLabel
: 'Confirm'}
</Button>
</div>
</Modal.Content>
@@ -104,8 +104,8 @@ export default function MultiSelect({
const updatedPayload = allowDuplicateSelection
? [..._selected.concat([option.value])]
: isActive
? [...without(_selected, option.value)]
: [..._selected.concat([option.value])]
? [...without(_selected, option.value)]
: [..._selected.concat([option.value])]
// Payload must always include disabled options
const compulsoryOptions = options
@@ -107,10 +107,10 @@ const DisplayApiSettings = () => {
!canReadAPIKeys
? 'You need additional permissions to view API keys'
: jwtSecretUpdateStatus === JwtSecretUpdateStatus.Failed
? 'JWT secret update failed, new API key may have issues'
: jwtSecretUpdateStatus === JwtSecretUpdateStatus.Updating
? 'Updating JWT secret...'
: x.api_key
? 'JWT secret update failed, new API key may have issues'
: jwtSecretUpdateStatus === JwtSecretUpdateStatus.Updating
? 'Updating JWT secret...'
: x.api_key
}
onChange={() => {}}
descriptionText={
@@ -78,8 +78,8 @@ const DisplayConfigSettings = () => {
jwtSecretUpdateStatus === JwtSecretUpdateStatus.Failed
? 'JWT secret update failed'
: jwtSecretUpdateStatus === JwtSecretUpdateStatus.Updating
? 'Updating JWT secret...'
: jwtSecret
? 'Updating JWT secret...'
: jwtSecret
}
className="input-mono"
descriptionText="Used to decode your JWTs. You can also use this to mint your own JWTs."
@@ -78,12 +78,12 @@ const ResourceExhaustionWarningBanner = () => {
metric === undefined
? undefined
: metric === null
? '/project/[ref]/settings/[infra-path]'
: metric === 'disk_space' || metric === 'read_only'
? '/project/[ref]/settings/database'
: metric === 'auth_email_rate_limit'
? '/project/[ref]/settings/auth'
: `/project/[ref]/settings/[infra-path]#${metric}`
? '/project/[ref]/settings/[infra-path]'
: metric === 'disk_space' || metric === 'read_only'
? '/project/[ref]/settings/database'
: metric === 'auth_email_rate_limit'
? '/project/[ref]/settings/auth'
: `/project/[ref]/settings/[infra-path]#${metric}`
)
?.replace('[ref]', ref ?? 'default')
?.replace('[infra-path]', 'infrastructure')
+3 -3
View File
@@ -9,8 +9,8 @@ type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T
type OneOf<T extends any[]> = T extends [infer Only]
? Only
: T extends [infer A, infer B, ...infer Rest]
? OneOf<[XOR<A, B>, ...Rest]>
: never
? OneOf<[XOR<A, B>, ...Rest]>
: never
export interface paths {
'/platform/notifications': {
@@ -3843,7 +3843,7 @@ export interface components {
message?: string
status?: string
},
string
string,
]
>
result?: Record<string, never>[]
@@ -85,7 +85,7 @@ export type EntityDefinitionsData = EntityDefinition[]
export type EntityDefinitionsError = unknown
export const useEntityDefinitionsQuery = <
TData extends EntityDefinitionsData = EntityDefinitionsData
TData extends EntityDefinitionsData = EntityDefinitionsData,
>(
{ limit, projectRef, connectionString }: EntityDefinitionsVariables,
options: UseQueryOptions<ExecuteSqlData, EntityDefinitionsError, TData> = {}

Some files were not shown because too many files have changed in this diff Show More