-
Notifications
You must be signed in to change notification settings - Fork 19
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
Hlm 6350 #1100
Hlm 6350 #1100
Conversation
Warning Rate limit exceeded@Bhavya-egov has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 48 seconds before requesting another review. 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. WalkthroughWalkthroughThe recent changes enhance the styling and functionality of the campaign page in the micro-UI project. CSS adjustments improve visual layout and alignment, while a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MyCampaignPage
participant TimelineComponent
participant DataService
User->>MyCampaignPage: Navigate to Campaign Page
MyCampaignPage->>TimelineComponent: Render TimelineComponent
TimelineComponent->>DataService: Fetch campaign data
DataService-->>TimelineComponent: Return campaign data
TimelineComponent-->>MyCampaignPage: Display timeline with processes
MyCampaignPage-->>User: Show updated campaign page with timeline
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add 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.
Caution
Inline review comments failed to post
Actionable comments posted: 5
Outside diff range, codebase verification and nitpick comments (2)
micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js (1)
Line range hint
495-504
: Consider removing commented-out code.The commented-out code related to user credentials and the download button should be removed if it's no longer needed to keep the codebase clean.
micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js (1)
16-39
: Consider removing commented-outonActionSelect
function.The commented-out
onActionSelect
function should be removed if it's no longer needed to keep the codebase clean.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (4)
micro-ui/web/micro-ui-internals/example/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/css/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json
is excluded by!**/*.json
Files selected for processing (8)
- micro-ui/web/micro-ui-internals/example/public/index.html (1 hunks)
- micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/Module.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js (4 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/TimelineComponent.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js (6 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/MyCampaign.js (3 hunks)
Files skipped from review due to trivial changes (1)
- micro-ui/web/micro-ui-internals/example/public/index.html
Additional context used
Path-based instructions (6)
micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/MyCampaign.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/Module.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/TimelineComponent.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js (1)
Pattern
**/*.js
: check
Additional comments not posted (23)
micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss (6)
80-81
: LGTM!The margin-bottom property for
.infoClass
is set correctly.
83-83
: LGTM!The display property for
.headerWrapperClassName
is set correctly.
87-88
: LGTM!The margin-top and margin-bottom properties for
.whoLogo
are set correctly.
92-102
: LGTM!The properties for
.digit-popup-wrapper
and its nested elements are set correctly.
108-112
: LGTM!The properties for
.timeline-div
are set correctly.
121-125
: LGTM!The properties for
.timeline-user
are set correctly.micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/MyCampaign.js (1)
6-7
: LGTM!The imports for
TimelineComponent
andPopUp
are added correctly.micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/Module.js (2)
30-30
: LGTM!The import for
TimelineComponent
is added correctly.
102-102
: LGTM!The
TimelineComponent
is included in thecomponentsToRegister
object correctly.micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/TimelineComponent.js (2)
1-6
: LGTM!The imports are added correctly.
35-178
: LGTM!The rest of the
TimelineComponent
function is implemented correctly.micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js (2)
153-153
: Correctly initializedisPreview
state variable.The
isPreview
state variable is correctly initialized based on the query parameter "preview".
225-241
: Conditional rendering of TimelineComponent is correct.The
TimelineComponent
is conditionally rendered based on theisPreview
state variable. This is implemented correctly.micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/configs/UICustomizations.js (7)
4-6
: Correct imports for new components.The new imports for
Fragment
,Button
,PopUp
, andTimelineComponent
are correctly added.
107-107
: Correctly added state management fortimeLine
.The state management for
timeLine
is correctly added usingReact.useState
.
109-130
: Correctly redefinedonActionSelect
function.The
onActionSelect
function is correctly redefined within theadditionalCustomizations
function to handle different actions.
148-164
: Correct adjustments toButton
component.The adjustments to the
Button
component, including the addition of options and theonOptionSelect
handler, are correctly implemented.
164-173
: Correct conditional rendering ofPopUp
.The
PopUp
component is correctly rendered conditionally based on thetimeLine
state.
345-369
: Correctly addedonActionSelect
function forMyCampaignConfigUpcoming
.The
onActionSelect
function is correctly added within theadditionalCustomizations
function forMyCampaignConfigUpcoming
.
386-411
: Correct adjustments toButton
component and conditional rendering ofPopUp
forMyCampaignConfigUpcoming
.The adjustments to the
Button
component and the conditional rendering ofPopUp
based on thetimeLine
state forMyCampaignConfigUpcoming
are correctly implemented.micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UploadData.js (3)
48-54
: Correctly reformattedDigit.Hooks.useCustomMDMS
function call.The
Digit.Hooks.useCustomMDMS
function call is correctly reformatted for better readability without breaking functionality.
187-189
: Correctly refactoredconvertIntoSchema
call forfacility
.The asynchronous
convertIntoSchema
call forfacility
is correctly refactored for better code clarity.
195-197
: Correctly refactoredconvertIntoSchema
call foruser
.The asynchronous
convertIntoSchema
call foruser
is correctly refactored for better code clarity.
Comments failed to post (5)
micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/MyCampaign.js
31-31: Remove unused variable.
The
searchParams
variable is not used in the code and should be removed to avoid confusion.- const searchParams = new URLSearchParams(location.search);
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.
32-34: Remove extra empty lines.
The extra empty lines do not serve any purpose and should be removed to maintain code readability.
- - -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.
micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/TimelineComponent.js
84-86: Use a constant for interval time.
Using a constant for the interval time improves code readability and maintainability.
- }, 60000); // 60000ms = 1 minute + }, INTERVAL_TIME); // 60000ms = 1 minuteconst INTERVAL_TIME = 60000;
35-38: Import
location
.The
location
object is used but not imported. Ensure it is imported to avoid runtime errors.+ import { useLocation } from "react-router-dom";
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.import { useLocation } from "react-router-dom"; const TimelineComponent = ({campaignId, resourceId}) => { const { t } = useTranslation(); const tenantId = Digit.ULBService.getCurrentTenantId(); const searchParams = new URLSearchParams(location.search);
8-33: Remove redundant comment.
The comment on line 9 is redundant and can be removed to improve code readability.
- // Create a new Date object using the epoch time
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.function epochToDateTime(epoch) { const date = new Date(epoch ); // Extract the date components const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-based, so add 1 const day = String(date.getDate()).padStart(2, '0'); // Extract the time components let hours = date.getHours(); const minutes = String(date.getMinutes()).padStart(2, '0'); const seconds = String(date.getSeconds()).padStart(2, '0'); // Determine AM/PM and convert to 12-hour format const ampm = hours >= 12 ? 'PM' : 'AM'; hours = hours % 12; hours = hours ? hours : 12; // the hour '0' should be '12' const formattedHours = String(hours).padStart(2, '0'); // Format the date and time const formattedDate = `${day}/${month}/${year}`; const formattedTime = `${formattedHours}:${minutes}:${seconds} ${ampm}`; // Return the formatted date and time return `${formattedDate} ${formattedTime}`; }
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss (2 hunks)
- micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/MyCampaign.js (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss
- micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/MyCampaign.js
@@ -49,45 +104,41 @@ const TimelineComponent = ({}) => { | |||
|
|||
const completedTimelines = completedProcesses?.map(process => ({ | |||
label: t(formatLabel(process.type)), | |||
subElements: [Digit.Utils.date.convertEpochToDate(process.lastModifiedTime)], | |||
subElements: [epochToDateTime(process.lastModifiedTime)], |
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.
keep both date and time
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.
the function is taking both date and time.
No description provided.