-
Notifications
You must be signed in to change notification settings - Fork 20
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
Audit fixes main #1926
Audit fixes main #1926
Conversation
Caution Review failedThe pull request is closed. 📝 Walkthrough## Walkthrough
The changes in this pull request primarily focus on enhancing the `UICustomizations` object and various UI components within the micro UI framework. Key modifications include the addition of new configurations for search handling, improved button functionalities, and refined CSS styles for better layout and responsiveness. The updates also involve enhanced error handling, user feedback mechanisms, and localization efforts across several components, ensuring a more cohesive and user-friendly interface.
## Changes
| File | Change Summary |
|----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js` | Added `MicroplanSearchConfig` and `MyMicroplanSearchConfig` with new `preProcess` methods and `onActionSelect` functions. Updated `UserManagementConfig` for mobile number validation and enhanced `additionalCustomizations`. |
| `health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss` | Introduced new CSS classes for improved layout, including `.microplan-deatils-view-card`, `.kpi-card`, and others. Updated styles for responsiveness and consistency. |
| `health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss` | Added `scrollbar-width: none` to hide scrollbars and refined styles for various components to improve layout and alignment. |
| `health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/formulaConfig.scss` | Updated styles for `.formula-label-field`, `.equals-icon`, and `.header-comp-blue` to enhance layout and typography. |
| `health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss` | Adjusted layout properties for `.employee-data-table` and refined button and header styles for better visual hierarchy. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BulkUpload.js` | Enhanced file handling and UI elements, refined error handling, and updated UI interactions for better user experience. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/MultiSelectDropdown.js` | Updated labels for "Select All" and clear button to use localization. Enhanced accessibility with state checks for the dropdown. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js` | Streamlined rendering logic and replaced `div` elements with `Button` components for better UI consistency. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js` | Updated icon usage and improved validation logic for new formulas, enhancing user feedback and clarity. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js` | Refactored rendering logic for assumption labels and delete buttons, improving user interaction and feedback. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanDetails.js` | Updated `className` for styling and replaced `TextInput` with `FieldV1` for better input handling. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js` | Modified rendering logic for village names and assignee data presentation, optimizing performance with `useMemo`. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js` | Improved search form layout and input validation for mobile numbers, enhancing user experience. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/VillageHierarchyTooltipWrapper.js` | Updated `wrapperClassName` for `TooltipWrapper` to include new class for styling. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/subBoundaryView.js` | Added `className` to `Card` component for enhanced styling capabilities. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js` | Introduced new `onActionSelect` functions for handling user actions in `MicroplanSearchConfig` and `MyMicroplanSearchConfig`. |
| `health/micro-ui/web/micro-ui-internals/example/public/index.html` | Updated CSS stylesheet links to new versions for `@egovernments/digit-ui-components-css` and `@egovernments/digit-ui-health-css`. |
| `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanCard.js` | Changed `Icon` property from a JSX element to a string for rendering and added a `className` for styling. |
| `health/micro-ui/web/public/index.html` | Updated CSS stylesheet links to new versions for `@egovernments/digit-ui-components-css` and `@egovernments/digit-ui-health-css`. |
## Poem
> In the land of code where rabbits play,
> New features hop in, brightening the day.
> Buttons now dance, and styles take flight,
> With every change, the UI feels right.
> So here’s to the tweaks, both big and small,
> A joyful leap for one and all! 🐇✨ Warning Rate limit exceeded@Swathi-eGov has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 11 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. 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 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: 23
🧹 Outside diff range comments (21)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/subBoundaryView.js (3)
Line range hint
37-65
: Consider refactoring pagination logicThe pagination implementation could be improved by:
- Extracting the magic number '10' into a named constant
- Moving the pagination logic into a custom hook for better reusability
+const ITEMS_PER_PAGE = 10; + const SubBoundaryView = ({ title, arr, style, editHandler, isEditable, headerStyle={fontSize:"1rem"} }) => { const [showPopUp, setShowPopUp] = useState(false); const { t } = useTranslation(); - {arr?.slice(0, 10)?.map((el, ind) => { + {arr?.slice(0, ITEMS_PER_PAGE)?.map((el, ind) => {
Line range hint
52-65
: Enhance accessibility for the "show more" buttonConsider adding aria-label and role attributes to improve screen reader support.
<Button label={`+${arr?.length - (10)} ${t("ES_MORE")}`} + aria-label={t("ARIA_LABEL_SHOW_MORE_ITEMS", { count: arr?.length - 10 })} + role="button" onClick={() => openPopUp()} variation="link"
Line range hint
8-8
: Add prop validationConsider adding PropTypes or TypeScript types to improve type safety and documentation.
+import PropTypes from 'prop-types'; const SubBoundaryView = ({ title, arr, style, editHandler, isEditable, headerStyle={fontSize:"1rem"} }) => { // ... component implementation } +SubBoundaryView.propTypes = { + title: PropTypes.string.isRequired, + arr: PropTypes.arrayOf(PropTypes.string), + style: PropTypes.object, + editHandler: PropTypes.func, + isEditable: PropTypes.bool, + headerStyle: PropTypes.object +};health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanDetails.js (3)
Line range hint
108-122
: Complete the FieldV1 component migrationThe migration from TextInput to FieldV1 appears incomplete:
- The
isMandatory
prop is missing- The
disable
prop is commented out- Error handling is commented out but might be needed for validation
Consider adding these props to maintain the same functionality:
<FieldV1 type="text" - // error={error?.message ? t(error?.message) : ""} + error={error?.message ? t(error?.message) : ""} populators={{ name: "microplanName" }} placeholder={t("MICROPLAN_NAME_INPUT_PLACEHOLDER")} value={microplan} onChange={onChangeMicroplanName} - // disabled={isFreezed} + disabled={isFreezed} + isMandatory={true} />
Line range hint
39-50
: Refactor useEffect hooks to prevent unnecessary rerendersThe current implementation has two useEffect hooks with similar functionality, and the second one runs on every render. This is inefficient and could cause performance issues.
Consider combining the effects and removing the execution count:
- useEffect(() => { - onSelect(customProps.name, { - microplanName: microplan, - }); - }, [microplan]); - - useEffect(() => { - if (executionCount < 5) { - onSelect(customProps.name, { - microplanName: microplan, - }); - setExecutionCount((prevCount) => prevCount + 1); - } - }); + useEffect(() => { + onSelect(customProps.name, { + microplanName: microplan, + }); + }, [microplan, onSelect, customProps.name]);
Line range hint
20-22
: Resolve inconsistent state handlingThe
isFreezed
state is commented out but its value is still being used in the component. This could lead to undefined behavior.Either:
- Remove all references to
isFreezed
if it's no longer needed- Or uncomment and properly implement the state:
- //const [isFreezed, setIsFreezed] = useState(campaignId && microplanId ? true : false); + const [isFreezed, setIsFreezed] = useState(campaignId && microplanId ? true : false);health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BulkUpload.js (3)
Line range hint
169-173
: Maintain consistent icon naming conventionThe icon string "Delete" differs from the naming convention used in "DownloadIcon". Consider using consistent naming like "DeleteIcon" for better maintainability.
- icon={"Delete"} + icon={"DeleteIcon"}
Line range hint
200-207
: Fix typo and improve readability
- The
isDleteBtn
prop has a typo (should beisDeleteBtn
)- Consider making the type determination more readable using a separate variable or utility function
- type={showToast?.key === "error" ? "error" : showToast?.key === "info" ? "info" : "success"} - isDleteBtn={true} + type={getToastType(showToast?.key)} + isDeleteBtn={true} // Add this utility function: + const getToastType = (key) => { + switch (key) { + case "error": return "error"; + case "info": return "info"; + default: return "success"; + } + };
Line range hint
1-207
: General improvements needed
- Remove commented-out code to improve maintainability
- Consider implementing a more robust error handling strategy:
- Add error boundaries
- Implement consistent error messaging
- Add retry mechanisms for file operations
Would you like assistance in implementing these improvements?
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js (2)
Line range hint
315-326
: Consider using a constant for translation keyWhile the implementation is correct, consider extracting the translation key
MP_${bHierarchy[ind + 2].toUpperCase()}
into a constant for better maintainability and reusability.+ const getTranslationKey = (boundary) => `MP_${boundary.toUpperCase()}`; - <Header className="summary-sub-heading">{t(`MP_${bHierarchy[ind + 2].toUpperCase()}`)}</Header> + <Header className="summary-sub-heading">{t(getTranslationKey(bHierarchy[ind + 2]))}</Header>
Line range hint
1-361
: Consider adding unit testsGiven the complexity of the boundary hierarchy handling and UI state management, it would be beneficial to add unit tests to ensure reliability.
Key areas to test:
- Boundary hierarchy processing logic
- View More/Less toggle functionality
- Edit handler behavior
- Conditional rendering based on setupCompleted
Would you like me to help generate unit test cases for this component?
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js (3)
Line range hint
531-541
: Enhance number input validationThe mobile number validation can be improved by:
- Using the
pattern
attribute for HTML5 validation- Centralizing the validation logic
<TextInput value={number} type={"text"} name={"number"} + pattern="[0-9]{10}" + maxLength={10} onChange={(e) => { const newValue = e.target.value.replace(/\D/g, ""); // Remove non-numeric characters setNumber(newValue); }} errorStyle={""} min={10} minlength={10} />
Line range hint
546-558
: Fix search form handlersThe search form's event handlers have duplicate logic and the handleSearchSubmit is called without the event parameter.
<form onSubmit={(e) => { e.preventDefault(); // Prevent default submission e.stopPropagation(); // Stop the event from reaching the parent form - handleSearchSubmit(); + handleSearchSubmit(e); }} onKeyDown={(e) => { if (e.key === "Enter") { - e.stopPropagation(); - handleSearchSubmit(); + // Remove this handler as onSubmit already handles Enter key } }} >
Line range hint
392-402
: Improve toast notification managementThe toast notification handling can be improved by:
- Moving the timeout duration to a constant
- Using a custom hook for toast management
+const TOAST_TIMEOUT = 5000; + +const useToast = () => { + const [toast, setToast] = useState(null); + + useEffect(() => { + if (toast) { + const timer = setTimeout(() => setToast(null), TOAST_TIMEOUT); + return () => clearTimeout(timer); + } + }, [toast]); + + return [toast, setToast]; +}; function RoleTableComposer({ nationalRoles }) { - const [showToast, setShowToast] = useState(null); + const [toast, setToast] = useToast(); - useEffect(() => { - if (showToast) { - setTimeout(closeToast, 5000); - } - }, [showToast]);health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/MultiSelectDropdown.js (4)
Line range hint
32-38
: Optimize component performance with memoizationThe component could benefit from performance optimizations:
- Memoize callback functions using
useCallback
- Memoize computed values using
useMemo
- Consider splitting the Menu component into a separate component
Example optimization for the Menu component:
+ const MemoizedMenuItem = React.memo(MenuItem); + const memoizedHandleSelectAll = useCallback(() => { if (!restrictSelection) { if (selectAllChecked) { dispatch({ type: "REPLACE_COMPLETE_STATE", payload: [] }); setSelectAllChecked(false); } else { // ... existing logic } } else { onSelect(); } }, [selectAllChecked, restrictSelection, dispatch, onSelect]); + const filteredOptionsMemoed = useMemo(() => searchQuery?.length > 0 ? options?.map(/* existing filtering logic */) : options, [searchQuery, options] );Also applies to: 819-849
Line range hint
1012-1024
: Enhance error handling and type validationConsider adding more comprehensive prop validation and error handling:
- Add specific error messages for invalid prop types
- Implement runtime type checking for critical props
MultiSelectDropdown.propTypes = { options: PropTypes.array.isRequired, optionsKey: PropTypes.string.isRequired, - selected: PropTypes.array, + selected: PropTypes.arrayOf( + PropTypes.shape({ + code: PropTypes.string.isRequired, + name: PropTypes.string.isRequired, + propsData: PropTypes.array + }) + ), onSelect: PropTypes.func.isRequired, onClose: PropTypes.func, defaultLabel: PropTypes.string, defaultUnit: PropTypes.string, - props: PropTypes.object, + props: PropTypes.shape({ + className: PropTypes.string, + style: PropTypes.object + }), isPropsNeeded: PropTypes.bool, - ServerStyle: PropTypes.object, + ServerStyle: PropTypes.shape({ + maxHeight: PropTypes.string, + overflowY: PropTypes.string + }), config: PropTypes.object, + variant: PropTypes.oneOf(['nestedmultiselect', 'treemultiselect', 'nestedtextmultiselect']), + addSelectAllCheck: PropTypes.bool, + addCategorySelectAllCheck: PropTypes.bool, + frozenData: PropTypes.array, + isSearchable: PropTypes.bool };
Line range hint
873-897
: Enhance accessibility with ARIA attributesThe component needs better accessibility support through ARIA attributes and roles.
<div className={`digit-multiselectdropdown-wrap ${props?.className ? props?.className : ""} ${variant ? variant : ""}`} ref={dropdownRef} + role="combobox" + aria-expanded={active} + aria-haspopup="listbox" style={props?.style} > <div className={`digit-multiselectdropdown-master${active ? `-active` : ``} ${disabled ? "disabled" : ""} ${variant ? variant : ""} ${isSearchable ? "serachable" : ""}`} > <input className="digit-cursorPointer" style={{}} type="text" + aria-label={defaultLabel} + aria-autocomplete="list" onKeyDown={keyChange} onFocus={() => setActive(true)} value={searchQuery} onChange={onSearch} />
Line range hint
1-1024
: Document component behavior and extract complex logicThe component would benefit from:
- JSDoc documentation for the component and its key functions
- Extraction of complex logic into separate utility functions
- Adding comments explaining complex state interactions
Example documentation:
/** * A customizable multi-select dropdown component that supports nested options, * keyboard navigation, and frozen items. * * @component * @param {Object} props * @param {Array} props.options - Array of options to display in the dropdown * @param {string} props.optionsKey - Key to use for option labels * @param {Array} [props.selected] - Array of pre-selected options * @param {Function} props.onSelect - Callback function when selection changes * @param {Object} [props.config] - Configuration object for customizing behavior */health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss (3)
Line range hint
2602-2608
: Incorrect properties inside::-webkit-scrollbar
pseudo-elementThe properties
overflow
,-ms-overflow-style
, andscrollbar-width
are not valid within the::-webkit-scrollbar
pseudo-element for.microPlanBulkTable
. These properties should be applied to the container, not the scrollbar pseudo-element.Apply this diff to correct the pseudo-element styles:
.microPlanBulkTable { overflow: scroll; /* Enables scrolling */ -ms-overflow-style: none; /* Internet Explorer 10+ */ scrollbar-width: none; /* Firefox */ } - .microPlanBulkTable::-webkit-scrollbar { - overflow: scroll; /* Enables scrolling */ - -ms-overflow-style: none; /* Internet Explorer 10+ */ - scrollbar-width: none; /* Firefox */ - } + .microPlanBulkTable::-webkit-scrollbar { + display: none; /* Chrome, Safari, and Edge */ + }
Line range hint
2610-2615
: Consolidate scrollbar styling into a mixinThe scrollbar hiding techniques for
.scroll-container
and.microPlanBulkTable
are similar but implemented separately. To improve maintainability and consistency, consider creating a mixin or a common class for scrollbar styling.For example, you can create a mixin:
@mixin hide-scrollbar { overflow: scroll; -ms-overflow-style: none; /* IE 10+ */ scrollbar-width: none; /* Firefox */ &::-webkit-scrollbar { display: none; /* Chrome, Safari, and Edge */ } }And then include it in your classes:
.scroll-container { @include hide-scrollbar; } .microPlanBulkTable { @include hide-scrollbar; }
Line range hint
2633-2637
: Remove duplicate CSS rulesThe
.sc-fzXfNN.sc-fzXfNO.sc-fzXfNP.iSamCd.rdt_TableCell>div:first-of-type
selector appears to have no associated styles. Additionally, ensure that class names generated dynamically (like hashed class names from CSS-in-JS libraries) are used appropriately.If this selector is unnecessary, consider removing it to clean up the stylesheet.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (16)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
(2 hunks)health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/formulaConfig.scss
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BulkUpload.js
(2 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/MultiSelectDropdown.js
(3 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js
(3 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
(6 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js
(7 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanDetails.js
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js
(2 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/VillageHierarchyTooltipWrapper.js
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/subBoundaryView.js
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BulkUpload.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/MultiSelectDropdown.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanDetails.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/VillageHierarchyTooltipWrapper.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/subBoundaryView.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js (1)
Pattern **/*.js
: check
📓 Learnings (2)
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss (1)
Learnt from: siddhant-nawale-egov
PR: egovernments/DIGIT-Frontend#876
File: micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss:1940-2392
Timestamp: 2024-11-10T20:01:49.000Z
Learning: Classes related to interactive elements in the microplan preview section are mostly passed to Higher Order Components (HOCs), and ARIA attributes for non-HOC elements will be managed directly by adding them where necessary.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js (1)
Learnt from: rachana-egov
PR: egovernments/DIGIT-Frontend#1622
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js:355-363
Timestamp: 2024-11-12T10:40:11.591Z
Learning: In `PopInboxTable.js`, the `showEditVillagePopup` state variable is initialized as an empty object.
🪛 Biome (1.9.4)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
[error] 826-837: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
[error] 323-323: Avoid passing children using a prop
The canonical way to pass children in React is to use JSX elements
(lint/correctness/noChildrenProp)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js
[error] 170-170: Avoid passing children using a prop
The canonical way to pass children in React is to use JSX elements
(lint/correctness/noChildrenProp)
[error] 202-202: Unnecessary use of boolean literals in conditional expression.
Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with
(lint/complexity/noUselessTernary)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js
[error] 109-120: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
🔇 Additional comments (15)
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/formulaConfig.scss (1)
21-21
: Verify typography system integration
Let's ensure the typography system is properly set up and consistent across the application.
✅ Verification successful
Typography system integration is properly set up
The typography system is well-defined and consistently used across the application. The .typography.heading-s
class is:
- Defined in the main typography files (
typography.scss
anddigitv2/typography.scss
) - Properly configured with responsive font sizes for mobile, tablet, and desktop
- Consistently used across multiple components and pages through
@extend
directives
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for typography system definition and usage
echo "Checking for typography system definition..."
rg -l "typography" --type scss
echo "Checking for heading-s usage..."
rg "heading-s" --type scss -A 2 -B 2
Length of output: 297
Script:
#!/bin/bash
# Check for typography system definition and usage with file extension
echo "Checking for typography system definition..."
rg -l "typography" -g "*.scss"
echo "\nChecking for heading-s usage..."
rg "heading-s" -g "*.scss" -A 2 -B 2
echo "\nChecking for typography class definitions..."
rg "\.typography" -g "*.scss" -A 2 -B 2
Length of output: 50291
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/subBoundaryView.js (1)
20-20
: Verify the CSS class definition
The added CSS class needs to be verified to ensure proper styling implementation.
✅ Verification successful
CSS class is properly defined and used
The CSS class sub-boundary-summary-card
is correctly defined in health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
with appropriate spacing properties (gap and padding), and it's being properly used in the component.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for the CSS class definition in scss files
rg -t scss "sub-boundary-summary-card"
Length of output: 67
Script:
#!/bin/bash
# Search for the CSS class definition in all files, focusing on common stylesheet extensions
rg "sub-boundary-summary-card" -g "*.css" -g "*.scss" -g "*.sass" -g "*.less"
# Also search in JavaScript/TypeScript files as styles might be defined inline or in styled-components
rg "sub-boundary-summary-card" -g "*.js" -g "*.jsx" -g "*.ts" -g "*.tsx"
Length of output: 450
Script:
#!/bin/bash
# Let's check the actual CSS definition to ensure it's properly implemented
rg -A 5 "sub-boundary-summary-card" health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
Length of output: 209
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/VillageHierarchyTooltipWrapper.js (1)
Line range hint 1-125
: Implementation looks good!
The component is well-structured with proper error handling, loading states, and follows React best practices. The code is maintainable and uses hooks effectively.
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BulkUpload.js (1)
158-159
: Verify icon string reference compatibility
The icon implementation has been changed from a custom component to a string reference. Please ensure that the ButtonNew component properly supports the "DownloadIcon" string reference for icon rendering.
✅ Verification successful
Icon implementation is correctly used
The string reference "DownloadIcon" is consistently used across the campaign-manager module and other components. Multiple instances in the codebase show this pattern of using string-based icon references with ButtonNew component, particularly in the campaign-manager module (e.g., in ViewHierarchy.js, TimelineComponent.js). The DownloadIcon component is properly imported from "@egovernments/digit-ui-react-components" and the string reference pattern appears to be the standardized approach.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other instances of ButtonNew with string icon references
ast-grep --pattern 'ButtonNew $props icon="$_"'
# Search for the ButtonNew component implementation
ast-grep --pattern 'const ButtonNew = $_'
Length of output: 93
Script:
#!/bin/bash
# Search for ButtonNew component usage with icon prop
rg -U "ButtonNew.*icon.*" -A 2 -B 2
# Search for ButtonNew component definition and imports
rg "ButtonNew" --type js
# Search for specific DownloadIcon usage
rg "DownloadIcon" --type js
Length of output: 8366
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js (1)
Line range hint 33-45
: Good move on using CSS classes, but let's complete the styling migration.
The change from inline styles to CSS classes improves maintainability. However, there's still an inline style on the Button component that could be moved to CSS.
Consider moving the remaining inline style to CSS:
-<Button
- style={{ minWidth: "unset" }}
- ...
->
+<Button
+ className="village-button"
+ ...
->
Then add to your CSS:
.village-button {
min-width: unset;
}
Let's verify the CSS class exists:
✅ Verification successful
Consider keeping the inline style for now
The .village-tooltip-wrap
class exists in the CSS file and handles the flex layout and spacing of the village button container. However, the minWidth: "unset"
style on the Button component appears to be a specific override for the Button's default styling, which is better left as an inline style in this case since it's a component-specific override.
- The
.village-tooltip-wrap
class is properly defined inmicroplan.scss
with appropriate flex layout properties - Moving the
minWidth
override to CSS could potentially conflict with the Button component's internal styling system
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if the CSS class is defined
rg -l "village-tooltip-wrap|village-button" --type css
Length of output: 138
Script:
#!/bin/bash
# Check the content of the CSS file to verify the class definitions
cat health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
Length of output: 10316
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss (3)
451-453
: LGTM! Good use of fit-content
The width property is appropriately set to ensure the KPI card sizes according to its content.
469-472
: LGTM! Clean and consistent styling
The card styling follows consistent spacing patterns using rem units.
491-495
: LGTM! Clean flexbox implementation
The tooltip wrapper uses appropriate flexbox properties for alignment and consistent spacing.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js (1)
305-305
: LGTM: Proper styling implementation
The styling implementation follows React conventions with appropriate prop passing.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js (2)
228-236
: LGTM! Clear and context-aware confirmation messages
The conditional rendering of deletion confirmation messages provides better context to users, distinguishing between custom and regular assumptions.
333-334
: LGTM! Improved button hierarchy
The button variation changes create better visual hierarchy and the label updates provide clearer action descriptions.
Also applies to: 343-344
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js (3)
7-7
: LGTM: Import statement for InfoOutline icon
The addition of the InfoOutline icon from the SVG components package is appropriate for the intended UI enhancement.
416-424
: LGTM: Improved deletion confirmation messages
The enhanced confirmation messages provide better clarity by distinguishing between custom and regular formula deletions.
497-498
: LGTM: Enhanced button labels and styling
The button label changes from "YES/NO" to "ADD/CANCEL" and their variations provide better action clarity and visual hierarchy.
Also applies to: 507-508
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
1028-1028
: LGTM!
The use of the isSuffix
prop enhances the button's icon placement and is appropriate here.
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/formulaConfig.scss
Show resolved
Hide resolved
...cro-ui-internals/packages/modules/microplan/src/components/VillageHierarchyTooltipWrapper.js
Show resolved
Hide resolved
...icro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanDetails.js
Show resolved
Hide resolved
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
Show resolved
Hide resolved
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
Show resolved
Hide resolved
...-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
Show resolved
Hide resolved
...-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
Outdated
Show resolved
Hide resolved
...b/micro-ui-internals/packages/modules/campaign-manager/src/components/MultiSelectDropdown.js
Show resolved
Hide resolved
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss
Outdated
Show resolved
Hide resolved
…ents/microplanning.scss Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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: 3
🧹 Outside diff range comments (6)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js (1)
Line range hint
33-45
: LGTM! Consider using URL builder utility.The changes look good with proper component composition and styling moved to CSS classes. The implementation maintains accessibility and follows React best practices.
Consider using a URL builder utility instead of string concatenation for the navigation URL to make it more maintainable:
-history.push( - `/${window.contextPath}/employee/microplan/village-view?microplanId=${url?.microplanId}&boundaryCode=${row.boundaryCode}&campaignId=${url?.campaignId}` -) +history.push( + buildUrl({ + path: '/employee/microplan/village-view', + queryParams: { + microplanId: url?.microplanId, + boundaryCode: row.boundaryCode, + campaignId: url?.campaignId + } + }) +)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js (1)
Line range hint
315-327
: Simplify conditional rendering of edit buttonThe current implementation can be made more concise by inverting the condition.
- {!(setupCompleted === "true") && ( + {setupCompleted !== "true" && ( <Button label={t("WBH_EDIT")} variation="secondary" icon={"Edit"} type="button" size="medium" onClick={(e) => { editHandler(); }} /> )}health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js (1)
Critical: Restore or replace the commented out validation logic
The search results confirm that there is no alternative validation for assumption names in place. While there is a
validateAssumptions
function in a related module, it only checks for non-empty values and doesn't validate the format of assumption names. TheaddNewAssumption
implementation shows that assumptions are being added without the critical alphanumeric name validation that was commented out.
- The commented out validation in
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js
must be restored or replaced to ensure:
- Names contain at least one letter
- Only alphanumeric characters and spaces are allowed
- Proper spacing is maintained
🔗 Analysis chain
Line range hint
416-430
: Critical: Restore or replace the commented out validation logicThe commented out validation for assumption names should either be restored or replaced with alternative validation. This validation ensures that assumption names:
- Contain at least one letter
- Only contain alphanumeric characters and spaces
- Have proper spacing
Removing this validation could lead to invalid assumption names being accepted.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if there are any other validation implementations for assumption names rg -A 5 "assumption.*name.*test|assumption.*name.*valid" --type jsLength of output: 68
Script:
#!/bin/bash # Let's search for any validation related to assumptions more broadly rg -A 5 "assumption.*valid|validateAssumption" --type js # Also search for where assumptions are added/created to see validation context rg -A 5 "addNewAssumption|createAssumption" --type jsLength of output: 4452
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js (3)
Line range hint
533-542
: Enhance mobile number input validationConsider improving the mobile number validation:
- Add maxLength attribute to prevent input beyond 10 digits
- Validate length during input instead of only on submit
- Consider using a more specific input type
<TextInput value={number} type={"text"} + maxLength={10} name={"number"} onChange={(e) => { const newValue = e.target.value.replace(/\D/g, ""); // Remove non-numeric characters + if (newValue.length <= 10) { setNumber(newValue); + } }} errorStyle={""} min={10} minlength={10} />
Line range hint
392-404
: Improve number sorting robustnessThe current number sorting implementation could be improved to handle edge cases better:
- Consider using Number() instead of parseInt for more consistent parsing
- Add proper validation for phone number format
sortFunction: (rowA, rowB) => { - const numberA = parseInt(rowA.number, 10); - const numberB = parseInt(rowB.number, 10); - if (isNaN(numberA)) return 1; // Treat invalid numbers as larger - if (isNaN(numberB)) return -1; + // Validate phone number format + const isValidPhoneNumber = num => /^\d{10}$/.test(num); + + if (!isValidPhoneNumber(rowA.number)) return 1; + if (!isValidPhoneNumber(rowB.number)) return -1; + + const numberA = Number(rowA.number); + const numberB = Number(rowB.number); if (numberA < numberB) return -1; if (numberA > numberB) return 1; return 0; }
Line range hint
583-591
: Improve toast notification handlingThe current toast implementation could be improved:
- Consider making the timeout duration configurable
- Clear the timeout on component unmount to prevent memory leaks
+const TOAST_TIMEOUT = 5000; + useEffect(() => { if (showToast) { - setTimeout(closeToast, 5000); + const timer = setTimeout(closeToast, TOAST_TIMEOUT); + return () => clearTimeout(timer); } }, [showToast]);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (8)
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js
(3 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
(5 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js
(7 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js
(2 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/subBoundaryView.js
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/subBoundaryView.js (1)
Pattern **/*.js
: check
📓 Learnings (3)
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss (1)
Learnt from: siddhant-nawale-egov
PR: egovernments/DIGIT-Frontend#876
File: micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss:1940-2392
Timestamp: 2024-11-10T20:01:49.000Z
Learning: Classes related to interactive elements in the microplan preview section are mostly passed to Higher Order Components (HOCs), and ARIA attributes for non-HOC elements will be managed directly by adding them where necessary.
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss (1)
Learnt from: siddhant-nawale-egov
PR: egovernments/DIGIT-Frontend#876
File: micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss:1940-2392
Timestamp: 2024-11-10T20:01:49.000Z
Learning: Classes related to interactive elements in the microplan preview section are mostly passed to Higher Order Components (HOCs), and ARIA attributes for non-HOC elements will be managed directly by adding them where necessary.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js (1)
Learnt from: rachana-egov
PR: egovernments/DIGIT-Frontend#1622
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js:355-363
Timestamp: 2024-11-12T10:40:11.591Z
Learning: In `PopInboxTable.js`, the `showEditVillagePopup` state variable is initialized as an empty object.
🪛 Biome (1.9.4)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js
[error] 325-325: Avoid passing children using a prop
The canonical way to pass children in React is to use JSX elements
(lint/correctness/noChildrenProp)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js
[error] 170-170: Avoid passing children using a prop
The canonical way to pass children in React is to use JSX elements
(lint/correctness/noChildrenProp)
[error] 202-202: Unnecessary use of boolean literals in conditional expression.
Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with
(lint/complexity/noUselessTernary)
🔇 Additional comments (20)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/subBoundaryView.js (1)
20-20
: Verify the CSS class definition exists
The addition of the className prop follows React best practices for styling components. However, let's ensure the CSS class is properly defined.
✅ Verification successful
CSS class is properly defined and styled
The .sub-boundary-summary-card
class is correctly defined in the microplan.scss file with appropriate styling:
.sub-boundary-summary-card{
gap: 1rem;
padding: 1rem;
}
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the CSS class is defined in the SCSS files
# Expected: Find the .sub-boundary-summary-card class definition
# Search for the class definition in SCSS files
rg -t scss "\.sub-boundary-summary-card\s*{"
Length of output: 172
Script:
#!/bin/bash
# Let's try a simpler search pattern for the CSS class
rg -t scss "sub-boundary-summary-card"
# Also search in CSS files in case it's not using SCSS
rg -t css "sub-boundary-summary-card"
# Let's also check if there are any SCSS/CSS files in the microplan module
fd -e scss -e css . health/micro-ui/web/micro-ui-internals/packages/modules/microplan/
Length of output: 304
Script:
#!/bin/bash
# Let's check the content of the CSS class definition
cat health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
Length of output: 10409
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss (6)
425-448
: Fix typo in class name: "deatils" should be "details"
The class name contains a spelling error that should be corrected for maintainability.
Well-structured responsive typography implementation
The responsive typography implementation using aspect ratio media queries is well-structured and follows best practices by:
- Using theme variables for consistent styling
- Providing appropriate breakpoints for different device types
- Maintaining font size hierarchy across viewports
450-452
: LGTM! Width implementation is appropriate
The use of fit-content
ensures the card adapts to its content size while maintaining constraints.
454-466
: Consider adding aria-label for icon wrapper
The styling implementation looks good. However, since this wrapper contains an icon, consider adding appropriate ARIA attributes in the corresponding component for better accessibility.
473-478
: Consider removing !important and handling overflow
Two suggestions for improvement:
- The use of
!important
flags suggests potential specificity issues. Consider restructuring the CSS to avoid them. - Fixed width dropdowns might truncate longer content. Consider adding overflow handling.
480-483
: Consider using min-height for better content accommodation
Using a fixed height might cause content overflow issues. Consider using min-height
instead to better accommodate varying content sizes.
485-494
: Fix typo in class name: "warpper" should be "wrapper"
The class name contains a spelling error that should be corrected for maintainability.
Well-structured tooltip implementation
The tooltip styling and positioning implementation is clean and follows best practices.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/CampaignBoundary.js (3)
305-305
: LGTM! Enhanced component configurability
The addition of editHandler, isEditable, and headerStyle props improves the component's flexibility and customization options.
332-334
: 🛠️ Refactor suggestion
Optimize duplicate SubBoundaryView implementations
The implementation still contains duplicate code for SubBoundaryView that can be optimized.
338-354
: 🛠️ Refactor suggestion
Optimize View More/Less button implementation
The implementation still contains duplicate Button components that can be consolidated into a single component with dynamic props.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js (5)
8-8
: LGTM: Import statement is correct
The addition of InfoOutline import is appropriate for the new icon implementation.
168-171
: Use JSX children pattern instead of children prop
This issue was previously identified. The TooltipWrapper implementation should use JSX children pattern for better React practices.
🧰 Tools
🪛 Biome (1.9.4)
[error] 170-170: Avoid passing children using a prop
The canonical way to pass children in React is to use JSX elements
(lint/correctness/noChildrenProp)
197-203
: Simplify conditional expression in isDisabled prop
This issue was previously identified. The isDisabled prop can be simplified by removing the unnecessary ternary operation.
🧰 Tools
🪛 Biome (1.9.4)
[error] 202-202: Unnecessary use of boolean literals in conditional expression.
Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with
(lint/complexity/noUselessTernary)
228-236
: LGTM: Clear and context-aware confirmation messages
The conditional rendering of deletion confirmation messages provides good user feedback with appropriate emphasis on important actions.
334-334
: LGTM: Improved button labels
The button labels have been updated to be more descriptive and action-oriented, which improves user experience.
Also applies to: 344-344
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js (1)
518-518
: Move inline styles to CSS modules
The inline styles for CardLabel components are duplicated and should be moved to a CSS module for better maintainability.
Also applies to: 533-533
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js (4)
7-7
: LGTM: Clean import addition
The InfoOutline component import is properly added and aligns with the component's requirements.
418-426
: LGTM: Improved delete confirmation messages
The delete confirmation dialog now provides clearer messages with proper distinction between custom and regular formulas.
500-500
: LGTM: More intuitive button labels
The button labels have been updated to be more descriptive and action-oriented, improving user experience.
Also applies to: 510-510
323-326
:
Fix React children prop usage
The tooltip wrapper implementation should use JSX children syntax instead of the children prop for better React practices.
Apply this change:
- <TooltipWrapper
- content={t(`FORMULA_MESSAGE_FOR_${formula.output}`)}
- children={<InfoOutline fill={"#C84C0E"} width={"1.25rem"} height={"1.25rem"} />}
- />
+ <TooltipWrapper
+ content={t(`FORMULA_MESSAGE_FOR_${formula.output}`)}
+ >
+ <InfoOutline fill={"#C84C0E"} width={"1.25rem"} height={"1.25rem"} />
+ </TooltipWrapper>
🧰 Tools
🪛 Biome (1.9.4)
[error] 325-325: Avoid passing children using a prop
The canonical way to pass children in React is to use JSX elements
(lint/correctness/noChildrenProp)
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
Outdated
Show resolved
Hide resolved
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss
Show resolved
Hide resolved
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss
Show resolved
Hide resolved
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
⛔ Files ignored due to path filters (6)
health/micro-ui/web/micro-ui-internals/example/package.json
is excluded by!**/*.json
health/micro-ui/web/micro-ui-internals/package.json
is excluded by!**/*.json
health/micro-ui/web/micro-ui-internals/packages/css/package.json
is excluded by!**/*.json
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/package.json
is excluded by!**/*.json
health/micro-ui/web/microplan/package.json
is excluded by!**/*.json
health/micro-ui/web/package.json
is excluded by!**/*.json
📒 Files selected for processing (4)
health/micro-ui/web/micro-ui-internals/example/public/index.html
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanCard.js
(1 hunks)health/micro-ui/web/public/index.html
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanCard.js (1)
Pattern **/*.js
: check
📓 Learnings (1)
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss (1)
Learnt from: siddhant-nawale-egov
PR: egovernments/DIGIT-Frontend#876
File: micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss:1940-2392
Timestamp: 2024-11-10T20:01:49.000Z
Learning: Classes related to interactive elements in the microplan preview section are mostly passed to Higher Order Components (HOCs), and ARIA attributes for non-HOC elements will be managed directly by adding them where necessary.
🔇 Additional comments (11)
health/micro-ui/web/micro-ui-internals/example/public/index.html (1)
14-15
: 🧹 Nitpick (assertive)
Consider security and stability improvements for external CSS dependencies
- The stylesheet versions are in beta (
0.0.2-beta.42
and0.1.50
). Consider using stable releases for production. - Add integrity hashes to the
<link>
tags to prevent CDN tampering:
- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.42/dist/index.css" />
- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.50/dist/index.css" />
+ <link rel="stylesheet"
+ href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.42/dist/index.css"
+ integrity="sha384-[HASH]"
+ crossorigin="anonymous" />
+ <link rel="stylesheet"
+ href="https://unpkg.com/@egovernments/digit-ui-health-css@0.1.50/dist/index.css"
+ integrity="sha384-[HASH]"
+ crossorigin="anonymous" />
- Add fallback in case the CDN fails:
<script>
function loadFallbackCSS(stylesheet) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = `/assets/css/${stylesheet}`;
document.head.appendChild(link);
}
window.addEventListener('error', function(e) {
if (e.target.tagName === 'LINK') {
loadFallbackCSS(e.target.href.split('/').pop());
}
}, true);
</script>
Let's verify if these are the latest stable versions available:
health/micro-ui/web/public/index.html (1)
11-13
: Review CSS dependency order and potential conflicts
The CSS files are loaded in a specific order:
- digit-ui-css (base)
- digit-ui-components-css
- digit-ui-health-css
Let's check for potential style conflicts or overrides:
✅ Verification successful
Review CSS dependency order and potential conflicts
The CSS files are loaded in the correct order with no concerning conflicts:
digit-ui-components-css
provides base component stylesdigit-ui-health-css
provides health module-specific styles
The analysis shows:
- No direct selector conflicts between the CSS files
- Health CSS file contains module-specific styles that complement rather than override the base styles
- The order ensures proper cascading where health module styles can appropriately extend base component styles
The current order allows for proper style inheritance and specificity, with no evidence of problematic overrides.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for potentially conflicting CSS selectors across the dependencies
# Fetch and compare CSS files for overlapping selectors
echo "Fetching CSS files and checking for selector conflicts..."
for url in \
"https://unpkg.com/@egovernments/digit-ui-css@1.8.3/dist/index.css" \
"https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.42/dist/index.css" \
"https://unpkg.com/@egovernments/digit-ui-health-css@0.1.50/dist/index.css"
do
echo "Analyzing $url"
curl -s "$url" | grep -E "^[.#][^{]+ {" | sort
done
Length of output: 110722
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/MicroplanCard.js (2)
49-49
: Verify the CSS class existence
A new className "microplan-employee-module-card"
has been added. We should verify that this class exists in the corresponding SCSS/CSS files.
Let's check for the CSS class definition:
✅ Verification successful
CSS class exists and is properly defined
The class microplan-employee-module-card
is correctly defined in health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
, matching its usage in the component.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the CSS class exists
# Expected: Find the class definition in SCSS/CSS files
# Search for the class definition
rg 'microplan-employee-module-card'
# Search specifically in SCSS files
fd -e scss -x rg 'microplan-employee-module-card' {}
Length of output: 383
45-45
: Verify the Icon prop type change
The Icon prop has been changed from a JSX element <SVG.UpdateExpense />
to a string "UpdateExpense"
. This could be a breaking change if the EmployeeModuleCard
component expects a different prop type.
Let's verify the expected prop type:
✅ Verification successful
Looking at the EmployeeModuleCard
implementation from the search results, I can see that the Icon prop is rendered directly within a span element:
<span className="logo removeBorderRadiusLogo">{Icon}</span>
Let me search for other usages of EmployeeModuleCard to understand the common pattern.
Based on the search results, I can see that the EmployeeModuleCard
component accepts both JSX elements and strings as valid Icon prop types. This is evident from the various usages across the codebase:
- String icons:
Icon: "Engineering"
,Icon: "AdminPanelSettings"
- JSX icons:
Icon: <SVG.Support />
,Icon: <WorksMgmtIcon />
The component renders the Icon prop directly within a span element: <span className="logo removeBorderRadiusLogo">{Icon}</span>
, which means it can handle both types of icons.
The Icon prop type change is valid
The change from JSX element to string "UpdateExpense"
is a valid modification as the component supports both formats. Other modules in the codebase are already using string-based icons successfully.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check EmployeeModuleCard implementation for Icon prop type
# Expected: Find the prop type definition or usage examples
# Search for EmployeeModuleCard component definition
ast-grep --pattern 'const EmployeeModuleCard = $_'
# Search for other instances of EmployeeModuleCard usage
rg -A 3 'Icon:.*UpdateExpense'
Length of output: 6931
Script:
#!/bin/bash
# Search for other EmployeeModuleCard usages to understand Icon prop pattern
rg -A 2 'Icon:' | grep -v 'UpdateExpense'
Length of output: 16385
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss (7)
454-466
: Consider adding aria-label for icon wrapper
The styling implementation looks good. However, since this wrapper contains an icon, consider adding appropriate ARIA attributes in the corresponding component for better accessibility.
502-504
: LGTM!
The minimum height constraint for the employee module card is appropriately implemented.
425-448
:
Fix typo in class name: "deatils" should be "details"
While the responsive typography implementation using aspect ratio media queries is well-structured, there's a spelling error in the class name that needs to be corrected.
-.microplan-deatils-view-card{
+.microplan-details-view-card{
Remember to update any corresponding JavaScript/TypeScript files that reference this class name.
473-478
: 🛠️ Refactor suggestion
Consider removing !important and handling overflow
Two suggestions for improvement:
- The use of
!important
flags suggests potential specificity issues. Consider restructuring the CSS to avoid them. - Fixed width dropdowns might truncate longer content. Consider adding overflow handling.
.action-button-open-microplan{
.header-dropdown-menu{
- min-width: 20rem !important;
- width: 20rem !important;
+ min-width: 20rem;
+ width: 20rem;
+ max-width: 100%;
+ overflow-x: auto;
}
}
480-483
: 🧹 Nitpick (assertive)
Consider using min-height for better content accommodation
Using a fixed height might cause content overflow issues. Consider using min-height
instead to better accommodate varying content sizes.
.action-bar-wrap{
- height: 4.5rem;
+ min-height: 4.5rem;
align-items: center;
}
485-488
:
Fix typo in class name: "warpper" should be "wrapper"
The class name contains a spelling error that should be corrected for maintainability.
-.tooltip-warpper-village-hierarchy{
+.tooltip-wrapper-village-hierarchy{
490-495
: 🛠️ Refactor suggestion
Consider a more flexible overflow handling approach
Using !important
to force overflow: visible
might cause issues with nested scrollable content.
.accessibility-pop-up {
.digit-popup-children-wrap {
- overflow: visible !important;
+ &.allow-overflow {
+ overflow: visible;
+ }
}
}
health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplan.scss
Show resolved
Hide resolved
* fixed assumption audit fixes (#1758) * fixed draft issue of Setup campaign (#1757) Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> * Summary css fix (#1755) * updated css for summary screen * removed log * added null check --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Breadcrumb for usermanagement (#1761) * Breadcrumb changes * console.log removed * indentations * Finalised microplan download (#1762) * Feat : Added download button for finalised microplans * Added Todo * fixed HCMPRE-776 and removed updated old validation (#1763) * fixed HCMPRE-776 and removed updated old validation * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/MapView.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update MyCampaign.js * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignDates.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update CampaignDates.js * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update SetupCampaign.js --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix key (#1764) Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * Fixed UiCustomisation Digit issue (#1766) Checking UisCustomisation * Fixed double selection of boundaries (#1765) Update MultiSelectDropdown.js * Fixed loader,breadcrumb,table cells css and added placeholder text fo… (#1769) Fixed loader,breadcrumb,table cells css and added placeholder text for assumption fields * fixed targetvalidation and added no results in boundary (#1768) * Dynamic column pop inbox (#1770) * Added dynamic column inside pop inbox * updated status to action in status logs * updated status log * added comment logs for edit population * updated css version * updated code rabbit comment and css version --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Feature/bug (#1773) * z-index and camapaign-name in preview * ui-ux-demo-review * version updates * ver * Update ViewHierarchy.js --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> * Updated the search dropdown (#1776) updated the search dropdown Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Info ToolTip added (#1775) * Added info icon on formula and assumptions * Incremented CSS version * Vesrion update (#1778) * updated react-components version to fix icon issues in inbox screen * updated versions everywhere * myMicroplanFixes (#1777) * My microplan data fixes, localisation fixes * setup response screen fixes, breadcrumb localisation code correctify * search bar fix * fixes * ADD NEW LOCALE * roletable fixes for mobile number search, qa issue fix * FIXES * quickfixes * quick fixes/ Tagging UI UX fixes * fix * added locale * census table assignee issue fixes * role table pop up css fix and my microplan click fix * fixes and stepper click enable for back * added user tag fixes * UserAccessfixes * Custom Assumption - Custom Formula * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Updated date formate (#1779) * updated date formate and css * updated css --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Fix for cycle draft ::changes for the draft flow (#1780) * Fixed assumption form multi save (#1781) Update SetupMicroplan.js * user tagging fixes (#1782) Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * Usermanagement row on click redirect (#1783) * Changes to usermanagement redirext on row click * changes to onRow click in userManagement * console removed * changes * null check * changes * removing extra mdms call * changing useState * removed var * changes * changes * Plan and Pop inbox changes (#1784) * removed popup for facilitya and population upload * updated plan inbox --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Feature/bugs (#1785) * bug/boundary * changed field name * added something * Update checklistSearchConfig.js * Update ViewHierarchy.js * fixes * fixes1 * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/ViewHierarchy.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fixed order in boundary details and changed hierarchy master (#1786) * added the checks for the update campaign flow (#1788) * Open Boundary Management ui Info pending changes (#1789) * pending changes * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/hooks/useBoundaryHome.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/GeoPode.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/GeoPode.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Reverted action in assign to all, updated the column heading with pro… (#1790) * reverted action in assign to all, updated the column heading with projecttype * removed logs --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Usermanagement css and boundaryScreen css (#1791) Changes to userManagement, css for boundary * Vehicle Change Assumptions & Formula (#1787) * user tagging fixes * Vehicle Assumptions and Vehicle Formula * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * yarn --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * css fixes (#1792) Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> * LCOALISATION FIXES (#1793) * user tagging fixes * Vehicle Assumptions and Vehicle Formula * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * yarn * locaisaton code fixes --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * some-ui-fixes (#1794) * some-ui-fixes * version updates * fixed boundary selection dropdown issue (#1796) * fixed boundary selection dropdown issue * fixed search juridiction dropdown --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Allowed to update the name of microplan (#1795) * Allowed to update the name of microplan * changed hardcoded date to 30 from 100 --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * demo issue fixes (#1797) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * ui fixes (#1798) * Added retry of failed campaign * stepper rvert back (#1799) * ESTIMATION & FORMULA FIXES (#1804) * user tagging fixes * Vehicle Assumptions and Vehicle Formula * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * yarn * locaisaton code fixes * estimationa and formula fixes --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * error toast and checklist updates (#1805) error taost and cehcklist updates * HCMPRE 1131 (#1807) * user tagging fixes * Vehicle Assumptions and Vehicle Formula * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * yarn * locaisaton code fixes * estimationa and formula fixes * my microplan fix * fixes --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Updated sidebar for microplan (#1802) * Updated sidebar for microplan * Update index.scss --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * style change of toolTip (#1806) * toast and minor ui (#1809) * ui/ux fixes (#1810) * Changes to AssummptionList and stepper disable in setupConfig (#1811) * Changes to assumptions list * setupCompleted changes * Formula View, and Select Acitivity Screen CSS changes (#1803) * select-activity-commit * Hover over formulaConfigView * margin adjust * removed console * css changes * package update * changes to css * package css update * Revert "Allowed to update the name of microplan (#1795)" (#1812) This reverts commit e32aad6. Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * updated message for header and label and added validation for max length (#1813) * Cleaned up boundary Management code and add some validations * redirect and ui (#1814) * Assumptionlist fix (#1815) changes * changes in the delivery type and selection of boundary (#1816) * to be picked (#1819) * to be picked * checklist and other changes * role table fixes, drop down fix, pop up fix, use tag fix (#1820) * user tagging fixes * Vehicle Assumptions and Vehicle Formula * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/Hypothesis.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * yarn * locaisaton code fixes * estimationa and formula fixes * my microplan fix * fixes * pull fixes * user tag changes * fixes --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fetch data type from mdms (#1822) * fixed app delivery condition (#1825) * not selected added in single value list (#1824) * not selected added in single value list * isActive added * one more fix * Facility dropdown (#1817) * Added single dropdown in facilityCatchment * tenantId fix * Hierarchies fix * Microplan name update (#1821) * updated start date for campaign * added update microplan name changes --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Internal demo fixes (#1827) * disabled the viewer card * updated suggested microplan name formate * updated assignee to assigner in timeline wrapper * updated button side in my microplan screen * updated sucurity and accessibility edit buttons * commented tranportation mode from accessibility details * added assignee next to village updated comment * updated plan inbox --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * tenant logo css fix (#1828) * Facility data fix (#1829) FacilityData Fix * Added boundary manager access to the home card * Updated activity selection screen to have view also (#1830) updated activity selection screen to have view also Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Added confirmation pop up to finalise actions (#1832) added confimation pop up to finalize actions Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Popup for userAccess boundary area and toast message for assign unassign (#1831) * Changed localization * Loc * Changes for popup in userAccess * changes * My MICROPLAN fixes, formula fixes (#1835) * Hcmpre 1290 (#1834) * fixed app delivery condition * added my microplan screen * changes in the url * changes --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> * Inbox (#1838) * fixed app delivery condition * fixed hover issue on search screen * demo review changes in boudnary management (#1836) * demo review changes in boudnary management * different download template for hierarchy from geopode and completely new * info cards added * code clean * Update searchSavedPlansWithCampaign.js (#1839) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Space (#1840) * fixed app delivery condition * added space * fixed miner issues (#1837) * fixed miner issues * fixed pop inbox issue * fixed status log issue * Update PopInbox.js --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Update searchSavedPlansWithCampaign.js (#1841) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Gepspatial map view (#1842) * added minor css changes and basic logic for geospatial view * updated css version * updated chooseactivity screen * fixed syntax issue * PO finding fixes (#1843) * Fix campaign Type in draft (#1846) * Plan Inbox patch fix (#1847) * added workflow for toast message * updated workflow button color * added count for assign to me and all tabs * added back button --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Go Back button and microplan name quotes fix (#1844) * Updated the core and other component version for landing page card override * Po finding fixes2 (#1845) * added tooltip for residing boundary * registered hierarchy tooltip inside component * added different workflow message and alert header * updated button color for workflow actions * added info icons in select activity card * added back button * fixed action for facility * updated css version --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Summary user role tagging and Response Screen (#1852) * Changes ro userAccessTableWrapper * Response Screen * comment removed * minor updates (#1853) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * toast localistaion (#1855) * updated core component & css version * updating the module versions * Reverting the libraries version update * Updated all the core component version from 1.8.3 to 1.8.10 * PO fixes (#1857) * reverted column freeze as it was causing issues (#1858) reverted column fix as it was causing issues * Added column in sorted way, added assignee, added total pop (#1859) Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * added serving facility (#1860) Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * updated code (#1861) * Formcomposer action bar fixes (#1862) * added serving facility * form composer action bar fix --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * Updated few localisation messages * added loader screen to ftech data from microplan integration screen * Updated UI Customizations file * Approved microplan integration * Added toast & success for api response * plan inbox assignee fix (#1863) * added serving facility * form composer action bar fix * plan inbox assignee fix --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * formula and assumption refresh issue (#1864) * added serving facility * form composer action bar fix * plan inbox assignee fix * formula and assumption refresh issue --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * minor changes (#1866) * Action bar fixes, session fixes (#1867) * added serving facility * form composer action bar fix * plan inbox assignee fix * formula and assumption refresh issue * action bar hidden fixes, session fixes * Update index.js * Update index.js --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * Download Button (#1865) * Loc changes to popInbox * Loc * Changes * UICust update * css package update * Changes * changes * Update UICustomizations.js * Name of file * For Download update * UI cust changes * added return in UI * Changes --------- Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * User Role being displayed in Pop, Plan and Fac (#1854) * changes localizations * Adding userName and their roles * resolved conflict * css package update * UIcustomization dropdown changes * pop-inbox changes * package update * loc added * loc changes * dropdown options changed * UICust making same as in example * UnassignPopup * comments * loc * Loader added * changes * changes to roletablecomposer for unassign popup * changes * Facility Catchment * reverted facility popup * Changes * KPI Card * package update * Facility data keys * changes according to comments * Changes * rowOn click redirection * Dummy Data removed * removed import * removed for residing boundary * removed 5000 * package update for css --------- Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * fixes (#1869) * added serving facility * form composer action bar fix * plan inbox assignee fix * formula and assumption refresh issue * action bar hidden fixes, session fixes * fixes * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * patch fix (#1868) * route back to home on back * fixed refresh issue for pop inbox --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * polling fix (#1870) * polling fix * Update TimelineComponent.js * assumptions fixes (#1871) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Facility pop up fix (#1872) * Localizations and Actions being cut (#1874) * Changes * Package update * Disabled updating security and accessibility details after finalize … (#1873) Disabled updating security and accessibility details after finalize facility catchment Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Update PopInbox.js (#1875) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * scroll (#1876) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Update FacilityPopup.js (#1877) * qquickfix (#1878) * added serving facility * form composer action bar fix * plan inbox assignee fix * formula and assumption refresh issue * action bar hidden fixes, session fixes * fixes * fix --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * Updated the microplan integration piece * adhoc changes (#1879) * some fixes * Update PlanInbox.js * added checklist redirection (#1880) * added checklist redirection * removed console * Updated workbench module version * Plan and Pop inbox fix (#1881) * fixed pop inbox boundary getting empty issue * fixed back button issue * updated search juridiction component * fixed facility pop up boundary refresh * removed pending for approval from status filter --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * updated table and other fixes (#1882) * updated table and other fixes * fixed table issue * Latest KPI values and Heading change (#1883) * Popup changed to alert type * UserName to name * userName to name * changes to heading font wieght * css package update * Removed i icon * changes * removed comments * removed comments * changes * isLoading removed * updated css --------- Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Added count of villages and facilities in confirmation messages (#1885) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Update UserUpload.js (#1886) * fixed localization issue (#1888) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Removed Core HRMS and updated the timeout of fetch from microplan * changed residing-boundary to multiselect dropdown, fixed table scroll… (#1889) * changed residing-boundary to multiselect dropdown, fixed table scroll styles, made boundary selection popup dropdown searcheable * fixed dropdown alignment * fixed validation in boundary create and timeline button in the summary (#1890) * fixed validation in boundary create and timeline button in the summary * changed localisation condition * Added missing the translation * Added list of assignee for pop and plan inbox (#1887) * added list of assignee for pop and plan inbox * updated comments * updated assignee for plan inbox --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Re render assumption fix, atleast one mdms check, blank custom name check, (#1884) * added serving facility * form composer action bar fix * plan inbox assignee fix * formula and assumption refresh issue * action bar hidden fixes, session fixes * fixes * fix * action bar fix, formula next back issue * assumption and formula one mdms check and refetch blank label check * remove status log column * fix * adhoc fix * fix * fix * del session --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * fixed validation cond for app (#1891) * fixed filestore call issue (#1895) * toast fix, user tagging table dropdown fix and added comment toast (#1896) * FIXES (#1893) * added serving facility * form composer action bar fix * plan inbox assignee fix * formula and assumption refresh issue * action bar hidden fixes, session fixes * fixes * fix * action bar fix, formula next back issue * assumption and formula one mdms check and refetch blank label check * remove status log column * fix * adhoc fix * fix * fix * del session * FIXES 1. After clicking on nextin vehicle after addinginvalid valu3 it redirects me to 1st assumption page 2. yes no buttton ki jagah same rakho na dono pop up me in formula and assumption pop up 3. User can add same duplicate text assumption and same value comess. similary for same dropdowns can be selected multiple times(in vehicle). Applies for formula and assumption 4. cache issue in pop of add new in assumption and formula. Entered value is not reset if they close and reopen the popup. Applies for formula and assumption 5. need different loc code for description for vehicle assumption and vehicle estimation * revert * a --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * ui fixes. (#1897) * ui fixes. * review changes * review changes1 * Fetch microplan related changes (#1898) * mychange * added changes for fetch from microplan screen * updated packege * added back button, redirected checklist success and fixed null issue … (#1894) added back button, redirected checklist success and fixed null issue for app * fixed finalized button issue (#1899) * added fixes for the campaign update and fetch from mp * added timeout cleaned up & fetch will start after the data template download * Employee search fix (#1892) * button change * Changes * Formula name validation * Changes * console log removed * changes * changes * changes * Original formula config * Formula config change for toast * Update FormulaConfiguration.js --------- Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Bug fix (#1900) * fixed decimal issue and total not getting validated issue * fixed user tagging multiselect dropdown issue --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Added few extra waiting steps for templates * KPI card fix, and css change (#1903) * Heading added * changes to query, for kpi card * css change * css package update * update to inbox codes (#1904) updates * Added dynamic columns in facility screen (#1902) * Added dynamic columns in facility screen * changed the filter condition * Update FacilityPopup.js --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * validations done for assumptions and formula (#1906) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * localisation and error codes (#1905) * Added fixes for timeout and redirection for fetch microplan (#1901) * Added fixes for timeout and redirection for fetch microplan * Update useFetchFromMicroplan.js * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/fetchFromMicroplan.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/fetchFromMicroplan.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Added fixes for the template generation * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/fetchFromMicroplan.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/fetchFromMicroplan.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * updated --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * wait and retry message (#1909) * Updated toast wran to warning message toast type * checking popup issue in facility screen (#1910) Co-authored-by: Swathi-eGov <swathi.chatrathi@egovernments.org> * Adhoc fixes 91 (#1912) * updates to validation * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * updated regex --------- Co-authored-by: Nipun Arora <aroranipun1@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Pop inbox Pagination fix (#1907) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Facility Pagination Fix (#1908) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Feature/er (#1914) * wait and retry message * type of structure changed for irs * fixed plan inbox issues (#1915) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Table changes (#1913) * a lot of changes * small change * changes * loc * removed * added fixes for sort, view summary issue, no results in dropdown (#1916) added fixes * fixed facility catchment pop up issue (#1917) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Fixed Audit issues (#1918) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * removed alphanumeric valiadtion (#1922) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * updated the loader screen loader styles as per ux audit * Kpis integrate (#1919) * Kpis integration * Some style changes * Some validations * Remove console * Removed merged changes * Data null handled * Data null handled * Assumption Toast Validation and Irs removed 1 (#1921) * changes * changes * changes * Fixed accessibility dropdown issue (#1923) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Added extra steps and styles updated * Added toast and changes primary, seccondary in Assumption,Formula (#1924) * changes * changes * changes * changes * Changed hierarchy schema for microplan (#1925) * Changed hierarchy schema for microplan * Update UserUpload.js * removed duplicate campaignId --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Fixed small issues (#1927) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Audit fixes main (#1926) * audit fixes * fixed campaign details css issue * Update health/micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * updated core, react-components,ui-components and releated css versions * added icon for download and changed primary to secondary for action button --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * width fix for module card (#1929) * Formula Checking Fix (#1930) * small changes * changes * changes * Edit Size button changed (#1931) changes * Update HypothesisWrapper.js (#1932) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Feature/fixes (#1928) * microplan hover and campign fixes with checklist minor improvements * bottom margin below add levels * review changes * Updates to formula (#1933) * Update HypothesisWrapper.js * Update FormulaConfigWrapper.js --------- Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * fixed pop issue (#1934) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * css fix on card comp (#1935) * Updated the campaign Card for the roles mapping * Fixed screen breaking issue (#1936) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * validation update (#1937) Update HypothesisWrapper.js * Fixed assignee count for pop and plan inbox (#1938) * Fixed assignee count for pop and plan inbox * fixed back button issue in plan inbox * removed logs --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Changes in facility kpis (#1939) * Changes in facility kpis * Some changes * fixed product chip and summary issue (#1941) fixed productchip and summary issue * Mdms kpi (#1942) * Kpis from mdms * Some optimizations * Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/useKpiDssSearch.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Dropdown popup fixes (#1943) * removed custom loader, updated dropdown styles inside popup,fixed action drodpown css * updated css version * Added inline validations (#1944) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Added refetch (#1945) * Assumption formula fixes (#1946) * added a toast on back button * updated formula source to CUSTOM when any custom assumption is used in --------- Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Update createUpdatePlanProject.js (#1948) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Fixed back button and edit population error message logic (#1949) * fixed back button and edit population error message logic * updated back button in facility screen * added show on ui conditions on fields * added translation function --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * localizations for user management and user tag (#1950) * Loc in userManagement * Changes to user tag loc * added status filters (#1952) * additional validations on assumptions + showing formulas in plan inbox based on show on estimation dashboard (#1953) additional validations * Updated Bread crumbs (#1954) * fixed back button and edit population error message logic * Updated breadcrumbs * removed unused import --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * sort issue fix, title for buttons, actionbar fix (#1955) * Patch fix (#1956) * added list of roles for assigner * added null check --------- Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Popup fix (#1958) * fixed popup scroll issue * updated versions * Changes for kpis (#1960) * Fixed toast issue + fixed invalidation of assumption and formula (#1963) Co-authored-by: Nipun Arora <aroranipun1@gmail.com> * Updated the loader text, updated the icon information, change log updated * fixed error message issue (#1964) Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * Adhoc fixes 13: Fixed formula custom cascading changes + validations (#1966) * updated toast error in formulas * Update createUpdatePlanProject.js * updated mdms paths (#1968) * Update searchDssChartV2.js (#1969) * fixed resources,delivery screen issue and added campaign name (#1965) * fixed resources,delivery screen issue and added campaign name * added classname * Update health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/BoundarySummary.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * removed logs --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * bug bash bug of download popup openinng again and again (#1961) * bug bash bug of download popup openinng again and again * review changes * Update UploadData.js --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> * changes from count to quantity (#1970) * changes from count to quantity * removed logs * Feature/time (#1971) * timeline fix for microplan * ui * Update campaign.scss --------- Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> * added campaign name in update (#1973) * Updated loc codes (#1976) Update Module.js * Revert module changes for localisation (#1977) Revert "Updated loc codes (#1976)" This reverts commit cf596aa. * Added fix for the buil issue for trying out the optional deepndency #1974 (#1978) Added fix for the buil issue for trying out the optional deepndency * Some handlings (#1980) * Updated hrms path (#1979) updated hrms path Co-authored-by: rachana-egov <rachana.singh@egovernment.org> * removed commented code * fixed usermanagement toast issue (#1982) * removed commented code * Added core ui build to check performance * Fixed error issue (#1983) * updated the package version of campaign manager modules * adding utils and remove hardcoding module name (#1984) * adding utils and remove hardcoding module name * Update UICustomizations.js * Update index.js --------- Co-authored-by: NabeelAyubee <nayubi7@gmail.com> Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> * added title for all buttons (#1985) * updated package versions * filtering fixes (#1986) Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * Updated the config for the core app * updated directory * Feature/hcmpre1418 (#1988) rounding off to nearest integer in attributes * formatted * Update health/micro-ui/web/core/install-deps.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update health/micro-ui/web/core/install-deps.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * updated changeQueryName for planfacilityserach as residingBoundaries … (#1989) * updated changeQueryName for planfacilityserach as residingBoundaries is changed to multiselect dropdown * fixed length change issue * fixed page responsiveness issue for formula configuration screen (#1990) * clearing console (#1991) Co-authored-by: NabeelAyubee <nayubi7@gmail.com> * fixed rerendering of summary screen in update dates (#1992) --------- Co-authored-by: Swathi-eGov <137176788+Swathi-eGov@users.noreply.github.com> Co-authored-by: Bhavya-egov <137176879+Bhavya-egov@users.noreply.github.com> Co-authored-by: rachana-egov <137176770+rachana-egov@users.noreply.github.com> Co-authored-by: rachana-egov <rachana.singh@egovernment.org> Co-authored-by: abishekTa-egov <abishek.t@egovernments.org> Co-authored-by: ashish-egov <137176738+ashish-egov@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: nabeelmd-eGov <nabeel.md@egovernments.org> Co-authored-by: NabeelAyubee <nayubi7@gmail.com> Co-authored-by: suryansh-egov <suryansh.singh@egovernments.org> Co-authored-by: Nipun Arora <aroranipun1@gmail.com> Co-authored-by: Swathi-eGov <swathi.chatrathi@egovernments.org> Co-authored-by: Shashwat Mishra <71879793+shashwat-egov@users.noreply.github.com> Co-authored-by: Anuraj <154124191+anuraj-egov@users.noreply.github.com> Co-authored-by: Bhavya-egov <bhavya.mangal@egovernments.org>
Choose the appropriate template for your PR:
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Style
Refactor