Skip to content

Conversation

@LuisRodriguezLD
Copy link
Contributor

@LuisRodriguezLD LuisRodriguezLD commented Jan 6, 2026

Summary by CodeRabbit

  • New Features

    • Added a "Use Content Manager Plugin" toggle in General Settings and a default setting to enable it.
    • Calendar now fetches events dynamically and respects the Content Manager permission toggle.
  • Documentation

    • Added English, German, and Spanish translations for the new setting.
  • Chores

    • Updated Strapi dependency declarations to v5.24.2.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

Adds a Content Manager integration toggle and associated setting; calendar event fetching now conditionally queries the Content Manager collection-types endpoint with RBAC filtering when enabled, otherwise uses the public plugin endpoint. Includes translations and a settings default, plus a Strapi dependency version bump.

Changes

Cohort / File(s) Summary
Settings & Types
admin/src/utils/defaultSettings.ts, types.ts
Added contentManager: boolean to defaultSettings and SettingsType (default: true).
UI — Settings
admin/src/components/Settings/GeneralSettings.tsx
Added a Field.Visible toggle labeled view.settings.section.general.use-content-manager.*, bound to settings.contentManager, with hint and localized on/off labels; updates via updateField.
Calendar Fetching Logic
admin/src/pages/CalendarPage.tsx
Replaced static events URL with a fetchEvents function; when contentManager is enabled fetches /content-manager/collection-types/<collection> and maps results (RBAC-aware); otherwise calls public /<PLUGIN_ID>/ endpoint. Added useFetchClient usage and moment for end-time handling.
Internationalization
admin/src/translations/en.json, admin/src/translations/de.json, admin/src/translations/es.json
Added four keys under view.settings.section.general.use-content-manager: label, description, off, on for English, German, and Spanish locales.
Dependencies
package.json
Updated @strapi/strapi version in devDependencies and peerDependencies from ^5.0.0 to ^5.24.2.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant UI as Calendar UI
participant Settings as Settings Store
participant Client as Fetch Client
participant Server as Strapi API
participant CM as Content Manager API

Note over UI,Settings: User opens calendar (reads Settings)
UI->>Settings: read settings.contentManager
alt contentManager = true
UI->>Client: GET /content-manager/collection-types/?filters...
Client->>Server: request (with auth/RBAC)
Server->>CM: query collection (RBAC enforced)
CM-->>Server: collection items
Server-->>Client: mapped items (id,title,start,end,colors,url)
Client-->>UI: events array
else contentManager = false
UI->>Client: GET /<PLUGIN_ID>/?start=...&end=...
Client->>Server: request (public endpoint)
Server-->>Client: events array
Client-->>UI: events array
end
UI->>UI: render events in FullCalendar

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat/content-manager-api' clearly identifies the main feature being added - integration with the content manager API for the calendar plugin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53a6e2b and 2408c99.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • admin/src/pages/CalendarPage.tsx
  • package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • admin/src/pages/CalendarPage.tsx
  • package.json

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

Copy link

@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: 5

🧹 Nitpick comments (1)
admin/src/components/Settings/GeneralSettings.tsx (1)

274-306: The new Content Manager toggle is well-implemented.

The UI component follows the established pattern in this file, with proper internationalization and state management. The hint description clearly communicates the RBAC purpose.

🔎 Minor cleanup: Remove redundant empty Field.Hint

Line 304 renders an empty <Field.Hint /> component, which is redundant since the hint text is already provided via the hint prop on Field.Root (line 277). Consider removing this line for cleaner code.

           />
-          <Field.Hint />
         </Field.Root>
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56cfb92 and 53a6e2b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • admin/src/components/Settings/GeneralSettings.tsx
  • admin/src/pages/CalendarPage.tsx
  • admin/src/translations/de.json
  • admin/src/translations/en.json
  • admin/src/translations/es.json
  • admin/src/utils/defaultSettings.ts
  • package.json
  • types.ts
🧰 Additional context used
🧬 Code graph analysis (2)
admin/src/pages/CalendarPage.tsx (1)
admin/src/pluginId.ts (1)
  • PLUGIN_ID (1-1)
admin/src/components/Settings/GeneralSettings.tsx (1)
admin/src/utils/getTranslation.ts (1)
  • getTranslation (5-5)
🔇 Additional comments (8)
types.ts (1)

9-9: LGTM!

The addition of the contentManager boolean field to SettingsType is clean and consistent with the existing type structure.

admin/src/utils/defaultSettings.ts (1)

10-10: LGTM!

Setting contentManager to true by default is a sensible choice, as it ensures that users see only the content they have permissions for, aligning with RBAC best practices.

admin/src/translations/de.json (1)

37-40: Translation keys are consistently present across all language files.

All three language files (en.json, es.json, de.json) contain the four required Content Manager plugin translation keys (label, description, off, on) with appropriate formatting and localized content for each language.

admin/src/translations/en.json (1)

37-40: LGTM! Translation keys are well-structured.

The new translation keys follow the existing pattern and provide clear labels for the Content Manager plugin toggle feature.

admin/src/pages/CalendarPage.tsx (3)

24-24: LGTM! Proper use of useFetchClient.

The useFetchClient hook provides authenticated API calls, which is appropriate for fetching calendar events with RBAC enforcement.


227-227: LGTM! Correct usage of FullCalendar events prop.

Switching from a URL string to a function reference allows for dynamic event fetching based on the contentManager setting, which is the intended behavior for this feature.


168-168: The status filter logic is correct.

The concern is unfounded. When drafts is true, the status filter is undefined (showing all content including drafts), and when drafts is false, the status filter is 'published' (showing only published content). This aligns perfectly with the label "Display drafts" in the settings UI and the intended behavior of the toggle.

admin/src/translations/es.json (1)

37-40: LGTM! Spanish translations are accurate and consistent.

The Spanish translation keys are well-structured and align with the English translations, providing proper localization for the Content Manager plugin toggle feature.

@LuisRodriguezLD LuisRodriguezLD merged commit 19dd866 into develop Jan 6, 2026
2 checks passed
@LuisRodriguezLD LuisRodriguezLD deleted the feat/content-manager-api branch January 6, 2026 23:11
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.

2 participants