Skip to content

ECHO-193 Report notification permissions and language fix#127

Closed
ussaama wants to merge 2 commits intomainfrom
report-notification-permissions-and-language
Closed

ECHO-193 Report notification permissions and language fix#127
ussaama wants to merge 2 commits intomainfrom
report-notification-permissions-and-language

Conversation

@ussaama
Copy link
Copy Markdown
Contributor

@ussaama ussaama commented May 5, 2025

  • Added missing permissions for report notifications
  • Fixed translations

Summary by CodeRabbit

  • New Features

    • Introduced support for managing project report notification participants, including full API and GraphQL capabilities for creating, reading, updating, and deleting participant entries.
    • Added the ability to enable or disable report notifications for projects.
    • Extended quote functionality with an optional "embedding" field for enhanced metadata.
    • Added real-time updates for notification participants and aspects via subscriptions.
  • Localization

    • Expanded and updated translation files for English, German, Spanish, French, and Dutch, adding new UI strings and improving support for notification management features.
    • Updated translation metadata and references to align with codebase changes.

ussaama added 2 commits May 5, 2025 09:16
- Adjusted message IDs and context references in German, English, Spanish, French, and Dutch localization files to ensure accurate translations across various UI elements.
- Enhanced existing translations for clarity and consistency, particularly in ProjectChatRoute and related components.
- Updated references in localization files to reflect changes in the codebase, ensuring proper context management in conversation components.
- Introduced new GraphQL queries and mutations for managing project report notification participants, including create, read, update, and delete operations.
- Updated permissions configuration to include actions for the new collection.
- Enhanced OpenAPI specifications to document the new endpoints for project report notification participants.
- Added necessary types and filters in GraphQL and OpenAPI to support the new functionality, improving user engagement and notification management for project reports.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented May 5, 2025

Walkthrough

This change introduces a new collection, project_report_notification_participants, across the backend (permissions, GraphQL schema, OpenAPI spec) and the frontend (localization messages in multiple languages). The backend updates provide full CRUD support, field-level permissions, and real-time subscription events for the new collection, as well as new fields for notification subscription and quote embeddings in related entities. The frontend localization files are expanded with new UI strings for notification management, email handling, and user prompts, ensuring multilingual support for the new features.

Changes

Files/Paths Change Summary
echo/directus/sync/collections/permissions.json Added permissions for project_report_notification_participants collection: create (fields: email_opt_in, email, project_id), delete (all fields), and read (fields: email, email_opt_out_token, project_id, email_opt_in, id), all with _sync_default_public_policy.
echo/directus/sync/specs/item.graphql, echo/directus/sync/specs/system.graphql Added full GraphQL schema support for project_report_notification_participants and aspect entities: queries, mutations, subscriptions, aggregation, versioning, and input types. Added new fields to project, quote, and related types for notification subscription and embedding support.
echo/directus/sync/specs/openapi.json Added OpenAPI CRUD endpoints and schemas for project_report_notification_participants and aspect. Updated/renamed several endpoint paths and schemas for consistency. Added new fields to ItemsQuote (embedding) and ItemsProject (is_project_notification_subscription_allowed).
echo/frontend/src/locales/en-US.ts, .../de-DE.ts, .../es-ES.ts, .../fr-FR.ts, .../nl-NL.ts Expanded localization messages in English, German, Spanish, French, and Dutch with new keys and strings for email notification management, confirmation dialogs, error messages, and UI prompts. No changes to exports, only content updates.
echo/frontend/src/locales/en-US.po, .../de-DE.po, .../es-ES.po, .../fr-FR.po, .../nl-NL.po Updated translation source code references, reordered entries, and cleaned up metadata in PO files for all supported languages. No changes to translation text, only metadata and reference updates.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant API
    participant DB

    User->>Frontend: Submit email to subscribe to report notifications
    Frontend->>API: POST /items/project_report_notification_participants
    API->>DB: Create participant entry (fields: email, project_id, email_opt_in)
    DB-->>API: Entry created
    API-->>Frontend: Success response
    Frontend-->>User: Show confirmation (localized)

    User->>Frontend: Request to unsubscribe
    Frontend->>API: DELETE /items/project_report_notification_participants/{id}
    API->>DB: Delete participant entry
    DB-->>API: Entry deleted
    API-->>Frontend: Success response
    Frontend-->>User: Show unsubscribe confirmation (localized)
