Skip to content

Commit fdfb967

Browse files
authored
Merge pull request #226 from chingu-x/dev
Merge into main for new release
2 parents 67c1285 + d116ff4 commit fdfb967

Some content is hidden

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

48 files changed

+7516
-540
lines changed

CHANGELOG.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,51 @@
11
# Changelog
22

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

1118
### Added
1219

20+
### Changed
21+
22+
### Fixed
23+
24+
### Removed
25+
26+
## [v1.1.0-alpha]
27+
28+
### Added
29+
30+
- Added same site property to the clear cookies function ([#218](https://github.com/chingu-x/chingu-dashboard-be/pull/218))
31+
- Added routes for teams to create own tech stack categories([#208](https://github.com/chingu-x/chingu-dashboard-be/pull/208))
32+
- Added unit tests for Features controller and services ([#220](https://github.com/chingu-x/chingu-dashboard-be/pull/220))
33+
- Added GET endpoint for solo project ([#223](https://github.com/chingu-x/chingu-dashboard-be/pull/223))
34+
- Added units test for sprints ([#224](https://github.com/chingu-x/chingu-dashboard-be/pull/224))
35+
36+
### Changed
37+
- Updated cors origin list ([#218](https://github.com/chingu-x/chingu-dashboard-be/pull/218))
38+
- refactored unit tests for the ideations controller and services([#219](https://github.com/chingu-x/chingu-dashboard-be/pull/219))
39+
- revised tech selections route to update only one tech per request([#221](https://github.com/chingu-x/chingu-dashboard-be/pull/221))
40+
41+
### Fixed
42+
43+
### Removed
44+
45+
## [v1.0.2-alpha]
46+
47+
### Added
48+
1349
- Add units tests for the forms controller and services([#204](https://github.com/chingu-x/chingu-dashboard-be/pull/204))
1450
- Add same site property to cookie ([#212](https://github.com/chingu-x/chingu-dashboard-be/pull/212))
1551
- Add same site property to cookie in refresh endpoint ([#214](https://github.com/chingu-x/chingu-dashboard-be/pull/214))
@@ -44,6 +80,7 @@ Another example [here](https://co-pilot.dev/changelog)
4480
- Add units tests for the teams resource controller & services([#201](https://github.com/chingu-x/chingu-dashboard-be/pull/201))
4581
- Add github workflow for PR reminders ([#202](https://github.com/chingu-x/chingu-dashboard-be/pull/202))
4682

83+
4784
### Changed
4885

4986
- updated changelog ([#195](https://github.com/chingu-x/chingu-dashboard-be/pull/195))
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
Warnings:
3+
4+
- A unique constraint covering the columns `[name,voyageTeamId]` on the table `TechStackCategory` will be added. If there are existing duplicate values, this will fail.
5+
6+
*/
7+
-- DropIndex
8+
DROP INDEX "TechStackCategory_name_key";
9+
10+
-- AlterTable
11+
ALTER TABLE "TechStackCategory" ADD COLUMN "voyageTeamId" INTEGER,
12+
ALTER COLUMN "name" SET DATA TYPE CITEXT;
13+
14+
-- CreateIndex
15+
CREATE UNIQUE INDEX "TechStackCategory_name_voyageTeamId_key" ON "TechStackCategory"("name", "voyageTeamId");
16+
17+
-- AddForeignKey
18+
ALTER TABLE "TechStackCategory" ADD CONSTRAINT "TechStackCategory_voyageTeamId_fkey" FOREIGN KEY ("voyageTeamId") REFERENCES "VoyageTeam"("id") ON DELETE CASCADE ON UPDATE CASCADE;

prisma/schema/teamStack.prisma

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
// === Voyage - Tech stack ===
22

33
model TechStackCategory {
4-
id Int @id @default(autoincrement())
5-
name String @unique
6-
description String
4+
id Int @id @default(autoincrement())
5+
name String @db.Citext
6+
description String
7+
voyageTeam VoyageTeam? @relation(fields: [voyageTeamId], references: [id], onUpdate: Cascade, onDelete: Cascade)
8+
voyageTeamId Int?
79
810
createdAt DateTime @default(now()) @db.Timestamptz()
911
updatedAt DateTime @updatedAt
1012
1113
teamTechStackItems TeamTechStackItem[]
14+
15+
@@unique(fields: [name, voyageTeamId], name: "teamCategoryUniqueKey")
1216
}
1317

1418
model TeamTechStackItem {

prisma/schema/voyage.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ model VoyageTeam {
9191
9292
voyageTeamMembers VoyageTeamMember[]
9393
teamTechStackItems TeamTechStackItem[]
94+
techStackCategory TechStackCategory[]
9495
teamMeetings TeamMeeting[]
9596
FormResponseVoyageProject FormResponseVoyageProject?
9697
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
export default [
1+
export const techStackCategoriesData = [
22
{
33
name: "Frontend",
44
description: "Frontend Stuff",
5+
voyageTeamId: 1,
56
},
67
{
78
name: "CSS Library",
89
description: "CSS Library",
10+
voyageTeamId: 1,
911
},
1012
{
1113
name: "Backend",
1214
description: "Backend Stuff",
15+
voyageTeamId: 1,
1316
},
1417
{
1518
name: "Project Management",
1619
description: "project management Stuff",
20+
voyageTeamId: 1,
1721
},
1822
{
1923
name: "Cloud Provider",
2024
description: "cloud stuff",
25+
voyageTeamId: 1,
2126
},
2227
{
2328
name: "Hosting",
2429
description: "Hosting stuff",
30+
voyageTeamId: 1,
2531
},
2632
];

prisma/seed/forms/solo-project.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ export const populateSoloProjectForm = async () => {
3232
text: "Deployed Url",
3333
answerRequired: true,
3434
},
35+
{
36+
order: 3,
37+
inputType: {
38+
connect: {
39+
name: "radio",
40+
},
41+
},
42+
text: "Tier",
43+
answerRequired: true,
44+
},
3545
],
3646
},
3747
},

prisma/seed/responses/helper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ export const populateQuestionResponses = async (
165165
}
166166
case "teamMembersCheckbox": {
167167
if (teamMemberId === 0) {
168-
console.log(question);
169168
throw new Error(
170169
`teamMemberId required for input type ${question.inputType.name} (question id:${question.id}).`,
171170
);

prisma/seed/seed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const deleteAllTables = async () => {
3434

3535
export const seed = async () => {
3636
await deleteAllTables();
37-
await populateTables(); // tables with no relations
37+
await populateTables(); //tables with no relations
3838
await populateVoyages();
3939
await populateUsers();
4040
await populateSprints();

prisma/seed/solo-project.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export const populateSoloProjects = async () => {
2424
select: {
2525
id: true,
2626
questions: {
27+
orderBy: {
28+
order: "asc",
29+
},
2730
select: {
2831
id: true,
2932
},
@@ -58,10 +61,12 @@ export const populateSoloProjects = async () => {
5861
createMany: {
5962
data: [
6063
{
64+
authorId: users[1].id,
6165
content: "This is a tier 2 project, not tier 3",
6266
type: "SoloProject",
6367
},
6468
{
69+
authorId: users[2].id,
6570
content: "ok",
6671
parentCommentId: 1,
6772
type: "SoloProject",
@@ -123,5 +128,64 @@ export const populateSoloProjects = async () => {
123128
},
124129
});
125130

131+
// Solo Project 3 (with option choices)
132+
const responseGroup3 = await prisma.responseGroup.create({
133+
data: {
134+
responses: {
135+
createMany: {
136+
data: [
137+
{
138+
questionId: soloProjectForm!.questions[0].id,
139+
text: "www.github.com/repo3",
140+
},
141+
{
142+
questionId: soloProjectForm!.questions[1].id,
143+
text: "www.vercel.com/3",
144+
},
145+
{
146+
questionId: soloProjectForm!.questions[2].id,
147+
optionChoiceId: 44,
148+
},
149+
],
150+
},
151+
},
152+
},
153+
});
154+
155+
await prisma.soloProject.create({
156+
data: {
157+
userId: users[6].id,
158+
evaluatorUserId: users[3].id,
159+
evaluatorFeedback: passedSampleFeedback,
160+
statusId: (await prisma.soloProjectStatus.findUnique({
161+
where: {
162+
status: "Requested Changes",
163+
},
164+
}))!.id,
165+
formId: soloProjectForm!.id,
166+
responseGroupId: responseGroup3.id,
167+
},
168+
});
169+
170+
const statuses = await prisma.soloProjectStatus.findMany({});
171+
172+
for (let i = 0; i < 40; i++) {
173+
await prisma.soloProject.create({
174+
data: {
175+
userId: users[5].id,
176+
evaluatorUserId: users[2].id,
177+
evaluatorFeedback: passedSampleFeedback,
178+
statusId: (await prisma.soloProjectStatus.findUnique({
179+
where: {
180+
status: statuses[
181+
Math.floor(Math.random() * statuses.length)
182+
].status,
183+
},
184+
}))!.id,
185+
formId: soloProjectForm!.id,
186+
},
187+
});
188+
}
189+
126190
console.log("Solo projects populated.");
127191
};

prisma/seed/tables.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Genders from "./data/genders";
22
import Tiers from "./data/tiers";
33
import VoyageRoles from "./data/voyage-roles";
44
import VoyageStatus from "./data/voyage-status";
5-
import TechStackCategories from "./data/tech-stack-categories";
65

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

@@ -27,7 +26,6 @@ export const populateTables = async () => {
2726
await populateTable("role", Roles);
2827
await populateTable("voyageRole", VoyageRoles);
2928
await populateTable("voyageStatus", VoyageStatus);
30-
await populateTable("techStackCategory", TechStackCategories);
3129
await populateTable("featureCategory", FeatureCategories);
3230
await populateTable("formType", FormTypes);
3331
await populateTable("inputType", InputTypes);

0 commit comments

Comments
 (0)