| undefined
- >(undefined)
+ const [isCreating, setIsCreating] = useState(false)
const handleEdit = (profile: Doc<'profiles'>) => {
- setEditingProfile(profile)
- setIsEditing(true)
+ navigate(`/dashboard/profiles/${profile._id}`)
}
const handleCreate = () => {
- setEditingProfile(undefined)
- setIsEditing(true)
+ setIsCreating(true)
}
const handleDelete = async (
@@ -64,11 +59,10 @@ export default function Dashboard() {
- {isEditing ? (
+ {isCreating ? (
setIsEditing(false)}
- onCancel={() => setIsEditing(false)}
+ onSave={() => setIsCreating(false)}
+ onCancel={() => setIsCreating(false)}
/>
) : (
@@ -82,10 +76,13 @@ export default function Dashboard() {
Version:{' '}
{profile.version}
-
-
+
+ {profile.description}
+
-
-
-
-
))}
{profiles?.length === 0 && (
diff --git a/src/pages/LandingPage.tsx b/src/pages/LandingPage.tsx
index b3b430e..220df44 100644
--- a/src/pages/LandingPage.tsx
+++ b/src/pages/LandingPage.tsx
@@ -51,6 +51,9 @@ export default function LandingPage() {
Version:{' '}
{profile.version}
+
+ {profile.description}
+
))}
diff --git a/src/pages/ProfileDetail.tsx b/src/pages/ProfileDetail.tsx
index e154501..22635d3 100644
--- a/src/pages/ProfileDetail.tsx
+++ b/src/pages/ProfileDetail.tsx
@@ -178,11 +178,6 @@ export default function ProfileDetail() {
}`}
>
{item.name}
- {item.architecture && (
-
- ({item.architecture})
-
- )}
)
})}
diff --git a/src/pages/ProfileEditorPage.tsx b/src/pages/ProfileEditorPage.tsx
new file mode 100644
index 0000000..6731165
--- /dev/null
+++ b/src/pages/ProfileEditorPage.tsx
@@ -0,0 +1,86 @@
+import { useQuery } from 'convex/react'
+import { ArrowLeft, Loader2 } from 'lucide-react'
+import { Link, useNavigate, useParams } from 'react-router-dom'
+import ProfileEditor from '@/components/ProfileEditor'
+import { Button } from '@/components/ui/button'
+import { api } from '../../convex/_generated/api'
+import type { Id } from '../../convex/_generated/dataModel'
+
+export default function ProfileEditorPage() {
+ const navigate = useNavigate()
+ const { id } = useParams<{ id: string }>()
+
+ const profile = useQuery(
+ api.profiles.get,
+ id ? { id: id as Id<'profiles'> } : 'skip'
+ )
+
+ if (!id) {
+ return (
+
+
+
+ No profile id provided.{' '}
+
+ Back to dashboard
+
+
+
+
+ )
+ }
+
+ if (profile === undefined) {
+ return (
+
+
+
+ )
+ }
+
+ if (profile === null) {
+ return (
+
+
+
+
Back to Dashboard
+
+
+
+
+ )
+ }
+
+ const handleDone = () => {
+ navigate('/dashboard')
+ }
+
+ return (
+
+
+
+
+
Back to Dashboard
+
+
+
+
+
+
+
+ )
+}
diff --git a/src/pages/ProfileFlash.tsx b/src/pages/ProfileFlash.tsx
index be887df..9466688 100644
--- a/src/pages/ProfileFlash.tsx
+++ b/src/pages/ProfileFlash.tsx
@@ -11,6 +11,8 @@ import { Button } from '@/components/ui/button'
import { humanizeStatus } from '@/lib/utils'
import { api } from '../../convex/_generated/api'
import type { Id } from '../../convex/_generated/dataModel'
+import modulesData from '../../convex/modules.json'
+import { TARGETS } from '../constants/targets'
export default function ProfileFlash() {
const { id, target } = useParams<{
@@ -22,8 +24,12 @@ export default function ProfileFlash() {
api.profiles.getProfileTarget,
id && target ? { profileId: id as Id<'profiles'>, target } : 'skip'
)
+ const profile = useQuery(
+ api.profiles.get,
+ id ? { id: id as Id<'profiles'> } : 'skip'
+ )
- if (data === undefined) {
+ if (data === undefined || profile === undefined) {
return (
@@ -49,7 +55,30 @@ export default function ProfileFlash() {
)
}
+ if (!profile) {
+ return (
+
+
+
+
Back to Profile
+
+
+
+
+ )
+ }
+
const build = data.build
+ const targetMeta = target ? TARGETS[target] : undefined
+ const targetLabel = targetMeta?.name ?? target ?? 'Unknown Target'
+ const includedModules = modulesData.modules.filter(
+ (module) => profile.config?.[module.id] === false
+ )
const getStatusColor = (status: string) => {
if (status === 'success') return 'text-green-400'
@@ -74,38 +103,70 @@ export default function ProfileFlash() {
return (
-
+
Back to Profile
+
+
+
+ Profile
+
+
{profile.name}
+
+ Version: {profile.version}
+
+
+
+ {profile.description}
+
+
+
-
-
- {getStatusIcon(build.status)}
-
-
{target}
-
-
- {humanizeStatus(build.status)}
-
-
•
-
{new Date(build.startedAt).toLocaleString()}
+
Included Modules
+ {includedModules.length === 0 ? (
+
No modules included.
+ ) : (
+
+ {includedModules.map((module) => (
+
+
{module.name}
+
{module.description}
+ ))}
+
+ )}
+
+
+
+
+ {getStatusIcon(build.status)}
+
+
+ Target
+
+
{targetLabel}
+
+
+ {humanizeStatus(build.status)}
+
+ •
+ {new Date(build.startedAt).toLocaleString()}
{githubActionUrl && (
-