Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show dial in number for running meetings #1810

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

SamuelWei
Copy link
Collaborator

@SamuelWei SamuelWei commented Jan 23, 2025

Fixes #1143

Type

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

Checklist

  • 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

Other information

Summary by CodeRabbit

Release Notes

  • New Features

    • Added phone dial-in option for joining meetings
    • Introduced phone number and PIN display for ongoing meetings
    • Implemented QR code generation for phone join functionality
  • Configuration

    • Added configuration for invalid dial numbers
    • Expanded language support for phone-related actions
  • Database

    • Added new columns for dial number and voice bridge in meetings table
  • Dependencies

    • Added QR code and Vue integration libraries

@SamuelWei SamuelWei linked an issue Jan 23, 2025 that may be closed by this pull request
Copy link

coderabbitai bot commented Jan 23, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The pull request introduces a comprehensive feature for displaying dial-in information for running meetings. This includes adding database columns for dial numbers and voice bridges, creating a new configuration for invalid dial numbers, updating the room resource to handle dial-in information, and implementing a new Vue component for joining meetings by phone. The changes span across multiple files, integrating backend and frontend functionality to provide users with an alternative method to join meetings via phone.

Changes

File Change Summary
app/Http/Resources/Room.php Modified getLastMeeting method to return dial-in information for ongoing meetings
app/Services/RoomService.php Updated start method to capture dial_number and voice_bridge from meeting creation response
config/bigbluebutton.php Added invalid_dial_numbers configuration array
database/migrations/... New migration to add dial_number and voice_bridge columns to meetings table
lang/en/rooms.php Added new translation keys for phone-related join functionality
package.json Added @vueuse/integrations and qrcode dependencies
resources/js/components/RoomJoinByPhoneButton.vue New Vue component for phone-based room joining
resources/js/views/RoomsView.vue Added conditional rendering of phone join button

Sequence Diagram

sequenceDiagram
    participant User
    participant Frontend
    participant MeetingService
    participant Database

    User->>Frontend: Start Meeting
    Frontend->>MeetingService: Create Meeting
    MeetingService-->>Frontend: Meeting Response with Dial-in Info
    Frontend->>Database: Save Meeting with Dial-in Details
    Frontend->>User: Display Phone Join Option
    User->>Frontend: Click Phone Join
    Frontend->>User: Show Dial Number, PIN, QR Code
Loading

Assessment against linked issues

Objective Addressed Explanation
Capture dial-in number and pin
Save in the database
Show in frontend if not invalid number
Provide link to click
Generate QR code

🪧 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. (Beta)
  • @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.

@SamuelWei SamuelWei force-pushed the 1143-show-dial-in-number-for-running-meetings branch from 01fe74c to a79e92b Compare January 23, 2025 08:53
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 81.47%. Comparing base (f4b7102) to head (b2a0adf).

Files with missing lines Patch % Lines
resources/js/components/RoomJoinByPhoneButton.vue 0.00% 8 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1810      +/-   ##
=============================================
- Coverage      81.52%   81.47%   -0.06%     
- Complexity      1410     1411       +1     
=============================================
  Files            364      365       +1     
  Lines           9548     9563      +15     
  Branches         867      867              
=============================================
+ Hits            7784     7791       +7     
- Misses          1764     1772       +8     

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

Copy link

cypress bot commented Jan 23, 2025

PILOS    Run #1755

Run Properties:  status check passed Passed #1755  •  git commit b2a0adf33a: Show dial in number for running meetings
Project PILOS
Branch Review 1143-show-dial-in-number-for-running-meetings
Run status status check passed Passed #1755
Run duration 09m 33s
Commit git commit b2a0adf33a: Show dial in number for running meetings
Committer Samuel Weirich
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 240
View all changes introduced in this branch ↗︎

@SamuelWei SamuelWei force-pushed the 1143-show-dial-in-number-for-running-meetings branch from a79e92b to d7195ec Compare January 23, 2025 10:44
@SamuelWei
Copy link
Collaborator Author

@coderabbitai review

Copy link

coderabbitai bot commented Jan 23, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 2

🧹 Nitpick comments (4)
database/migrations/2024_06_12_171150_add_dial_in_to_meetings_table.php (1)

14-17: Consider adding an index for the dial_number column.

Since the dial_number will likely be used in queries to check for invalid numbers and duplicates, adding an index could improve query performance.

 Schema::table('meetings', function (Blueprint $table) {
     $table->string('dial_number')->nullable();
     $table->integer('voice_bridge')->nullable();
+    $table->index('dial_number');
 });
resources/js/components/RoomJoinByPhoneButton.vue (1)

85-89: Improve phone number validation and formatting.

The current validation only removes non-digits and '+'. Consider:

  1. Using a proper phone number validation library
  2. Formatting the number consistently for display
 const link = computed(() => {
-  // Remove all chars that are not digits or '+'
-  const cleanNumber = props.number.replace(/[^0-9+]/g, "");
+  // Use libphonenumber-js for validation and formatting
+  const phoneNumber = parsePhoneNumber(props.number);
+  if (!phoneNumber?.isValid()) return '';
+  const cleanNumber = phoneNumber.format('E.164');
   return `tel:${cleanNumber},${props.pin}#`;
 });
app/Http/Resources/Room.php (1)

85-88: Optimize configuration access.

Consider caching the invalid dial numbers configuration to avoid repeated file reads.

