Skip to content
Open
Show file tree
Hide file tree
Changes from 19 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
Expand Up @@ -137,7 +137,7 @@ const getFieldType = (field) => {
return "text";
case "number":
return "number";
case "textarea":
case "textArea":
return "textarea";
case "time":
return "time";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +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 { t } = useTranslation();
const history = useHistory();
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 @@ -191,7 +191,7 @@ const SelectingBoundariesDuplicate = ({ onSelect, formData, ...props }) => {
<TagComponent campaignName={campaignName} />
{
isDraftCampaign ? (
<div className="digit-tag-container" style={{margin:"0rem"}}>
<div className="digit-tag-container" style={{ margin: "0rem" }}>
<Chip text={`${t(`CANCEL_CAMPAIGN`)}`} onClick={handleCancelClick} hideClose={false} />
</div>
) : null
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