Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0cb1fa4
Added complaint changes
Bhavya-egov Aug 4, 2025
3cd151a
FEATURE/HCMPRE-2947 : Cancel Campign UI Integration (#2964)
Swathi-eGov Aug 6, 2025
45c5ffe
Merge branch 'master' into console-V0.5
Swathi-eGov Aug 6, 2025
230df89
Fixed Syntax Issue
Swathi-eGov Aug 6, 2025
6e9194d
Merge branch 'master' into console-V0.5
Swathi-eGov Aug 6, 2025
ad486aa
Merge branch 'master' into console-V0.5
Swathi-eGov Aug 6, 2025
a0cc3f4
Merge branch 'master' into console-V0.5
NabeelAyubee Aug 6, 2025
ff44c55
Merge branch 'master' into console-V0.5
Swathi-eGov Aug 8, 2025
2bcee17
Merge branch 'master' into console-V0.5
Swathi-eGov Aug 8, 2025
3f516d6
FEATURE/HCMPRE-2958 : Added dependency field changes (#2980)
Swathi-eGov Aug 8, 2025
747151d
Merge branch 'master' into console-V0.5
Swathi-eGov Aug 8, 2025
c671b13
Fixed Compile issues
Ramkrishna-egov Aug 11, 2025
d3672b5
GIT-2888:: Fetaures/Properties changes and HRMS Fixes (#2959)
Ramkrishna-egov Aug 11, 2025
5272fef
Fixed Acxknowledgement page rendering and Accept visibilityCondition …
Ramkrishna-egov Aug 12, 2025
4ffc60e
Added complaint components
Ramkrishna-egov Aug 13, 2025
4bdcd7b
Added autro fill condition to field properties
Ramkrishna-egov Aug 13, 2025
218abb2
Updated Complaint Inbox Template name
Ramkrishna-egov Aug 18, 2025
468c4e9
Fixed FormConfig update issue
Ramkrishna-egov Aug 18, 2025
f42593c
Updated conditionalNavigationKey in Form Config to acept empty array …
Ramkrishna-egov Aug 18, 2025
218a4ae
migrating 0.4 fixes (#3024)
nabeelmd-eGov Aug 22, 2025
046c25a
Updated Template renderer Case mismatch for template name
Ramkrishna-egov Aug 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-health-css",
"version": "0.3.9",
"version": "0.3.11",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ $border-color: rgba(214, 213, 212, 1);
margin-left: 0.3rem;
display: flex;
align-items: flex-start;
flex-direction: row;

.number {
min-width: 1.2rem !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,9 @@

.digit-dss-card-item-border {
border-bottom: 0.063rem solid theme(digitv2.lightTheme.divider);
.digit-dss-insight-card {
margin-bottom: 2rem !important;
}
}
Comment on lines 729 to 734
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Avoid compounding vertical rhythm: margin inside a bordered row conflicts with parent gaps

You add margin-bottom: 2rem on .digit-dss-insight-card within .digit-dss-card-item-border, but .digit-dss-card-body-stacked already uses gap: 2rem (Line 715), which can double the spacing. Prefer spacing on the container or suppress the extra margin for the last item.

Minimal fix to avoid double-spacing:

 .digit-dss-card-item-border {
   border-bottom: 0.063rem solid theme(digitv2.lightTheme.divider);
-  .digit-dss-insight-card {
-    margin-bottom: 2rem !important;
-  }
+  .digit-dss-insight-card {
+    margin-bottom: 2rem;
+  }
+  .digit-dss-insight-card:last-child {
+    margin-bottom: 0;
+  }
 }

Alternatively, replace child margin with container padding-bottom, which generally composes better with flex gaps.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.digit-dss-card-item-border {
border-bottom: 0.063rem solid theme(digitv2.lightTheme.divider);
.digit-dss-insight-card {
margin-bottom: 2rem !important;
}
}
.digit-dss-card-item-border {
border-bottom: 0.063rem solid theme(digitv2.lightTheme.divider);
.digit-dss-insight-card {
margin-bottom: 2rem;
}
.digit-dss-insight-card:last-child {
margin-bottom: 0;
}
}
🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/healthdss.scss
around lines 729-734, the .digit-dss-insight-card sets margin-bottom: 2rem which
duplicates spacing provided by the parent .digit-dss-card-body-stacked (gap:
2rem); remove the child margin to avoid compounding vertical rhythm and either
(a) delete the margin-bottom declaration so spacing is driven by the container
gap, or (b) suppress it for the last child (e.g. clear margin-bottom via
:last-child { margin-bottom: 0 }) or move the spacing to the container as
padding-bottom if bottom padding is required instead of gap.


.digit-dss-insight-card {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import { useTranslation } from "react-i18next";
import { useHistory } from "react-router-dom";

const ViewDetailComponent = ({ headingName, desc, buttonLabel, navLink , type , icon , disabled,isDraftCampaign }) => {
const ViewDetailComponent = ({ headingName, desc, buttonLabel, navLink, type, icon, disabled, isDraftCampaign }) => {
const { t } = useTranslation();
const history = useHistory();

Expand All @@ -12,19 +12,24 @@ const ViewDetailComponent = ({ headingName, desc, buttonLabel, navLink , type ,
<div className="details-heading">
<div className="icon-heading">
{icon}
<HeaderComponent className={"detail-header"} styles={{
color: disabled ? "#C5C5C5" : "#004b5e", // same gray for disabled header
}}>{headingName}</HeaderComponent>
<HeaderComponent
className={"detail-header"}
styles={{
color: disabled ? "#C5C5C5" : "#004b5e", // same gray for disabled header
}}
>
{headingName}
</HeaderComponent>
Comment on lines +15 to +22
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Prefer theme tokens or classNames over inline color for disabled headings

Inline hex (#C5C5C5 / #004b5e) bypasses theming. Recommend mapping disabled state to a class or using theme tokens so designs remain consistent across themes.

Example:

-<HeaderComponent
-  className={"detail-header"}
-  styles={{
-    color: disabled ? "#C5C5C5" : "#004b5e",
-  }}
->
+<HeaderComponent
+  className={clsx("detail-header", { "is-disabled": disabled })}
+>

And style .detail-header.is-disabled via your theme.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CreateCampaignComponents/ViewDetailComponent.js
around lines 15-22, the HeaderComponent uses inline hex colors for disabled and
normal states which bypasses theming; remove the inline styles and instead
toggle a class or theme token: add a conditional className (e.g. "detail-header
is-disabled" when disabled, otherwise "detail-header"), delete the styles prop
with hardcoded colors, and update the component stylesheet or theme tokens to
map .detail-header and .detail-header.is-disabled to the appropriate color
values so the design follows theme tokens across themes.

</div>
<Button
label={buttonLabel}
onClick={() => {
history.push(`/${window.contextPath}/employee/campaign/${navLink}`,{isDraftCampaign : isDraftCampaign});
history.push(`/${window.contextPath}/employee/campaign/${navLink}`, { isDraftCampaign: isDraftCampaign });
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Harden route construction; avoid accidental double slashes and undefined contextPath

If navLink includes a leading slash or window.contextPath is undefined, the final URL may be inconsistent.

Proposed safeguard:

- history.push(`/${window.contextPath}/employee/campaign/${navLink}`, { isDraftCampaign: isDraftCampaign });
+ const base = `/${window?.contextPath || ""}/employee/campaign`;
+ const path = `${base}/${String(navLink || "").replace(/^\/+/, "")}`;
+ history.push(path, { isDraftCampaign });

Run a quick scan to ensure similar route building is consistent across Campaign Manager:


🏁 Script executed:

#!/bin/bash
# Scan for history.push calls constructing routes with window.contextPath in Campaign Manager module
rg -nP --type=ts --type=tsx --type=js --type=jsx -C2 'history\.push\(\s*`/\$\{?window\.contextPath\}?/employee/campaign' health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager

Length of output: 223


🏁 Script executed:

#!/bin/bash
# Re-scan for history.push calls constructing routes with window.contextPath using glob patterns
rg -n -C2 'history\.push\(\s*`/\\$\\{?window\.contextPath\}?/employee/campaign' -g '*.js' -g '*.jsx' -g '*.ts' -g '*.tsx' health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager

Length of output: 372


🏁 Script executed:

#!/bin/bash
# 1. Find all usages of window.contextPath in Campaign Manager
rg -n "window\.contextPath" --glob '*.js' --glob '*.jsx' health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager

# 2. Find all occurrences of employee/campaign routes in Campaign Manager
rg -n "employee/campaign" --glob '*.js' --glob '*.jsx' health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager

Length of output: 49471


Harden and centralize campaign‐route construction

Our scan uncovered dozens of call sites in the Campaign Manager module where routes are built via

`/${window.contextPath}/employee/campaign/...`

Relying on ad-hoc template strings risks accidental double-slashes (if navLink has a leading slash) and broken URLs when window.contextPath is undefined. Rather than patching each occurrence individually, extract a shared helper that:

  1. Defaults contextPath safely.
  2. Strips any leading slashes from navLink.
  3. Concatenates segments without introducing double-slashes.

Example utility (e.g. src/utils/buildCampaignPath.js):

export function buildCampaignPath(
  navLink,
  contextPath = typeof window !== "undefined" ? window.contextPath : ""
) {
  const base = `/${contextPath || ""}/employee/campaign`;
  return `${base}/${String(navLink || "").replace(/^\/+/, "")}`;
}

Then, in ViewDetailComponent.js:

--- a/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CreateCampaignComponents/ViewDetailComponent.js
+++ b/health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CreateCampaignComponents/ViewDetailComponent.js
@@ 27
-   history.push(`/${window.contextPath}/employee/campaign/${navLink}`, { isDraftCampaign: isDraftCampaign });
+   history.push(buildCampaignPath(navLink), { isDraftCampaign });

• Apply this helper here to harden the patch.
Optional: Gradually refactor other history.push calls in the Campaign Manager codebase to use buildCampaignPath for consistency and safety.

🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CreateCampaignComponents/ViewDetailComponent.js
around line 27, the route is constructed inline with a template string which can
produce double-slashes or break when window.contextPath is undefined; create a
shared helper (e.g. src/utils/buildCampaignPath.js) that defaults contextPath
safely (use empty string if window/contextPath not available), strips any
leading slashes from navLink, and concatenates segments without double-slashes,
then replace the inline template with a call to buildCampaignPath(navLink, /*
optional contextPath */) and pass the resulting path into history.push along
with the existing state.

}}
variation={type}
style={{ width: '19rem' }}
isDisabled = {disabled}
title = {buttonLabel}
style={{ width: "19rem" }}
isDisabled={disabled}
title={buttonLabel}
Comment on lines +30 to +32
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Button accessibility: title duplicates label

title={buttonLabel} is redundant since the Button already exposes an accessible name via label. Consider dropping title to avoid duplicate announcements on some ATs.

🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CreateCampaignComponents/ViewDetailComponent.js
around lines 30-32, the Button currently passes title={buttonLabel} which
duplicates the accessible name exposed by the label; remove the title prop (or
set it to undefined) so the Button only provides a single accessible name via
its label; if a tooltip is required, implement it separately (e.g., using an
aria-describedby or a dedicated Tooltip component) rather than using title to
avoid duplicate announcements.

/>
</div>
<div className="details-desc">{desc}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import React, { useState, Fragment, useEffect } from "react";
import { TextInput, Dropdown, RadioButtons, Button, FieldV1, Switch, Loader } from "@egovernments/digit-ui-components";
import { useTranslation } from "react-i18next";
const FiltersRenderer = ({ cField, drawerState, setDrawerState, t, disabled }) => {
const [localSelectedSchema, setLocalSelectedSchema] = useState(null);
const [localActiveOptions, setLocalActiveOptions] = useState([]); // store codes

// Fetch MDMS data based on selected schema
const { isLoading, data: mdmsOptions = [] } = Digit.Hooks.useCustomMDMS(
Digit.ULBService.getCurrentTenantId(),
localSelectedSchema?.moduleName,
localSelectedSchema?.masterName ? [{ name: localSelectedSchema.masterName }] : [],
{
enabled: !!localSelectedSchema?.moduleName && !!localSelectedSchema?.masterName,
select: (data) => data?.[localSelectedSchema?.moduleName]?.[localSelectedSchema.masterName] || [],
},
{ schemaCode: "FILTERSDROPDOWNLIST" }
);

// When MDMS options load, set default active
useEffect(() => {
if (mdmsOptions.length > 0) {
const defaultActive = mdmsOptions.filter((opt) => opt.active).map((opt) => opt.code);
setLocalActiveOptions(defaultActive);
// Also initialize enums in drawerState with these active objects
const activeObjects = mdmsOptions.filter((item) => defaultActive.includes(item.code));
setDrawerState((prev) => ({
...prev,
enums: activeObjects,
}));
}
}, [mdmsOptions]);

// Handle toggle
const handleToggle = (code, checked) => {
setLocalActiveOptions((prev) => {
let updated = [...prev];
if (checked) {
if (!updated.includes(code)) updated.push(code);
} else {
updated = updated.filter((c) => c !== code);
}

// Map updated codes to full objects
const activeObjects = mdmsOptions.filter((item) => updated.includes(item.code));

// Update drawerState.enums directly
setDrawerState((prev) => ({
...prev,
enums: activeObjects,
}));

return updated;
});
};

return (
<>
{/* Dropdown for selecting schema */}
<Dropdown
variant={""}
t={t}
disabled={disabled}
option={cField?.mdmsOptions || []}
optionKey={"schemaCode"}
selected={localSelectedSchema || {}}
select={(value) => {
setLocalSelectedSchema(value);
setLocalActiveOptions([]); // reset active when schema changes
setDrawerState((prev) => ({ ...prev, enums: [] })); // reset enums
}}
/>
Comment on lines +60 to +72
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Dropdown uses prop “disable”, not “disabled” — current control won’t disable

The shared Dropdown component checks props.disable, so passing disabled has no effect. Update to disable to ensure the dropdown can be disabled.

-      <Dropdown
+      <Dropdown
         variant={""}
         t={t}
-        disabled={disabled}
+        disable={disabled}
         option={cField?.mdmsOptions || []}
         optionKey={"schemaCode"}
         selected={localSelectedSchema || {}}
         select={(value) => {
           setLocalSelectedSchema(value);
           setLocalActiveOptions([]); // reset active when schema changes
           setDrawerState((prev) => ({ ...prev, enums: [] })); // reset enums
         }}
       />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Dropdown
variant={""}
t={t}
disabled={disabled}
option={cField?.mdmsOptions || []}
optionKey={"schemaCode"}
selected={localSelectedSchema || {}}
select={(value) => {
setLocalSelectedSchema(value);
setLocalActiveOptions([]); // reset active when schema changes
setDrawerState((prev) => ({ ...prev, enums: [] })); // reset enums
}}
/>
<Dropdown
variant={""}
t={t}
disable={disabled}
option={cField?.mdmsOptions || []}
optionKey={"schemaCode"}
selected={localSelectedSchema || {}}
select={(value) => {
setLocalSelectedSchema(value);
setLocalActiveOptions([]); // reset active when schema changes
setDrawerState((prev) => ({ ...prev, enums: [] })); // reset enums
}}
/>
🤖 Prompt for AI Agents
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/FiltersRenderer.js
lines 60-72: the Dropdown is passed disabled={disabled} but the shared component
reads prop disable, so the control never disables; change the prop name to
disable={disabled} (ensuring a boolean) so the Dropdown receives the expected
prop and remains disabled when appropriate, and keep the existing state-reset
logic inside the select callback unchanged.


{isLoading && <Loader/>}

{!isLoading && mdmsOptions.length > 0 && (
<div style={{ marginTop: "1rem", display: "flex", flexDirection: "column", gap: "0.5rem" }}>
{mdmsOptions.map((opt) => {
const isActive = localActiveOptions.includes(opt.code);
return (
<Switch
key={opt.code}
label={t(opt.name)}
isCheckedInitially={isActive}
onToggle={(checked) => handleToggle(opt.code, checked)}
disable={false}
shapeOnOff
/>
);
})}
</div>
)}
</>
);
};

export default FiltersRenderer;
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ const GenericTemplateScreen = ({ components = [], t, selectedField, templateName
.filter(
(field) =>
!field.hidden &&
(field.jsonPath === "PrimaryButton" || field.jsonPath === "SecondaryButton" || field.jsonPath === "qrscanner")
(field.jsonPath === "PrimaryButton" || field.jsonPath === "SecondaryButton" || field.jsonPath === "scanner")
)
.sort((a, b) => (a.order || 0) - (b.order || 0));


return (
<div
style={{
Expand Down Expand Up @@ -94,11 +95,11 @@ const GenericTemplateScreen = ({ components = [], t, selectedField, templateName
<div className={`${selectedField?.jsonPath === field.jsonPath ? "app-preview-field-pair app-preview-selected" : ""}`}>
<Button
key={index}
variation={field.jsonPath === "SecondaryButton" ? "secondary" : "primary"}
variation={field.jsonPath === "SecondaryButton" || field.jsonPath === "scanner" ? "secondary" : "primary"}
label={t(field?.label)}
onClick={() => { }}
style={{ minWidth: "100%" }}
icon={field.icon || null}
icon={field.jsonPath === "scanner" ? "QrCodeScanner" : null}
/>
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useMemo, Fragment, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { useLocation, useHistory } from "react-router-dom";
import { Wrapper } from "./SelectingBoundaryComponent";
import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader,Chip } from "@egovernments/digit-ui-components";
import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip } from "@egovernments/digit-ui-components";
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

CardText used but not imported — will crash at runtime

You render inside PopUp, but it isn’t imported. Either import CardText or replace it with the already-imported TextBlock.

Apply this minimal fix:

-import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip } from "@egovernments/digit-ui-components";
+import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip, CardText } from "@egovernments/digit-ui-components";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip } from "@egovernments/digit-ui-components";
-import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip } from "@egovernments/digit-ui-components";
+import { AlertCard, Stepper, TextBlock, Tag, Card, HeaderComponent, Loader, PopUp, Button, Chip, CardText } from "@egovernments/digit-ui-components";
🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/SelectingBoundariesDuplicate.js
around line 5, the JSX renders <CardText> but CardText is not imported causing a
runtime crash; replace any <CardText> usage with the already-imported TextBlock
(or alternatively add CardText to the named import list from
"@egovernments/digit-ui-components") so the component reference matches an
imported symbol.

import { CONSOLE_MDMS_MODULENAME } from "../Module";
import TagComponent from "./TagComponent";

Expand Down Expand Up @@ -78,7 +78,7 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => {
},
};

const { data: campaignData, isFetching } = Digit.Hooks.useCustomAPIHook(reqCriteria);
const { data: campaignData, isFetching } = Digit.Hooks.useCustomAPIHook(reqCriteria);

Comment on lines +81 to 82
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Hook result aliasing: remove unused isFetching or use for loader

You destructure isFetching but never use it. Either wire it into your loading state or drop it to keep the file clean.

🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/SelectingBoundariesDuplicate.js
around lines 81-82, the hook result destructures isFetching but it is never
used; either remove isFetching from the destructuring to avoid an unused
variable, or wire it into the component's loading state (e.g., show a
loader/spinner or an early return while isFetching is true and only render the
main UI when false); update imports/props as needed to pass the loading flag to
children or to render a loading indicator and ensure no lint warnings remain.

useEffect(() => {
onSelect("boundaryType", { selectedData: selectedData, boundaryData: boundaryOptions, updateBoundary: !restrictSelection });
Expand Down Expand Up @@ -107,9 +107,9 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => {
setBoundaryOptions(sessionData?.boundaryData || {});
}
setTimeout(() => setIsLoading(false), 10);
}, [props?.props?.sessionData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType , campaignData]);
}, [props?.props?.sessionData?.HCM_CAMPAIGN_SELECTING_BOUNDARY_DATA?.boundaryType, campaignData]);

useEffect(() => {
useEffect(() => {
if (
props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_BOUNDARY_DATA?.uploadBoundary?.uploadedFile?.length > 0 ||
props?.props?.sessionData?.HCM_CAMPAIGN_UPLOAD_FACILITY_DATA?.uploadFacility?.uploadedFile?.length > 0 ||
Expand Down Expand Up @@ -157,7 +157,7 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => {
CampaignDetails: {
tenantId: tenantId,
campaignId: queryParams?.id,
}
},
},
};
const mutation = Digit.Hooks.useCustomAPIMutationHook(Template);
Expand All @@ -167,7 +167,7 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => {
{},
{
onSuccess: async (result) => {
history.push(`/${window?.contextPath}/employee/campaign/my-campaign-new`)
history.push(`/${window?.contextPath}/employee/campaign/my-campaign-new`);
},
onError: (error, result) => {
const errorCode = error?.response?.data?.Errors?.[0]?.code;
Expand All @@ -184,20 +184,17 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => {
return (
<>
<div className="container-full">

<div className="card-container-delivery">
<Card>
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}>
<TagComponent campaignName={campaignName} />
{
isDraftCampaign ? (
<div className="digit-tag-container" style={{margin:"0rem"}}>
<Chip text={`${t(`CANCEL_CAMPAIGN`)}`} onClick={handleCancelClick} hideClose={false} />
</div>
) : null
}
{isDraftCampaign ? (
<div className="digit-tag-container" style={{ margin: "0rem" }}>
<Chip text={`${t(`CANCEL_CAMPAIGN`)}`} onClick={handleCancelClick} hideClose={false} />
</div>
) : null}
Comment on lines +191 to +195
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Chip semantics: hideClose={false} exposes a close icon for a destructive action

For destructive “Cancel Campaign,” consider using a Button with explicit variant=“secondary”/“tertiary” and an icon that communicates intent, or set hideClose={true} to avoid implying a dismiss-only affordance.

🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/SelectingBoundariesDuplicate.js
around lines 191-195, the Chip currently renders a destructive "Cancel Campaign"
action with hideClose={false} which exposes a close icon and implies a
dismiss-only affordance; replace the Chip with your Button component (or the
design system's actionable control) using variant="secondary" or "tertiary", add
an explicit cancel icon (e.g., Trash or Close) and keep the same
handleCancelClick handler, or if you must keep the Chip set hideClose={true} and
style it to look like an action (but preferred is swapping to Button for correct
semantics and accessibility).

</div>
<HeaderComponent className = "select-boundary">{t(`CAMPAIGN_SELECT_BOUNDARY`)}</HeaderComponent>
<HeaderComponent className="select-boundary">{t(`CAMPAIGN_SELECT_BOUNDARY`)}</HeaderComponent>
<p className="dates-description">{t(`CAMPAIGN_SELECT_BOUNDARIES_DESCRIPTION`)}</p>
<Wrapper
hierarchyType={hierarchyType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ const AppConfigurationParentRedesign = ({
parentDispatch={parentDispatch}
AppConfigMdmsData={AppConfigMdmsData}
localeModule={localeModule}
parentState={parentState}
pageTag={`${t("CMN_PAGE")} ${currentStep} / ${stepper?.length}`}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const reducer = (state = initialState, action, updateLocalization) => {

const MODULE_CONSTANTS = "HCM-ADMIN-CONSOLE";

function AppConfigurationWrapper({ screenConfig, localeModule, pageTag }) {
function AppConfigurationWrapper({ screenConfig, localeModule, pageTag,parentState }) {
const queryClient = useQueryClient();
const { locState, addMissingKey, updateLocalization, onSubmit, back, showBack, parentDispatch } = useAppLocalisationContext();
const [state, dispatch] = useReducer((state, action) => reducer(state, action, updateLocalization), initialState);
Expand Down Expand Up @@ -395,7 +395,7 @@ function AppConfigurationWrapper({ screenConfig, localeModule, pageTag }) {
for (let i = 0; i < headerFields.length; i++) {
if (headerFields[i]?.jsonPath === "ScreenHeading") {
const fieldItem = headerFields[i];
const value = locS?.find((i) => i?.code === fieldItem?.value)?.[cL] || null;
const value = (locS ||[])?.find((i) => i?.code === fieldItem?.value)?.[cL] || null;
if (!value || value.trim() === "") {
return { type: "error", value: `${t("HEADER_FIELD_EMPTY_ERROR")}` };
}
Expand Down Expand Up @@ -633,7 +633,7 @@ function AppConfigurationWrapper({ screenConfig, localeModule, pageTag }) {
})
}
/>
<DrawerFieldComposer />
<DrawerFieldComposer parentState={parentState} screenConfig={screenConfig} selectedField={state?.drawerField}/>
</>
) : (
<DndProvider backend={HTML5Backend}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const locReducer = (state = initialState, action) => {

const MODULE_CONSTANTS = "HCM-ADMIN-CONSOLE";
//TODO @nabeel @jagan move this component to ui-component repo & clean up
function AppLocalisationWrapperDev({ onSubmit, localeModule, screenConfig, back, showBack, parentDispatch, ...props }) {
function AppLocalisationWrapperDev({ onSubmit, localeModule, screenConfig, back, showBack, parentDispatch, parentState, ...props }) {
if (!localeModule) {
return <Loader />;
}
Expand Down Expand Up @@ -129,7 +129,7 @@ function AppLocalisationWrapperDev({ onSubmit, localeModule, screenConfig, back,
localeModule,
}}
>
<AppConfigurationWrapper pageTag={props?.pageTag} screenConfig={screenConfig} localeModule={localeModule} />
<AppConfigurationWrapper pageTag={props?.pageTag} screenConfig={screenConfig} localeModule={localeModule} parentState={parentState} />
</AppLocalisationContext.Provider>
);
}
Expand Down
Loading
Loading