Loading

Possibly related PRs

  • ECHO-43 Project report notification feature #90: Implements backend email configuration and notification sending for project report notifications. Related at the feature level, as both PRs address project notification flows, but this PR focuses on permissions, schema, and frontend localization/UI.

Suggested reviewers

  • spashii

Poem

🚀
New features land with a multilingual cheer,
Notification flows are now crystal clear!
Emails managed, permissions set tight,
Subscriptions and embeddings, all working right.
From Dutch to French, the UI’s on point—
SF 100x vibes, let’s ship this joint!
LGTM.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ussaama ussaama requested a review from spashii May 5, 2025 09:55
@ussaama ussaama changed the title Report notification permissions and language fix ECHO-193 Report notification permissions and language fix May 5, 2025
@linear
Copy link
Copy Markdown

linear bot commented May 5, 2025

Copy link
Copy Markdown
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: 2

🧹 Nitpick comments (7)
echo/frontend/src/locales/fr-FR.ts (1)

1-1: LGTM – Optional: refine linting and parse approach
The file disables all ESLint rules at the top and uses a large JSON.parse string. Consider limiting the disable to specific lines or loading the messages as a static JSON import (typing it directly) to improve type safety and avoid runtime parsing overhead.

echo/directus/sync/specs/system.graphql (3)

2080-2091: Define Project Report Notification Participants Type
The new project_report_notification_participants type cleanly models the subscription entity. For clarity in schema introspection, consider adding a brief """…""" description above the type.


2982-2982: Allow Embeddings on Quote Creation
create_quote_input now accepts an embedding string. You may want to enforce a max length or validation rule to prevent oversized payloads or injection risks.


3735-3735: Filter Quotes by Embedding Field
Including embedding in quote_filter enables clients to query by vector data, but be mindful of performance—indexing or specialized search (e.g., PostgreSQL pgvector) may be needed for efficient queries.

echo/directus/sync/specs/openapi.json (1)

22557-22560: Add descriptive metadata for embedding.

The new embedding string field in ItemsQuote is fine, but consider adding a description to clarify its purpose (e.g., JSON vector embedding). Improves auto-generated docs. LGTM.

echo/directus/sync/specs/item.graphql (2)

1953-1964: Define project_report_notification_participants type
Core fields (date_submitted, date_updated, email, etc.) are correctly declared. Consider adding a relational field (project(filter: project_filter): project) if consumers need to traverse from a participant to its parent project.


3158-3167: Add input and filter types for project_report_notification_participants
The create_, update_, and filter input definitions cover all fields. If any fields (e.g., email) are required at creation, consider marking them non-null.

Also applies to: 3763-3776, 4236-4245

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a13d618 and ec1849c.

📒 Files selected for processing (14)
  • echo/directus/sync/collections/permissions.json (1 hunks)
  • echo/directus/sync/specs/item.graphql (22 hunks)
  • echo/directus/sync/specs/openapi.json (64 hunks)
  • echo/directus/sync/specs/system.graphql (10 hunks)
  • echo/frontend/src/locales/de-DE.po (17 hunks)
  • echo/frontend/src/locales/de-DE.ts (1 hunks)
  • echo/frontend/src/locales/en-US.po (16 hunks)
  • echo/frontend/src/locales/en-US.ts (1 hunks)
  • echo/frontend/src/locales/es-ES.po (17 hunks)
  • echo/frontend/src/locales/es-ES.ts (1 hunks)
  • echo/frontend/src/locales/fr-FR.po (17 hunks)
  • echo/frontend/src/locales/fr-FR.ts (1 hunks)
  • echo/frontend/src/locales/nl-NL.po (15 hunks)
  • echo/frontend/src/locales/nl-NL.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
