Skip to content

Commit cf8ef05

Browse files
committed
Merge branch 'stage'
2 parents 9eb17c9 + 718486d commit cf8ef05

File tree

195 files changed

+3682
-1753
lines changed

Some content is hidden

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

195 files changed

+3682
-1753
lines changed

.coderabbit.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-US"
3+
early_access: false
4+
reviews:
5+
profile: "chill"
6+
request_changes_workflow: false
7+
high_level_summary: false
8+
poem: false
9+
review_status: true
10+
collapse_walkthrough: true
11+
auto_review:
12+
enabled: true
13+
drafts: false
14+
chat:
15+
auto_reply: true

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- uses: actions/checkout@v4
1010
- uses: actions/setup-node@v4
1111
with:
12-
node-version: "21.0.0"
12+
node-version: "20.0.0"
1313
cache: "yarn"
1414

1515
- name: Install dependencies

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v21.0.0
1+
v20.14.0

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ They can also be given class names as shown in the above image.
144144

145145
```javascript
146146
<div
147-
className={classNames("w-1/3", "bg-primary", {
147+
className={classNames("w-1/3", "bg-brand", {
148148
"text-white": type === "default",
149149
underline: hasLink,
150150
})}

__mocks__/community.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Community } from "@/types/community";
2+
import { reward } from "./reward";
3+
import { colors } from "./colors";
4+
5+
6+
export const metadata = {
7+
invite_id: "abc123",
8+
submissions: 5,
9+
bestSubmissions: ["submission1", "submission2"],
10+
feedbacks: 10,
11+
name: "Project XYZ",
12+
issuedOn: "2024-01-29T12:00:00Z",
13+
image: "image_url",
14+
title: "Title of the project",
15+
description: "Description of the project",
16+
narrative: "Narrative of the project",
17+
recipientName: "John Doe",
18+
issuerName: "Jane Smith",
19+
comment: "This is a comment",
20+
linkToWork: "link_to_work",
21+
submission: "submission_details",
22+
};
23+
24+
export const community: Community = {
25+
id: "ew-43",
26+
ref: "community/ref",
27+
created_at: new Date("2022-05-01T12:00:00Z"),
28+
updated_at: new Date("2022-05-01T12:00:00Z"),
29+
summary: "this is the summary",
30+
icon: "public/img/communities/aeternity.svg",
31+
name: "aeternity",
32+
image: "public/img/communities/aeternity.svg",
33+
colors: colors,
34+
slug: "ae",
35+
active: true,
36+
description: "this is a aeternity community",
37+
metadata,
38+
timestamp: 182044800000,
39+
rewards: [reward],
40+
reward,
41+
courses: 3,
42+
duration: 4,
43+
can_mint_certificates: true,
44+
challenges: 3
45+
};

__mocks__/fixtures/bounty.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import { Bounty, BountyCourse } from "@/types/bounty";
2+
import { colors } from "./colors";
3+
import { mockMetadata } from "./community";
4+
5+
export const mockBountyCourse: BountyCourse = {
6+
duration: 0,
7+
slug: "intoduction-to-blockchain",
8+
active: false,
9+
id: "123",
10+
ref: "courses/123",
11+
created_at: new Date(),
12+
updated_at: new Date(),
13+
summary: "this is a course",
14+
level: 0,
15+
name: "introduction to blockchain",
16+
description: "",
17+
objectives: [],
18+
locale: "",
19+
community: "icp",
20+
introduction: {
21+
text: "Introduction",
22+
},
23+
certificateIcon: "",
24+
certificateData: {
25+
narrative: "",
26+
icon: "",
27+
},
28+
timestamp: 0,
29+
learningModules: [],
30+
translations: [],
31+
};
32+
export const mockBounty: Bounty = {
33+
url: "",
34+
image: undefined,
35+
id: "",
36+
ref: "",
37+
created_at: new Date().toISOString(),
38+
updated_at: new Date().toISOString(),
39+
icon: "",
40+
active: false,
41+
colors,
42+
description: "",
43+
summary: "",
44+
name: "",
45+
slug: "",
46+
metadata: mockMetadata,
47+
timestamp: 0,
48+
course: mockBountyCourse,
49+
challenge: "",
50+
reward: {
51+
id: "",
52+
ref: "",
53+
created_at: new Date(),
54+
updated_at: new Date(),
55+
challenge: "",
56+
type: "",
57+
community: "",
58+
token: "",
59+
stable: false,
60+
fiatCurrency: undefined,
61+
amount: 0,
62+
timestamp: 0,
63+
distribution: undefined,
64+
},
65+
community: "",
66+
};
67+
export const mockTrailer = {
68+
summary: "trailer summary",
69+
description: "trailer descriptio",
70+
video: "trailer video",
71+
duration: 4,
72+
info: {
73+
items: ["item 1", "item 2"],
74+
title: "info title",
75+
},
76+
};

__mocks__/fixtures/challenge.ts

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
import { mockFormat, mockCertificateData, mockCourse, mockLearningModule, mockRatingCriteria } from "./course";
2+
import { mockCommunity, mockMetadata } from "./community";
3+
import { reward } from "./reward";
4+
import { Evaluation, Submission } from "@/types/bounty";
5+
import { AdditionalInfo, Challenge } from "@/types/course";
6+
import { GRADING_CRITERIA, TEAM_FORMATION } from "@/constants/challengeInfo";
7+
import { Team, TeamMember } from "@/types/challenge";
8+
import { Feedback } from "@/types/feedback";
9+
import { mockUser } from "./user";
10+
11+
export const mockAdditionalInfo: { [type: string]: AdditionalInfo } = {
12+
type: { type: "additional type", text: "additional text" },
13+
};
14+
15+
export const challenge: Challenge = {
16+
id: "challenge",
17+
ref: "challenge ref",
18+
created_at: new Date("2022-05-01T12:00:00Z"),
19+
updated_at: new Date("2022-05-01T12:00:00Z"),
20+
hint: "Hint",
21+
name: "challenge name",
22+
format: mockFormat,
23+
description: "challenge description",
24+
course: mockCourse,
25+
type: "course",
26+
isTeamChallenge: false,
27+
objectives: ["objectives 1", "Objectives 2", "Objectives 3", "Objectives 4"],
28+
threshold: 8,
29+
community: mockCommunity,
30+
reviewTime: 9,
31+
metadata: mockMetadata,
32+
level: 58,
33+
courses: [mockCourse],
34+
learningModules: [mockLearningModule],
35+
expiresAt: "2025",
36+
reward: reward,
37+
certificateIcon: "certificate",
38+
certificateData: mockCertificateData,
39+
ratingCriteria: [mockRatingCriteria],
40+
timestamp: 6,
41+
maxPoints: 299,
42+
minPoints: 9,
43+
rewards: [reward],
44+
feedbacks: {},
45+
feedbackInfo: [{}],
46+
bestSubmissions: [{}],
47+
teamLimit: 5,
48+
isHackathon: false,
49+
additionalInfo: {
50+
[TEAM_FORMATION]: {
51+
type: "teamFormation",
52+
text: "Form your team details here",
53+
},
54+
[GRADING_CRITERIA]: { type: "teamFormation", text: "Sample grading criteria text" },
55+
},
56+
};
57+
export const evaluation: Evaluation = {
58+
evaluator: mockUser,
59+
created_at: new Date("2022-05-01T12:00:00Z"),
60+
comment: "comment",
61+
criteria: [],
62+
metadata: {
63+
language: "language",
64+
},
65+
points: 10,
66+
totalPoints: 1,
67+
reward: {
68+
amount: 10,
69+
token: "token",
70+
},
71+
};
72+
73+
export const submission: Submission = {
74+
length: 0,
75+
id: "submission_id",
76+
ref: "reference",
77+
created_at: new Date("2022-05-01T12:00:00Z"),
78+
updated_at: new Date("2022-05-01T12:00:00Z"),
79+
link: "/submissions/reference",
80+
community: mockCommunity,
81+
user_id: "user_id",
82+
challenge: challenge,
83+
text: "Submission",
84+
reviewDeadline: new Date(),
85+
metadata: {
86+
applicableReward: {
87+
ref: "",
88+
amount: 0,
89+
updated_at: "",
90+
challenge: "",
91+
created_at: "",
92+
id: "",
93+
type: "",
94+
community: "",
95+
timestamp: 0,
96+
token: "",
97+
},
98+
reviewed: false,
99+
feedbacks: 0,
100+
language: "",
101+
evaluation: {
102+
points: 8,
103+
reward: reward,
104+
score: 80,
105+
totalPoints: 10,
106+
},
107+
},
108+
evaluation: evaluation,
109+
timestamp: 0,
110+
user: mockUser,
111+
reviewable: false,
112+
status: "",
113+
reward: reward,
114+
map: () => {
115+
throw new Error("Function not implemented.");
116+
},
117+
};
118+
119+
export const mockInvite = {
120+
created_at: new Date().toISOString(),
121+
id: "invite",
122+
ref: "invitation ref",
123+
status: "invitation status",
124+
team_ref: "team reference",
125+
timestamp: 3,
126+
updated_at: new Date().toISOString(),
127+
user: mockUser,
128+
user_id: "user id",
129+
};
130+
131+
export const mockTeamMember: TeamMember = {
132+
created_at: new Date().toISOString(),
133+
id: "id",
134+
joined_on: "joined_on",
135+
ref: "ref",
136+
team_ref: "team reference",
137+
timestamp: 3,
138+
updated_at: new Date().toISOString(),
139+
user: mockUser,
140+
};
141+
142+
export const mockTeam: Team = {
143+
challenge: challenge,
144+
challenge_ref: "challenge ref",
145+
created_at: new Date().toISOString(),
146+
id: "id",
147+
locked: true,
148+
name: "Master",
149+
organizer: mockUser,
150+
organizer_id: "organizer id",
151+
invites: [mockInvite],
152+
members: [mockTeamMember],
153+
ref: "",
154+
timestamp: "",
155+
updated_at: new Date().toISOString(),
156+
};
157+
158+
export const mockFeedback: Feedback = {
159+
submission: submission,
160+
id: "234-4231243",
161+
ref: "feedbacks/234-4231243",
162+
created_at: new Date(),
163+
updated_at: "",
164+
criteria: ["criteria 1", "criteria 2"],
165+
positive: false,
166+
name: "The person who made a submission",
167+
challenge: "challenge name",
168+
timestamp: undefined,
169+
user: mockUser,
170+
ranking: 0,
171+
text: "I am providing a feedback",
172+
};
File renamed without changes.

__mocks__/fixtures/community.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { Community } from "@/types/community";
2+
import { colors } from "./colors";
3+
4+
export const mockMetadata = {
5+
invite_id: "abc123",
6+
submissions: 5,
7+
bestSubmissions: ["submission1", "submission2"],
8+
feedbacks: 10,
9+
name: "Project XYZ",
10+
issuedOn: "2024-01-29T12:00:00Z",
11+
image: "image_url",
12+
title: "Title of the project",
13+
description: "Description of the project",
14+
narrative: "Narrative of the project",
15+
recipientName: "John Doe",
16+
issuerName: "Jane Smith",
17+
comment: "This is a comment",
18+
linkToWork: "link_to_work",
19+
submission: "submission_details",
20+
};
21+
22+
const mockReward = {
23+
id: "123456789",
24+
ref: "ref123",
25+
created_at: new Date("2024-01-29T08:00:00Z"),
26+
updated_at: new Date("2024-01-29T08:30:00Z"),
27+
challenge: "Challenge Name",
28+
type: "SUBMISSION",
29+
community: "Community Name",
30+
token: "Token ID",
31+
stable: true,
32+
amount: 100,
33+
timestamp: 1643424000,
34+
};
35+
36+
export const mockCommunity: Community = {
37+
id: "ew-43",
38+
ref: "community/ref",
39+
created_at: new Date("2022-05-01T12:00:00Z"),
40+
updated_at: new Date("2022-05-01T12:00:00Z"),
41+
summary: "this is the summary",
42+
icon: "public/img/communities/aeternity.svg",
43+
name: "aeternity",
44+
image: "public/img/communities/aeternity.svg",
45+
colors: colors,
46+
slug: "ae",
47+
active: true,
48+
description: "this is a aeternity community",
49+
metadata: mockMetadata,
50+
timestamp: 182044800000,
51+
rewards: [mockReward],
52+
reward: mockReward,
53+
courses: 3,
54+
duration: 4,
55+
can_mint_certificates: true,
56+
challenges: 3,
57+
};

0 commit comments

Comments
 (0)