+ private $invalidDialNumbers;
+
+ public function __construct($resource)
+ {
+     parent::__construct($resource);
+     $this->invalidDialNumbers = config('bigbluebutton.invalid_dial_numbers');
+     // ... existing code ...
+ }

  'dial_in' => $this->when(
-   $latestMeeting->end == null && !in_array($latestMeeting->dial_number, config('bigbluebutton.invalid_dial_numbers')),
+   $latestMeeting->end == null && !in_array($latestMeeting->dial_number, $this->invalidDialNumbers),
    [
      'number' => $latestMeeting->dial_number,
      'pin' => $latestMeeting->voice_bridge,
    ]
  ),
app/Services/RoomService.php (1)

87-90: Consider adding error handling for dial-in properties.

The changes look good! The code correctly captures the meeting creation response and stores the dial-in information. However, consider adding null checks before accessing the dial-in properties to handle cases where the meeting service doesn't provide this information.

-            $meeting->dial_number = $createMeetingResponse->getDialNumber();
-            $meeting->voice_bridge = $createMeetingResponse->getVoiceBridge();
+            $meeting->dial_number = $createMeetingResponse->getDialNumber() ?? null;
+            $meeting->voice_bridge = $createMeetingResponse->getVoiceBridge() ?? null;

Also applies to: 105-106

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f4b7102 and d7195ec.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • app/Http/Resources/Room.php (1 hunks)
  • app/Services/RoomService.php (2 hunks)
  • config/bigbluebutton.php (1 hunks)
  • database/migrations/2024_06_12_171150_add_dial_in_to_meetings_table.php (1 hunks)
  • lang/en/rooms.php (1 hunks)
  • package.json (2 hunks)
  • resources/js/components/RoomJoinByPhoneButton.vue (1 hunks)
  • resources/js/views/RoomsView.vue (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Frontend Tests (5)
  • GitHub Check: Frontend Tests (4)
  • GitHub Check: Frontend Tests (3)
  • GitHub Check: Frontend Tests (2)
  • GitHub Check: Frontend Tests (1)
  • GitHub Check: Visual Tests
  • GitHub Check: System Tests
🔇 Additional comments (5)
resources/js/components/RoomJoinByPhoneButton.vue (1)

3-9: Great implementation of accessible UI elements!

The component makes good use of ARIA labels, tooltips, and semantic HTML elements.

app/Http/Resources/Room.php (1)

85-88: Well-implemented security check for dial-in information.

The code properly gates the dial-in information behind both meeting status and valid number checks.

resources/js/views/RoomsView.vue (1)

205-209: LGTM! Well-structured component integration.

The RoomJoinByPhoneButton component is properly integrated with appropriate conditional rendering and prop passing. The placement alongside other room control buttons maintains UI consistency.

lang/en/rooms.php (1)

268-275: LGTM! Complete translation coverage for phone features.

The translation strings are well-organized and provide comprehensive coverage for all phone-related UI elements. The structure aligns with the existing translation patterns.

package.json (1)

61-61: Verify security of new dependencies.

The new dependencies support the phone join feature. Let's verify their security status and latest versions.

Also applies to: 77-77

✅ Verification successful

Dependencies verified as secure and up-to-date

Both @vueuse/integrations (12.5.0) and qrcode (1.5.4) are actively maintained packages with no reported security advisories. The packages show recent updates and have established track records in the ecosystem.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for security advisories and latest versions of new dependencies

# Check npm for latest versions and security advisories
echo "Checking @vueuse/integrations..."
npm view @vueuse/integrations version
npm audit @vueuse/integrations

echo "Checking qrcode..."
npm view qrcode version
npm audit qrcode

Length of output: 950


Script:

#!/bin/bash
# Check GitHub security advisories and package stats
echo "Checking @vueuse/integrations..."
gh api /repos/vueuse/vueuse/security-advisories --jq 'length'
npm view @vueuse/integrations downloads last-month
npm view @vueuse/integrations time --json | jq -r '.modified,.created'

echo "Checking qrcode..."
gh api /repos/soldair/node-qrcode/security-advisories --jq 'length'
npm view qrcode downloads last-month
npm view qrcode time --json | jq -r '.modified,.created'

Length of output: 575

@@ -16,7 +16,7 @@
'room_refresh_rate' => (int) env('ROOM_REFRESH_RATE', 30),
'server_online_threshold' => (int) env('BBB_SERVER_ONLINE_THRESHOLD', 3),
'server_offline_threshold' => (int) env('BBB_SERVER_OFFLINE_THRESHOLD', 3),

'invalid_dial_numbers' => ['0', '613-555-1212', '613-555-1234', '0000'],
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Move invalid dial numbers to environment configuration.

The invalid dial numbers should be configurable via environment variables for better security and flexibility across different environments.

-    'invalid_dial_numbers' => ['0', '613-555-1212', '613-555-1234', '0000'],
+    'invalid_dial_numbers' => array_filter(explode(',', env('BBB_INVALID_DIAL_NUMBERS', '0,0000'))),

Also, consider removing specific area codes from the default configuration to avoid potential security implications of exposing geographic information.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'invalid_dial_numbers' => ['0', '613-555-1212', '613-555-1234', '0000'],
'invalid_dial_numbers' => array_filter(explode(',', env('BBB_INVALID_DIAL_NUMBERS', '0,0000'))),

Comment on lines +27 to +34
<InputText
class="text-overflow-ellipsis w-full border-0 shadow-none"
id="invitationLink"
:aria-label="$t('rooms.phone.number')"
readonly
:value="number"
/>
</IconField>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance security of sensitive information.

The phone number is directly exposed in the DOM. Consider masking it partially or implementing a reveal mechanism.

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.

Show dial-in number for running meetings
1 participant