echo/frontend/src/locales/en-US.ts (4)
echo/frontend/src/locales/fr-FR.ts (1)
  • messages (1-1)
echo/frontend/src/locales/es-ES.ts (1)
  • messages (1-1)
echo/frontend/src/locales/de-DE.ts (1)
  • messages (1-1)
echo/frontend/src/locales/nl-NL.ts (1)
  • messages (1-1)
echo/frontend/src/locales/nl-NL.ts (1)
echo/frontend/src/locales/en-US.ts (1)
  • messages (1-1)
🔇 Additional comments (75)
echo/frontend/src/locales/de-DE.po (13)

52-56: LGTM – Added new source reference for the {0} placeholder.
The extra #: src/components/project/ProjectPortalEditor.tsx:232 entry correctly maps the dynamic {0} string to its component.


127-130: LGTM – New reference for “Adding Context:”.
The updated line number in ProjectChatRoute.tsx:428 ensures the German translation stays in sync.


282-285: LGTM – Mapped “Basic (Essential tutorial slides)” to the correct source.
The added reference in ProjectPortalEditor.tsx:339 is accurate.


347-349: LGTM – Added source reference for “Citing the following sources”.
The new entry in Sources.tsx:21 keeps the translation metadata aligned.


528-531: LGTM – Added German translation for the “Dutch” language option.
“Niederländisch” is correct for the ProjectPortalEditor dropdown.


575-577: LGTM – Preserved the email placeholder email@work.com.
No change to the string itself—just metadata alignment.


688-690: LGTM – New error message mapping for retranscription failure.
“Fehler beim Hertranskribieren des Gesprächs…” matches the English source.


692-695: LGTM – Added mapping for email verification error.
The German text correctly reflects “Failed to verify email status.”


1076-1079: LGTM – Fallback tutorial absence message added.
“No tutorial (only Privacy statements)” is now correctly mapped.


1273-1275: LGTM – Added status translation for “Processing Transcript”.
The German “Transkript wird verarbeitet” is spot on.


1644-1647: LGTM – Mapped the “Spanish” language option.
“Spanisch” is the correct German label.


2059-2062: LGTM – Confirmation message for successful unsubscribe added.
“Sie haben sich erfolgreich abgemeldet.” fits perfectly.


2063-2066: LGTM – Prompt for recording another conversation added.
The German string is accurate and clear.

echo/frontend/src/locales/es-ES.po (11)

52-56: LGTM – Added new source reference for the {0} placeholder.
The extra #: src/components/project/ProjectPortalEditor.tsx:232 entry keeps the Spanish metadata in sync.


127-130: LGTM – New reference for “Adding Context:”.
The updated ProjectChatRoute.tsx:428 mapping is correct.


286-289: LGTM – Mapped “Basic (Essential tutorial slides)” entry.
The Spanish “Básico (Diapositivas esenciales del tutorial)” is correctly referenced.


351-354: LGTM – Added source reference for “Citar las siguientes fuentes”.
Aligns the translation with the Sources.tsx:21 component.


532-535: LGTM – Added Spanish translation for the “Dutch” language option.
“Holandés” is accurate for the dropdown.


579-582: LGTM – Preserved the placeholder email email@work.com.
The Spanish translation keeps the literal email intact.


692-694: LGTM – New error message mapping for retranscription failure.
“Error al retranscribir la conversación…” matches the source.


696-700: LGTM – Added mapping for email verification error.
The Spanish text is correct for “Failed to verify email status.”


1348-1351: LGTM – Added “Refresh” translation entry.
“Actualizar” fits the UI context.


2060-2062: LGTM – Confirmation for successful unsubscribe added.
“Has desuscribido con éxito.” is correct.


