Skip to content

Commit f9bdc45

Browse files
committed
Add branch to project
1 parent 49fd44f commit f9bdc45

File tree

4 files changed

+9
-316
lines changed

4 files changed

+9
-316
lines changed

src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/project/[projectSlug]/(specific-project-pages)/layout.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
44
import { getProjectTitleById, getSlimProjectBySlug } from "@/data/user/projects";
55
import { isLocalEnvironment } from "@/lib/utils";
66
import { projectSlugParamSchema } from "@/utils/zod-schemas/params";
7-
import { AlertCircleIcon } from "lucide-react";
7+
import { AlertCircleIcon, GitBranch } from "lucide-react";
88
import { Suspense } from "react";
99

1010

11-
async function ProjectPageHeading({ projectId }: { projectId: string }) {
11+
async function ProjectPageHeading({ projectId, branch }: { projectId: string, branch: string | null }) {
1212
const projectTitle = await getProjectTitleById(projectId);
1313
return (
1414
<PageHeading
1515
title={projectTitle}
16-
subTitle="Manage your project here"
16+
subTitle={<p className="flex items-center"><GitBranch /> {branch || 'main'}</p>}
1717
/>
1818
);
1919
}
@@ -54,7 +54,7 @@ export default async function ProjectPagesLayout({ params, children }: { params:
5454
)}
5555

5656
<Suspense>
57-
<ProjectPageHeading projectId={project.id} />
57+
<ProjectPageHeading projectId={project.id} branch={project.branch} />
5858
</Suspense>
5959
<Suspense>
6060
<TabsNavigationV2 tabs={tabs} />

src/components/PageHeading/PageHeading.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Link from 'next/link';
44

55
type PageHeadingProps = {
66
title: string;
7-
subTitle?: string;
7+
subTitle?: React.ReactNode;
88
actions?: React.ReactNode;
99
titleHref?: string;
1010
titleClassName?: string;

src/data/user/projects.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const getSlimProjectBySlug = async (projectSlug: string) => {
2929
const supabaseClient = createSupabaseUserServerComponentClient();
3030
const { data, error } = await supabaseClient
3131
.from("projects")
32-
.select("id, slug, name, organization_id")
32+
.select("id, slug, name, organization_id, branch")
3333
.eq("slug", projectSlug)
3434
.single();
3535
if (error) {

src/lib/database.types.ts

+3-310
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,7 @@ export type Database = {
12981298
}
12991299
projects: {
13001300
Row: {
1301+
branch: string | null
13011302
configuration_yaml: string | null
13021303
created_at: string
13031304
deleted_at: string | null
@@ -1320,6 +1321,7 @@ export type Database = {
13201321
updated_at: string
13211322
}
13221323
Insert: {
1324+
branch?: string | null
13231325
configuration_yaml?: string | null
13241326
created_at?: string
13251327
deleted_at?: string | null
@@ -1342,6 +1344,7 @@ export type Database = {
13421344
updated_at?: string
13431345
}
13441346
Update: {
1347+
branch?: string | null
13451348
configuration_yaml?: string | null
13461349
created_at?: string
13471350
deleted_at?: string | null
@@ -2011,315 +2014,6 @@ export type Database = {
20112014
[_ in never]: never
20122015
}
20132016
}
2014-
storage: {
2015-
Tables: {
2016-
buckets: {
2017-
Row: {
2018-
allowed_mime_types: string[] | null
2019-
avif_autodetection: boolean | null
2020-
created_at: string | null
2021-
file_size_limit: number | null
2022-
id: string
2023-
name: string
2024-
owner: string | null
2025-
owner_id: string | null
2026-
public: boolean | null
2027-
updated_at: string | null
2028-
}
2029-
Insert: {
2030-
allowed_mime_types?: string[] | null
2031-
avif_autodetection?: boolean | null
2032-
created_at?: string | null
2033-
file_size_limit?: number | null
2034-
id: string
2035-
name: string
2036-
owner?: string | null
2037-
owner_id?: string | null
2038-
public?: boolean | null
2039-
updated_at?: string | null
2040-
}
2041-
Update: {
2042-
allowed_mime_types?: string[] | null
2043-
avif_autodetection?: boolean | null
2044-
created_at?: string | null
2045-
file_size_limit?: number | null
2046-
id?: string
2047-
name?: string
2048-
owner?: string | null
2049-
owner_id?: string | null
2050-
public?: boolean | null
2051-
updated_at?: string | null
2052-
}
2053-
Relationships: []
2054-
}
2055-
migrations: {
2056-
Row: {
2057-
executed_at: string | null
2058-
hash: string
2059-
id: number
2060-
name: string
2061-
}
2062-
Insert: {
2063-
executed_at?: string | null
2064-
hash: string
2065-
id: number
2066-
name: string
2067-
}
2068-
Update: {
2069-
executed_at?: string | null
2070-
hash?: string
2071-
id?: number
2072-
name?: string
2073-
}
2074-
Relationships: []
2075-
}
2076-
objects: {
2077-
Row: {
2078-
bucket_id: string | null
2079-
created_at: string | null
2080-
id: string
2081-
last_accessed_at: string | null
2082-
metadata: Json | null
2083-
name: string | null
2084-
owner: string | null
2085-
owner_id: string | null
2086-
path_tokens: string[] | null
2087-
updated_at: string | null
2088-
version: string | null
2089-
}
2090-
Insert: {
2091-
bucket_id?: string | null
2092-
created_at?: string | null
2093-
id?: string
2094-
last_accessed_at?: string | null
2095-
metadata?: Json | null
2096-
name?: string | null
2097-
owner?: string | null
2098-
owner_id?: string | null
2099-
path_tokens?: string[] | null
2100-
updated_at?: string | null
2101-
version?: string | null
2102-
}
2103-
Update: {
2104-
bucket_id?: string | null
2105-
created_at?: string | null
2106-
id?: string
2107-
last_accessed_at?: string | null
2108-
metadata?: Json | null
2109-
name?: string | null
2110-
owner?: string | null
2111-
owner_id?: string | null
2112-
path_tokens?: string[] | null
2113-
updated_at?: string | null
2114-
version?: string | null
2115-
}
2116-
Relationships: [
2117-
{
2118-
foreignKeyName: "objects_bucketId_fkey"
2119-
columns: ["bucket_id"]
2120-
isOneToOne: false
2121-
referencedRelation: "buckets"
2122-
referencedColumns: ["id"]
2123-
},
2124-
]
2125-
}
2126-
s3_multipart_uploads: {
2127-
Row: {
2128-
bucket_id: string
2129-
created_at: string
2130-
id: string
2131-
in_progress_size: number
2132-
key: string
2133-
owner_id: string | null
2134-
upload_signature: string
2135-
version: string
2136-
}
2137-
Insert: {
2138-
bucket_id: string
2139-
created_at?: string
2140-
id: string
2141-
in_progress_size?: number
2142-
key: string
2143-
owner_id?: string | null
2144-
upload_signature: string
2145-
version: string
2146-
}
2147-
Update: {
2148-
bucket_id?: string
2149-
created_at?: string
2150-
id?: string
2151-
in_progress_size?: number
2152-
key?: string
2153-
owner_id?: string | null
2154-
upload_signature?: string
2155-
version?: string
2156-
}
2157-
Relationships: [
2158-
{
2159-
foreignKeyName: "s3_multipart_uploads_bucket_id_fkey"
2160-
columns: ["bucket_id"]
2161-
isOneToOne: false
2162-
referencedRelation: "buckets"
2163-
referencedColumns: ["id"]
2164-
},
2165-
]
2166-
}
2167-
s3_multipart_uploads_parts: {
2168-
Row: {
2169-
bucket_id: string
2170-
created_at: string
2171-
etag: string
2172-
id: string
2173-
key: string
2174-
owner_id: string | null
2175-
part_number: number
2176-
size: number
2177-
upload_id: string
2178-
version: string
2179-
}
2180-
Insert: {
2181-
bucket_id: string
2182-
created_at?: string
2183-
etag: string
2184-
id?: string
2185-
key: string
2186-
owner_id?: string | null
2187-
part_number: number
2188-
size?: number
2189-
upload_id: string
2190-
version: string
2191-
}
2192-
Update: {
2193-
bucket_id?: string
2194-
created_at?: string
2195-
etag?: string
2196-
id?: string
2197-
key?: string
2198-
owner_id?: string | null
2199-
part_number?: number
2200-
size?: number
2201-
upload_id?: string
2202-
version?: string
2203-
}
2204-
Relationships: [
2205-
{
2206-
foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey"
2207-
columns: ["bucket_id"]
2208-
isOneToOne: false
2209-
referencedRelation: "buckets"
2210-
referencedColumns: ["id"]
2211-
},
2212-
{
2213-
foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey"
2214-
columns: ["upload_id"]
2215-
isOneToOne: false
2216-
referencedRelation: "s3_multipart_uploads"
2217-
referencedColumns: ["id"]
2218-
},
2219-
]
2220-
}
2221-
}
2222-
Views: {
2223-
[_ in never]: never
2224-
}
2225-
Functions: {
2226-
can_insert_object: {
2227-
Args: {
2228-
bucketid: string
2229-
name: string
2230-
owner: string
2231-
metadata: Json
2232-
}
2233-
Returns: undefined
2234-
}
2235-
extension: {
2236-
Args: {
2237-
name: string
2238-
}
2239-
Returns: string
2240-
}
2241-
filename: {
2242-
Args: {
2243-
name: string
2244-
}
2245-
Returns: string
2246-
}
2247-
foldername: {
2248-
Args: {
2249-
name: string
2250-
}
2251-
Returns: string[]
2252-
}
2253-
get_size_by_bucket: {
2254-
Args: Record<PropertyKey, never>
2255-
Returns: {
2256-
size: number
2257-
bucket_id: string
2258-
}[]
2259-
}
2260-
list_multipart_uploads_with_delimiter: {
2261-
Args: {
2262-
bucket_id: string
2263-
prefix_param: string
2264-
delimiter_param: string
2265-
max_keys?: number
2266-
next_key_token?: string
2267-
next_upload_token?: string
2268-
}
2269-
Returns: {
2270-
key: string
2271-
id: string
2272-
created_at: string
2273-
}[]
2274-
}
2275-
list_objects_with_delimiter: {
2276-
Args: {
2277-
bucket_id: string
2278-
prefix_param: string
2279-
delimiter_param: string
2280-
max_keys?: number
2281-
start_after?: string
2282-
next_token?: string
2283-
}
2284-
Returns: {
2285-
name: string
2286-
id: string
2287-
metadata: Json
2288-
updated_at: string
2289-
}[]
2290-
}
2291-
operation: {
2292-
Args: Record<PropertyKey, never>
2293-
Returns: string
2294-
}
2295-
search: {
2296-
Args: {
2297-
prefix: string
2298-
bucketname: string
2299-
limits?: number
2300-
levels?: number
2301-
offsets?: number
2302-
search?: string
2303-
sortcolumn?: string
2304-
sortorder?: string
2305-
}
2306-
Returns: {
2307-
name: string
2308-
id: string
2309-
updated_at: string
2310-
created_at: string
2311-
last_accessed_at: string
2312-
metadata: Json
2313-
}[]
2314-
}
2315-
}
2316-
Enums: {
2317-
[_ in never]: never
2318-
}
2319-
CompositeTypes: {
2320-
[_ in never]: never
2321-
}
2322-
}
23232017
}
23242018

23252019
type PublicSchema = Database[Extract<keyof Database, "public">]
@@ -2403,4 +2097,3 @@ export type Enums<
24032097
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
24042098
? PublicSchema["Enums"][PublicEnumNameOrOptions]
24052099
: never
2406-

0 commit comments

Comments
 (0)