Company member access group#1778
Conversation
Add mermaid.min.js to angular.json scripts so ngx-markdown can use the mermaid attribute, and add the required `provide: MERMAID_OPTIONS` key to satisfy the TypedValueProvider type constraint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…table Shows a CDK overlay popup on hover of the check_circle icon listing each connection (title + database name) and its groups for the member. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use Material font tokens for font-family/size and tighten gaps between connections. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds an interactive access popup to the company component's member table, displaying connection and group membership details. It introduces new TypeScript data models, updates the component template to use CDK overlay directives, adds CSS styling, and configures Mermaid build and markdown support. ChangesMember Access Popup Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Adds UI and model support for displaying a company member’s connection/group access details (via a hover popup), and adjusts Mermaid integration/configuration used by Markdown-rendered content.
Changes:
- Extend
CompanyMemberto include per-connection membership/group details (user_membership) and related model types. - Update the Company members table “Access” column to show a CDK overlay popup with connection + group information.
- Adjust Mermaid configuration for
ngx-markdownand add Mermaid as a global build script.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/styles.scss | Adds a blank line (no functional impact). |
| frontend/src/main.ts | Updates ngx-markdown Mermaid options provisioning. |
| frontend/src/app/models/company.ts | Adds membership/group model types and CompanyMember.user_membership. |
| frontend/src/app/components/company/company.component.ts | Imports CDK overlay directives for the new access popup. |
| frontend/src/app/components/company/company.component.html | Replaces access icons with a hover-triggered overlay showing access details. |
| frontend/src/app/components/company/company.component.css | Adds styling for the new access details popup. |
| frontend/angular.json | Adds Mermaid as a global script asset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| is_2fa_enabled: boolean; | ||
| role: CompanyMemberRole; | ||
| has_groups: boolean; | ||
| user_membership: CompanyMembershipConnection[]; |
| <mat-icon class="company-member-cell_accessed" fontSet="material-symbols-outlined" | ||
| #overlayOrigin="cdkOverlayOrigin" | ||
| cdkOverlayOrigin | ||
| (mouseenter)="element._popupOpen = true" | ||
| (mouseleave)="element._popupOpen = false">check_circle</mat-icon> | ||
| <ng-template | ||
| cdkConnectedOverlay | ||
| [cdkConnectedOverlayOrigin]="overlayOrigin" | ||
| [cdkConnectedOverlayOpen]="element._popupOpen" | ||
| [cdkConnectedOverlayPositions]="[ | ||
| { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 }, | ||
| { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 } | ||
| ]" | ||
| [cdkConnectedOverlayHasBackdrop]="false"> | ||
| <div class="access-popup" (mouseleave)="element._popupOpen = false"> |
| (mouseenter)="element._popupOpen = true" | ||
| (mouseleave)="element._popupOpen = false">check_circle</mat-icon> | ||
| <ng-template | ||
| cdkConnectedOverlay | ||
| [cdkConnectedOverlayOrigin]="overlayOrigin" | ||
| [cdkConnectedOverlayOpen]="element._popupOpen" | ||
| [cdkConnectedOverlayPositions]="[ | ||
| { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 }, | ||
| { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 } | ||
| ]" | ||
| [cdkConnectedOverlayHasBackdrop]="false"> | ||
| <div class="access-popup" (mouseleave)="element._popupOpen = false"> |
| <mat-icon class="company-member-cell_accessed" fontSet="material-symbols-outlined" | ||
| #overlayOrigin="cdkOverlayOrigin" | ||
| cdkOverlayOrigin | ||
| (mouseenter)="element._popupOpen = true" | ||
| (mouseleave)="element._popupOpen = false">check_circle</mat-icon> | ||
| <ng-template |
| "includePaths": ["node_modules/@brumeilde/ngx-theme/presets/material"] | ||
| }, | ||
| "scripts": [], | ||
| "scripts": ["node_modules/mermaid/dist/mermaid.min.js"], |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/app/components/company/company.component.html`:
- Around line 208-237: The access popup is only triggered by mouse events
(mouseenter/mouseleave) so add keyboard support by making the trigger icon
focusable (add tabindex) and handling focus/blur and keyboard events to toggle
element._popupOpen; specifically, update the mat-icon that uses overlayOrigin
and element._popupOpen to include tabindex and (focus)="element._popupOpen =
true", (blur)="element._popupOpen = false", and a (keydown) handler that opens
on Enter/Space and closes on Escape, and ensure the cdkConnectedOverlay has
appropriate aria attributes (aria-haspopup, aria-expanded bound to
element._popupOpen) so screen readers and keyboard users can open/close the
overlay created by cdkConnectedOverlay consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f5e7361a-412b-4167-ba43-4555c06cfe86
📒 Files selected for processing (7)
frontend/angular.jsonfrontend/src/app/components/company/company.component.cssfrontend/src/app/components/company/company.component.htmlfrontend/src/app/components/company/company.component.tsfrontend/src/app/models/company.tsfrontend/src/main.tsfrontend/src/styles.scss
| @if (element.has_groups) { | ||
| <mat-icon class="company-member-cell_accessed" fontSet="material-symbols-outlined" | ||
| #overlayOrigin="cdkOverlayOrigin" | ||
| cdkOverlayOrigin | ||
| (mouseenter)="element._popupOpen = true" | ||
| (mouseleave)="element._popupOpen = false">check_circle</mat-icon> | ||
| <ng-template | ||
| cdkConnectedOverlay | ||
| [cdkConnectedOverlayOrigin]="overlayOrigin" | ||
| [cdkConnectedOverlayOpen]="element._popupOpen" | ||
| [cdkConnectedOverlayPositions]="[ | ||
| { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 }, | ||
| { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 } | ||
| ]" | ||
| [cdkConnectedOverlayHasBackdrop]="false"> | ||
| <div class="access-popup" (mouseleave)="element._popupOpen = false"> | ||
| @for (conn of element.user_membership; track conn.id) { | ||
| <div class="access-popup__connection"> | ||
| <span class="access-popup__connection-title">{{ conn.title }}</span> | ||
| <span class="access-popup__connection-db">{{ conn.database }}</span> | ||
| @for (group of conn.groups; track group.id) { | ||
| <span class="access-popup__group">{{ group.title }}</span> | ||
| } | ||
| </div> | ||
| } | ||
| </div> | ||
| </ng-template> | ||
| } @else { | ||
| <mat-icon class="company-member-cell_not-accessed" fontSet="material-symbols-outlined">cancel</mat-icon> | ||
| } |
There was a problem hiding this comment.
Make the access popup keyboard-accessible.
The popup is currently mouse-only (mouseenter/mouseleave), so keyboard users can’t open or inspect access details.
Suggested minimal fix
- <mat-icon class="company-member-cell_accessed" fontSet="material-symbols-outlined"
+ <mat-icon class="company-member-cell_accessed" fontSet="material-symbols-outlined"
+ tabindex="0"
+ role="button"
+ aria-label="Show member access details"
`#overlayOrigin`="cdkOverlayOrigin"
cdkOverlayOrigin
(mouseenter)="element._popupOpen = true"
- (mouseleave)="element._popupOpen = false">check_circle</mat-icon>
+ (mouseleave)="element._popupOpen = false"
+ (focus)="element._popupOpen = true"
+ (blur)="element._popupOpen = false">check_circle</mat-icon>
- <div class="access-popup" (mouseleave)="element._popupOpen = false">
+ <div class="access-popup"
+ (mouseenter)="element._popupOpen = true"
+ (mouseleave)="element._popupOpen = false">📝 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.
| @if (element.has_groups) { | |
| <mat-icon class="company-member-cell_accessed" fontSet="material-symbols-outlined" | |
| #overlayOrigin="cdkOverlayOrigin" | |
| cdkOverlayOrigin | |
| (mouseenter)="element._popupOpen = true" | |
| (mouseleave)="element._popupOpen = false">check_circle</mat-icon> | |
| <ng-template | |
| cdkConnectedOverlay | |
| [cdkConnectedOverlayOrigin]="overlayOrigin" | |
| [cdkConnectedOverlayOpen]="element._popupOpen" | |
| [cdkConnectedOverlayPositions]="[ | |
| { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 }, | |
| { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 } | |
| ]" | |
| [cdkConnectedOverlayHasBackdrop]="false"> | |
| <div class="access-popup" (mouseleave)="element._popupOpen = false"> | |
| @for (conn of element.user_membership; track conn.id) { | |
| <div class="access-popup__connection"> | |
| <span class="access-popup__connection-title">{{ conn.title }}</span> | |
| <span class="access-popup__connection-db">{{ conn.database }}</span> | |
| @for (group of conn.groups; track group.id) { | |
| <span class="access-popup__group">{{ group.title }}</span> | |
| } | |
| </div> | |
| } | |
| </div> | |
| </ng-template> | |
| } @else { | |
| <mat-icon class="company-member-cell_not-accessed" fontSet="material-symbols-outlined">cancel</mat-icon> | |
| } | |
| `@if` (element.has_groups) { | |
| <mat-icon class="company-member-cell_accessed" fontSet="material-symbols-outlined" | |
| tabindex="0" | |
| role="button" | |
| aria-label="Show member access details" | |
| `#overlayOrigin`="cdkOverlayOrigin" | |
| cdkOverlayOrigin | |
| (mouseenter)="element._popupOpen = true" | |
| (mouseleave)="element._popupOpen = false" | |
| (focus)="element._popupOpen = true" | |
| (blur)="element._popupOpen = false">check_circle</mat-icon> | |
| <ng-template | |
| cdkConnectedOverlay | |
| [cdkConnectedOverlayOrigin]="overlayOrigin" | |
| [cdkConnectedOverlayOpen]="element._popupOpen" | |
| [cdkConnectedOverlayPositions]="[ | |
| { originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom', offsetY: -4 }, | |
| { originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top', offsetY: 4 } | |
| ]" | |
| [cdkConnectedOverlayHasBackdrop]="false"> | |
| <div class="access-popup" | |
| (mouseenter)="element._popupOpen = true" | |
| (mouseleave)="element._popupOpen = false"> | |
| `@for` (conn of element.user_membership; track conn.id) { | |
| <div class="access-popup__connection"> | |
| <span class="access-popup__connection-title">{{ conn.title }}</span> | |
| <span class="access-popup__connection-db">{{ conn.database }}</span> | |
| `@for` (group of conn.groups; track group.id) { | |
| <span class="access-popup__group">{{ group.title }}</span> | |
| } | |
| </div> | |
| } | |
| </div> | |
| </ng-template> | |
| } `@else` { | |
| <mat-icon class="company-member-cell_not-accessed" fontSet="material-symbols-outlined">cancel</mat-icon> | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@frontend/src/app/components/company/company.component.html` around lines 208
- 237, The access popup is only triggered by mouse events
(mouseenter/mouseleave) so add keyboard support by making the trigger icon
focusable (add tabindex) and handling focus/blur and keyboard events to toggle
element._popupOpen; specifically, update the mat-icon that uses overlayOrigin
and element._popupOpen to include tabindex and (focus)="element._popupOpen =
true", (blur)="element._popupOpen = false", and a (keydown) handler that opens
on Enter/Space and closes on Escape, and ensure the cdkConnectedOverlay has
appropriate aria attributes (aria-haspopup, aria-expanded bound to
element._popupOpen) so screen readers and keyboard users can open/close the
overlay created by cdkConnectedOverlay consistently.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary by CodeRabbit
Release Notes
New Features
Style
Chores