2064-2066: LGTM – Prompt for recording another conversation added.
“También puedes elegir registrar otra conversación.” is spot on.

echo/frontend/src/locales/fr-FR.po (5)

127-129: Source reference update looks solid

Clean reference update for translations to match the new line numbers in the codebase. Standard source mapping maintenance.


351-352: Placeholder email translation is properly repositioned

Translation key repositioning with updated source refs. Nice work keeping the translation metadata in sync.


669-674: File reference update correctly implemented

Proper reference updates for "Experimental" translation key. This maintains the localization system's integrity.


692-694: Solid reference updates for system messages

Updated references for retranscription and email verification status messages - aligned with code structure changes. These are critical system notifications for the user experience.

Also applies to: 696-700, 1461-1463


2060-2063: New unsubscribe message translation added correctly

The addition of "You have successfully unsubscribed" translation aligns perfectly with the PR objective of adding report notification permissions. This message is essential for notification subscription flow completion.

echo/frontend/src/locales/es-ES.ts (1)

1-1: Spanish translations properly implemented for notification system

The Spanish localization file has been comprehensively updated with all necessary translations for the notification system. Key translations like "Desuscribirse de Notificaciones", "E-mails añadidos", and subscription status messages are properly included. The minified format is appropriate for production.

The translations in this file perfectly complement the backend changes for project report notification participants mentioned in the PR objectives. All user-facing notification management flows now have complete Spanish language support.

echo/frontend/src/locales/en-US.po (5)

53-53: LGTM – Synced placeholder reference
You’ve added the new source reference for the {0} placeholder in ProjectPortalEditor.tsx. This ensures the translation key is tracked for the new component.


132-134: LGTM – Added “Adding Context:” entry
Introduced the new translation key for “Adding Context:” at the correct code location. Everything looks in order.


303-305: LGTM – Added basic tutorial slides key
The “Basic (Essential tutorial slides)” message has been included with its source reference. Good to have this new UI string localized.


557-559: LGTM – Added language option “Dutch”
The new “Dutch” entry is properly inserted with the correct reference. Translation metadata stays consistent.


605-606: LGTM – Added placeholder email
New placeholder entry for "email@work.com" has been added to support the email subscription UI.

echo/directus/sync/collections/permissions.json (1)

94-135: LGTM! Solid permission structure for notification participants collection.

The new permissions for project_report_notification_participants are well-crafted and follow the established patterns in the codebase. The public sync policy with appropriate field-level permissions enables the notification subscription flow while maintaining proper security boundaries. Create/read/delete operations cover the full lifecycle for notification subscriptions.

echo/frontend/src/locales/nl-NL.ts (6)

1-1: LGTM! Dutch translation file looks comprehensive and properly structured.

The localization file follows best practices with appropriate key-value mapping structure, and includes all necessary translations for the report notification system. The translation quality is high with natural Dutch phrasing that maintains proper context.


132-132: Keys like "G3dSLc" suggest a strong i18n architecture.

Translation for "Berichtsbenachrichtigingen inschakelen" (Enable report notifications) aligns perfectly with the new notification permissions functionality. The key-based approach prevents string duplication issues and ensures consistent translations throughout the app.


133-133: Translation for notification feature description is well-articulated.

The Dutch copy for explaining the notification feature is clear and maintains the same meaning as other language versions while using natural Dutch sentence structure.


417-417: Notification report key "hIQOLx" translation is spot on.

"Rapportmeldingen" is correctly translated to represent "Report Notifications" in Dutch, maintaining consistency with the feature terminology across the app.


486-486: Email removal functionality properly translated.

"E-mail verwijderen" accurately represents the "Remove Email" functionality needed for the notification subscription management workflow.


539-539: Unsubscribe translation matches the feature purpose.

"Afmelden" is the proper Dutch term for "Unsubscribe", maintaining semantic equivalence across languages for this critical notification feature.

