Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rinkitadhana
Copy link
Contributor

@rinkitadhana rinkitadhana commented Aug 11, 2025

fixes #4483

image

Summary by CodeRabbit

  • New Features

    • “Add New Domain” CTA in the header; per-domain actions: View, Edit, Delete with client-side confirmation and loading overlay; empty state with “Add Your First Domain.”
  • Style

    • Full redesign to a header-centric, card-based layout with responsive domain cards, logos or initial avatars, gradients, hover effects, and inline icons.
  • Usability

    • Domain URLs auto-normalized (https added if missing) and open in a new tab.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Walkthrough

Rewrites the organization_manage_domains.html template into a header- and card-based layout. Adds client-side delete confirmation with a loading overlay, per-item View/Edit/Delete actions, URL normalization for display, empty-state messaging, data-name/data-url attributes, and modernized gradients/styling; removes fixed external links.

Changes

Cohort / File(s) Summary
Template overhaul: manage domains UI
website/templates/organization/dashboard/organization_manage_domains.html
Replaced minimal fixed utility bar and plain list with a header + card grid UI; added “Add New Domain” CTA and inline SVGs; per-item View/Edit/Delete actions; delete confirmation dialog and full-screen loading overlay; empty-state ("No domains yet")+CTA; domain display URL normalization (prefix https if missing) and target _blank; domain logo or generated gradient avatar; data-name/data-url attributes and hover/translate effects; removed fixed GitHub/Figma links.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant B as Browser (UI)
  participant S as Server

  U->>B: Click "Delete" on a domain card
  B->>U: Show confirmation dialog "Are you sure...?"
  alt User confirms
    B->>B: Display full-screen loading overlay
    B->>S: Submit delete form (POST)
    S-->>B: Return success/redirect
    B->>U: Update page / navigate
  else User cancels
    B->>U: Dismiss dialog, no action
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective (issue) Addressed Explanation
Redesign Manage Domain Page — implement header/card-based layout, per-item actions, empty state, and updated visuals (#4483)
Add delete confirmation with clear warning and submit flow (#4483)
Ensure domain URLs display normalized (https) and open in new tab (#4483)

(Only objectives present in linked issue #4483 were evaluated.)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 1a1d8ae and 0530f56.

📒 Files selected for processing (1)
  • website/templates/organization/dashboard/organization_manage_domains.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • website/templates/organization/dashboard/organization_manage_domains.html
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Run Tests
  • GitHub Check: docker-test
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (javascript-typescript)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

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 generate unit tests to generate unit tests for 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.

Copy link
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 (4)
website/templates/organization/dashboard/organization_manage_domains.html (4)

52-53: Avoid lowercasing None values in data attributes and display

If domain.url is None, lower will stringify to "None". Use default_if_none first.

- data-url="{{ domain.url|lower }}">
+ data-url="{{ domain.url|default_if_none:''|lower }}">
- {{ domain.url }}
+ {{ domain.url|default_if_none:'' }}

Also applies to: 74-74


164-176: Improve accessibility of the loading overlay

Add dialog semantics and live region for screen readers.

-<div id="loadingOverlay"
-     class="hidden fixed inset-0 bg-gray-900 bg-opacity-50 z-50">
+<div id="loadingOverlay"
+     class="hidden fixed inset-0 bg-gray-900 bg-opacity-50 z-50"
+     role="dialog" aria-modal="true" aria-labelledby="loadingTitle">
   <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
-      <div class="bg-white rounded-lg p-6 flex items-center space-x-3">
+      <div class="bg-white rounded-lg p-6 flex items-center space-x-3" role="status" aria-live="polite">
         <svg class="animate-spin h-5 w-5 text-[#e74c3c]"
              fill="none"
              viewBox="0 0 24 24">
           <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
           <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
           </path>
         </svg>
-        <span class="text-gray-700">Loading...</span>
+        <span id="loadingTitle" class="text-gray-700">Loading...</span>
       </div>
   </div>
 </div>

51-51: Replace JS hover handlers with CSS utility classes

No need for JS listeners just to translate on hover; Tailwind utilities handle this more efficiently and accessibly.

-<div class="domain-item p-6 hover:bg-gray-50 transition-all duration-200"
+<div class="domain-item p-6 hover:bg-gray-50 transform transition-transform duration-200 hover:translate-x-1"
      data-name="{{ domain.name|lower }}"
      data-url="{{ domain.url|lower }}">

And remove the JS hover block:

-            // Add hover effects
-            const domainItems = document.querySelectorAll('.domain-item');
-            domainItems.forEach(item => {
-                item.addEventListener('mouseenter', function() {
-                    this.style.transform = 'translateX(4px)';
-                });
-                
-                item.addEventListener('mouseleave', function() {
-                    this.style.transform = 'translateX(0)';
-                });
-            });

Also applies to: 200-210


25-37: Consider internationalization for user-visible strings

Hard-coded English strings make localization harder. Wrap text in {% trans %} or {% blocktrans %}.

Examples:

  • Manage Domains, Organize and control your domain portfolio
  • All Domains
  • View, Edit, Delete
  • No domains yet, Get started by adding your first domain, Add Your First Domain

Also applies to: 47-47, 70-71, 94-95, 106-107, 124-125, 144-156

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 5f4ccd0 and 1a1d8ae.

📒 Files selected for processing (1)
  • website/templates/organization/dashboard/organization_manage_domains.html (1 hunks)
🔇 Additional comments (3)
website/templates/organization/dashboard/organization_manage_domains.html (3)

71-71: URL scheme normalization: keep as-is but ensure backend validation

Using slice:':4' == 'http' suffices for http/https. Ensure backend validation enforces proper URL formats to prevent invalid entries.

Do you already validate domain.url server-side (e.g., URLField with a validator)? If not, consider enforcing https?:// and stripping whitespace on save.


108-116: I didn’t find any delete_domain route in the main URLconfs, and our quick scan also didn’t locate an add_domain pattern—so it’s unclear whether a dedicated delete endpoint exists or if deletion is handled by the add view via _method. Please double-check your URL configuration for both:

• an add_domain pattern (to confirm where the form is posting today)
• a matching delete_domain (or similarly named) endpoint you can call directly

If neither exists, either introduce a proper delete URL or document that deletion is in-line via _method.


83-96: view_domain only requires domain.id
The URL in blt/urls.py (lines 889–892) is defined as:

path(
    "organization/domain/<int:pk>/",
    login_required(DomainView.as_view()),
    name="view_domain",
)

It only takes the single pk argument—no organization parameter is needed. The existing link

<a href="{% url 'view_domain' domain.id %}">

is correct; no changes required.

Likely an incorrect or invalid review comment.

@DonnieBLT DonnieBLT added this pull request to the merge queue Aug 11, 2025
Merged via the queue into OWASP-BLT:main with commit 1b1a408 Aug 11, 2025
13 checks passed
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.

Fix & Redesign: Manage Domain Page

2 participants