Skip to content
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

css fixes #1715

Merged
merged 3 commits into from
Oct 30, 2024
Merged

css fixes #1715

merged 3 commits into from
Oct 30, 2024

Conversation

Swathi-eGov
Copy link
Contributor

@Swathi-eGov Swathi-eGov commented Oct 30, 2024

Choose the appropriate template for your PR:

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced user management with a new mobile number validation method.
    • Improved search functionality with additional criteria based on user input.
    • Updated UI components for better layout and styling, including new button sizes and action icons.
  • Bug Fixes

    • Refined handling of user roles and statuses for better navigation and button rendering.
  • Style

    • Added and modified CSS classes for improved visual consistency across components.
    • Adjusted margins and paddings for better layout on the employee page.
  • Documentation

    • Updated configurations to reflect changes in user interactions and data processing.

@Swathi-eGov Swathi-eGov requested a review from a team as a code owner October 30, 2024 10:50
Copy link
Contributor

coderabbitai bot commented Oct 30, 2024

📝 Walkthrough

Walkthrough

The pull request introduces a series of modifications across multiple files in the micro UI framework. Key updates include enhancements to user management configurations, styling adjustments in SCSS files, and refinements in component rendering logic. Notable changes involve the addition of validation methods, improved handling of user roles, and updates to UI components to enhance user experience. The changes also streamline certain functionalities, such as removing redundant elements and optimizing layout properties, while maintaining core logic and functionality throughout the application.

Changes

File Change Summary
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js Added customValidationCheck method; updated preProcess methods for various configurations; enhanced additionalCustomizations.
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/facility.scss Added new CSS classes and styles for scrollbar customization; modified existing styles for layout improvements.
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss Adjusted margins, paddings, and display properties; added !important to enforce styles; introduced new mobile styles.
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/villageView.scss Modified margin properties for existing classes; added new class .questions-divider.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfigWrapper.js Updated layout to use class names instead of inline styles; retained core functionality.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js Adjusted import statements; refined internal logic; modified rendering logic for Card and Button components.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js Refactored data handling logic; updated rendering of hierarchy and selected boundaries; improved search functionality.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/TableSearchBar.js Made cosmetic changes to formatting and style properties; altered border radius of input field.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js Updated styling for Card and Header; refined layout management; preserved core functionality.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccessWrapper.js Improved formatting for readability; updated class name for Card; adjusted gap style.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/accessbilityPopUP.js Added width styles to Button components; preserved core logic and state management.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js Removed functionality related to confirming target population; added equalWidthButtons property to PopUp.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/securityPopUp.js Added Divider component for visual separation of questions; adjusted spacing for RadioButtons.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js Introduced Header component; modified button rendering logic to include icons.
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js Updated button sizes; removed unnecessary dividers; maintained popup display logic.

Poem

In the meadow where rabbits play,
Changes hop in a bright array.
With styles refined and logic clear,
Our UI blooms, bringing cheer!
Buttons gleam, and layouts sing,
A joyful dance, let the changes ring! 🐇✨


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 22

🧹 Outside diff range comments (10)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/securityPopUp.js (1)

Line range hint 94-123: Consider adding validation for required questions before save.

While the component handles API errors well, it might benefit from client-side validation before attempting to save, especially for questions marked as required.

Consider adding validation logic before the save operation:

const validateAnswers = () => {
  const requiredQuestions = questions.filter(q => q.required);
  const unansweredRequired = requiredQuestions.filter(q => !answers[q.id]);
  return unansweredRequired.length === 0;
};

const handleSave = async () => {
  if (!validateAnswers()) {
    setShowToast({ 
      key: "error", 
      label: t("HCM_REQUIRED_QUESTIONS_ERROR") 
    });
    return;
  }
  // ... existing save logic
};
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js (3)

Line range hint 9-10: Remove unused state for confirmedTargetPopulation

The UI elements for confirmedTargetPopulation have been commented out, but the state initialization is still present. This creates inconsistency and potential maintenance issues.

Clean up the unused state by applying this diff:

  // State to manage confirmed population and target population
  const [confirmedTotalPopulation, setConfirmedTotalPopulation] = useState("");
- const [confirmedTargetPopulation, setConfirmedTargetPopulation] = useState("");
  const [showToast, setShowToast] = useState(null);

Also applies to: 77-86


