Prettier format pending files

This commit is contained in:
Builder.io 2025-11-15 17:16:51 +00:00
parent 3d0e095b99
commit 35133d884b
9 changed files with 75 additions and 52 deletions

View file

@ -44,7 +44,9 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
.from("gameforge_projects")
.select("id")
.eq("id", sprint.project_id)
.or(`lead_id.eq.${user.id},id.in.(select project_id from gameforge_team_members where user_id='${user.id}')`)
.or(
`lead_id.eq.${user.id},id.in.(select project_id from gameforge_team_members where user_id='${user.id}')`,
)
.single();
if (!projectAccess) {
@ -105,9 +107,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
.single();
if (memberError || !member) {
return res
.status(404)
.json({ error: "Not a member of this sprint" });
return res.status(404).json({ error: "Not a member of this sprint" });
}
// Don't allow lead to leave if they're the only lead

View file

@ -24,10 +24,8 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
if (req.method === "GET") {
const { projectId, status } = req.query;
let query = admin
.from("gameforge_sprints")
.select(
`
let query = admin.from("gameforge_sprints").select(
`
id,
project_id,
sprint_number,
@ -46,7 +44,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
gameforge_projects(name),
gameforge_sprint_members(user_id)
`,
);
);
if (projectId) {
query = query.eq("project_id", projectId);

View file

@ -24,10 +24,8 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
if (req.method === "GET") {
const { sprintId, projectId, status, assignedTo } = req.query;
let query = admin
.from("gameforge_tasks")
.select(
`
let query = admin.from("gameforge_tasks").select(
`
id,
sprint_id,
project_id,
@ -46,7 +44,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
user_profiles:assigned_to(id, full_name, avatar_url),
creator:created_by_id(id, full_name)
`,
);
);
if (sprintId) {
query = query.eq("sprint_id", sprintId);
@ -97,7 +95,9 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
.from("gameforge_projects")
.select("id")
.eq("id", projectId)
.or(`lead_id.eq.${user.id},id.in.(select project_id from gameforge_team_members where user_id='${user.id}')`)
.or(
`lead_id.eq.${user.id},id.in.(select project_id from gameforge_team_members where user_id='${user.id}')`,
)
.single();
if (projectError || !project) {

View file

@ -86,7 +86,7 @@ export default function SprintManager({
`${API_BASE}/api/gameforge/sprint?projectId=${projectId}`,
{
headers: { Authorization: `Bearer ${token}` },
}
},
);
if (res.ok) {
@ -98,10 +98,10 @@ export default function SprintManager({
data
.filter((sprint: Sprint) =>
sprint.gameforge_sprint_members?.some(
(m: any) => m.user_id === session?.user?.id
)
(m: any) => m.user_id === session?.user?.id,
),
)
.map((s: Sprint) => s.id)
.map((s: Sprint) => s.id),
);
setUserSprints(userSprintIds);
}
@ -336,7 +336,10 @@ export default function SprintManager({
type="number"
value={formData.plannedVelocity}
onChange={(e) =>
setFormData({ ...formData, plannedVelocity: e.target.value })
setFormData({
...formData,
plannedVelocity: e.target.value,
})
}
placeholder="Story points or tasks"
className="bg-slate-900 border-slate-700"
@ -418,8 +421,7 @@ export default function SprintManager({
)}
{sprint.end_date && (
<div className="flex items-center gap-1">
{" "}
{new Date(sprint.end_date).toLocaleDateString()}
{new Date(sprint.end_date).toLocaleDateString()}
</div>
)}
<div className="flex items-center gap-1">

View file

@ -578,7 +578,7 @@ export default function Dashboard() {
linkedProviderMap={
linkedProviders
? Object.fromEntries(
linkedProviders.map((p) => [p.provider, p])
linkedProviders.map((p) => [p.provider, p]),
)
: {}
}

View file

@ -356,7 +356,8 @@ const Profile = () => {
</Card>
{/* SKILLS & LANGUAGES */}
{(profile.skills_detailed && profile.skills_detailed.length > 0) ||
{(profile.skills_detailed &&
profile.skills_detailed.length > 0) ||
(profile.languages && profile.languages.length > 0) ? (
<Card className="border-border/40 bg-background/60 backdrop-blur">
<CardHeader>
@ -369,7 +370,8 @@ const Profile = () => {
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
{profile.skills_detailed && profile.skills_detailed.length > 0 ? (
{profile.skills_detailed &&
profile.skills_detailed.length > 0 ? (
<div>
<p className="text-sm font-medium text-foreground/80 mb-2">
Technical Skills
@ -499,7 +501,8 @@ const Profile = () => {
) : null}
{/* ARM AFFILIATIONS */}
{profile.arm_affiliations && profile.arm_affiliations.length > 0 ? (
{profile.arm_affiliations &&
profile.arm_affiliations.length > 0 ? (
<Card className="border-border/40 bg-background/60 backdrop-blur">
<CardHeader>
<CardTitle className="flex items-center gap-2 text-white">
@ -520,28 +523,34 @@ const Profile = () => {
> = {
foundation: {
label: "Foundation",
color: "bg-red-500/20 text-red-200 border-red-500/40",
color:
"bg-red-500/20 text-red-200 border-red-500/40",
},
gameforge: {
label: "GameForge",
color: "bg-green-500/20 text-green-200 border-green-500/40",
color:
"bg-green-500/20 text-green-200 border-green-500/40",
},
labs: {
label: "Labs",
color: "bg-yellow-500/20 text-yellow-200 border-yellow-500/40",
color:
"bg-yellow-500/20 text-yellow-200 border-yellow-500/40",
},
corp: {
label: "Corp",
color: "bg-blue-500/20 text-blue-200 border-blue-500/40",
color:
"bg-blue-500/20 text-blue-200 border-blue-500/40",
},
devlink: {
label: "Dev-Link",
color: "bg-cyan-500/20 text-cyan-200 border-cyan-500/40",
color:
"bg-cyan-500/20 text-cyan-200 border-cyan-500/40",
},
};
const config = armConfig[arm] || {
label: arm,
color: "bg-slate-500/20 text-slate-200 border-slate-500/40",
color:
"bg-slate-500/20 text-slate-200 border-slate-500/40",
};
return (
<Badge

View file

@ -764,24 +764,29 @@ const ProfilePassport = () => {
},
gameforge: {
label: "GameForge",
color: "bg-green-500/20 text-green-200 border-green-500/40",
color:
"bg-green-500/20 text-green-200 border-green-500/40",
},
labs: {
label: "Labs",
color: "bg-yellow-500/20 text-yellow-200 border-yellow-500/40",
color:
"bg-yellow-500/20 text-yellow-200 border-yellow-500/40",
},
corp: {
label: "Corp",
color: "bg-blue-500/20 text-blue-200 border-blue-500/40",
color:
"bg-blue-500/20 text-blue-200 border-blue-500/40",
},
devlink: {
label: "Dev-Link",
color: "bg-cyan-500/20 text-cyan-200 border-cyan-500/40",
color:
"bg-cyan-500/20 text-cyan-200 border-cyan-500/40",
},
};
const config = armConfig[arm] || {
label: arm,
color: "bg-slate-500/20 text-slate-200 border-slate-500/40",
color:
"bg-slate-500/20 text-slate-200 border-slate-500/40",
};
return (
<Badge

View file

@ -452,7 +452,10 @@ export default function GameForgeDashboard() {
</TabsContent>
{/* Sprints Tab */}
<TabsContent value="sprints" className="space-y-4 animate-fade-in">
<TabsContent
value="sprints"
className="space-y-4 animate-fade-in"
>
{sprint && sprint.project_id ? (
<SprintManager
projectId={sprint.project_id}

View file

@ -81,7 +81,9 @@ export default function NexusDashboard() {
availability_status: creatorProfile.availability_status || "available",
availability_hours_per_week:
creatorProfile.availability_hours_per_week?.toString() || "",
skills: Array.isArray(creatorProfile.skills) ? creatorProfile.skills : [],
skills: Array.isArray(creatorProfile.skills)
? creatorProfile.skills
: [],
});
}
}, [creatorProfile]);
@ -208,9 +210,10 @@ export default function NexusDashboard() {
? parseFloat(profileFormData.hourly_rate)
: null,
availability_status: profileFormData.availability_status,
availability_hours_per_week: profileFormData.availability_hours_per_week
? parseFloat(profileFormData.availability_hours_per_week)
: null,
availability_hours_per_week:
profileFormData.availability_hours_per_week
? parseFloat(profileFormData.availability_hours_per_week)
: null,
skills: profileFormData.skills,
}),
});
@ -223,17 +226,20 @@ export default function NexusDashboard() {
setCreatorProfile(updatedProfile);
// Update user profile to mark Nexus as complete
const userProfileRes = await fetch(`${API_BASE}/api/user/profile-update`, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
const userProfileRes = await fetch(
`${API_BASE}/api/user/profile-update`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
nexus_profile_complete: true,
nexus_headline: profileFormData.headline,
}),
},
body: JSON.stringify({
nexus_profile_complete: true,
nexus_headline: profileFormData.headline,
}),
});
);
if (userProfileRes.ok) {
aethexToast({