-
-
Notifications
You must be signed in to change notification settings - Fork 313
Feat: Added URL for organization dashboard. #4128
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
Conversation
WalkthroughThe changes update the URL routing for organization-related views and adjust UI labels accordingly. In the URL configuration, the existing organization view path has been changed from Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Browser
participant DjangoRouter
participant DashboardView
User->>Browser: Click "Organization Dashboard" link
Browser->>DjangoRouter: GET /organization/dashboard/
DjangoRouter->>DashboardView: Route to dashboard_view
DashboardView->>DashboardView: Verify user is active and not anonymous
DashboardView->>DashboardView: Check organization membership and roles
alt Organization found and user authorized
DashboardView->>Browser: Redirect to organization analytics page
else No organization or unauthorized
DashboardView->>Browser: Redirect to login/registration with error message
end
Assessment against linked issues
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (3)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
website/views/company.py (1)
105-132: Add descriptive docstring to document the function's purpose.The new function lacks documentation explaining its purpose. Since this is part of a navigation feature, documenting how it contributes to the site navigation would improve maintainability.
Add a docstring to clarify the function's purpose:
def dashboard_view(request, *args, **kwargs): + """ + Handle requests to the organization dashboard URL. + + Verifies user authentication and organization membership, then redirects to + the organization analytics page for the user's organization. + """ user = request.user
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
blt/urls.py(2 hunks)website/templates/includes/header.html(1 hunks)website/templates/includes/navbar.html(1 hunks)website/templates/sitemap.html(1 hunks)website/views/company.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
blt/urls.py (1)
website/views/company.py (2)
dashboard_view(105-131)Organization_view(77-102)
website/views/company.py (1)
website/models.py (2)
Organization(135-231)Domain(241-340)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Run Tests
- GitHub Check: docker-test
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
website/templates/includes/navbar.html (1)
183-190: Great addition of separate navigation items for organization view and dashboard.The changes improve navigation by clearly distinguishing between viewing an organization's details and accessing its dashboard functionality. This separation makes the UI more intuitive and aligns well with the PR objectives.
website/templates/sitemap.html (1)
640-641: Navigation link properly updated for consistency.The sitemap link has been correctly updated to point to the new organization dashboard route, maintaining consistency with the navigation changes in other templates.
website/templates/includes/header.html (1)
609-618: Navigation options properly updated in the header dropdown.The changes mirror those made in the navbar, providing consistent navigation options across the application. Good use of appropriate icons for each option, with "fa-building" for viewing the organization and "fa-gauge" for the dashboard.
blt/urls.py (2)
72-72: Import correctly added for the new dashboard view function.The dashboard_view function has been properly imported from the company.py module.
815-816: URL paths correctly configured for separate organization views.The changes create a clear separation between:
- Viewing organization details (
organization/view)- Accessing the organization dashboard (
organization/dashboard/)This matches the UI changes in the templates and improves the URL structure of the application. The functions are properly mapped to their respective URL names, allowing for consistent reverse URL lookups throughout the application.
website/views/company.py (1)
105-132:Details
❓ Verification inconclusive
Verify that the "organization_analytics" URL pattern exists and accepts an 'id' parameter.
The function redirects to
organization_analyticswith anidparameter. Make sure this URL pattern is defined correctly in the URL configuration file.
🏁 Script executed:
#!/bin/bash # Verify URL pattern for organization_analytics exists in urls.py files # Search for the organization_analytics URL pattern definition rg -r "path\(.*organization_analytics.*" --include="*.py" -A 3Length of output: 506
URL Pattern Check for "organization_analytics"
The redirection in
dashboard_viewuses the URL name "organization_analytics" with anidparameter. Please ensure that:
- The URL pattern is defined in one of your
urls.pyfiles.- It correctly accepts an
idparameter (e.g., using a path converter like<int:id>).Run the provided command to verify the URL configuration. If you find that the URL pattern is missing or not correctly configured, please update the URL config accordingly.
🏁 Script executed:
#!/bin/bash # Verify the "organization_analytics" URL pattern exists in urls.py files. # This command searches for the pattern definition within files matching "*urls.py" rg 'path\(.*organization_analytics.*' -g '*urls.py' -A 3Length of output: 180
Action Required: Validate "organization_analytics" URL Pattern
Please manually verify that the URL pattern named
"organization_analytics"is defined in one of your project'surls.pyfiles and correctly accepts anidparameter (for example, using a converter like<int:id>). The automated searches did not return any definitive evidence of its existence, so a manual check is required to ensure the redirection indashboard_viewfunctions as expected.
Fixes #4097
Description:
This PR fixes a missing navigation element for the Organization Dashboard. Previously, there was no URL route or header button leading to the dashboard page.
Changes made:
Changes:
Summary by CodeRabbit
New Features
Refactor
Style