PILOS icon indicating copy to clipboard operation
PILOS copied to clipboard

Default record agreement

Open q16marvin opened this issue 7 months ago • 3 comments

Type

  • Bugfix**
  • Feature
  • Documentation
  • Refactoring (e.g. Style updates, Test implementation, etc.)
  • Other (please describe):

Checklist

  • [x] Code updated to current develop branch head
  • [ ] Passes CI checks
  • [ ] Is a part of an issue
  • [ ] Tests added for the bugfix or newly implemented feature, describe below why if not
  • [ ] Changelog is updated
  • [ ] Documentation of code and features exists

Changes

  • added some profile settings to have default values for this 3 kinds of agreements: grafik

Other information

Summary by CodeRabbit

  • New Features
    • Added three new user consent options: Record Agreement, Record Video Agreement, and Record Attendance Agreement, available in user settings and profile.
    • These consent options are now displayed and editable within the user interface.
  • Improvements
    • User consent values are now shown in relevant dialogs and initialized from the current user's profile.
    • Language support for these options added in both English and German.
  • Bug Fixes
    • Ensured proper validation and saving of new consent fields when updating user settings.

q16marvin avatar Apr 28 '25 06:04 q16marvin

Walkthrough

Three new boolean user attributes—record_agreement, record_video_agreement, and record_attendance_agreement—were introduced throughout the application. The database schema was updated to include these fields with default values. The backend now validates, stores, and exposes these attributes in API responses. The user interface was extended to allow users and administrators to view and modify these settings, with localization support added for both English and German. Existing user update flows and resource representations were modified to handle these new consent-related fields.

Changes

Files / Areas Change Summary
app/Models/User.php, database/migrations/2025_03_30_213313_add_default-record-agreement.php Added record_agreement, record_video_agreement, and record_attendance_agreement as boolean fields to the User model and database, including fillable and cast attributes. Migration adds/removes columns with default false.
app/Http/Controllers/api/v1/UserController.php, app/Http/Requests/UserRequest.php Extended user update logic and validation to handle the three new boolean fields, conditionally updating and validating them if present in requests.
app/Http/Resources/User.php Modified resource output: removed initial_password_set, added the three new consent fields to API responses.
lang/en/admin.php, lang/de/admin.php Added translation keys and text for the new consent fields in both English and German admin language files.
lang/en/validation.php, lang/de/validation.php Added attribute labels for the new fields in validation language files for both English and German.
resources/js/components/UserTabOtherSettings.vue Added three new toggle switches for the consent fields in the user settings form, updated save logic to include them, and refreshed current user data if changed.
resources/js/components/RoomJoinButton.vue Initialized consent checkboxes from the authenticated user's properties, added profile links below checkboxes, and logged the user object for debugging.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant API
    participant DB

    User->>Frontend: Toggle consent fields in settings
    Frontend->>API: PATCH /users/{id} with consent fields
    API->>DB: Update user record with new consent values
    DB-->>API: Confirmation
    API-->>Frontend: Updated user resource (incl. consent fields)
    Frontend->>User: Show updated consent status
sequenceDiagram
    participant User
    participant Frontend
    participant API

    User->>Frontend: Opens profile/settings or join modal
    Frontend->>API: GET /users/me
    API-->>Frontend: User data with consent fields
    Frontend->>User: Show consent checkboxes/toggles pre-filled
✨ 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.

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.

coderabbitai[bot] avatar Apr 28 '25 06:04 coderabbitai[bot]

@q16marvin Thanks for your PR. However, we are planning to merge #1697, which includes several changes to the join dialog, etc. Just to let you know, there will be some changes required.

samuelwei avatar Apr 28 '25 07:04 samuelwei

@q16marvin Please rebase this PR, due to the changes of #1697 and add software tests. It might make sence to also add the new "streaming" consent

samuelwei avatar Apr 28 '25 15:04 samuelwei