Line range hint 13-19: Update useEffect to remove confirmedTargetPopulation initialization

The effect hook still attempts to initialize the removed confirmedTargetPopulation state.

Update the effect hook to match the current component state:

  useEffect(() => {
    if (census?.additionalDetails) {
      setConfirmedTotalPopulation(census.additionalDetails.confirmedTotalPopulation || "");
-     setConfirmedTargetPopulation(census.additionalDetails.confirmedTargetPopulation || "");
    }
  }, [census]);

Line range hint 44-60: Clean up commented properties in mutation payload

The mutation payload contains commented properties that should be removed for better code maintainability.

Update the mutation payload:

  body: {
    Census: {
      ...census,
      totalPopulation: confirmedTotalPopulation,
      additionalDetails: {
        ...census.additionalDetails,
-       // confirmedTotalPopulation,
-       //confirmedTargetPopulation,
      },
      workflow: {
        ...census.workflow,
        action: workflowAction,
      },
    },
  }
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/accessbilityPopUP.js (1)

Line range hint 1-176: File naming convention needs to be consistent.

The filename accessbilityPopUP.js has inconsistent casing. Consider renaming it to AccessibilityPopUp.js to match the component name and follow proper React component naming conventions.

🧰 Tools
🪛 Biome

[error] 155-164: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccessWrapper.js (1)

Line range hint 65-73: Consider enhancing error handling in handleNext.

The current error handling when data is null for national roles could be more informative. Consider adding more context to help users understand why they can't proceed.

