Skip to content

Commit

Permalink
Merge pull request #226 from chingu-x/dev
Browse files Browse the repository at this point in the history
Merge into main for new release
  • Loading branch information
cherylli authored Dec 5, 2024
2 parents 67c1285 + d116ff4 commit fdfb967
Show file tree
Hide file tree
Showing 48 changed files with 7,516 additions and 540 deletions.
45 changes: 41 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,51 @@
# Changelog

All notable changes to this project will be documented in this file.
> [!IMPORTANT]
> All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Another example [here](https://co-pilot.dev/changelog)
> [!NOTE]
> The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), <br/>
> and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). <br/>
> Another example [here](https://co-pilot.dev/changelog) <br/>
> [!TIP]
> MAJOR version when you make incompatible API changes <br/>
> MINOR version when you add functionality in a backward compatible manner <br/>
> PATCH version when you make backward compatible bug fixes <br/>
## [Unreleased]

### Added

### Changed

### Fixed

### Removed

## [v1.1.0-alpha]

### Added

- Added same site property to the clear cookies function ([#218](https://github.com/chingu-x/chingu-dashboard-be/pull/218))
- Added routes for teams to create own tech stack categories([#208](https://github.com/chingu-x/chingu-dashboard-be/pull/208))
- Added unit tests for Features controller and services ([#220](https://github.com/chingu-x/chingu-dashboard-be/pull/220))
- Added GET endpoint for solo project ([#223](https://github.com/chingu-x/chingu-dashboard-be/pull/223))
- Added units test for sprints ([#224](https://github.com/chingu-x/chingu-dashboard-be/pull/224))

### Changed
- Updated cors origin list ([#218](https://github.com/chingu-x/chingu-dashboard-be/pull/218))
- refactored unit tests for the ideations controller and services([#219](https://github.com/chingu-x/chingu-dashboard-be/pull/219))
- revised tech selections route to update only one tech per request([#221](https://github.com/chingu-x/chingu-dashboard-be/pull/221))

### Fixed

### Removed

## [v1.0.2-alpha]

### Added

- Add units tests for the forms controller and services([#204](https://github.com/chingu-x/chingu-dashboard-be/pull/204))
- Add same site property to cookie ([#212](https://github.com/chingu-x/chingu-dashboard-be/pull/212))
- Add same site property to cookie in refresh endpoint ([#214](https://github.com/chingu-x/chingu-dashboard-be/pull/214))
Expand Down Expand Up @@ -44,6 +80,7 @@ Another example [here](https://co-pilot.dev/changelog)
- Add units tests for the teams resource controller & services([#201](https://github.com/chingu-x/chingu-dashboard-be/pull/201))
- Add github workflow for PR reminders ([#202](https://github.com/chingu-x/chingu-dashboard-be/pull/202))


### Changed

- updated changelog ([#195](https://github.com/chingu-x/chingu-dashboard-be/pull/195))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Warnings:
- A unique constraint covering the columns `[name,voyageTeamId]` on the table `TechStackCategory` will be added. If there are existing duplicate values, this will fail.
*/
-- DropIndex
DROP INDEX "TechStackCategory_name_key";

-- AlterTable
ALTER TABLE "TechStackCategory" ADD COLUMN "voyageTeamId" INTEGER,
ALTER COLUMN "name" SET DATA TYPE CITEXT;

-- CreateIndex
CREATE UNIQUE INDEX "TechStackCategory_name_voyageTeamId_key" ON "TechStackCategory"("name", "voyageTeamId");

-- AddForeignKey
ALTER TABLE "TechStackCategory" ADD CONSTRAINT "TechStackCategory_voyageTeamId_fkey" FOREIGN KEY ("voyageTeamId") REFERENCES "VoyageTeam"("id") ON DELETE CASCADE ON UPDATE CASCADE;
10 changes: 7 additions & 3 deletions prisma/schema/teamStack.prisma
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
// === Voyage - Tech stack ===

model TechStackCategory {
id Int @id @default(autoincrement())
name String @unique
description String
id Int @id @default(autoincrement())
name String @db.Citext
description String
voyageTeam VoyageTeam? @relation(fields: [voyageTeamId], references: [id], onUpdate: Cascade, onDelete: Cascade)
voyageTeamId Int?
createdAt DateTime @default(now()) @db.Timestamptz()
updatedAt DateTime @updatedAt
teamTechStackItems TeamTechStackItem[]
@@unique(fields: [name, voyageTeamId], name: "teamCategoryUniqueKey")
}

model TeamTechStackItem {
Expand Down
1 change: 1 addition & 0 deletions prisma/schema/voyage.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ model VoyageTeam {
voyageTeamMembers VoyageTeamMember[]
teamTechStackItems TeamTechStackItem[]
techStackCategory TechStackCategory[]
teamMeetings TeamMeeting[]
FormResponseVoyageProject FormResponseVoyageProject?
}
Expand Down
8 changes: 7 additions & 1 deletion prisma/seed/data/tech-stack-categories.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
export default [
export const techStackCategoriesData = [
{
name: "Frontend",
description: "Frontend Stuff",
voyageTeamId: 1,
},
{
name: "CSS Library",
description: "CSS Library",
voyageTeamId: 1,
},
{
name: "Backend",
description: "Backend Stuff",
voyageTeamId: 1,
},
{
name: "Project Management",
description: "project management Stuff",
voyageTeamId: 1,
},
{
name: "Cloud Provider",
description: "cloud stuff",
voyageTeamId: 1,
},
{
name: "Hosting",
description: "Hosting stuff",
voyageTeamId: 1,
},
];
10 changes: 10 additions & 0 deletions prisma/seed/forms/solo-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ export const populateSoloProjectForm = async () => {
text: "Deployed Url",
answerRequired: true,
},
{
order: 3,
inputType: {
connect: {
name: "radio",
},
},
text: "Tier",
answerRequired: true,
},
],
},
},
Expand Down
1 change: 0 additions & 1 deletion prisma/seed/responses/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ export const populateQuestionResponses = async (
}
case "teamMembersCheckbox": {
if (teamMemberId === 0) {
console.log(question);
throw new Error(
`teamMemberId required for input type ${question.inputType.name} (question id:${question.id}).`,
);
Expand Down
2 changes: 1 addition & 1 deletion prisma/seed/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const deleteAllTables = async () => {

export const seed = async () => {
await deleteAllTables();
await populateTables(); // tables with no relations
await populateTables(); //tables with no relations
await populateVoyages();
await populateUsers();
await populateSprints();
Expand Down
64 changes: 64 additions & 0 deletions prisma/seed/solo-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const populateSoloProjects = async () => {
select: {
id: true,
questions: {
orderBy: {
order: "asc",
},
select: {
id: true,
},
Expand Down Expand Up @@ -58,10 +61,12 @@ export const populateSoloProjects = async () => {
createMany: {
data: [
{
authorId: users[1].id,
content: "This is a tier 2 project, not tier 3",
type: "SoloProject",
},
{
authorId: users[2].id,
content: "ok",
parentCommentId: 1,
type: "SoloProject",
Expand Down Expand Up @@ -123,5 +128,64 @@ export const populateSoloProjects = async () => {
},
});

// Solo Project 3 (with option choices)
const responseGroup3 = await prisma.responseGroup.create({
data: {
responses: {
createMany: {
data: [
{
questionId: soloProjectForm!.questions[0].id,
text: "www.github.com/repo3",
},
{
questionId: soloProjectForm!.questions[1].id,
text: "www.vercel.com/3",
},
{
questionId: soloProjectForm!.questions[2].id,
optionChoiceId: 44,
},
],
},
},
},
});

await prisma.soloProject.create({
data: {
userId: users[6].id,
evaluatorUserId: users[3].id,
evaluatorFeedback: passedSampleFeedback,
statusId: (await prisma.soloProjectStatus.findUnique({
where: {
status: "Requested Changes",
},
}))!.id,
formId: soloProjectForm!.id,
responseGroupId: responseGroup3.id,
},
});

const statuses = await prisma.soloProjectStatus.findMany({});

for (let i = 0; i < 40; i++) {
await prisma.soloProject.create({
data: {
userId: users[5].id,
evaluatorUserId: users[2].id,
evaluatorFeedback: passedSampleFeedback,
statusId: (await prisma.soloProjectStatus.findUnique({
where: {
status: statuses[
Math.floor(Math.random() * statuses.length)
].status,
},
}))!.id,
formId: soloProjectForm!.id,
},
});
}

console.log("Solo projects populated.");
};
2 changes: 0 additions & 2 deletions prisma/seed/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Genders from "./data/genders";
import Tiers from "./data/tiers";
import VoyageRoles from "./data/voyage-roles";
import VoyageStatus from "./data/voyage-status";
import TechStackCategories from "./data/tech-stack-categories";

import FeatureCategories from "./data/feature-categories";

Expand All @@ -27,7 +26,6 @@ export const populateTables = async () => {
await populateTable("role", Roles);
await populateTable("voyageRole", VoyageRoles);
await populateTable("voyageStatus", VoyageStatus);
await populateTable("techStackCategory", TechStackCategories);
await populateTable("featureCategory", FeatureCategories);
await populateTable("formType", FormTypes);
await populateTable("inputType", InputTypes);
Expand Down
26 changes: 18 additions & 8 deletions prisma/seed/voyage-teams.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { prisma } from "./prisma-client";
import { techStackCategoriesData } from "./data/tech-stack-categories";

export const populateVoyageTeams = async () => {
const users = await prisma.user.findMany({});
Expand Down Expand Up @@ -1531,6 +1532,15 @@ export const populateVoyageTeams = async () => {
},
});

//Add Tech Stack Categories
for (let teamId = 1; teamId <= 11; teamId += 1) {
for (const category of techStackCategoriesData) {
category.voyageTeamId = teamId;
await prisma["TechStackCategory"].create({ data: category });
}
}
console.log("TechStackCategories populated");

const voyageTeamMembers = await prisma.voyageTeamMember.findMany({});

/* ============== Add tech stack items, etc to teams ================== */
Expand All @@ -1547,7 +1557,7 @@ export const populateVoyageTeams = async () => {
name: "Javascript",
category: {
connect: {
name: "Frontend",
id: 7,
},
},
teamTechStackItemVotes: {
Expand Down Expand Up @@ -1581,7 +1591,7 @@ export const populateVoyageTeams = async () => {
name: "React",
category: {
connect: {
name: "Frontend",
id: 7,
},
},
teamTechStackItemVotes: {
Expand Down Expand Up @@ -1615,7 +1625,7 @@ export const populateVoyageTeams = async () => {
name: "Tailwind",
category: {
connect: {
name: "CSS Library",
id: 8,
},
},
teamTechStackItemVotes: {
Expand Down Expand Up @@ -1649,7 +1659,7 @@ export const populateVoyageTeams = async () => {
name: "Node",
category: {
connect: {
name: "Backend",
id: 9,
},
},
teamTechStackItemVotes: {
Expand Down Expand Up @@ -1683,7 +1693,7 @@ export const populateVoyageTeams = async () => {
name: "Jira",
category: {
connect: {
name: "Project Management",
id: 10,
},
},
teamTechStackItemVotes: {
Expand Down Expand Up @@ -1717,7 +1727,7 @@ export const populateVoyageTeams = async () => {
name: "Azure",
category: {
connect: {
name: "Cloud Provider",
id: 11,
},
},
teamTechStackItemVotes: {
Expand Down Expand Up @@ -1751,7 +1761,7 @@ export const populateVoyageTeams = async () => {
name: "Netlify",
category: {
connect: {
name: "Hosting",
id: 12,
},
},
teamTechStackItemVotes: {
Expand Down Expand Up @@ -1785,7 +1795,7 @@ export const populateVoyageTeams = async () => {
name: "Java",
category: {
connect: {
name: "Backend",
id: 9,
},
},
teamTechStackItemVotes: {
Expand Down
2 changes: 2 additions & 0 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { DevelopmentModule } from "./development/development.module";
import { AppConfigModule } from "./config/app/appConfig.module";
import { MailConfigModule } from "./config/mail/mailConfig.module";
import { DbConfigModule } from "./config/database/dbConfig.module";
import { SoloProjectsModule } from "./solo-projects/solo-projects.module";

@Module({
imports: [
Expand Down Expand Up @@ -64,6 +65,7 @@ import { DbConfigModule } from "./config/database/dbConfig.module";
VoyagesModule,
AbilityModule,
DevelopmentModule,
SoloProjectsModule,
],
controllers: [HealthCheckController],
providers: [
Expand Down
Loading

0 comments on commit fdfb967

Please sign in to comment.