-
Notifications
You must be signed in to change notification settings - Fork 31
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
FEATURE/HCMPRE-0112: Mandatory Sign for assumptions and Formula Screen #2281
base: console
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes involve minor formatting adjustments and UI enhancements across several components. In the Changes
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
✨ 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/DataMgmtComponent.js
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js
(0 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js
(2 hunks)
💤 Files with no reviewable changes (1)
- health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: check
**/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/DataMgmtComponent.js
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js
🔇 Additional comments (3)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js (1)
321-321
: Good UI enhancement for required field indication.Adding the mandatory asterisk indicator helps users understand which fields are required, improving form usability.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js (2)
165-165
: Good implementation of conditional mandatory indicator.The conditional rendering of the mandatory asterisk based on category and source type is well-implemented and aligns with the PR objectives.
175-175
: Clean code improvement.Removing the extra whitespace improves code cleanliness.
...cro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/DataMgmtComponent.js
Show resolved
Hide resolved
4950cee
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: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
(14 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: check
**/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
🧬 Code Definitions (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/configs/UICustomizations.js (5) (5)
businessServiceMap
(8-10)inboxModuleNameMap
(12-14)UICustomizations
(66-324)UICustomizations
(66-324)additionalFieldsToSet
(164-170)
🪛 Biome (1.9.4)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
[error] 5-6: Use let or const instead of var.
A variable declared with var is accessible in the whole module. Thus, the variable can be accessed before its initialization and outside the block where it is declared.
See MDN web docs for more details.
Unsafe fix: Use 'const' instead.
(lint/style/noVar)
[error] 186-186: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 194-194: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 206-206: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 207-207: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 224-224: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 193-193: This let declares a variable that is only assigned once.
'selectedOrg' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
[error] 329-329: This let declares a variable that is only assigned once.
'Individual' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
⏰ Context from checks skipped due to timeout of 10000ms (2)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (actions)
🔇 Additional comments (10)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js (1)
321-321
: Good implementation of the mandatory field indicator!The conditional rendering for the mandatory asterisk follows React best practices. The indicator is only shown for non-CUSTOM formula sources, which aligns with the PR objective to add mandatory signs to the Formula Screen.
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (9)
110-115
: Consistent spacing in object properties improves readability.The spacing in this object is now more consistent. The code is functionally identical, but the improved formatting enhances readability.
117-117
: Proper spacing around spread operator enhances readability.The addition of spaces around the spread operator improves code readability while maintaining the same functionality.
122-125
: Formatting improvement in the enableModalSubmit function.The improved formatting makes the code more readable while maintaining the same functionality.
149-159
: Consistent formatting in conditional blocks.The consistent formatting of the
else if
conditions improves readability. Each condition is now properly spaced with a consistent pattern.
243-243
: LGTM: Path construction for link.The path construction for the link is correct and uses template literals appropriately.
271-271
: Improved return statement for workflow states.The code now correctly returns the workflow state with proper translation key formatting.
274-274
: Good error handling with default case.Adding a default case with a clear "case not handled" message improves error handling and debugging.
292-295
: Improved formatting for the functions object.The consistent indentation and formatting of the
functions
object improves readability.
336-336
: String trimming logic is correctly implemented.The string trimming logic for the specified fields is correct and helps prevent issues with extra whitespace.
@@ -392,15 +325,15 @@ export const UICustomizations = { | |||
wardCode: "wardCode[0].code", | |||
socialCategory: "socialCategory.code", | |||
}; | |||
const textConfig = ["name", "individualId"]; | |||
const textConfig = ["name", "individualId"] | |||
let Individual = Object.keys(requestBody) |
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.
🧹 Nitpick (assertive)
Use const
instead of let
for the Individual variable.
Since Individual
is only assigned once and never reassigned, it should use const
instead of let
.
-let Individual = Object.keys(requestBody)
+const Individual = Object.keys(requestBody)
📝 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.
let Individual = Object.keys(requestBody) | |
const Individual = Object.keys(requestBody) |
🧰 Tools
🪛 Biome (1.9.4)
[error] 329-329: This let declares a variable that is only assigned once.
'Individual' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
//setting limit and offset becoz somehow they are not getting set in muster inbox | ||
data.body.inbox .limit = data.state.tableForm.limit | ||
data.body.inbox.offset = data.state.tableForm.offset | ||
delete data.state | ||
return data; |
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.
🧹 Nitpick (assertive)
Consider alternatives to using the delete operator.
Using the delete
operator can impact performance. Consider setting properties to undefined
instead of deleting them.
//setting limit and offset becoz somehow they are not getting set in muster inbox
data.body.inbox .limit = data.state.tableForm.limit
data.body.inbox.offset = data.state.tableForm.offset
-delete data.state
+data.state = undefined
📝 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.
//setting limit and offset becoz somehow they are not getting set in muster inbox | |
data.body.inbox .limit = data.state.tableForm.limit | |
data.body.inbox.offset = data.state.tableForm.offset | |
delete data.state | |
return data; | |
//setting limit and offset becoz somehow they are not getting set in muster inbox | |
data.body.inbox .limit = data.state.tableForm.limit | |
data.body.inbox.offset = data.state.tableForm.offset | |
data.state = undefined | |
return data; |
🧰 Tools
🪛 Biome (1.9.4)
[error] 224-224: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
// var Digit = window.Digit || {}; | ||
|
||
|
||
var Digit = window.Digit || {}; |
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.
🛠️ Refactor suggestion
Replace var
with const
for better variable scoping.
Using var
for variable declarations is not recommended in modern JavaScript as it has function scope rather than block scope, which can lead to unexpected behavior. Consider using const
instead since this variable is not reassigned.
-var Digit = window.Digit || {};
+const Digit = window.Digit || {};
📝 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.
var Digit = window.Digit || {}; | |
const Digit = window.Digit || {}; |
🧰 Tools
🪛 Biome (1.9.4)
[error] 5-6: Use let or const instead of var.
A variable declared with var is accessible in the whole module. Thus, the variable can be accessed before its initialization and outside the block where it is declared.
See MDN web docs for more details.
Unsafe fix: Use 'const' instead.
(lint/style/noVar)
|
||
let selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null); | ||
let selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null); |
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.
🧹 Nitpick (assertive)
Use const
instead of let
for variables that aren't reassigned.
The selectedOrg
variable is only assigned once and never reassigned, so it should use const
instead of let
for better code quality and to prevent accidental reassignment.
-let selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null);
+const selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null);
📝 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.
let selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null); | |
const selectedOrg = _.clone(data.body.inbox.moduleSearchCriteria.orgId ? data.body.inbox.moduleSearchCriteria.orgId : null); |
🧰 Tools
🪛 Biome (1.9.4)
[error] 193-193: This let declares a variable that is only assigned once.
'selectedOrg' is never reassigned.
Safe fix: Use const instead.
(lint/style/useConst)
FEATURE/HCMPRE-0112: Mandatory Sign for assumptions and Formula Screen
Summary by CodeRabbit
New Features
Style
Chores