Skip to content

mandatory label fixes, rendering fixes, #2387

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

Open
wants to merge 3 commits into
base: console
Choose a base branch
from
Open

Conversation

nabeelmd-eGov
Copy link
Contributor

@nabeelmd-eGov nabeelmd-eGov commented Apr 29, 2025

Choose the appropriate template for your PR:

Feature PR

Feature Request

JIRA ID

Module

Description

Related Issues


Bugfix PR

Bugfix Request

JIRA ID

Module

Description

Root Cause

Related Issues


Release PR

Summary by CodeRabbit

  • New Features

    • Enhanced field previews with informational alerts and tooltips for help text in campaign manager cards.
    • Added a loading indicator when fetching app configuration data.
  • Bug Fixes

    • Improved conditional rendering of action buttons in campaign response footers.
  • Refactor

    • Adjusted memoization of several components for consistency and maintainability.
    • Updated field property naming for clarity and consistency in app configuration redesign.
    • Improved code formatting and removed unused/commented code for better readability.
    • Modified field deletion logic to use JSON path for precise identification.
  • Style

    • Improved spacing and formatting across multiple components for a cleaner UI.

@nabeelmd-eGov nabeelmd-eGov requested a review from a team as a code owner April 29, 2025 08:04
Copy link
Contributor

coderabbitai bot commented Apr 29, 2025

📝 Walkthrough
## Walkthrough

This set of changes focuses on UI enhancements and code refactoring within the campaign manager module of a micro-UI application. The `AppPreview` component now displays additional UI elements such as informational alerts and tooltips for fields with `infoText` or `helpText` properties. Several components, including `SetupCampaign`, `UpdateCampaign`, and `App`, have been refactored to apply `React.memo` at the export level instead of at declaration. Conditional rendering logic for buttons in the `Response` page has been improved, and loading states are now handled in the `ImpelComponentWrapper`. Property naming in app configuration restructuring functions has been updated, and minor formatting and import adjustments are present throughout.

## Changes

| File(s)                                                                                          | Change Summary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `src/components/AppPreview.js`                                                                  | Enhanced field rendering: displays `AlertCard` for `infoText`, tooltips for `helpText`, conditionally shows mandatory asterisk, and updates imports for new UI elements.                                                                                                                                                                                                                                                                                                                                       |
| `src/components/CampaignCard.js`                                                                | Commented out a specific link object in the `links` array, making it inactive. No logic or rendering changes elsewhere.                                                                                                                                                                                                                                                                                                                                                                                        |
| `src/pages/employee/Response.js`                                                                | Reformatted imports and logic; removed commented-out code; improved conditional rendering for secondary action button in the `Footer` component.                                                                                                                                                                                                                                                                                                                                                               |
| `src/pages/employee/SetupCampaign.js`, `src/pages/employee/UpdateCampaign.js`, `src/pages/employee/index.js` | Refactored to declare components as plain functions and apply `React.memo` at export. Adjusted formatting and spacing throughout. No logic changes.                                                                                                                                                                                                                                                                                                                    |
| `src/pages/employee/appConfigurationRedesign/AppConfigurationParentLayer.js`                    | Changed property mapping from `required` to `Mandatory` in restructuring functions; removed a commented-out dispatch call.                                                                                                                                                                                                                                                                                                                                              |
| `src/pages/employee/appConfigurationRedesign/AppFieldComposer.js`                               | Changed import to use `AlertCard` aliased as `InfoCard`; added `e.stopPropagation()` in click handlers to prevent event bubbling. No logic changes.                                                                                                                                                                                                                                                                                                                                                                     |
| `src/pages/employee/appConfigurationRedesign/ImpelComponentWrapper.js`                          | Added loading state handling: displays `Loader` component while MDMS data is loading.                                                                                                                                                                                                                                                                                                                                                                                  |
| `src/pages/employee/appConfigurationRedesign/AppConfigurationWrapper.js`                        | Modified reducer "DELETE_FIELD" case to filter fields by `jsonPath` instead of `id`.                                                                                                                                                                                                                                                                                                                                                                              |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant AppPreview
    participant AlertCard
    participant TooltipWrapper

    User->>AppPreview: Render preview of a card
    AppPreview->>AppPreview: For each active field
    AppPreview-->>AlertCard: If field.infoText exists, render AlertCard above field
    AppPreview-->>TooltipWrapper: If field.helpText exists, render label with TooltipWrapper and InfoOutline
    AppPreview->>AppPreview: Render field label (with asterisk if required/Mandatory)
    AppPreview->>AppPreview: Render field UI

Possibly related PRs

Suggested reviewers

  • jagankumar-egov

Poem

