Skip to content

Commit daec255

Browse files
committed
Made fixes to workflow tests and frontend code
1 parent e628b14 commit daec255

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

.github/workflows/playwright.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ jobs:
7070
fail-fast: false
7171
steps:
7272
- uses: actions/checkout@v5
73+
- name: Create .env file
74+
run: touch .env
7375
- uses: actions/setup-node@v5
7476
with:
7577
node-version: lts/*

.github/workflows/test-backend.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ jobs:
3232
SENTRY_DSN: ""
3333
PROJECT_NAME: "Mosaic Project"
3434
STACK_NAME: mosaic-project-local
35+
DOCKER_IMAGE_BACKEND: backend
36+
DOCKER_IMAGE_FRONTEND: frontend
3537
steps:
3638
- name: Checkout
3739
uses: actions/checkout@v5
40+
- name: Create .env file
41+
run: touch .env
3842
- name: Set up Python
3943
uses: actions/setup-python@v6
4044
with:

.github/workflows/test-docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
steps:
3939
- name: Checkout
4040
uses: actions/checkout@v5
41+
- name: Create .env file
42+
run: touch .env
4143
- run: docker compose build
4244
- run: docker compose down -v --remove-orphans
4345
- run: docker compose up -d --wait backend frontend adminer

frontend/src/routes/_layout/index.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,23 @@ function Dashboard() {
7878
const recentProjects = projectsData?.data?.slice(0, 3) || []
7979

8080
// Get projects with upcoming deadlines (within 2 weeks, not completed)
81+
type DeadlineItem = {
82+
id: number
83+
project: string
84+
date: string
85+
daysLeft: number
86+
}
87+
8188
const upcomingDeadlines = (projectsData?.data || [])
8289
.filter((p: Project) => p.deadline && p.status !== "completed")
83-
.map((p: Project) => ({
90+
.map((p: Project): DeadlineItem => ({
8491
id: p.id,
8592
project: p.name,
8693
date: p.deadline!,
8794
daysLeft: getDaysUntil(p.deadline!),
8895
}))
89-
.filter((d) => d.daysLeft >= 0 && d.daysLeft <= 14)
90-
.sort((a, b) => a.daysLeft - b.daysLeft)
96+
.filter((d: DeadlineItem) => d.daysLeft >= 0 && d.daysLeft <= 14)
97+
.sort((a: DeadlineItem, b: DeadlineItem) => a.daysLeft - b.daysLeft)
9198
.slice(0, 3)
9299

93100
const isLoading = statsLoading || projectsLoading
@@ -188,7 +195,7 @@ function Dashboard() {
188195
<Text color="fg.muted">No upcoming deadlines in the next 2 weeks.</Text>
189196
) : (
190197
<Stack gap={3}>
191-
{upcomingDeadlines.map((deadline) => (
198+
{upcomingDeadlines.map((deadline: DeadlineItem) => (
192199
<Box key={deadline.id} p={3} borderWidth="1px" borderRadius="md">
193200
<Text fontWeight="semibold" fontSize="sm" mb={1}>
194201
{deadline.project}

frontend/src/routes/_layout/projects.$projectId.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
FiUsers,
2323
} from "react-icons/fi"
2424

25-
import { ProjectsServiceTemp, GalleriesServiceTemp } from "@/client"
25+
import { ProjectsServiceTemp, GalleriesServiceTemp, type Gallery } from "@/client"
2626

2727
export const Route = createFileRoute("/_layout/projects/$projectId")({
2828
component: ProjectDetail,
@@ -78,7 +78,7 @@ function ProjectDetail() {
7878
}
7979

8080
const galleries = galleriesData?.data || []
81-
const fileCount = galleries.reduce((sum, g) => sum + g.photo_count, 0)
81+
const fileCount = galleries.reduce((sum: number, g: Gallery) => sum + g.photo_count, 0)
8282

8383
return (
8484
<Container maxW="full" p={6}>
@@ -218,7 +218,7 @@ function ProjectDetail() {
218218
<Text fontWeight="semibold" mb={2}>Galleries</Text>
219219
{galleries.length > 0 ? (
220220
<Stack gap={2}>
221-
{galleries.map((gallery) => (
221+
{galleries.map((gallery: Gallery) => (
222222
<Flex key={gallery.id} alignItems="center" gap={2}>
223223
<FiImage size={14} />
224224
<Text fontSize="sm">{gallery.name}</Text>

0 commit comments

Comments
 (0)