echo/frontend/src/locales/de-DE.ts (1)

1-1: This localization update is 🚀 - adding new notification feature strings!

The German localization file has been updated with all the necessary strings for the new report notification features. The key translations like "Von Benachrichtigungen abmelden" (Unsubscribe from notifications) and "Berichtsbenachrichtigungen" (Report notifications) are all properly included.

echo/frontend/src/locales/nl-NL.po (2)

692-694: Nice work adding the Dutch email placeholder translation!

Good call adding the work email placeholder translation from "email@work.com" to "email@werk.com" in Dutch. This maintains consistency across the localization ecosystem.


817-820: Email verification status message implementation looks great!

The Dutch translation for "Failed to verify email status. Please try again." is correctly implemented. This is crucial for the notification subscription flow.

echo/frontend/src/locales/en-US.ts (1)

1-1: LGTM! Comprehensive notification strings implementation.

This file now includes all the necessary English strings for the new report notification features, including:

  • "Unsubscribe from Notifications"
  • "Added emails"
  • "Confirm Publishing"
  • "An email Notification will be sent..."
  • "This email is already in the list."
  • "This email is already subscribed to notifications."
  • "Thank you! We'll notify you when the report is ready."

These strings align perfectly with the new collection project_report_notification_participants and support the notification subscription flow.

echo/directus/sync/specs/system.graphql (7)

266-267: New Subscription Events for Project Report Notifications
LGTM! The project_report_notification_participants_mutated entry is correctly added and positioned before aspect_mutated. Ensure the server-side resolvers publish this event in sync with your Directus hooks.


2927-2927: Align Create Input with Project Type
You’ve added is_project_notification_subscription_allowed to create_project_input. Verify that the mutation resolver and database layer initialize this field (default to false if omitted) to prevent unexpected nulls.


4324-4324: Support Notification Subscription in Update Input
update_project_input now accepts is_project_notification_subscription_allowed. Confirm that partial updates respect this field and don’t reset it inadvertently when omitted in the payload.


3656-3656: Enable Filtering by Notification Subscription
Great addition to project_filter—including is_project_notification_subscription_allowed lets clients query projects by subscription preference. Ensure your GraphQL engine maps this filter to the underlying Boolean column.


2093-2097: Add Mutation Event Type for Project Report Notifications
The project_report_notification_participants_mutated type aligns with existing mutation events. Good to go!


2122-2122: Expose Embedding Field on Quote
Adding embedding: String to the quote type is spot-on for returning vector data. Double-check that resolvers populate this field (e.g., after embedding generation) and that clients handle it correctly.


4378-4378: Support Embedding Updates
update_quote_input can now update the embedding. Verify that omitting this field in a patch doesn’t nullify existing embeddings and that your update logic respects partial inputs.

echo/directus/sync/specs/openapi.json (11)

8307-8618: Consistent schema references for ItemsAspect.

All request bodies and responses now uniformly reference #/components/schemas/ItemsAspect. This consistency ensures the OpenAPI spec stays DRY and accurate across create, read (list & single), update (bulk & single), and delete operations. LGTM.


8343-8352: Approve ItemsAspect operation descriptions.

The summaries, descriptions, tags, and operationIds for List (readItemsAspect), Update Multiple, Delete Multiple, Retrieve Single, Update Single, and Delete Single operations are clear and conform to naming conventions. LGTM.

Also applies to: 8407-8414, 8476-8485, 8496-8502, 8560-8567, 8631-8638


8675-9025: Review ItemsAccount endpoints.

  • CRUD operation descriptions (Create, List, Update Multiple, Delete Multiple, Retrieve Single, Update Single, Delete Single) are accurate and follow the established pattern.
  • Ensure that the Tags and operationIds align with other collections.
    LGTM.

8694-9005: Consistent schema references for ItemsAccount.

All bulk and single create/update responses correctly reference #/components/schemas/ItemsAccount. This consistency avoids mismatch between API and schema definitions. LGTM.


