Skip to content

Commit

Permalink
Merge branch 'feature/homepage-redesign' into #3044-slack-endpoint-li…
Browse files Browse the repository at this point in the history
…stener
  • Loading branch information
caiodasilva2005 committed Dec 14, 2024
2 parents 6b8863e + 95f8685 commit ba44349
Show file tree
Hide file tree
Showing 92 changed files with 4,372 additions and 2,469 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/production-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

name: Production Build

on:
push:
branches:
- main
- multitenancy

jobs:
run-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.17.1
cache: 'yarn'
- name: Yarn Install
run: yarn install
- name: Run Tests
run: yarn containerize
2 changes: 1 addition & 1 deletion .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- name: Yarn Install
run: yarn install
- name: Run Tests
run: yarn containerize:teste2e
run: yarn containerize:test:e2e
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.17.1
FROM node:20
WORKDIR /base

COPY package.json tsconfig.build.json ./
Expand Down
2 changes: 1 addition & 1 deletion src/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TO BE RUN FROM DOCKER COMPOSE. DO NOT RUN MANUALLY AS CONTEXT IS NOT SET CORRECTLY
FROM node:18
FROM node:20

WORKDIR /base

Expand Down
3 changes: 2 additions & 1 deletion src/backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import recruitmentRouter from './src/routes/recruitment.routes';
import slackRouter from './src/routes/slack.routes';

const app = express();

const port = process.env.PORT || 3001;
const isProd = process.env.NODE_ENV === 'production';

Expand Down Expand Up @@ -70,7 +71,7 @@ app.use('/organizations', organizationRouter);
app.use('/recruitment', recruitmentRouter);
app.use('/slack', slackRouter);
app.use('/', (_req, res) => {
res.json('Welcome to FinishLine');
res.status(200).json('Welcome to FinishLine');
});

// custom error handler middleware
Expand Down
4 changes: 2 additions & 2 deletions src/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@types/concat-stream": "^2.0.0",
"@types/cookie-parser": "^1.4.3",
"@types/cors": "^2.8.12",
"@types/express": "^4.17.6",
"@types/express": "^5.0.0",
"@types/multer": "^1.4.7",
"@types/nodemailer": "^6.4.0",
"body-parser": "^1.19.0",
Expand All @@ -23,7 +23,7 @@
"cors": "^2.8.5",
"decimal.js": "^10.4.3",
"dotenv": "^16.0.1",
"express": "^4.17.1",
"express": "^5.0.0",
"express-jwt": "^7.7.5",
"express-validator": "^6.14.2",
"google-auth-library": "^8.1.1",
Expand Down
8 changes: 4 additions & 4 deletions src/backend/src/controllers/cars.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export default class CarsController {
try {
const cars = await CarsService.getAllCars(req.organization);

return res.status(200).json(cars);
res.status(200).json(cars);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -17,9 +17,9 @@ export default class CarsController {
const { name } = req.body;
const car = await CarsService.createCar(req.organization, req.currentUser, name);

return res.status(201).json(car);
res.status(201).json(car);
} catch (error: unknown) {
return next(error);
next(error);
}
}
}
36 changes: 18 additions & 18 deletions src/backend/src/controllers/change-requests.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ export default class ChangeRequestsController {
const { crId } = req.params;

const cr = await ChangeRequestsService.getChangeRequestByID(crId, req.organization);
return res.status(200).json(cr);
res.status(200).json(cr);
} catch (error: unknown) {
return next(error);
next(error);
}
}

