-
-
Notifications
You must be signed in to change notification settings - Fork 512
Improve Module Card: Show mentors/mentee avatars & change grid to 3 columns #3296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c1c0506
ba91a24
8810feb
bdc7793
a62451d
f34e381
db1deb7
87c96c4
845b5b4
3137ca5
b158ec3
9405c3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ import type { Module } from 'types/mentorship' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { formatDate } from 'utils/dateFormatter' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import EntityActions from 'components/EntityActions' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import Markdown from 'components/MarkdownWrapper' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import MenteeContributorsList from 'components/MenteeContributorsList' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { getSimpleDuration } from 'components/ModuleCard' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import TopContributorsList from 'components/TopContributorsList' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -88,6 +89,24 @@ const SingleModuleCard: React.FC<SingleModuleCardProps> = ({ module, accessLevel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label="Mentors" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {module.mentees?.length > 0 && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (pathname?.startsWith('/my/mentorship') ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <MenteeContributorsList | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| icon={HiUserGroup} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contributors={module.mentees} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxInitialDisplay={6} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label="Mentees" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| programKey={programKey} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| moduleKey={module.key} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TopContributorsList | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| icon={HiUserGroup} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contributors={module.mentees} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxInitialDisplay={6} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label="Mentees" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ))} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+92
to
+109
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's look at the SingleModuleCard.tsx file structure
cd frontend/src/components && head -120 SingleModuleCard.tsx | tail -50Repository: OWASP/Nest Length of output: 1395 🏁 Script executed: # Also get the full context of the component to understand prop types
cat -n frontend/src/components/SingleModuleCard.tsx | head -30Repository: OWASP/Nest Length of output: 1238 🏁 Script executed: # Find where SingleModuleCard is used
rg "SingleModuleCard" frontend/src --type tsx -A 2Repository: OWASP/Nest Length of output: 81 🏁 Script executed: # Check routes that contain '/my/mentorship'
find frontend/src -type f \( -name "*.tsx" -o -name "*.ts" \) -exec grep -l "/my/mentorship" {} \;Repository: OWASP/Nest Length of output: 804 🏁 Script executed: # Check complete SingleModuleCard implementation to see where programKey is used
cat -n frontend/src/components/SingleModuleCard.tsxRepository: OWASP/Nest Length of output: 4605 🏁 Script executed: # Look for how SingleModuleCard is used in pages
rg "SingleModuleCard" frontend/src/app -B 5 -A 5 --type tsRepository: OWASP/Nest Length of output: 36 🏁 Script executed: # Check MenteeContributorsList implementation
cat -n frontend/src/components/MenteeContributorsList.tsxRepository: OWASP/Nest Length of output: 3163 Guard admin mentee rendering when When accessing 🛠️ Suggested fix- {module.mentees?.length > 0 &&
- (pathname?.startsWith('/my/mentorship') ? (
+ {module.mentees?.length > 0 &&
+ (pathname?.startsWith('/my/mentorship') && programKey ? (
<MenteeContributorsList
icon={HiUserGroup}
contributors={module.mentees}
maxInitialDisplay={6}
label="Mentees"
programKey={programKey}
moduleKey={module.key}
/>
) : (
<TopContributorsList
icon={HiUserGroup}
contributors={module.mentees}
maxInitialDisplay={6}
label="Mentees"
/>
))}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.