Skip to content

Comments

Feature : add create request card component - 2#1001

Merged
iamitprakash merged 2 commits intodevelopfrom
feature/create-request-card-2
May 21, 2025
Merged

Feature : add create request card component - 2#1001
iamitprakash merged 2 commits intodevelopfrom
feature/create-request-card-2

Conversation

@AnujChhikara
Copy link
Contributor

@AnujChhikara AnujChhikara commented May 18, 2025

Date: 18 May 2025

Developer Name: @AnujChhikara


Issue Ticket Number

Description

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
  • Note: these are final Changes after all the PRs of this request card merged
  • Extension Request
brave_Wvd4QGQdA8.mp4
brave_5ZdF3b4Crh.mp4
brave_6dHlJo2kGe.mp4
  • OOO and Onboarding Requests
brave_cMuGGLoJBQ.mp4
brave_UHzBMcVK3p.mp4

Test Coverage

Screenshot 1

image
image

Additional Notes

Test PR: #994

@AnujChhikara AnujChhikara self-assigned this May 18, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 18, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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.

Summary by CodeRabbit

  • New Features
    • Enhanced request card with interactive editing of request fields, including title, reason, and deadline.
    • Added real-time validation, loading indicators, and success/error feedback during updates.
    • Improved display of assignee information, committed hours, and task details.
    • Log entries are now dynamically appended to the request card for better tracking.
  • Bug Fixes
    • Improved fallback handling for missing user or assignee data.
  • Style
    • Updated card layout for clearer organization of header, task details, summary, and logs.

Walkthrough

The createRequestCardComponent function and its related helpers in components/request-card/script.js were refactored and expanded to integrate requestDetails data throughout the UI and logic. The update introduces detailed data binding, interactive editing, asynchronous updates, improved DOM structure, and enhanced input validation for request cards.

Changes

File(s) Change Summary
components/request-card/script.js Refactored createRequestCardComponent to use requestDetails for initializing UI and logic. Enhanced data flow by passing explicit properties to helpers. Added interactive editing, input validation, asynchronous update handling, optimistic UI updates, and error handling. Updated DOM construction for better organization and conditional rendering. Modified signatures of createRequestElements, createRequestCardHeader, and extended attributes in createAccordionContainer. Added helper functions for UI state management and log appending.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant RequestCardComponent
    participant Server

    User->>RequestCardComponent: Edit request fields & submit form
    RequestCardComponent->>RequestCardComponent: Validate inputs
    alt Invalid input
        RequestCardComponent-->>User: Show validation error
    else Valid input
        RequestCardComponent->>RequestCardComponent: Show spinner, disable UI, update card optimistically
        RequestCardComponent->>Server: updateExtensionRequest(data)
        alt Success
            Server-->>RequestCardComponent: Success response
            RequestCardComponent->>RequestCardComponent: Update data model, show success, append logs
            RequestCardComponent-->>User: Show updated card
        else Failure
            Server-->>RequestCardComponent: Error response
            RequestCardComponent->>RequestCardComponent: Revert changes, show error feedback, show error toast
            RequestCardComponent-->>User: Show error
        end
        RequestCardComponent->>RequestCardComponent: Clear spinner, enable UI, toggle accordion panel
    end
Loading

Possibly related PRs

Suggested reviewers

  • pankajjs
  • Achintya-Chatterjee
  • iamitprakash

Poem

In the land of code where requests abound,
A card grows smarter, with data all around.
Inputs now shimmer, spinners do spin,
Edits and updates, let the magic begin!
With logs and accordions, UI feels bright—
The dashboard hops forward, from morning to night.
🐇✨


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.
    • @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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

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.

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

🔭 Outside diff range comments (1)
components/request-card/script.js (1)

472-480: 🧹 Nitpick (assertive)

Hover-card event listeners are never removed – potential memory leak

setupHoverCardListeners conveniently returns a cleanup function (removeListeners) but it is stored and never invoked.
If request cards are removed from the DOM (e.g., when navigating away or re-rendering), lingering listeners keep the card elements in memory.

Add a teardown call when the card is destroyed, or expose it through the component’s public API so the parent can clean up:

// somewhere during component disposal
removeHoverCardListeners();
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2bd0d44 and bc970b2.

📒 Files selected for processing (1)
  • components/request-card/script.js (6 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
components/request-card/script.js

[error] 197-197: This let declares a variable that is only assigned once.

'formData' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: test
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Cloudflare Pages

@AnujChhikara AnujChhikara force-pushed the feature/create-request-card-2 branch from bc970b2 to 96344e7 Compare May 18, 2025 09:13
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 18, 2025

Deploying dashboard-rds with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1c3ef87
Status: ✅  Deploy successful!
Preview URL: https://14fffe8a.dashboard-rds.pages.dev
Branch Preview URL: https://feature-create-request-card-ppv0.dashboard-rds.pages.dev

View logs

@MayankBansal12
Copy link
Member

@AnujChhikara Please include working proof and test coverage

@AnujChhikara
Copy link
Contributor Author

@AnujChhikara Please include working proof and test coverage

Added

Copy link
Contributor

@Suvidh-kaushik Suvidh-kaushik left a comment

Choose a reason for hiding this comment

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

LGTM .!

Copy link
Contributor

@VinuB-Dev VinuB-Dev left a comment

Choose a reason for hiding this comment

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

LGTM

@iamitprakash iamitprakash merged commit 37988bb into develop May 21, 2025
6 checks passed
@iamitprakash iamitprakash deleted the feature/create-request-card-2 branch May 21, 2025 19:23
@AnujChhikara AnujChhikara mentioned this pull request May 22, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 11, 2025
10 tasks
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.

5 participants