static async getAllChangeRequests(req: Request, res: Response, next: NextFunction) {
try {
const changeRequests = await ChangeRequestsService.getAllChangeRequests(req.organization);
return res.status(200).json(changeRequests);
res.status(200).json(changeRequests);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -33,9 +33,9 @@ export default class ChangeRequestsController {
req.organization,
psId
);
return res.status(200).json({ message: `Change request #${id} successfully reviewed.` });
res.status(200).json({ message: `Change request #${id} successfully reviewed.` });
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -55,9 +55,9 @@ export default class ChangeRequestsController {
confirmDetails,
req.organization
);
return res.status(200).json({ message: `Successfully created activation change request with id #${id}` });
res.status(200).json({ message: `Successfully created activation change request with id #${id}` });
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -73,9 +73,9 @@ export default class ChangeRequestsController {
confirmDone,
req.organization
);
return res.status(200).json({ message: `Successfully created stage gate request with id #${id}` });
res.status(200).json({ message: `Successfully created stage gate request with id #${id}` });
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -99,9 +99,9 @@ export default class ChangeRequestsController {
projectProposedChanges,
workPackageProposedChanges
);
return res.status(200).json(createdCR);
res.status(200).json(createdCR);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -117,9 +117,9 @@ export default class ChangeRequestsController {
scopeImpact,
req.organization
);
return res.status(200).json({ message: `Successfully added proposed solution with id #${id}` });
res.status(200).json({ message: `Successfully added proposed solution with id #${id}` });
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -128,9 +128,9 @@ export default class ChangeRequestsController {
const { crId } = req.params;

await ChangeRequestsService.deleteChangeRequest(req.currentUser, crId, req.organization);
return res.status(200).json({ message: `Successfully deleted change request #${crId}` });
res.status(200).json({ message: `Successfully deleted change request #${crId}` });
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -140,9 +140,9 @@ export default class ChangeRequestsController {
const { crId } = req.params;

await ChangeRequestsService.requestCRReview(req.currentUser, userIds, crId, req.organization);
return res.status(200).json({ message: `Successfully requested reviewer(s) to change request #${crId}` });
res.status(200).json({ message: `Successfully requested reviewer(s) to change request #${crId}` });
} catch (error: unknown) {
return next(error);
next(error);
}
}
}
14 changes: 7 additions & 7 deletions src/backend/src/controllers/description-bullets.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ export default class DescriptionBulletsController {
descriptionId,
req.organization
);
return res.status(200).json(updatedDB);
res.status(200).json(updatedDB);
} catch (error: unknown) {
return next(error);
next(error);
}
}

static async getAllDescriptionBulletTypes(req: Request, res: Response, next: NextFunction) {
try {
const descriptionBulletTypes = await DescriptionBulletsService.getAllDescriptionBulletTypes(req.organization);
return res.status(200).json(descriptionBulletTypes);
res.status(200).json(descriptionBulletTypes);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -37,7 +37,7 @@ export default class DescriptionBulletsController {
);
res.status(201).json(newDescriptionBulletType);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -52,9 +52,9 @@ export default class DescriptionBulletsController {
projectRequired,
req.organization
);
return res.status(200).json(updatedDescriptionBulletType);
res.status(200).json(updatedDescriptionBulletType);
} catch (error: unknown) {
return next(error);
next(error);
}
}
}
28 changes: 14 additions & 14 deletions src/backend/src/controllers/design-reviews.controllers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ export default class DesignReviewsController {
static async getAllDesignReviews(req: Request, res: Response, next: NextFunction) {
try {
const designReviews = await DesignReviewsService.getAllDesignReviews(req.organization);
return res.status(200).json(designReviews);
res.status(200).json(designReviews);
} catch (error: unknown) {
return next(error);
next(error);
}
}

static async deleteDesignReview(req: Request, res: Response, next: NextFunction) {
try {
const drId: string = req.params.designReviewId;
const deletedDesignReview = await DesignReviewsService.deleteDesignReview(req.currentUser, drId, req.organization);
return res.status(200).json(deletedDesignReview);
res.status(200).json(deletedDesignReview);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -36,9 +36,9 @@ export default class DesignReviewsController {
meetingTimes,
req.organization
);
return res.status(200).json(createdDesignReview);
res.status(200).json(createdDesignReview);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -47,9 +47,9 @@ export default class DesignReviewsController {
const drId: string = req.params.designReviewId;

const designReview = await DesignReviewsService.getSingleDesignReview(req.currentUser, drId, req.organization);
return res.status(200).json(designReview);
res.status(200).json(designReview);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand Down Expand Up @@ -90,9 +90,9 @@ export default class DesignReviewsController {
meetingTimes,
req.organization
);
return res.status(200).json({ message: 'Design Review updated successfully' });
res.status(200).json({ message: 'Design Review updated successfully' });
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -109,9 +109,9 @@ export default class DesignReviewsController {
user,
req.organization
);
return res.status(200).json(updatedDesignReview);
res.status(200).json(updatedDesignReview);
} catch (error: unknown) {
return next(error);
next(error);
}
}

Expand All @@ -127,9 +127,9 @@ export default class DesignReviewsController {
status,
req.organization
);
return res.status(200).json(updatedDesignReview);
res.status(200).json(updatedDesignReview);
} catch (error: unknown) {
return next(error);
next(error);
}
}
}
Loading

0 comments on commit ba44349

Please sign in to comment.