Apply this diff to improve the error message:

       if (data === null && nationalRoles.includes(String(rolesArray?.[prevKey - 1]))) {
+        console.debug(`Cannot proceed: data is null for national role ${rolesArray?.[prevKey - 1]}`);
         setShowErrorToast(true);
         return prevKey; // Keep the same value if condition is true
       } else {
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js (2)

Line range hint 31-98: Consider refactoring the deletion logic for better maintainability.

The handleConfirmDelete function contains complex nested logic and multiple state updates. Consider breaking it down into smaller, focused functions for better maintainability and testing.

+ const clearDependentFormulas = (deletedOutput, formula) => {
+   const shouldClearInput = formula.input === deletedOutput;
+   const shouldClearAssumption = formula.assumptionValue === deletedOutput;
+   
+   return {
+     ...formula,
+     input: shouldClearInput ? "" : formula.input,
+     assumptionValue: shouldClearAssumption ? "" : formula.assumptionValue
+   };
+ };

  const handleConfirmDelete = () => {
    if (formulaToDelete !== null) {
      const deletedFormula = formulas.find(operation => operation.output === formulaToDelete.output);
      
-     // Current complex implementation
+     // Update formulas
+     const updatedFormulas = formulas.filter(operation => operation.output !== formulaToDelete.output);
+     setFormulas(updatedFormulas);
+     
+     // Update deleted formulas tracking
+     if (!deletedFormulaCategories.current[category]) {
+       deletedFormulaCategories.current[category] = [];
+     }
+     deletedFormulaCategories.current[category].push(deletedFormula.output);
+     setDeletedFormulas(prev => [...prev, deletedFormula.output]);
+     
+     // Handle cascade effects
+     setFormulaConfigValues(prevValues => 
+       prevValues
+         .filter(value => value.output !== deletedFormula.output)
+         .map(formula => clearDependentFormulas(deletedFormula.output, formula))
+     );
    }
    setShowPopUp(false);
  };

Line range hint 246-333: Extract common PopUp logic and add missing key props.

The delete and add formula PopUps share similar structure. Consider extracting common logic and adding required key props.

  footerChildren={[
    <Button
+     key="confirm"
      type={"button"}
      size={"large"}
      variation={"secondary"}
      label={t("YES")}
      onClick={handleConfirmDelete}
    />,
    <Button
+     key="cancel"
      type={"button"}
      size={"large"}
      variation={"primary"}
      label={t("NO")}
      onClick={handleCancelDelete}
    />,
  ]}

Consider creating a reusable ConfirmationPopUp component:

const ConfirmationPopUp = ({ 
  isOpen, 
  onClose, 
  onConfirm, 
  title, 
  children 
}) => (
  <PopUp
    className="popUpClass"
    type="default"
    heading={title}
    equalWidthButtons={true}
    children={children}
    onOverlayClick={onClose}
    footerChildren={[/* ... */]}
    sortFooterChildren={true}
    onClose={onClose}
  />
);
🧰 Tools
🪛 Biome

[error] 269-269: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js (2)

Line range hint 295-309: Remove commented code blocks to improve maintainability.

Instead of keeping commented code in the file:

  1. If the code will be needed later, create a ticket to track the TODO items.
  2. If the code is obsolete, remove it entirely.
  3. Consider using Git history to track previous implementations if needed.

This will improve code readability and reduce maintenance overhead.

Would you like me to help create tickets for tracking these TODO items?


Line range hint 13-24: Consider refactoring to improve component maintainability.

The component currently manages multiple responsibilities and state variables. Consider:

  1. Breaking down the component into smaller, focused components
  2. Using a reducer pattern to manage popup states instead of multiple useState calls
  3. Creating a custom hook to centralize the data fetching logic

This would improve code organization, testability, and maintainability.

Example reducer pattern for popup states:

const popupReducer = (state, action) => {
  switch (action.type) {
    case 'SHOW_POPUP':
      return { ...state, [action.popup]: true };
    case 'HIDE_POPUP':
      return { ...state, [action.popup]: false };
    default:
      return state;
  }
};

// Usage in component
const [popupState, dispatch] = useReducer(popupReducer, {
  accessibility: false,
  security: false,
  editPopulation: false,
  commentLog: false
});

Also applies to: 37-40

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between b9fb371 and d3eca50.

📒 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/pages/employee/facility.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/css/src/pages/employee/villageView.scss (3 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfigWrapper.js (2 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js (9 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js (9 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/TableSearchBar.js (3 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js (2 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccessWrapper.js (4 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/accessbilityPopUP.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/securityPopUp.js (3 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js (2 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js (4 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js (3 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfigWrapper.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/RoleTableComposer.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/TableSearchBar.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccessWrapper.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/accessbilityPopUP.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/securityPopUp.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js (1)

Pattern **/*.js: check

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js (1)

Pattern **/*.js: check

📓 Learnings (1)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccessWrapper.js (1)
Learnt from: Ramkrishna-egov
PR: egovernments/DIGIT-Frontend#1670
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccessMgmtTableWrapper.js:156-160
Timestamp: 2024-10-25T09:24:29.878Z
Learning: In the `UserAccessMgmtTableWrapper` component, since the `ShowMoreWrapper` is rendered within the cell, additional checks or row-specific state management are not required.
🪛 Biome
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js

[error] 228-228: 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)


[error] 164-164: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)


[error] 269-269: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js

[error] 287-287: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccessWrapper.js

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

'mpRolesArray' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/securityPopUp.js

[error] 94-94: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🔇 Additional comments (18)
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/villageView.scss (3)

8-8: LGTM! Margin adjustment improves vertical rhythm.

The reduction in margin-bottom creates better spacing between the header and subsequent content.


21-21: LGTM! Explicit margin reset improves layout consistency.

Setting margin to 0rem helps prevent any unwanted spacing inheritance.


73-76: LGTM! Consistent margin spacing with other headings.

The increased margin-bottom aligns with the spacing pattern used throughout the file.

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/TableSearchBar.js (1)

5-5: LGTM! Component structure follows React best practices.

The component maintains proper prop validation and follows React patterns correctly.

Also applies to: 69-70

health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/facility.scss (1)

185-185: LGTM! Good use of gap property for consistent spacing.

The gap property is a clean solution for spacing between tags.

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/securityPopUp.js (2)

3-3: LGTM: Import changes are well-organized.

The addition of the Divider component import is properly grouped with other component imports from the same package.


116-116: LGTM: UI improvements enhance readability.

The changes improve the visual hierarchy and spacing:

  • Increased gap between radio options provides better visual separation
  • Added divider between questions makes the structure clearer

Also applies to: 122-123

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js (1)

144-144: LGTM! Good UI enhancement

The addition of equalWidthButtons={true} improves the visual consistency of the popup buttons, aligning with the CSS fixes objective of this PR.

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/accessbilityPopUP.js (1)

Line range hint 1-176: Well-structured component with proper implementation patterns.

The component demonstrates good practices:

  • Effective use of React hooks for state management
  • Proper error handling with Toast notifications
  • Clean mutation handling with proper loading states
  • Well-structured form with proper validation
  • Good implementation of translations
🧰 Tools
🪛 Biome

[error] 155-164: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccessWrapper.js (2)

128-128: LGTM! Styling improvements enhance visual consistency.

The changes improve the component's visual presentation:

  • Reduced gap spacing for better element alignment
  • More descriptive class name that better reflects the component's purpose

Also applies to: 133-133


139-142: LGTM! Props structure follows best practices.

The UserAccess component props are well-organized and properly typed:

  • Clear prop naming
  • Logical prop values derived from parent state and constants
  • Multi-line format improves readability
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserAccess.js (1)

233-234: LGTM! Verify translation key existence.

The styling changes look good. However, ensure that the translation key ${category}_DESCRIPTION exists in the translation files for all possible category values to avoid missing translations.

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js (1)

242-242: LGTM: Button size standardization improves UI consistency.

The button size changes appropriately differentiate between primary actions (medium) and secondary actions (small), creating a clear visual hierarchy.

Also applies to: 261-261, 288-288

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfigWrapper.js (1)

Line range hint 361-374: LGTM! Clean class-based styling implementation.

The refactoring to use class-based styling with semantic class names improves maintainability and follows CSS best practices.

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js (1)

9-9: Verify CSS styles for the new header.

The Header component is properly added with the className "pop-inbox-header". However, ensure that the corresponding CSS styles exist in your stylesheet.

Also applies to: 384-384

✅ Verification successful

CSS styles exist but could be enhanced

The CSS class pop-inbox-header exists in facility.scss but only sets margin: 0rem. Consider enhancing the styles to better match the header's visual requirements if needed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the pop-inbox-header class definition
rg -g "*.scss" -g "*.css" "pop-inbox-header"

Length of output: 148


Script:

#!/bin/bash
# Let's check the actual CSS definition for pop-inbox-header
rg -g "*.scss" -g "*.css" -A 5 "pop-inbox-header"

Length of output: 639

health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/RoleTableComposer.js (2)

541-541: 🧹 Nitpick (assertive)

Remove commented loader code

Clean up the commented LoaderOverlay code since it's been replaced with the standard Loader component.

-  {/* {isLoading || isHrmsLoading ? <LoaderOverlay /> : null} */}
   <DataTable
     columns={columns}
     data={HrmsData?.data}
     pagination
     progressPending={isLoading || isHrmsLoading}
     progressComponent={<Loader />}

Likely invalid or redundant comment.


165-169: 🛠️ Refactor suggestion

Consider adding confirmation before resetting boundaries

When changing hierarchy, all selected boundaries are reset without warning. This could lead to accidental data loss if users change the hierarchy by mistake.

Consider adding a confirmation dialog:

 ...i,
 selectedHierarchy: value,
 boundaryOptions,
-selectedBoundaries: [], // Keep existing selected boundaries
+selectedBoundaries: existingRow.selectedBoundaries?.length > 0 
+  ? (window.confirm(t("CONFIRM_RESET_BOUNDARIES")) ? [] : existingRow.selectedBoundaries)
+  : [],
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)

987-987: ⚠️ Potential issue

Add 'DOWNLOAD' case to handle 'DOWNLOAD' action in onActionSelect

The onClick handler calls onActionSelect("DOWNLOAD", row), but the onActionSelect function does not handle the "DOWNLOAD" action. This will result in the default case being executed, which may lead to unexpected behavior.

Apply this diff to add the 'DOWNLOAD' case:

 const onActionSelect = (key, row) => {
   switch (key) {
     case "START":
       // existing code
       break;
     case "EDIT":
       // existing code
       break;
+    case "DOWNLOAD":
+      // Add logic to handle DOWNLOAD action
+      window.location.href = `/your/download/path?microplanId=${row?.id}&campaignId=${row?.campaignId}`;
+      break;
     default:
-      console.log(value);
+      console.log(`Unhandled action: ${key}`);
       break;
   }
 };

Likely invalid or redundant comment.

@nipunarora-eGov nipunarora-eGov merged commit 8a68781 into console Oct 30, 2024
3 checks passed
@nipunarora-eGov nipunarora-eGov deleted the Audit-Fixes-2 branch October 30, 2024 11:48
This was referenced Nov 11, 2024
@nabeelmd-eGov nabeelmd-eGov mentioned this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants