Skip to content

Commit 4d08824

Browse files
committed
Merge branch 'develop' into #4020-improved-task-dragging
2 parents 250f0b9 + dcf8df3 commit 4d08824

57 files changed

Lines changed: 1165 additions & 870 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage - compile TypeScript
2-
FROM node:20 AS builder
2+
FROM node:25 AS builder
33
WORKDIR /app
44

55
COPY package.json tsconfig.build.json ./
@@ -11,11 +11,11 @@ RUN cd src/backend && npx prisma generate
1111
RUN yarn build:shared
1212
RUN yarn build:backend
1313

14-
FROM node:20-slim
14+
FROM platformatic/node-caged:25-slim
1515
WORKDIR /app
1616

1717
# Install OpenSSL for Prisma (slim image needs this)
18-
RUN apt-get update -y && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
18+
RUN apt-get update -y && apt-get install -y openssl && rm -rf /var/lib/apt/lists/* && npm install -g yarn
1919

2020
COPY package.json ./
2121

devContainerization/Dockerfile.backend.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20
1+
FROM node:25
22

33
COPY package.json tsconfig.build.json ./
44
COPY ./src/backend/package.json ./src/backend/tsconfig.json src/backend/

devContainerization/Dockerfile.frontend.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-alpine
1+
FROM node:25-alpine
22

33
COPY package.json tsconfig.build.json ./
44
COPY ./src/frontend/package.json ./src/frontend/tsconfig.json src/frontend/
@@ -11,4 +11,4 @@ COPY ./src/frontend src/frontend
1111
COPY ./src/shared src/shared
1212

1313
EXPOSE 3000
14-
CMD [ "yarn", "workspace", "frontend", "vite", "--force", "--host" ]
14+
CMD [ "yarn", "workspace", "frontend", "vite", "--force", "--host" ]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"@babel/preset-typescript": "^7.18.6",
8787
"@types/canvas-confetti": "^1.9.0",
8888
"@types/jest": "^29.5.14",
89-
"@types/node": "20.0.0",
89+
"@types/node": "^25.0.0",
9090
"@typescript-eslint/eslint-plugin": "8.20.0",
9191
"@typescript-eslint/parser": "8.20.0",
9292
"concurrently": "^9.1.0",

src/backend/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# TO BE RUN FROM DOCKER COMPOSE. DO NOT RUN MANUALLY AS CONTEXT IS NOT SET CORRECTLY
2-
FROM node:20
2+
FROM platformatic/node-caged:25-slim
3+
RUN npm install -g yarn
34

45
WORKDIR /base
56

src/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"devDependencies": {
4040
"@types/express-jwt": "^6.0.4",
4141
"@types/jsonwebtoken": "^8.5.9",
42-
"@types/node": "^20.0.0",
42+
"@types/node": "^25.0.0",
4343
"@types/supertest": "^2.0.12",
4444
"nodemon": "^2.0.16",
4545
"supertest": "^6.2.4",

src/backend/src/controllers/organizations.controllers.ts

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,6 @@ export default class OrganizationsController {
2222
}
2323
}
2424

25-
static async setImages(req: Request, res: Response, next: NextFunction) {
26-
try {
27-
const { applyInterestImage = [], exploreAsGuestImage = [] } = req.files as {
28-
applyInterestImage?: Express.Multer.File[];
29-
exploreAsGuestImage?: Express.Multer.File[];
30-
};
31-
32-
const applyInterestFile = applyInterestImage[0] || null;
33-
const exploreAsGuestFile = exploreAsGuestImage[0] || null;
34-
35-
const newImages = await OrganizationsService.setImages(
36-
applyInterestFile,
37-
exploreAsGuestFile,
38-
req.currentUser,
39-
req.organization
40-
);
41-
42-
res.status(200).json(newImages);
43-
} catch (error: unknown) {
44-
next(error);
45-
}
46-
}
4725
static async getAllUsefulLinks(req: Request, res: Response, next: NextFunction) {
4826
try {
4927
const links = await OrganizationsService.getAllUsefulLinks(req.organization.organizationId);
@@ -97,15 +75,6 @@ export default class OrganizationsController {
9775
}
9876
}
9977

100-
static async getOrganizationImages(req: Request, res: Response, next: NextFunction) {
101-
try {
102-
const images = await OrganizationsService.getOrganizationImages(req.organization.organizationId);
103-
res.status(200).json(images);
104-
} catch (error: unknown) {
105-
next(error);
106-
}
107-
}
108-
10978
static async setOrganizationFeaturedProjects(req: Request, res: Response, next: NextFunction) {
11079
try {
11180
const { projectIds } = req.body;
@@ -142,6 +111,20 @@ export default class OrganizationsController {
142111
}
143112
}
144113

114+
static async setPlatformLogoImage(req: Request, res: Response, next: NextFunction) {
115+
try {
116+
if (!req.file) {
117+
throw new HttpException(400, 'Invalid or undefined image data');
118+
}
119+
120+
const updatedOrg = await OrganizationsService.setPlatformLogoImage(req.file, req.currentUser, req.organization);
121+
122+
res.status(200).json(updatedOrg);
123+
} catch (error: unknown) {
124+
next(error);
125+
}
126+
}
127+
145128
static async setNewMemberImage(req: Request, res: Response, next: NextFunction) {
146129
try {
147130
if (!req.file) {
@@ -181,6 +164,20 @@ export default class OrganizationsController {
181164
}
182165
}
183166

167+
static async setPlatformDescription(req: Request, res: Response, next: NextFunction) {
168+
try {
169+
const updatedOrg = await OrganizationsService.setPlatformDescription(
170+
req.body.platformDescription,
171+
req.currentUser,
172+
req.organization
173+
);
174+
175+
res.status(200).json(updatedOrg);
176+
} catch (error: unknown) {
177+
next(error);
178+
}
179+
}
180+
184181
static async getOrganizationFeaturedProjects(req: Request, res: Response, next: NextFunction) {
185182
try {
186183
const featuredProjects = await OrganizationsService.getOrganizationFeaturedProjects(req.organization.organizationId);

src/backend/src/controllers/projects.controllers.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,16 @@ export default class ProjectsController {
166166

167167
static async createLinkType(req: Request, res: Response, next: NextFunction) {
168168
try {
169-
const { name, iconName, required } = req.body;
169+
const { name, iconName, required, isOnGuestHomePage } = req.body;
170170

171-
const newLinkType = await ProjectsService.createLinkType(req.currentUser, name, iconName, required, req.organization);
171+
const newLinkType = await ProjectsService.createLinkType(
172+
req.currentUser,
173+
name,
174+
iconName,
175+
required,
176+
req.organization,
177+
isOnGuestHomePage
178+
);
172179
res.status(200).json(newLinkType);
173180
} catch (error: unknown) {
174181
next(error);
@@ -449,13 +456,14 @@ export default class ProjectsController {
449456
static async editLinkType(req: Request, res: Response, next: NextFunction) {
450457
try {
451458
const { linkTypeName } = req.params as Record<string, string>;
452-
const { name: newName, iconName, required } = req.body;
459+
const { name: newName, iconName, required, isOnGuestHomePage } = req.body;
453460
const linkTypeUpdated = await ProjectsService.editLinkType(
454461
linkTypeName,
455462
iconName,
456463
required,
457464
req.currentUser,
458465
req.organization,
466+
isOnGuestHomePage,
459467
newName
460468
);
461469
res.status(200).json(linkTypeUpdated);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `applyInterestImageId` on the `Organization` table. All the data in the column will be lost.
5+
- You are about to drop the column `exploreAsGuestImageId` on the `Organization` table. All the data in the column will be lost.
6+
7+
*/
8+
-- DropForeignKey
9+
ALTER TABLE "Sponsor" DROP CONSTRAINT "Sponsor_sponsorTierId_fkey";
10+
11+
-- AlterTable
12+
ALTER TABLE "Link_Type" ADD COLUMN "isOnGuestHomePage" BOOLEAN NOT NULL DEFAULT false;
13+
14+
-- AlterTable
15+
ALTER TABLE "Organization" DROP COLUMN "applyInterestImageId",
16+
DROP COLUMN "exploreAsGuestImageId",
17+
ADD COLUMN "platformDescription" TEXT NOT NULL DEFAULT '',
18+
ADD COLUMN "platformLogoImageId" TEXT;
19+
20+
-- AlterTable
21+
ALTER TABLE "Sponsor" ALTER COLUMN "valueTypes" DROP DEFAULT;
22+
23+
-- AddForeignKey
24+
ALTER TABLE "Sponsor" ADD CONSTRAINT "Sponsor_sponsorTierId_fkey" FOREIGN KEY ("sponsorTierId") REFERENCES "Sponsor_Tier"("sponsorTierId") ON DELETE SET NULL ON UPDATE CASCADE;

src/backend/src/prisma/schema.prisma

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -599,16 +599,17 @@ model Work_Package {
599599
}
600600

601601
model Link_Type {
602-
id String @id @default(uuid())
603-
name String
604-
dateCreated DateTime @default(now())
605-
iconName String
606-
required Boolean
607-
creatorId String
608-
creator User @relation(name: "linkTypeCreator", fields: [creatorId], references: [userId])
609-
links Link[] @relation(name: "linkTypes")
610-
organizationId String
611-
organization Organization @relation(fields: [organizationId], references: [organizationId])
602+
id String @id @default(uuid())
603+
name String
604+
dateCreated DateTime @default(now())
605+
iconName String
606+
required Boolean
607+
creatorId String
608+
creator User @relation(name: "linkTypeCreator", fields: [creatorId], references: [userId])
609+
links Link[] @relation(name: "linkTypes")
610+
organizationId String
611+
organization Organization @relation(fields: [organizationId], references: [organizationId])
612+
isOnGuestHomePage Boolean @default(false)
612613
613614
@@unique([name, organizationId], name: "uniqueLinkType")
614615
@@index([organizationId])
@@ -1392,8 +1393,6 @@ model Organization {
13921393
advisor User? @relation(name: "advisor", fields: [advisorId], references: [userId])
13931394
advisorId String?
13941395
description String @default("")
1395-
applyInterestImageId String?
1396-
exploreAsGuestImageId String?
13971396
newMemberImageId String?
13981397
logoImageId String?
13991398
slackWorkspaceId String?
@@ -1402,6 +1401,8 @@ model Organization {
14021401
partReviewSampleImageId String?
14031402
partReviewGuideLink String?
14041403
sponsorshipNotificationsSlackChannelId String?
1404+
platformDescription String @default("")
1405+
platformLogoImageId String?
14051406
14061407
// Relation references
14071408
wbsElements WBS_Element[]

0 commit comments

Comments
 (0)