9059-9412: Review ItemsAccountDirectusUsers endpoints.

Operation summaries, descriptions, tags, and operationIds for all CRUD paths are consistent and descriptive. These changes properly integrate the new collection into the API spec. LGTM.


9081-9392: Consistent schema references for ItemsAccountDirectusUsers.

All relevant request/response bodies uniformly reference #/components/schemas/ItemsAccountDirectusUsers. This keeps the spec aligned and reduces potential errors. LGTM.


9449-9799: Review ItemsView endpoints.

Create, List, Update Multiple, Delete Multiple, Retrieve Single, Update Single, and Delete Single operations all have clear summaries/descriptions and correct tags/operationIds. Consistency with other collections is spot on. LGTM.


9468-9779: Consistent schema references for ItemsView.

All endpoints for ItemsView now correctly reference #/components/schemas/ItemsView in their request and response bodies. This uniformity is excellent. LGTM.


18865-18873: Include new collection in components list.

The ItemsProjectReportNotificationParticipants entry is added alongside existing collections. Confirm collection order and that no duplicates exist. LGTM.


20924-21052: Validate schema definitions for new and existing collections.

  • ItemsProjectReportNotificationParticipants: fields (email, email_opt_in, email_opt_out_token, project_id, sort) and required id are correctly defined.
  • ItemsAspect: reintroduced schema matches expectations, including oneOf references for view_id and nested quote types.
    LGTM.

21284-21287: Approve new boolean field on ItemsAccount.

The is_project_notification_subscription_allowed boolean is added correctly with nullable: true. Ensure front-end and GraphQL layers support this field. LGTM.

echo/directus/sync/specs/item.graphql (11)

6-9: Add new Query entries for project_report_notification_participants
The Query type now supports listing (project_report_notification_participants), lookup by ID, aggregation, and versioned queries for the new collection—consistent with existing patterns. LGTM.


123-124: Add create mutations for project_report_notification_participants
The create_project_report_notification_participants_items and create_project_report_notification_participants_item mutations follow the established naming and parameter conventions.


125-126: Streamline Aspect CRUD & Subscription declarations
The create, update, delete, and subscription entries for aspect are now declared cleanly—duplicates were removed and naming aligns with other collections. LGTM.

Also applies to: 185-187, 270-271, 350-350


182-184: Add update mutations for project_report_notification_participants
The batch and single-item update mutations for project_report_notification_participants (items, batch, item) follow the existing schema conventions.


268-269: Add delete mutations for project_report_notification_participants
The delete_project_report_notification_participants_items and delete_project_report_notification_participants_item mutations are correctly named and parameterized for bulk and single-item deletion.


349-349: Add Subscription event for project_report_notification_participants
The project_report_notification_participants_mutated subscription event enables real-time updates on this collection.


1966-1977: Add aggregation types for project_report_notification_participants
The aggregated, aggregated_count, and aggregated_fields types mirror other collections, supporting grouping, counts, and numeric field aggregation (sort).

Also applies to: 1979-1988, 1990-1992


1994-1998: Add mutated payload type for project_report_notification_participants
The project_report_notification_participants_mutated type wraps event data consistently with other mutated payloads.


2495-2504: Define versioned type for project_report_notification_participants
The version snapshot type includes all scalar fields (id, project_id, dates, flags) following the versioning pattern.


1520-1520: Introduce is_project_notification_subscription_allowed across schema
The new boolean flag is added to project, its aggregated count, create_project_input, project_filter, and update_project_input. Consistent implementation—LGTM.

Also applies to: 1565-1565, 3125-3125, 3714-3714, 4203-4203


2050-2050: Add embedding support for quote
The embedding field is now available on the quote type, its aggregated count, versioned snapshot, create/update inputs, and filter. Ensure the database schema and resolvers are updated to store, retrieve, and filter on this new field.

