Skip to content

Conversation

@lodewiges
Copy link
Contributor

@lodewiges lodewiges commented Oct 13, 2024

combining dinsdag kring and woensdag kring in 1 category because all kringen are on Tuesday.

depended on csvalpha/amber-api#438
NEED TO BE MERGED AT THE SAME TIME

fixes #861 and #685

Summary by CodeRabbit

  • New Features

    • Users can save preferred activity categories via a new "Opslaan" control on the calendar subscription page.
  • Documentation

    • Calendar subscription guidance updated to note existing subscriptions update automatically (no manual re-add required).
  • Chores

    • Activity category labels consolidated and renamed (legacy labels removed or replaced) for clearer categorization.

@codecov
Copy link

codecov bot commented Oct 13, 2024

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.02%. Comparing base (050fab4) to head (cb4ed13).

Files with missing lines Patch % Lines
app/controllers/activities/ical.js 0.00% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging     #885      +/-   ##
===========================================
- Coverage    13.05%   13.02%   -0.03%     
===========================================
  Files          450      450              
  Lines         3117     3124       +7     
===========================================
  Hits           407      407              
- Misses        2710     2717       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DrumsnChocolate
Copy link
Contributor

can you ask someone else to review this? Maybe Maarten or Jesse?

@lodewiges lodewiges requested a review from ToMaarton January 19, 2025 13:48
@DrumsnChocolate
Copy link
Contributor

nvm I have already left my thoughts on csvalpha/amber-api#438

Copy link
Contributor

@DrumsnChocolate DrumsnChocolate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide not to follow the route of what I'm suggesting in csvalpha/amber-api#438 (comment), then this is approved

@lodewiges lodewiges marked this pull request as draft February 5, 2025 22:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Walkthrough

Consolidated and renamed activity categories in constants and fixtures, added icalCategories attribute to the User model, refactored the activities iCal controller to extend EditController and expose saveCategories, and updated the iCal template to use explicit this bindings, show generated URLs, and add a save button.

Changes

Cohort / File(s) Summary
Category Constants & Fixtures
app/constants.js, mirage/factories/activity.js
Replaced Dinsdagkring/Woensdagkring with Kring, renamed KiemgroepenGenootschapen, removed Curiositates; mirrored updates in Mirage activity factory.
User Model
app/models/user.js
Added @attr icalCategories; to store user-selected iCal categories.
iCal Controller
app/controllers/activities/ical.js
Controller now extends EditController; added saveCategories = () => { ... }; categoriesParams now returns an array of selected category values; iCalURL/webcalURL no longer append category params.
iCal Template
app/templates/activities/ical.hbs
Switched to this.activityCategoryOptions, this.webcalURL, this.iCalURL; added an "Opslaan" button wired to this.saveCategories; updated Dutch guidance text.

Sequence Diagram

sequenceDiagram
    participant User
    participant Template as "iCal Template"
    participant Controller as "ActivitiesIcalController"
    participant Model as "currentUser"
    participant API as "Backend"

    User->>Template: toggle category checkboxes
    Note over Template: selection tracked in controller state
    User->>Template: click "Opslaan"
    Template->>Controller: invoke saveCategories()
    Controller->>Model: set icalCategories = [selectedValues]
    Controller->>API: persist currentUser
    alt success
        API-->>Controller: success
        Controller->>Template: show confirmation
    else failure
        API-->>Controller: error
        Controller->>Template: show error
    end
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review app/controllers/activities/ical.js for correct inheritance, saveCategories implementation, and type change of categoriesParams.
  • Verify template bindings (this.*) match controller properties and actions.
  • Confirm app/models/user.js serialization and persistence of icalCategories.
  • Ensure constants and Mirage factory remain consistent with UI and any category-dependent logic.

Poem

🐰 I hopped through lists and names anew,
Kring and Genootschap in tidy view,
A little "Opslaan" — choices kept right,
Calendars whisper, through day and night,
Rabbit nods softly: "All set, goodnight." ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description lacks the required structure from the template, missing a proper 'Summary' section with UI changes/screenshots and incomplete 'Other information' section. Restructure the description to follow the template: add a comprehensive Summary section describing UI changes, include screenshots if applicable, and expand 'Other information' with details about the coordinated merge requirement and dependencies.
Title check ❓ Inconclusive The title refers to a real aspect of the change (cleaning/consolidating activity categories) but is overly broad and vague; it doesn't clearly convey the specific main change of combining Tuesday/Wednesday kringen into a single 'Kring' category. Consider a more specific title such as 'Consolidate Dinsdagkring and Woensdagkring into single Kring category' to better communicate the primary change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/agenda-clean

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 and usage tips.

