Skip to content

Commit

Permalink
resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajen07 committed May 6, 2024
2 parents 0ffaf9d + 61ddd65 commit 65f96ac
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Another example [here](https://co-pilot.dev/changelog)
- Updated response for route GET sprints/meetings/{meetingId} to include updatedAt for agendas [#140](https://github.com/chingu-x/chingu-dashboard-be/pull/140)
- Update test github actions workflow with timeout [#143](https://github.com/chingu-x/chingu-dashboard-be/pull/143)
- Refractor of all form title reference to use values from formTitle.ts [#145](https://github.com/chingu-x/chingu-dashboard-be/pull/145)
- Update/Add more form input types [#146](https://github.com/chingu-x/chingu-dashboard-be/pull/146)

### Fixed

Expand Down
14 changes: 13 additions & 1 deletion prisma/seed/data/input-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ export default [
{
name: "text",
},
{
name: "shortText",
},
{
name: "url",
},
{
name: "radio",
},
{
name: "radioIcon",
},
{
name: "radioGroup",
},
Expand All @@ -15,9 +24,12 @@ export default [
name: "number",
},
{
name: "yesNo",
name: "boolean",
},
{
name: "teamMembersCheckbox",
},
{
name: "scale",
},
];
12 changes: 6 additions & 6 deletions prisma/seed/forms/checkinform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const populateCheckinForm = async () => {
order: 4,
inputType: {
connect: {
name: "radio",
name: "radioIcon",
},
},
text: "How would you rate your team's progress right now?",
Expand All @@ -97,13 +97,13 @@ export const populateCheckinForm = async () => {
createMany: {
data: [
{
text: "We have had a good start!",
text: "{{greenRocket}} We have had a good start!",
},
{
text: "I'm nervous we won't finish",
text: "{{amberRocket}} I'm nervous we won't finish",
},
{
text: "It doesn't look good right now",
text: "{{redRocket}} It doesn't look good right now",
},
],
},
Expand Down Expand Up @@ -151,10 +151,10 @@ export const populateCheckinForm = async () => {
order: 5,
inputType: {
connect: {
name: "yesNo",
name: "boolean",
},
},
text: "Did you deploy to Production at the end of this Sprint",
text: "{{Yes,No}}Did you deploy to Production at the end of this Sprint",
answerRequired: true,
},
{
Expand Down
4 changes: 2 additions & 2 deletions prisma/seed/forms/voyage-project-submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export const populateVoyageSubmissionForm = async () => {
order: 8,
inputType: {
connect: {
name: "radio",
name: "scale",
},
},
text: "On a scale of 0-10, how likely are you to suggest Chingu to a friend or colleague?",
text: "{{Not Likely,Extremely Likely}}On a scale of 0-10, how likely are you to suggest Chingu to a friend or colleague?",
answerRequired: true,
optionGroup: {
create: {
Expand Down
7 changes: 5 additions & 2 deletions prisma/seed/responses/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export const populateQuestionResponses = async (
responseGroupId: responseGroupId,
};
switch (question.inputType.name) {
case "text": {
case "text":
case "shortText": {
await prisma.response.create({
data: {
...data,
Expand All @@ -81,6 +82,8 @@ export const populateQuestionResponses = async (
});
break;
}
case "scale":
case "radioIcon":
case "radio": {
const radioChoices = await getRandomOptionId(
question.optionGroupId,
Expand Down Expand Up @@ -174,7 +177,7 @@ export const populateQuestionResponses = async (
});
break;
}
case "yesNo": {
case "boolean": {
await prisma.response.create({
data: {
...data,
Expand Down

0 comments on commit 65f96ac

Please sign in to comment.