Skip to content

Commit

Permalink
updated versions for v0.2 admin console in master (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhavya-egov authored Aug 13, 2024
1 parent b6249df commit d5b9fa6
Show file tree
Hide file tree
Showing 13 changed files with 138 additions and 57 deletions.
10 changes: 5 additions & 5 deletions health/micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"start": "react-scripts start"
},
"devDependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.1",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.3",
"@egovernments/digit-ui-components": "0.0.2-beta.1",
"@egovernments/digit-ui-module-core": "1.8.2-beta.2",
"@egovernments/digit-ui-libraries": "1.8.2-beta.6",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.7",
"@egovernments/digit-ui-components": "0.0.2-beta.19",
"@egovernments/digit-ui-module-core": "1.8.2-beta.13",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.30",
"@egovernments/digit-ui-react-components": "1.8.2-beta.10",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-module-hcmworkbench":"0.0.38",
"@egovernments/digit-ui-module-campaign-manager": "0.2.0",
"@egovernments/digit-ui-module-hcmmicroplanning": "0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
rel="stylesheet"
href="https://unpkg.com/@egovernments/digit-ui-css@1.8.0-alpha.6/dist/index.css"
/> -->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.2-beta.9/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.2-beta.11/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.0-alpha.6/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.13/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.65-campaign/dist/index.css" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ module.exports = function (app) {
"/boundary-service",
"/product",
"/plan-service",
"/health-project"
].forEach((location) => app.use(location, createProxy));
["/pb-egov-assets"].forEach((location) => app.use(location, assetsProxy));
["/mdms-v2/v2/_create"].forEach((location) => app.use(location, mdmsProxy));
Expand Down
4 changes: 2 additions & 2 deletions health/micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"ajv": "8.12.0",
"lodash": "4.17.21",
"microbundle-crl": "0.13.11",
"@egovernments/digit-ui-react-components": "1.8.2-beta.10",
"@egovernments/digit-ui-components": "0.0.2-beta.1",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-components": "0.0.2-beta.19",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "6.15.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ const TimelineComponent = ({campaignId, resourceId}) => {
return latestProcess;
}, null);

const failedProcess = progessTrack?.processTrack
.filter((process) => process.status === "failed")
.reduce((latestProcess, currentProcess) => {
return latestProcess === null || currentProcess.lastModifiedTime > latestProcess.lastModifiedTime ? currentProcess : latestProcess;
}, null);

const searchAPIData = async (campaignId, resourceId) => {
try {
Expand All @@ -112,21 +117,26 @@ const TimelineComponent = ({campaignId, resourceId}) => {
};

useEffect(() => {
if (resourceId.length === 0 && lastCompletedProcess?.type === "campaign-creation" && lastCompletedProcess?.status === "completed" && !dataFetched ) {
if (
resourceId.length === 0 &&
lastCompletedProcess?.type === "campaign-creation" &&
lastCompletedProcess?.status === "completed" &&
!dataFetched
) {
const fetchData = async () => {
try {
const data = await searchAPIData(campaignId);
setSearchDATA(data);
setDataFetched(true)
setDataFetched(true);
} catch (error) {
console.error("Error fetching data:", error);
}
};

fetchData();
}
}, [campaignId, newResourceId, lastCompletedProcess , dataFetched]);
}, [campaignId, newResourceId, lastCompletedProcess, dataFetched]);

useEffect(() => {
if (searchDATA) {
const userResource = searchDATA?.CampaignDetails?.[0]?.resources?.find((resource) => resource.type === "user");
Expand All @@ -135,11 +145,11 @@ const TimelineComponent = ({campaignId, resourceId}) => {
}
}
}, [searchDATA]);

useEffect(() => {
let intervalId;

if (lastCompletedProcess?.type !== "campaign-creation") {
if (failedProcess?.status !== "failed" && lastCompletedProcess?.type !== "campaign-creation") {
intervalId = setInterval(() => {
refetch();
}, baseTimeOut?.["HCM-ADMIN-CONSOLE"]?.baseTimeOut?.[0]?.timelineRefetch);
Expand All @@ -162,23 +172,41 @@ const TimelineComponent = ({campaignId, resourceId}) => {
subElements: [epochToDateTime(process.lastModifiedTime)],
}));

// const inprogressProcesses = progessTrack?.processTrack
// .filter((process) => process.status === "inprogress" && process.showInUi === true)
// .map((process) => ({ type: process.type, lastModifiedTime: process.lastModifiedTime }));

// const subElements =
// inprogressProcesses?.length > 0
// ? inprogressProcesses.map((process) => `${t(formatLabel(process?.type))} , ${epochToDateTime(process.lastModifiedTime)}`)
// : [];

// const upcomingProcesses = progessTrack?.processTrack
// .filter((process) => process.status === "toBeCompleted" && process.showInUi === true)
// .map((process) => ({ type: process.type, lastModifiedTime: process.lastModifiedTime }));

// const subElements2 =
// upcomingProcesses?.length > 0
// ? upcomingProcesses.map((process) => `${t(formatLabel(process?.type))} , ${epochToDateTime(process.lastModifiedTime)}`)
// : [];

const inprogressProcesses = progessTrack?.processTrack
.filter((process) => process.status === "inprogress" && process.showInUi === true)
.map((process) => ({ type: process.type, lastModifiedTime: process.lastModifiedTime }));

const subElements =
inprogressProcesses?.length > 0
? inprogressProcesses.map((process) => `${t(formatLabel(process?.type))} , ${epochToDateTime(process.lastModifiedTime)}`)
: [];
const inProgressTimelines = inprogressProcesses?.map((process) => ({
label: t(formatLabel(process?.type)),
subElements: [epochToDateTime(process.lastModifiedTime)],
}));

const upcomingProcesses = progessTrack?.processTrack
.filter((process) => process.status === "toBeCompleted" && process.showInUi === true)
.map((process) => ({ type: process.type, lastModifiedTime: process.lastModifiedTime }));

const subElements2 =
upcomingProcesses?.length > 0
? upcomingProcesses.map((process) => `${t(formatLabel(process?.type))} , ${epochToDateTime(process.lastModifiedTime)}`)
: [];
const upcomingTimelines = upcomingProcesses?.map((process) => ({
label: t(formatLabel(process?.type)),
subElements: [epochToDateTime(process.lastModifiedTime)],
}));

// useEffect(()=>{
// const lastCompletedProcess = progessTrack?.processTrack
Expand Down Expand Up @@ -220,17 +248,32 @@ const TimelineComponent = ({campaignId, resourceId}) => {
return (
<React.Fragment>
<div className="timeline-user">
{subElements.length > 0 || subElements2.length > 0 ? (
{inProgressTimelines?.length > 0 || upcomingTimelines?.length > 0 ? (
<TimelineMolecule>
<Timeline label={t("HCM_UPCOMING")} variant="upcoming" subElements={subElements2} className={"upcoming-timeline"} showConnector={true} />
{/* <Timeline label={t("HCM_UPCOMING")} variant="upcoming" subElements={subElements2} className={"upcoming-timeline"} showConnector={true} /> */}

{/* <Timeline
label={t("HCM_CURRENT")}
subElements={subElements}
variant="inprogress"
showConnector={true}
/> */}
{subElements.length > 0 && <Timeline label={t("HCM_CURRENT")} subElements={subElements} variant="inprogress" showConnector={true} />}
{/* {subElements.length > 0 && <Timeline label={t("HCM_CURRENT")} subElements={subElements} variant="inprogress" showConnector={true} />} */}

{upcomingTimelines?.map((timeline, index) => (
<Timeline
key={index}
label={timeline?.label}
subElements={timeline?.subElements}
variant="upcoming"
showConnector={true}
className={"upcoming-timeline"}
/>
))}

{inProgressTimelines?.map((timeline, index) => (
<Timeline key={index} label={timeline?.label} subElements={timeline?.subElements} variant="inprogress" showConnector={true} />
))}

{completedTimelines?.map((timeline, index) => (
<Timeline key={index} label={timeline?.label} subElements={timeline?.subElements} variant="completed" showConnector={true} />
Expand All @@ -239,7 +282,14 @@ const TimelineComponent = ({campaignId, resourceId}) => {
) : (
<TimelineMolecule initialVisibleCount={1} hideFutureLabel={true}>
{completedTimelines?.map((timeline, index) => (
<Timeline key={index} label={timeline?.label} subElements={timeline?.subElements} variant="completed" showConnector={true} />
<Timeline
key={index}
label={timeline?.label}
subElements={timeline?.subElements}
variant="completed"
viewLessLabelForPast={t("HCM_SHOW_LESS")}
viewMoreLabelForPast={t("HCM_SHOW_MORE")}
showConnector={true} />
))}
</TimelineMolecule>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,14 @@ export const UICustomizations = {
type="actionButton"
variation="secondary"
label={"Action"}
// options={[
// { key: 1, code: "ACTION_LABEL_UPDATE_DATES", i18nKey: t("ACTION_LABEL_UPDATE_DATES") },
// { key: 2, code: "ACTION_LABEL_CONFIGURE_APP", i18nKey: t("ACTION_LABEL_CONFIGURE_APP") },
// { key: 3, code: "ACTION_LABEL_VIEW_TIMELINE", i18nKey: t("ACTION_LABEL_VIEW_TIMELINE") },
// ]}
options={[
{ key: 1, code: "ACTION_LABEL_UPDATE_DATES", i18nKey: t("ACTION_LABEL_UPDATE_DATES") },
{ key: 2, code: "ACTION_LABEL_CONFIGURE_APP", i18nKey: t("ACTION_LABEL_CONFIGURE_APP") },
...(row?.status === "created" ? [{ key: 1, code: "ACTION_LABEL_UPDATE_DATES", i18nKey: t("ACTION_LABEL_UPDATE_DATES") }] : []),
// { key: 2, code: "ACTION_LABEL_CONFIGURE_APP", i18nKey: t("ACTION_LABEL_CONFIGURE_APP") },
{ key: 3, code: "ACTION_LABEL_VIEW_TIMELINE", i18nKey: t("ACTION_LABEL_VIEW_TIMELINE") },
]}
optionsKey="i18nKey"
Expand Down Expand Up @@ -450,9 +455,14 @@ export const UICustomizations = {
type="actionButton"
variation="secondary"
label={"Action"}
// options={[
// { key: 1, code: "ACTION_LABEL_UPDATE_DATES", i18nKey: t("ACTION_LABEL_UPDATE_DATES") },
// { key: 2, code: "ACTION_LABEL_CONFIGURE_APP", i18nKey: t("ACTION_LABEL_CONFIGURE_APP") },
// { key: 3, code: "ACTION_LABEL_VIEW_TIMELINE", i18nKey: t("ACTION_LABEL_VIEW_TIMELINE") },
// ]}
options={[
{ key: 1, code: "ACTION_LABEL_UPDATE_DATES", i18nKey: t("ACTION_LABEL_UPDATE_DATES") },
{ key: 2, code: "ACTION_LABEL_CONFIGURE_APP", i18nKey: t("ACTION_LABEL_CONFIGURE_APP") },
...(row?.status === "created" ? [{ key: 1, code: "ACTION_LABEL_UPDATE_DATES", i18nKey: t("ACTION_LABEL_UPDATE_DATES") }] : []),
// { key: 2, code: "ACTION_LABEL_CONFIGURE_APP", i18nKey: t("ACTION_LABEL_CONFIGURE_APP") },
{ key: 3, code: "ACTION_LABEL_VIEW_TIMELINE", i18nKey: t("ACTION_LABEL_VIEW_TIMELINE") },
]}
optionsKey="i18nKey"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,11 @@ const SetupCampaign = ({ hierarchyType }) => {
/>
{actionBar === "true" && (
<ActionBar style={{ zIndex: "19" }}>
{displayMenu ? <Menu options={["UPDATE_DATES", "CONFIGURE_APP"]} t={t} onSelect={onActionSelect} /> : null}
{displayMenu ? <Menu
options={["UPDATE_DATES",
// "CONFIGURE_APP"
]}
t={t} onSelect={onActionSelect} /> : null}
<SubmitBar label={t("ES_COMMON_TAKE_ACTION")} onSubmit={() => setDisplayMenu(!displayMenu)} />
</ActionBar>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ function UpdateDatesWithBoundaries() {
const [showToast, setShowToast] = useState(null);
const { state } = useLocation();
const [showPopUp, setShowPopUp] = useState(null);
const searchParams = new URLSearchParams(location.search);
const id = searchParams.get("id");
const { isLoading: DateWithBoundaryLoading, data: DateWithBoundary } = Digit.Hooks.useCustomMDMS(
tenantId,
"HCM-ADMIN-CONSOLE",
Expand All @@ -35,18 +37,27 @@ function UpdateDatesWithBoundaries() {
const checkValid = (data) => {
if (DateWithBoundary) {
const temp = data?.dateWithBoundary;
const allCycleDateValid = temp
.map((i) => i.additionalDetails.projectType.cycles.every((j) => j.startDate && j.endDate))
.every((k) => k === true);
// const allCycleDateValid = temp
// .map((i) => i.additionalDetails.projectType.cycles.every((j) => j.startDate && j.endDate))
// .every((k) => k === true);
const allCycleDateValid = temp?.projectType === "MR-DN"
? temp.map((i) => i?.additionalDetails?.projectType?.cycles.every((j) => j?.startDate && j?.endDate)).every((k) => k === true)
: true;
const allDateValid = temp.every((i) => i.startDate && i.endDate);

if (allCycleDateValid && allDateValid) {
if (temp?.projectType === "MR-DN" && allCycleDateValid && allDateValid) {
return true;
}
else if (temp?.projectType !== "MR-DN" && allDateValid) {
return true;
}
return false;
} else if (!DateWithBoundary) {
const cycleDateValid = data?.dateAndCycle?.additionalDetails?.projectType?.cycles?.every((item) => item?.startDate && item?.endDate);
if (data?.dateAndCycle?.startDate && data?.dateAndCycle?.endDate && cycleDateValid) {
if (data?.dateAndCycle?.projectType === "MR-DN" && data?.dateAndCycle?.startDate && data?.dateAndCycle?.endDate && cycleDateValid) {
return true;
}
else if (data?.dateAndCycle?.projectType !== "MR-DN" && data?.dateAndCycle?.startDate && data?.dateAndCycle?.endDate) {
return true;
}
return false;
Expand Down Expand Up @@ -100,7 +111,7 @@ function UpdateDatesWithBoundaries() {
// text: t("ES_CAMPAIGN_CREATE_SUCCESS_RESPONSE_TEXTKK"),
// info: t("ES_CAMPAIGN_SUCCESS_INFO_TEXTKK"),
actionLabel: t("HCM_DATE_CHANGE_SUCCESS_RESPONSE_ACTION"),
actionLink: `/${window.contextPath}/employee/campaign/my-campaign`,
actionLink: `/${window.contextPath}/employee/campaign/setup-campaign?id=${id}&preview=true&action=false&actionBar=true&key=10&summary=true`
});
} else {
const res = await Digit.CustomService.getResponse({
Expand All @@ -115,7 +126,7 @@ function UpdateDatesWithBoundaries() {
// text: t("ES_CAMPAIGN_CREATE_SUCCESS_RESPONSE_TEXTKK"),
// info: t("ES_CAMPAIGN_SUCCESS_INFO_TEXTKK"),
actionLabel: t("HCM_DATE_CHANGE_SUCCESS_RESPONSE_ACTION"),
actionLink: `/${window.contextPath}/employee/campaign/my-campaign`,
actionLink: `/${window.contextPath}/employee/campaign/setup-campaign?id=${id}&preview=true&action=false&actionBar=true&key=10&summary=true`
});
}
} catch (error) {
Expand Down Expand Up @@ -159,7 +170,9 @@ function UpdateDatesWithBoundaries() {
}}
variant="default"
style={{ marginBottom: "1.5rem", marginTop: "1.5rem", marginLeft: "0rem", maxWidth: "100%" }}
additionalElements={[<span style={{ color: "#505A5F" }}>{t(`UPDATE_DATE_CHANGE_INFO_TEXT`)}</span>]}
additionalElements={[<span style={{ color: "#505A5F" }}>{t(`UPDATE_DATE_CHANGE_INFO_TEXT1`)}</span>,
<span style={{ color: "#505A5F" }}>{t(`UPDATE_DATE_CHANGE_INFO_TEXT2`)}</span>
]}
label={"Info"}
headerClassName={"headerClassName"}
/>
Expand All @@ -172,6 +185,9 @@ function UpdateDatesWithBoundaries() {
onOverlayClick={() => {
setShowPopUp(false);
}}
onClose={() => {
setShowPopUp(false);
}}
footerChildren={[
<Button
type={"button"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"dependencies": {
"@cyntler/react-doc-viewer": "1.10.3",
"@egovernments/digit-ui-components": "0.0.2-beta.2",
"@egovernments/digit-ui-react-components": "1.8.2-beta.4",
"@egovernments/digit-ui-components": "0.0.2-beta.19",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-svg-components": "1.0.8",
"@rjsf/core": "5.10.0",
"@rjsf/utils": "5.10.0",
Expand Down
8 changes: 4 additions & 4 deletions health/micro-ui/web/microplan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
],
"homepage": "/microplan-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.1",
"@egovernments/digit-ui-module-core": "1.8.2-beta.1",
"@egovernments/digit-ui-libraries": "1.8.2-beta.6",
"@egovernments/digit-ui-module-core": "1.8.2-beta.13",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.23",
"@egovernments/digit-ui-react-components": "1.8.2-beta.1",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-module-hcmmicroplanning":"0.0.1",
"@egovernments/digit-ui-components": "0.0.2-beta.2",
"@egovernments/digit-ui-components": "0.0.2-beta.19",
"babel-loader": "8.1.0",
"clean-webpack-plugin": "4.0.0",
"react": "17.0.2",
Expand Down
10 changes: 5 additions & 5 deletions health/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
],
"homepage": "/digit-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.1-beta.4",
"@egovernments/digit-ui-module-workbench": "1.0.1-beta.16",
"@egovernments/digit-ui-module-core": "1.8.2-beta.2",
"@egovernments/digit-ui-libraries": "1.8.2-beta.6",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.7",
"@egovernments/digit-ui-module-core": "1.8.2-beta.13",
"@egovernments/digit-ui-module-hrms": "1.8.0-beta.2",
"@egovernments/digit-ui-react-components": "1.8.2-beta.10",
"@egovernments/digit-ui-components": "0.0.2-beta.1",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-components": "0.0.2-beta.19",
"@egovernments/digit-ui-module-dss": "1.8.0-beta",
"@egovernments/digit-ui-module-common": "1.8.0-beta",
"@egovernments/digit-ui-module-utilities": "1.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion health/micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.0-alpha.6/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.2-beta.9/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.2-beta.11/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.11/dist/index.css" />
<!-- added below css for hcm-workbench module inclusion-->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.0.65-campaign/dist/index.css" />
Expand Down
Loading

0 comments on commit d5b9fa6

Please sign in to comment.