Also applies to: 2084-2084, 2521-2521, 3200-3200, 3821-3821, 4278-4278

image_generation_model: String
is_conversation_allowed: Boolean!
is_get_reply_enabled: Boolean
is_project_notification_subscription_allowed: Boolean
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider Non-Nullable Notification Subscription Field
The project.is_project_notification_subscription_allowed is defined as Boolean, but similar flags (e.g., is_conversation_allowed) use Boolean!. To avoid null checks downstream, consider making this field non-nullable (Boolean!) with a default of false.

Comment on lines +7901 to 8299
"/items/project_report_notification_participants": {
"post": {
"summary": "Create an Item",
"description": "Create a new project_report_notification_participants item.",
"tags": [
"Items",
"ItemsProjectReportNotificationParticipants"
],
"operationId": "createItemsProjectReportNotificationParticipants",
"parameters": [
{
"$ref": "#/components/parameters/Meta"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
},
{
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
]
}
}
}
},
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"items": {
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
}
}
},
"get": {
"summary": "List Items",
"description": "List the project_report_notification_participants items.",
"tags": [
"Items",
"ItemsProjectReportNotificationParticipants"
],
"operationId": "readItemsProjectReportNotificationParticipants",
"security": [
{
"Auth": []
}
],
"parameters": [
{
"$ref": "#/components/parameters/Fields"
},
{
"$ref": "#/components/parameters/Limit"
},
{
"$ref": "#/components/parameters/Meta"
},
{
"$ref": "#/components/parameters/Offset"
},
{
"$ref": "#/components/parameters/Sort"
},
{
"$ref": "#/components/parameters/Filter"
},
{
"$ref": "#/components/parameters/Search"
}
],
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
},
"meta": {
"$ref": "#/components/schemas/x-metadata"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
}
}
},
"patch": {
"summary": "Update Multiple Items",
"description": "Update multiple project_report_notification_participants items at the same time.",
"tags": [
"Items",
"ItemsProjectReportNotificationParticipants"
],
"operationId": "updateItemsProjectReportNotificationParticipants",
"parameters": [
{
"$ref": "#/components/parameters/Fields"
},
{
"$ref": "#/components/parameters/Limit"
},
{
"$ref": "#/components/parameters/Meta"
},
{
"$ref": "#/components/parameters/Offset"
},
{
"$ref": "#/components/parameters/Sort"
},
{
"$ref": "#/components/parameters/Filter"
},
{
"$ref": "#/components/parameters/Search"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
},
{
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
]
}
}
}
},
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"items": {
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
}
}
}
}
}
}
}
},
"delete": {
"summary": "Delete Multiple Items",
"description": "Delete multiple existing project_report_notification_participants items.",
"tags": [
"Items",
"ItemsProjectReportNotificationParticipants"
],
"operationId": "deleteItemsProjectReportNotificationParticipants",
"responses": {
"200": {
"description": "Successful request"
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
}
},
"parameters": []
}
},
"/items/project_report_notification_participants/{id}": {
"get": {
"summary": "Retrieve an Item",
"description": "Retrieve a single project_report_notification_participants item by unique identifier.",
"tags": [
"Items",
"ItemsProjectReportNotificationParticipants"
],
"operationId": "readSingleItemsProjectReportNotificationParticipants",
"parameters": [
{
"$ref": "#/components/parameters/Fields"
},
{
"$ref": "#/components/parameters/Meta"
},
{
"$ref": "#/components/parameters/Version"
},
{
"name": "id",
"description": "Index of the item.",
"in": "path",
"required": true,
"schema": {
"oneOf": [
{
"type": "integer",
"description": "Incremental index of the item.",
"example": 1
},
{
"type": "string",
"description": "Unique identifier of the item.",
"example": "8cbb43fe-4cdf-4991-8352-c461779cec02"
}
]
}
}
],
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
},
"404": {
"$ref": "#/components/responses/NotFoundError"
}
}
},
"patch": {
"summary": "Update an Item",
"description": "Update an existing project_report_notification_participants item.",
"tags": [
"Items",
"ItemsProjectReportNotificationParticipants"
],
"operationId": "updateSingleItemsProjectReportNotificationParticipants",
"parameters": [
{
"$ref": "#/components/parameters/Fields"
},
{
"$ref": "#/components/parameters/Meta"
},
{
"name": "id",
"description": "Index of the item.",
"in": "path",
"required": true,
"schema": {
"oneOf": [
{
"type": "integer",
"description": "Incremental index of the item.",
"example": 1
},
{
"type": "string",
"description": "Unique identifier of the item.",
"example": "8cbb43fe-4cdf-4991-8352-c461779cec02"
}
]
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
}
}
},
"responses": {
"200": {
"description": "Successful request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"$ref": "#/components/schemas/ItemsProjectReportNotificationParticipants"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
},
"404": {
"$ref": "#/components/responses/NotFoundError"
}
}
},
"delete": {
"summary": "Delete an Item",
"description": "Delete an existing project_report_notification_participants item.",
"tags": [
"Items",
"ItemsProjectReportNotificationParticipants"
],
"operationId": "deleteSingleItemsProjectReportNotificationParticipants",
"responses": {
"200": {
"description": "Successful request"
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
},
"404": {
"$ref": "#/components/responses/NotFoundError"
}
},
"parameters": [
{
"name": "id",
"description": "Index of the item.",
"in": "path",
"required": true,
"schema": {
"oneOf": [
{
"type": "integer",
"description": "Incremental index of the item.",
"example": 1
},
{
"type": "string",
"description": "Unique identifier of the item.",
"example": "8cbb43fe-4cdf-4991-8352-c461779cec02"
}
]
}
}
]
}
},
"/items/aspect": {
"post": {
"summary": "Create an Item",
"description": "Create a new account item.",
"description": "Create a new aspect item.",
"tags": [
"Items",
"ItemsAccount"
"ItemsAspect"
],
"operationId": "createItemsAccount",
"operationId": "createItemsAspect",
"parameters": [
{
"$ref": "#/components/parameters/Meta"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Missing security requirements on new endpoints.

The project_report_notification_participants CRUD operations (post, single-get, patch, delete) lack explicit "security": [ { "Auth": [] } ] blocks. Without these, unauthenticated clients may create, read, update, or delete participants. Please add authentication requirements to each operation (or verify global security settings apply). LGTM otherwise.


Let’s verify if a global security block exists in the root of the OpenAPI spec:


🏁 Script executed:

#!/bin/bash
# Search for global security definitions in the OpenAPI file
rg -n '"security":' echo/directus/sync/specs/openapi.json | head -n 200

Length of output: 1040


Time to confirm global auth policy up top—rockets don’t launch without checking the launch codes. Let’s peek at the first 50 lines for a "security" block:


🏁 Script executed:

#!/bin/bash
# Check for global security requirement in the OpenAPI spec
head -n 50 echo/directus/sync/specs/openapi.json | rg -n '"security":'

Length of output: 72


Confirming global security presence in the spec’s header:


🏁 Script executed:

#!/bin/bash
# Check for global security block in the first 200 lines
head -n 200 echo/directus/sync/specs/openapi.json | rg -n '"security":'

Length of output: 73


Enforce Auth on project_report_notification_participants CRUD endpoints

There’s no global security block in the spec header, so any operation without its own security is public. Please add:

• echo/directus/sync/specs/openapi.json
/items/project_report_notification_participants:
• post
• patch
• delete
/items/project_report_notification_participants/{id}:
• get
• patch
• delete

…each with:

security:
  - Auth: []

LGTM otherwise—lock it down!

@ussaama ussaama closed this May 5, 2025
@ussaama
Copy link
Copy Markdown
Contributor Author

ussaama commented May 5, 2025

additional requirements need to be fulfilled

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.

1 participant