@lodewiges lodewiges marked this pull request as ready for review November 3, 2025 23:02
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
app/controllers/activities/ical.js (1)

1-1: Reconsider extending EditController.

The ActivitiesIcalController now extends EditController, which provides submit/cancel actions, flash notices, and ModelSaveUtil designed for form editing workflows. However, this controller displays iCal settings and uses a custom saveCategories method that doesn't leverage the inherited functionality. Consider whether extending Controller is more appropriate, or clarify why the EditController's features are needed.

Also applies to: 8-8

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 050fab4 and 440ec7f.

📒 Files selected for processing (5)
  • app/constants.js (1 hunks)
  • app/controllers/activities/ical.js (3 hunks)
  • app/models/user.js (1 hunks)
  • app/templates/activities/ical.hbs (3 hunks)
  • mirage/factories/activity.js (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/controllers/activities/ical.js (1)
app/controllers/application/edit.js (1)
  • EditController (7-46)
🪛 GitHub Actions: Continuous Integration
app/templates/activities/ical.hbs

[error] 38-38: no-redundant-fn: 'fn' helpers without additional arguments are not allowed.

🪛 GitHub Check: Lint
app/templates/activities/ical.hbs

[failure] 38-38:
fn helpers without additional arguments are not allowed

app/controllers/activities/ical.js

[failure] 28-28:
Replace category with (category)


[failure] 27-27:
Replace category with (category)


[failure] 64-64:
Delete ⏎··⏎··


[failure] 57-57:
Insert ⏎······


[failure] 56-56:
Delete ··

🔇 Additional comments (7)
mirage/factories/activity.js (1)

14-27: LGTM!

The factory category options correctly align with the updated ActivityCategories constant, maintaining consistency between test data and production code.

app/templates/activities/ical.hbs (2)

10-11: LGTM!

The updated text improves clarity for users.


21-21: LGTM!

Explicit this. context binding improves code clarity and follows modern Ember conventions.

Also applies to: 59-59

app/controllers/activities/ical.js (2)

24-29: LGTM!

The updated categoriesParams getter correctly returns an array of selected category values, which aligns with the new persistence mechanism.


35-41: Verify backend support for category persistence.

The URLs no longer include category query parameters. This means the backend must now read the user's selected categories from the icalCategories attribute stored on the user model. Confirm that the corresponding backend changes (referenced in PR description: csvalpha/amber-api#438) are complete and deployed before merging this PR.

app/constants.js (1)

22-35: ActivityCategories and GroupKinds represent separate domain concepts and do not require synchronization.

ActivityCategories categorizes activities (Algemeen, Sociëteit, etc.), while GroupKinds classifies group types (bestuur, commissie, dispuut, etc.). The values 'kiemgroep' and 'curiositas' are legitimate group types unrelated to the activity categories being updated in this PR. No changes to GroupKinds are needed.

Likely an incorrect or invalid review comment.

app/models/user.js (1)

48-48: No changes needed. The code is correct as-is.

The icalCategories attribute requires no type annotation. Ember Data passes untyped @attr attributes through unchanged as JSON, and arrays serialize as JSON arrays by default without explicit type annotation. This approach aligns with the established pattern throughout the codebase, where many attributes (like foodPreferences, address, etc.) are declared without type annotations.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a53472 and 3ad7326.

📒 Files selected for processing (1)
  • app/controllers/activities/ical.js (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/controllers/activities/ical.js (1)
app/controllers/application/edit.js (1)
  • EditController (7-46)
🪛 ESLint
app/controllers/activities/ical.js

[error] 63-63: Insert ·

(prettier/prettier)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (3)
app/controllers/activities/ical.js (3)

1-1: LGTM: Extending EditController is appropriate.

The change to extend EditController provides the necessary flashNotice service for user feedback in the saveCategories method. This is a clean architectural decision.

Also applies to: 8-8


26-28: Public API change: categoriesParams now returns an array.

The getter now returns an array of selected category values instead of a query string. This is a breaking change, but appears intentional and coordinated with the template changes that use saveCategories to persist selections.


35-40: Verify backend coordination for icalCategories.

The iCal endpoint (/ical/activities?key=...&user_id=...) no longer includes category parameters in the URL. Instead, categories are now stored in the user model (icalCategories). The backend must be updated to read this user attribute and filter activities accordingly when generating the iCal feed. Since this is a frontend repository, confirm that corresponding changes exist in the amber-api repository and that the /ical/activities endpoint has been updated to apply the icalCategories filter.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cleaning up alpha agenda options cleaning up alpha agenda categories

3 participants