feat: seed learning resources and implement competency<>resource UI#29
Conversation
- Add unique constraint on CompetencyRelationship to prevent duplicates - Add database indexes on CompetencyResourceLink foreign keys for performance - Make userId optional in CompetencyResourceLink with SetNull on delete - Add error logging and visibility in migration system - Move database docs to root as DATABASE.md - Sync package-lock.json with package.json (TypeScript 5.9.3) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Maximilian Anzinger <44003963+MaximilianAnzinger@users.noreply.github.com>
Co-authored-by: Maximilian Anzinger <44003963+MaximilianAnzinger@users.noreply.github.com>
…om:ls1intum/memo into feature/setup-domain-core-db-communication
There was a problem hiding this comment.
Pull request overview
This PR implements a comprehensive competency-resource mapping UI to support issue #24, enabling contributors to align learning resources with competencies. The implementation includes database schema updates, seed data for learning resources, new UI components for dual-mode mapping (competency-to-competency and competency-to-resource), and significant refactoring of the session page.
Changes:
- Added
ResourceMatchTypeenum andmatchTypefield toCompetencyResourceLinkmodel for quality categorization - Created reusable mapping components (
TypeSelectionButton,SkeletonCard,MappingCard) and a hover management hook - Refactored session page from ~1670 to ~900 lines with dual-mode support for mapping competencies and resources
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| prisma/schema.prisma | Added ResourceMatchType enum, matchType field, UNRELATED relationship type, and replaced unique constraint with separate indexes |
| prisma/seed.js | Added seed data for 5 learning resources with placeholder URLs |
| domain_core/model/domain_model.ts | Exported ResourceMatchType enum and added matchType to link interfaces |
| domain_core/services/learning_resource.ts | Added getRandomLearningResource method for fetching random resources |
| domain_core/repositories/dc_repo.ts | Updated repository to handle matchType field in link creation |
| hooks/useHoverWithTimeout.ts | New custom hook for debounced hover state management |
| components/session/session-constants.ts | Centralized configuration for relationship types, resource match types, colors, and icons |
| components/session/TypeSelectionButton.tsx | Reusable generic button component for type selection |
| components/session/SkeletonCard.tsx | Loading skeleton for card placeholders |
| components/session/MappingCard.tsx | Unified card component for displaying competencies and resources |
| components/ui/tooltip.tsx | Refactored to use portals for absolute positioning with improved positioning logic |
| components/ui/badge.tsx | Added missing React type import |
| components/navbar.tsx | Fixed activeIndex calculation and restructured "Start Contributing" button |
| components/footer.tsx | Converted anchor tags to Next.js Link components |
| app/session/page.tsx | Major refactor to support dual-mode mapping with keyboard shortcuts and improved UX |
| app/page.tsx | Fixed apostrophe encoding and simplified CSS class usage |
| app/layout.tsx | Added flexbox layout structure for better content flow |
| app/globals.css | Added custom scrollbar utility classes |
| docker/development/docker-compose.yml | Removed deprecated version field |
| app/actions/learning_resources.ts | Added getRandomLearningResourceAction server action |
| app/actions/competency_resource_links.ts | Added matchType parameter with validation logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
you should merge main on this branch |
🔍 Code Quality Report📊 Code Statistics🚨 Potential Issues✅ No console statements found |
🔍 Code Quality Report📊 Code Statistics🚨 Potential Issues✅ No console statements found |
🔍 Code Quality Report📊 Code Statistics🚨 Potential Issues✅ No console statements found |
🔍 Code Quality Report📊 Code Statistics🚨 Potential Issues✅ No console statements found |
1 similar comment
🔍 Code Quality Report📊 Code Statistics🚨 Potential Issues✅ No console statements found |
🔍 Code Quality Report📊 Code Statistics🚨 Potential Issues✅ No console statements found |
MaximilianAnzinger
left a comment
There was a problem hiding this comment.
Thx for resolving the minor conflict
Add initial seeding data and logic for learning resources to support development/demo workflows
Type of Change
Related Issues
Related to feat: implement competency-resource mapping UI #24
Changes Made
getRandomLearningResourceActionfor fetching random resources; addcreateCompetencyResourceLinkActionanddeleteCompetencyResourceLinkActionTesting
Test Cases
Manual Testing
Screenshots/Videos
Before
After