-
Notifications
You must be signed in to change notification settings - Fork 164
feat: add util functions for request card #1002
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
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughThis update introduces two new modules for the Changes
Sequence Diagram(s)sequenceDiagram
participant UI as User Interface
participant Utils as request-card/utils.js
participant API as Backend API
UI->>Utils: updateRequestStatus({ id, body, isExtensionRequest })
Utils->>API: PATCH /requests or /extension-requests
API-->>Utils: Response (JSON)
Utils-->>UI: Updated status or error message
UI->>Utils: removeCard(element, class, container)
Utils->>UI: Animate removal, update DOM
Possibly related PRs
Suggested reviewers
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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: 8
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
components/request-card/constant.js(1 hunks)components/request-card/utils.js(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
components/request-card/utils.js (3)
components/request-card/constant.js (5)
DEADLINE_WARNING_THRESHOLD_DAYS(4-4)ErrorMessage(27-29)CARD_REMOVAL_INITIAL_DELAY_MS(1-1)CARD_REMOVAL_ANIMATION_DURATION_MS(2-2)CARD_REMOVAL_ANIMATION_EASING(3-3)components/request-card/script.js (3)
createSummarySection(80-88)oldEndsOn(379-379)createDateContainer(89-102)extension-requests/script.js (2)
isStatusPending(522-522)isNewDeadLineCrossed(520-521)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
components/request-card/utils.js (1)
135-168:⚠️ Potential issueDOM IDs reused for every card will break accessibility & CSS selectors
Functions
createSummarySectionandcreateDateContainerinject elements with hard-codedidvalues (deadline-container,new-deadline-container,newEndsOn, etc.). When multiple cards are rendered, the page contains duplicate IDs – invalid HTML that can cause:•
document.getElementByIdto return the first match only
• CSS rules to apply unpredictably
• Screen-readers to misbehaveConvert these to classes or data-attributes, e.g.
-attributes: { id: 'deadline-container' }, +attributes: { class: 'deadline-container' },and update any selector logic accordingly.
Likely an incorrect or invalid review comment.
Deploying dashboard-rds with
|
| Latest commit: |
602b090
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://75c69ae9.dashboard-rds.pages.dev |
| Branch Preview URL: | https://request-card-util-functions.dashboard-rds.pages.dev |
8e002cc to
c3af82b
Compare
c3af82b to
70ce78f
Compare
ad098d7 to
92e3a95
Compare
099f132 to
7f0bc9a
Compare
7f0bc9a to
00ca389
Compare
pankajjs
left a comment
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.
My comments have been addressed. Therefore approving it.
* feature: Implementation of the request card component * fix: add error handling for getSelfUser and fix css
Date: 22 May 2025
Developer Name: @AnujChhikara
Issue Ticket Number
Description
This PR introduces a new function createActionContainer responsible for dynamically generating action elements (buttons, status indicators, input fields) for request cards based on the request type and status.
Test PR test: add test for request card component #994
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
brave_Wvd4QGQdA8.mp4
brave_5ZdF3b4Crh.mp4
brave_6dHlJo2kGe.mp4
brave_cMuGGLoJBQ.mp4
brave_UHzBMcVK3p.mp4
Test Coverage
Screenshot 1
Additional Notes
Test PR: #994