Skip to content

Commit

Permalink
Merge branch 'console' into abi-14-11
Browse files Browse the repository at this point in the history
  • Loading branch information
abishekTa-egov committed Nov 14, 2024
2 parents dd7325a + aa672b1 commit baf12f7
Show file tree
Hide file tree
Showing 19 changed files with 177 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<title>DIGIT</title>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].33/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].34/dist/index.css" />

<!-- added below css for hcm-workbench module inclusion-->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" /> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ export const UICustomizations = {
label={t("START")}
variation="secondary"
icon={"ArrowForward"}
style={{minWidth:"240px"}}
type="button"
isDisabled={!hasRequiredRole}
// className="dm-workbench-download-template-btn dm-hover"
Expand All @@ -992,6 +993,7 @@ export const UICustomizations = {
label={t("WBH_DOWNLOAD")}
variation="secondary"
icon={"FileDownload"}
style={{minWidth:"240px"}}
type="button"
// className="dm-workbench-download-template-btn dm-hover"
onClick={(e) => onActionSelect("DOWNLOAD", row)}
Expand All @@ -1001,6 +1003,7 @@ export const UICustomizations = {
label={t("WBH_EDIT")}
variation="secondary"
icon={"Edit"}
style={{minWidth:"240px"}}
type="button"
// className="dm-workbench-download-template-btn dm-hover"
onClick={(e) => onActionSelect("EDIT", row)}
Expand Down Expand Up @@ -1220,6 +1223,8 @@ export const UICustomizations = {
const FacilityPopUp = Digit.ComponentRegistryService.getComponent("FacilityPopup");

switch (key) {
case "MICROPLAN_FACILITY_SERVINGPOPULATION":
return row?.additionalDetails?.servingPopulation;
case "MICROPLAN_FACILITY_RESIDINGVILLAGE":
return t(row?.residingBoundary);
case "MICROPLAN_FACILITY_ASSIGNED_VILLAGES":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-health-css",
"version": "0.1.33",
"version": "0.1.34",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,8 @@
.search-component-table::-webkit-scrollbar-thumb {
background-color: #d6d5d4;
border-radius: 0.563rem;
}

.digit-topbar .digit-logo-ulb-wrapper .digit-topbar-logo{
width: fit-content !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import React from "react";
import { useTranslation } from "react-i18next";

const ROLES = {
CAMPAIGN_MANAGER:["CAMPAIGN_MANAGER"],
CAMPAIGN_MANAGER:["CAMPAIGN_MANAGER","MICROPLAN_CAMPAIGN_INTEGRATOR"],
BOUNDARY_MANAGER:["BOUNDARY_MANAGER"],
CAMPAIGN_MANAGER_ONLY:["CAMPAIGN_MANAGER"],
NATIONAL_SUPERVISOR:["NATIONAL_SUPERVISOR"]
};

Expand All @@ -20,41 +22,24 @@ const CampaignCard = () => {
}

const { t } = useTranslation();
const tenantId = Digit.ULBService.getCurrentTenantId();
// const reqCriteria = {
// url: "/project-factory/v1/project-type/search",
// params: {},
// body: { CampaignDetails:{
// tenantId,
// createdBy: Digit.UserService.getUser().info.uuid,
// pagination: {
// "sortBy": "createdTime",
// "sortOrder": "desc",
// "limit": 1,
// "offset": 0
// }
// } },
// config: {
// select: (data) => {
// return data?.totalCount;
// },
// },
// };
// const { isLoading, data } = Digit.Hooks.useCustomAPIHook(
// reqCriteria
// );

let links = [

{
label: t("ACTION_TEST_SETUP_CAMPAIGN"),
link: `/${window?.contextPath}/employee/campaign/setup-campaign`,
roles: ROLES.CAMPAIGN_MANAGER
roles: ROLES.CAMPAIGN_MANAGER_ONLY
},
{
label: t("ACTION_TEST_MY_CAMPAIGN"),
link: `/${window?.contextPath}/employee/campaign/my-campaign`,
roles: ROLES.CAMPAIGN_MANAGER,
// count: isLoading?"-":data
},
{ //@Bhavya put the new url and remove the comment
label: t("ACTION_TEST_SETUP_CAMPAIGN_FROM_MICROPLAN"),
link: `/${window?.contextPath}/employee/campaign/setup-campaign`,
roles: ROLES.CAMPAIGN_MANAGER
},
{
label: t("NATIONAL_DASHBOARD"),
Expand All @@ -71,7 +56,7 @@ const CampaignCard = () => {
{
label: t("BOUNDARY_MANAGEMENT"),
link: `/${window?.contextPath}/employee/campaign/boundary/home`,
roles: ROLES.CAMPAIGN_MANAGER,
roles: ROLES.BOUNDARY_MANAGER,
// count: isLoading?"-":data
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
const [searchKey, setSearchKey] = useState(0); // Key for forcing re-render of SearchJurisdiction
const [loader, setLoader] = useState(false);
const [selectedRows, setSelectedRows] = useState([]); // State for selected rows
const [isAllSelected, setIsAllSelected] = useState(false);
const [censusData, setCensusData] = useState([]);
const [showToast, setShowToast] = useState(null);
const [accessibilityData, setAccessibilityData] = useState(null);
Expand Down Expand Up @@ -58,7 +57,6 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
// Reset selected rows when changing tabs
setSelectedRows([]);
setCurrentPage(1);
setIsAllSelected(false);
};

useEffect(async () => {
Expand Down Expand Up @@ -178,7 +176,6 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
}
);
setSelectedRows([]);
setIsAllSelected(false);
await new Promise((resolve) => setTimeout(resolve, 500));
setTableLoader(false);
}
Expand All @@ -196,7 +193,6 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
const newSelectedRows = event.selectedRows.map(row => row.id);
// Update the state with the list of selected IDs
setSelectedRows(newSelectedRows);
setIsAllSelected(event.allSelected);
};

const handleViewDetailsForAccessibility = (row) => {
Expand Down Expand Up @@ -280,7 +276,6 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
{
onSuccess: async (result) => {
setSelectedRows([]);
setIsAllSelected(false);
updateDetails(newDetails);
if(facilityAssignedStatus){
setShowToast({ key: "success", label: `${ t("UNASSIGNED_SUCESS")} ${details?.additionalDetails?.facilityName}`, transitionTime: 5000 });
Expand All @@ -292,6 +287,7 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
},
onError: async (result) => {
// setDownloadError(true);
setSelectedRows([]);
setShowToast({ key: "error", label: t("ERROR_WHILE_UPDATING_PLANFACILITY"), transitionTime: 5000 });
},
}
Expand Down Expand Up @@ -388,7 +384,7 @@ const FacilityPopUp = ({ details, onClose, updateDetails }) => {
type="button"
onClick={handleAssignUnassign}
size={"large"}
icon={"AddIcon"}
icon={facilityAssignedStatus ? "Close" : "AddIcon"}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const MicroplanDetails = ({ onSelect, props: customProps, ...props }) => {
);
const [executionCount, setExecutionCount] = useState(0);
const { campaignId, microplanId, key, ...queryParams } = Digit.Hooks.useQueryParams();
const [isFreezed, setIsFreezed] = useState(campaignId && microplanId ? true : false);
//const [isFreezed, setIsFreezed] = useState(campaignId && microplanId ? true : false);
const campaignData = customProps?.sessionData?.CAMPAIGN_DETAILS?.campaignDetails;
const campaignCard = [
{
Expand Down Expand Up @@ -119,7 +119,7 @@ const MicroplanDetails = ({ onSelect, props: customProps, ...props }) => {
placeholder={t("MICROPLAN_NAME_INPUT_PLACEHOLDER")}
value={microplan}
onChange={onChangeMicroplanName}
disabled={isFreezed}
// disabled={isFreezed}
/>
</div>
</LabelFieldPair>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ const PopInboxTable = ({ ...props }) => {
},
width: "180px",
},
{
name: t("INBOX_ASSIGNEE"),
selector: (row, index) => props?.employeeNameData?.[row?.assignee] || t("ES_COMMON_NA"),
sortable: true,
width: "180px",
},
...(
(props?.censusData?.[0]?.additionalFields || [])
.filter((field) => field.showOnUi)
Expand Down Expand Up @@ -101,12 +107,6 @@ const PopInboxTable = ({ ...props }) => {
sortable: false,
width: "180px",
},
{
name: t("INBOX_ASSIGNEE"),
selector: (row, index) => props?.employeeNameData?.[row?.assignee] || t("ES_COMMON_NA"),
sortable: true,
width: "180px",
},
];
}, [props.showEditColumn, props.employeeNameData, props.censusData]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ const AccessibilityPopUp = ({ onClose, census, onSuccess }) => {
// Initialize dropdown values with the existing accessibility details from additionalDetails if available
const [dropdown1Value, setDropdown1Value] = useState(null);
const [dropdown2Value, setDropdown2Value] = useState(null);
const [dropdown3Value, setDropdown3Value] = useState(null);
// const [dropdown3Value, setDropdown3Value] = useState(null);
const [initialValues, setInitialValues] = useState({});
const [showToast, setShowToast] = useState(null);

useEffect(() => {
if (census?.additionalDetails?.accessibilityDetails) {
const { roadCondition, terrain, transportationMode } = census?.additionalDetails?.accessibilityDetails || {};
const { roadCondition, terrain} = census?.additionalDetails?.accessibilityDetails || {}; /// removed transportationMode
setDropdown1Value(roadCondition);
setDropdown2Value(terrain);
setDropdown3Value(transportationMode);
// setDropdown3Value(transportationMode);

// Store initial values to compare later
setInitialValues({
roadCondition,
terrain,
transportationMode,
// transportationMode,
});
}
}, [census]);
Expand All @@ -46,9 +46,9 @@ const AccessibilityPopUp = ({ onClose, census, onSuccess }) => {
case "dropdown2":
setDropdown2Value(value);
break;
case "dropdown3":
setDropdown3Value(value);
break;
// case "dropdown3":
// setDropdown3Value(value);
// break;
default:
break;
}
Expand All @@ -63,7 +63,7 @@ const AccessibilityPopUp = ({ onClose, census, onSuccess }) => {
accessibilityDetails: {
roadCondition: dropdown1Value,
terrain: dropdown2Value,
transportationMode: dropdown3Value,
// transportationMode: dropdown3Value,
},
},
},
Expand All @@ -73,10 +73,10 @@ const AccessibilityPopUp = ({ onClose, census, onSuccess }) => {
const isChanged = React.useCallback(() => {
return (
dropdown1Value !== initialValues.roadCondition ||
dropdown2Value !== initialValues.terrain ||
dropdown3Value !== initialValues.transportationMode
dropdown2Value !== initialValues.terrain
//dropdown3Value !== initialValues.transportationMode
);
}, [dropdown1Value, dropdown2Value, dropdown3Value, initialValues]);
}, [dropdown1Value, dropdown2Value, initialValues]);

// Define the mutation configuration
const mutation = Digit.Hooks.useCustomAPIMutationHook({
Expand Down Expand Up @@ -129,7 +129,7 @@ const AccessibilityPopUp = ({ onClose, census, onSuccess }) => {
/>
</LabelFieldPair>

<LabelFieldPair>
{/* <LabelFieldPair>
<div className="edit-label">{t(`HCM_MICROPLAN_VILLAGE_TRANSPORTATION_MODE_LABEL`)}</div>
<Dropdown
option={[{ name: "OTHER", code: "OTHER" }]} // Your options list
Expand All @@ -138,7 +138,7 @@ const AccessibilityPopUp = ({ onClose, census, onSuccess }) => {
select={(value) => handleDropdownChange(value, "dropdown3")}
t={t}
/>
</LabelFieldPair>
</LabelFieldPair> */}
</Card>,
]}
onOverlayClick={onClose}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const TimelinePopUpWrapper = ({ onClose, businessId, heading }) => {
label: t(instance?.action),
variant: 'completed',
subElements: [Digit.Utils.microplanv1.epochToDateTime(instance?.auditDetails?.lastModifiedTime),
instance?.assignes?.length > 0 &&
`${instance.assignes[0]?.name} - ${instance.assignes[0]?.roles?.[0]?.name || 'NA'}`,
instance.comment && t(`${instance.comment}`)
instance?.assigner &&
`${instance.assigner?.name} - ${instance.assigner?.roles?.[0]?.name || 'NA'}`,
instance.comment && `${t('COMMENT_PREFIX')} "${instance.comment}"`
],
showConnector: true
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const facilityMappingConfig = (projectType) => {
{
label: "MICROPLAN_FACILITY_SERVINGPOPULATION",
jsonPath: "additionalDetails.servingPopulation",
additionalCustomization: true,
},
{
label: "MICROPLAN_FACILITY_FIXEDPOST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export const UICustomizations = {
variation="secondary"
icon={"ArrowForward"}
type="button"
style={{minWidth:"240px"}}
isDisabled={!hasRequiredRole}
// className="dm-workbench-download-template-btn dm-hover"
onClick={(e) => onActionSelect("START", row)}
Expand All @@ -276,6 +277,7 @@ export const UICustomizations = {
label={t("WBH_DOWNLOAD")}
variation="secondary"
icon={"FileDownload"}
style={{minWidth:"240px"}}
type="button"
// className="dm-workbench-download-template-btn dm-hover"
onClick={(e) => onActionSelect("DOWNLOAD", row)}
Expand All @@ -285,6 +287,7 @@ export const UICustomizations = {
label={t("WBH_EDIT")}
variation="secondary"
icon={"Edit"}
style={{minWidth:"240px"}}
type="button"
// className="dm-workbench-download-template-btn dm-hover"
onClick={(e) => onActionSelect("EDIT", row)}
Expand Down Expand Up @@ -527,6 +530,8 @@ export const UICustomizations = {
const [showPopup, setShowPopup] = useState(false);
const FacilityPopUp = Digit.ComponentRegistryService.getComponent("FacilityPopup");
switch (key) {
case "MICROPLAN_FACILITY_SERVINGPOPULATION":
return row?.additionalDetails?.servingPopulation;
case "MICROPLAN_FACILITY_RESIDINGVILLAGE":
return t(row?.residingBoundary);
case "MICROPLAN_FACILITY_ASSIGNED_VILLAGES":
Expand Down
Loading

0 comments on commit baf12f7

Please sign in to comment.