In fields where infoText grows,
A rabbit hops and clearly shows—
AlertCards bloom, tooltips gleam,
Labels sparkle with asterisks’ sheen.
Refactors hop from file to file,
Wrapping memos with a tidy style.
🐇✨ Code carrots for all—compile!


</details>

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: ASSERTIVE**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between c9d348b2b2cb93898b47b65822dbbb7c192eff11 and 352b42c4e1fe34673f14afa85b5aa749cf242d32.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationParentLayer.js` (3 hunks)
* `health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationWrapper.js` (1 hunks)
* `health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppFieldComposer.js` (3 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>📓 Path-based instructions (1)</summary>

<details>
<summary>`**/*.js`: check</summary>

> `**/*.js`: check

- `health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationWrapper.js`
- `health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationParentLayer.js`
- `health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppFieldComposer.js`

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 10000ms (2)</summary>

* GitHub Check: Analyze (javascript-typescript)
* GitHub Check: Analyze (actions)

</details>

<details>
<summary>🔇 Additional comments (7)</summary><blockquote>

<details>
<summary>health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationWrapper.js (1)</summary>

`150-150`: **Improvement to field deletion logic**

The filter condition now uses `jsonPath` property instead of `id` to identify fields for deletion, which brings consistency with other parts of the reducer where `jsonPath` is already used as a unique identifier (like line 214).

</details>
<details>
<summary>health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppFieldComposer.js (3)</summary>

`7-7`: **Component replacement with alias for backward compatibility**

Replacing `InfoCard` with `AlertCard` (aliased as `InfoCard`) standardizes the UI components across the app while maintaining backward compatibility in this file.

---

`138-139`: **Preventing event bubbling during delete operation**

Adding `e.stopPropagation()` prevents the click event from bubbling up to parent elements, which avoids unintended side effects like selecting the field after attempting to delete it.

---

`828-829`: **Preventing event bubbling during field selection**

Similar to the delete button improvement, this addition prevents click events from bubbling up the DOM tree when selecting fields, improving the reliability of the UI interactions.

</details>
<details>
<summary>health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationParentLayer.js (3)</summary>

`76-76`: **Standardized property naming from 'required' to 'Mandatory'**

Renaming the property from `required` to `Mandatory` aligns with UI rendering in other components like AppPreview where the UI now checks for both flags for displaying mandatory indicators.

---

`85-85`: **Added unique identifier for card headers**

Adding a UUID to each card's header ensures reliable identification of cards throughout the application, especially important when multiple cards might have similar or identical display headers.

---

`142-142`: **Updated reverse mapping to use 'Mandatory' property**

This change ensures bidirectional consistency between the restructured and original data formats after renaming the property from `required` to `Mandatory` on line 76.

</details>

</blockquote></details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACJmTFpqfBdILxUSXwAzeA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pb6I8eWE9gmA4MkGvLfBlii0FtpSUOYL+lMCuZVwWBTjTMDVUSo5NaQEiKRM7lTBJpkodYeWDIFUZrRnAwsUlH1FuDt19g2gj9vwzDboAeMeg9tL4IwD+DYA1BDjsYKQi4AzB0tanLYIQB8gZ0LnflPICpafgfQ1SMJvpxuJYxPwSgSIKKDbYko5EsgvFBJmDxCDSsCAabMzFC5vF42AVaLpkGTYBcjGiXSdL73zZFc82IJTLmCQq5h8OmMJXJsSzS4w0BhgbErpO1XSjCi2kJcIPXgmbHpDABgPSFUgSzCQ8ApkJ/DajUY2QqA9kd9hz1UiuQNIHkbSLpH4jgp1AkqCYIgElS7RuodASVPhi+ZeQdhDAAAJy0A1gAAFg2ACAVg4IhgAIH+GbB/hYI4EVsAEAAA2ALBsBWArBaAqgAQFsAYAABGf4SsGU64jcRdw7YQ8LWABYIRwIlYAwGBEkBcR0oEEUiK2BrAMguI4ETWzQAbAAsAgALGgDQBbBgR/whgBkBWDUigRKwUkWSIgCPDcAzww8G8NhQfDaAkqe4PoCAA== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=egovernments/DIGIT-Frontend&utm_content=2387):

- 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 generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

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: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8446be and c9d348b.

📒 Files selected for processing (9)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AppPreview.js (2 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignCard.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/Response.js (3 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js (4 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js (14 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationParentLayer.js (2 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppFieldComposer.js (1 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/ImpelComponentWrapper.js (2 hunks)
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/index.js (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: check

**/*.js: check

  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppFieldComposer.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/ImpelComponentWrapper.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationParentLayer.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/index.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignCard.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/Response.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AppPreview.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js
  • health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js
🧬 Code Graph Analysis (2)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/ImpelComponentWrapper.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationScreenParent/ImpelComponentWrapper.js (1)
  • isLoadingAppConfigMdmsData (8-20)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/index.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppFeatures.js (1)
  • AppFeatures (6-87)
🪛 Biome (1.9.4)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/Response.js

[error] 65-71: 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/campaign-manager/src/components/AppPreview.js

[error] 303-303: 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/campaign-manager/src/pages/employee/UpdateCampaign.js

[error] 110-110: 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] 711-711: Use Number.parseInt instead of the equivalent global.

ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.

(lint/style/useNumberNamespace)

⏰ Context from checks skipped due to timeout of 10000ms (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
🔇 Additional comments (19)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/SetupCampaign.js (3)

29-29: Component declaration style refactored

The component declaration has been changed from using React.memo() at declaration to a regular functional component declaration. This is part of a pattern change to consistently apply memoization at export rather than declaration.


546-908: Enhanced submission handling with improved routing

The onSubmit function now includes additional conditional handling for when isSubmit is true. The new code properly sets shouldUpdate and adds navigation logic to redirect to view details page when certain key values are met.


1106-1108: Memoization moved to export statement

The memoization using React.memo has been moved from the component declaration to the export statement. This is a more standard pattern that helps with code readability while maintaining the performance benefits of memoization.

health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignCard.js (1)

71-76: Disabled App Configuration 3.0 navigation option

The link to the App Configuration 3.0 page has been commented out, removing this navigation option from the campaign manager dashboard. This may be related to feature deprecation or work-in-progress functionality.

Make sure this change is intended and communicated to users who might be looking for this functionality.

health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppFieldComposer.js (1)

1-10: Replaced InfoCard with AlertCard

The component import has been changed to use AlertCard from the component library but aliased as InfoCard. This suggests a UI enhancement where information cards are now being rendered as alert cards for better visibility or styling.

While this change preserves the existing function calls throughout the code, consider updating the variable name for clarity in future refactorings to avoid confusion between component names and their actual imported identities.

health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/ImpelComponentWrapper.js (2)

4-4: Added Loader component import

The Loader component has been imported from the digit-ui-components package, enhancing the UI by providing a loading indicator for asynchronous operations.


24-24: Added loading state handling

A loading state check has been added to display a loader while MDMS data is being fetched. This improves user experience by providing visual feedback during data loading and prevents rendering issues when data isn't available yet.

health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/appConfigurationRedesign/AppConfigurationParentLayer.js (2)

76-76: Property naming standardization

The property name has been changed from required to Mandatory in the restructure function, which aligns with the UI display standards used in related components.


141-141: Consistent property name change

This change correctly updates the reverseRestructure function to derive the required property from Mandatory, maintaining consistency with the change made in the restructure function.

health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/index.js (2)

119-135: Improved memoization pattern

The component has been refactored to apply React.memo at the export level instead of at declaration, which is a cleaner pattern that separates component logic from optimization concerns.

Also applies to: 204-206


199-199: Formatting improvement

Added space inside JSX component tag for better readability.

health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AppPreview.js (1)

1-4: Added imports for enhanced UI components

New imports for Fragment, AlertCard, TooltipWrapper, and InfoOutline enable the rendering of information alerts and tooltips in the UI.

health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/Response.js (1)

1-4: Code formatting improvements

Import statements and function indentation have been standardized for better readability and consistency.

Also applies to: 17-28

health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js (6)

21-21: Applied React.memo at export for consistency.

The component is now declared as a plain function and memoized at export, aligning with other components in this module. This improves readability and consistency.


29-29: Double-check UpdateBoundaryConfig initial invocation.

The initial useState call uses UpdateBoundaryConfig(totalFormData, null, isSubmitting), while elsewhere (see line 219) it is invoked with a single object argument. Verify that the UpdateBoundaryConfig signature supports both invocation styles and that no parameters are mismatched.


828-833: Approve loader usage for loading states.

The component now returns a full-page <Loader /> when in preview or draft mode before data is fetched, improving UX during asynchronous operations.


839-839: Verify customSteps alignment with configuration.

Ensure that the array of translation keys passed to customSteps matches the order and count of steps in UpdateBoundaryConfig. A mismatch can desynchronize the stepper UI from actual form steps.


859-859: Explicitly set noCardStyle prop.

The prop is correctly set to true, making the FormComposerV2 render without its default card style. This is a clear improvement over previous implicit usage.


875-875: Consistent memoization at export.

By exporting the component as React.memo(UpdateCampaign), re-renders are avoided for unchanged props, optimizing performance.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 29, 2025
{t(field.label)}
{field.required && " *"}
<>
{field?.infoText && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is info text ?

we have only innerLabel which acts as placeholder

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