Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/apps/mentorship/api/internal/nodes/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ModuleNode:
@strawberry.field
def mentors(self) -> list[MentorNode]:
"""Get the list of mentors for this module."""
return self.mentors.all()
return self.mentors.order_by("github_user__login")
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated

@strawberry.field
def mentees(self) -> list[UserNode]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def mock_module_node():
"""Fixture for a mock ModuleNode instance."""
m = FakeModuleNode()

m.mentors.all.return_value = [MagicMock(), MagicMock()]
m.mentors.order_by.return_value = [MagicMock(), MagicMock()]
m.menteemodule_set.select_related.return_value.filter.return_value.values_list.return_value = [
"github_user_id_1",
"github_user_id_2",
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_module_node_mentors(self, mock_module_node):
"""Test the mentors resolver."""
mentors = mock_module_node.mock_mentors()
assert len(mentors) == 2
mock_module_node.mentors.all.assert_called_once()
mock_module_node.mentors.order_by.assert_called_once_with("github_user__login")

def test_module_node_mentees(self, mock_module_node):
"""Test the mentees resolver."""
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -482,3 +482,29 @@ select:disabled,
.chapter-map .leaflet-marker-shadow {
cursor: pointer !important;
}

/* MarkdownWrapper CSS */

.md-wrapper p {
margin: 0 0 16px;
}

.md-wrapper ul {
margin: 16px 0;
padding-left: 24px;
}

.md-wrapper ol {
margin: 16px 0;
padding-left: 24px;
}

.md-wrapper li {
margin-bottom: 8px;
}

.md-wrapper h1,
.md-wrapper h2,
.md-wrapper h3 {
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
margin: 24px 0 16px;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
2 changes: 1 addition & 1 deletion frontend/src/components/ModuleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const ModuleItem = ({
<div className="flex items-center justify-between">
<Link
href={`${pathname}/modules/${module.key}`}
className="text-start font-semibold text-gray-600 hover:underline dark:text-gray-300"
className="mr-2 min-w-0 flex-1 text-start font-semibold text-gray-600 hover:underline dark:text-gray-300"
>
<TruncatedText text={module?.name} />
</Link>
Expand Down
19 changes: 8 additions & 11 deletions frontend/src/components/ModuleForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
setFormData: React.Dispatch<React.SetStateAction<ModuleFormProps['formData']>>
onSubmit: (e: React.FormEvent) => void
loading: boolean
isEdit?: boolean

Check warning on line 42 in frontend/src/components/ModuleForm.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'isEdit' PropType is defined but prop is never used

See more on https://sonarcloud.io/project/issues?id=OWASP_Nest&issues=AZ8E_nsIRt_76T3rJjfZ&open=AZ8E_nsIRt_76T3rJjfZ&pullRequest=5059
title: string
submitText?: string
minDate?: string
Expand All @@ -60,7 +60,6 @@
onSubmit,
loading,
title,
isEdit,
submitText = 'Save',
minDate,
maxDate,
Expand Down Expand Up @@ -308,16 +307,14 @@
errorMessage={touched.projectId ? errors.projectId : undefined}
/>
</div>
{isEdit && (
<FormTextInput
id="module-mentor-logins"
label="Mentor GitHub Usernames"
placeholder="johndoe, jane-doe"
value={formData.mentorLogins}
onValueChange={(value) => handleInputChange('mentorLogins', value)}
className="w-full min-w-0 lg:col-span-2"
/>
)}
<FormTextInput
id="module-mentor-logins"
label="Mentor GitHub Usernames"
placeholder="johndoe, jane-doe"
value={formData.mentorLogins}
onValueChange={(value) => handleInputChange('mentorLogins', value)}
className="w-full min-w-0 lg:col-span-2"
/>
</div>
</section>

Expand Down