Skip to content

Answer:1 Projection (done refactoring of card component) - #1537

Open
jpaberzs wants to merge 1 commit into
tomalaforge:mainfrom
jpaberzs:projection-task
Open

Answer:1 Projection (done refactoring of card component)#1537
jpaberzs wants to merge 1 commit into
tomalaforge:mainfrom
jpaberzs:projection-task

Conversation

@jpaberzs

@jpaberzs jpaberzs commented Aug 25, 2026

Copy link
Copy Markdown

✅ Challenge Submission Checklist

  • You must refactor the CardComponent and ListItemComponent.
  • The @for must be declared and remain inside the CardComponent. You might be tempted to move it to the ParentCardComponent like TeacherCardComponent.
  • CardComponent should not contain any conditions.
  • CSS: try to avoid using ::ng-deep. Find a better way to handle CSS styling.

Summary by CodeRabbit

  • New Features
    • Redesigned city, student, and teacher displays with reusable cards and list items.
    • Added optimized images and customizable item templates.
    • Added controls to create random entries and delete existing entries.
    • Improved event handling for adding and removing items.
    • City data is now available for broader component interaction.

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

@jpaberzs is attempting to deploy a commit to the tomalaforge's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e380a98e-55e6-4564-88e5-508edff9160b

📥 Commits

Reviewing files that changed from the base of the PR and between c119b88 and 9c42dc8.

📒 Files selected for processing (7)
  • apps/angular/1-projection/src/app/component/city-card/city-card.component.ts
  • apps/angular/1-projection/src/app/component/student-card/student-card.component.ts
  • apps/angular/1-projection/src/app/component/teacher-card/teacher-card.component.ts
  • apps/angular/1-projection/src/app/data-access/city.store.ts
  • apps/angular/1-projection/src/app/model/card.model.ts
  • apps/angular/1-projection/src/app/ui/card/card.component.ts
  • apps/angular/1-projection/src/app/ui/list-item/list-item.component.ts
💤 Files with no reviewable changes (1)
  • apps/angular/1-projection/src/app/model/card.model.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The Angular projection example now uses shared projected templates for city, student, and teacher lists. CardComponent renders typed item templates and forwards add events. ListItemComponent emits delete events. Parent components manage store updates and entity-specific rendering.

Projected card lists

Layer / File(s) Summary
Shared projection and event API
apps/angular/1-projection/src/app/ui/card/card.component.ts, apps/angular/1-projection/src/app/ui/list-item/list-item.component.ts
CardComponent renders typed projected templates and forwards add events. ListItemComponent emits typed item IDs for deletion.
Student and teacher card integrations
apps/angular/1-projection/src/app/component/student-card/student-card.component.ts, apps/angular/1-projection/src/app/component/teacher-card/teacher-card.component.ts
Student and teacher cards provide typed signals, projected templates, optimized images, and store-backed add and delete handlers.
City card integration
apps/angular/1-projection/src/app/component/city-card/city-card.component.ts, apps/angular/1-projection/src/app/data-access/city.store.ts
The city card renders a projected city list, loads fetched cities, adds random cities, and deletes cities by ID. CityStore.cities is publicly accessible.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 9c42d

The refactor is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant StudentCardComponent
  participant CardComponent
  participant ListItemComponent
  participant StudentStore
  StudentCardComponent->>CardComponent: pass students and projected item template
  CardComponent->>ListItemComponent: render student id and name
  ListItemComponent->>StudentCardComponent: emit deleteItem with student ID
  StudentCardComponent->>StudentStore: delete student by ID
  CardComponent->>StudentCardComponent: emit addNewItem event
  StudentCardComponent->>StudentStore: add random student
Loading

Suggested reviewers: tomalaforge

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title starts with the required "Answer:1" prefix and clearly identifies the card component refactoring. The wording is somewhat awkward but remains concise and related to the main change.
Description check ✅ Passed The description includes the required refactoring checklist and addresses the @for location, the absence of conditions in CardComponent, and CSS styling without ::ng-deep. It is sufficient for the sta…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the required refactoring checklist and addresses the @for location, the absence of conditions in CardComponent, and CSS styling without ::ng-deep. It is sufficient for the stated objectives.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 exercice projection answer answer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant