Skip to content

Commit

Permalink
fixed timeline issues (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhavya-egov committed Aug 12, 2024
1 parent b5245fb commit 291fe4b
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.5",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.3",
"@egovernments/digit-ui-components": "0.0.2-beta.18",
"@egovernments/digit-ui-components": "0.0.2-beta.19",
"@egovernments/digit-ui-module-core": "1.8.2-beta.8",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.30",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<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]/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].63-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].64-campaign/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
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"lodash": "4.17.21",
"microbundle-crl": "0.13.11",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-components": "0.0.2-beta.18",
"@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
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/packages/css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-css",
"version": "1.0.63-campaign",
"version": "1.0.64-campaign",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <[email protected]>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@
display: flex;
justify-content: space-between;
}
.upcoming-timeline{
.timeline-label{
color: #b1b4b6;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-components": "0.0.2-beta.18",
"@egovernments/digit-ui-components": "0.0.2-beta.19",
"@rjsf/core": "5.10.0",
"@rjsf/utils": "5.10.0",
"@rjsf/validator-ajv8": "5.10.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const CampaignSummary = (props) => {
const cycleData = reverseDeliveryRemap(target, t);
return {
cards: [
isPreview
isPreview === "true"
? {
name: "timeline",
sections: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const TimelineComponent = ({campaignId, resourceId}) => {
const { data: baseTimeOut } = Digit.Hooks.useCustomMDMS(tenantId, "HCM-ADMIN-CONSOLE", [{ name: "baseTimeOut" }]);

const formatLabel = (label) => {
if(!label) return null;
return `HCM_${label.replace(/-/g, "_").toUpperCase()}`;
};

Expand Down Expand Up @@ -83,7 +84,7 @@ const TimelineComponent = ({campaignId, resourceId}) => {
const { data: progessTrack , refetch} = Digit.Hooks.useCustomAPIHook(reqCriteria);

const lastCompletedProcess = progessTrack?.processTrack
.filter((process) => process.status === "completed")
.filter((process) => process.status === "completed" && process.showInUi === true)
.reduce((latestProcess, currentProcess) => {
if (!latestProcess || currentProcess.lastModifiedTime > latestProcess.lastModifiedTime) {
return currentProcess;
Expand All @@ -109,29 +110,29 @@ const TimelineComponent = ({campaignId, resourceId}) => {


const completedProcesses = progessTrack?.processTrack
.filter(process => process.status === 'completed')
.filter(process => process.status === 'completed' && process.showInUi === true)
.sort((a, b) => b.lastModifiedTime - a.lastModifiedTime)
.map(process => ({ type: process.type, lastModifiedTime: process.lastModifiedTime }));

const completedTimelines = completedProcesses?.map(process => ({
label: t(formatLabel(process.type)),
label: t(formatLabel(process?.type)),
subElements: [epochToDateTime(process.lastModifiedTime)],
}));

const inprogressProcesses = progessTrack?.processTrack
.filter(process => process.status === 'inprogress')
.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)}`)
? inprogressProcesses.map(process => `${t(formatLabel(process?.type))} , ${epochToDateTime(process.lastModifiedTime)}`)
: [];

const upcomingProcesses = progessTrack?.processTrack
.filter(process => process.status === "toBeCompleted")
.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)}`)
? upcomingProcesses.map(process => `${t(formatLabel(process?.type))} , ${epochToDateTime(process.lastModifiedTime)}`)
: [];

// useEffect(()=>{
Expand Down Expand Up @@ -183,7 +184,9 @@ const TimelineComponent = ({campaignId, resourceId}) => {
<Timeline label={t("HCM_UPCOMING")}
variant="upcoming"
subElements={subElements2}
className = {"upcoming-timeline"}
showConnector={true} />

<Timeline
label={t("HCM_CURRENT")}
subElements={subElements}
Expand Down Expand Up @@ -211,7 +214,7 @@ const TimelineComponent = ({campaignId, resourceId}) => {
</TimelineMolecule>
)
}
{userCredential && (
{userCredential && lastCompletedProcess?.type === "campaign-creation" && (
<Button
label={t("CAMPAIGN_DOWNLOAD_USER_CRED")}
variation="primary"
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@egovernments/digit-ui-module-core": "1.8.2-beta.8",
"@egovernments/digit-ui-module-hrms": "1.8.0-beta.2",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
"@egovernments/digit-ui-components": "0.0.2-beta.18",
"@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 micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<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" />
<!-- added below css for hcm-workbench module inclusion-->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].63-campaign/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].64-campaign/dist/index.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>DIGIT</title>
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.5",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.3",
"@egovernments/digit-ui-components": "0.0.2-beta.18",
"@egovernments/digit-ui-components": "0.0.2-beta.19",
"@egovernments/digit-ui-module-core": "1.8.2-beta.8",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.30",
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
Expand Down

0 comments on commit 291fe4b

Please sign in to comment.