From 3e3c7e3763ede6223d896ee0083224071aea08f9 Mon Sep 17 00:00:00 2001 From: nabeelmd-eGov <94039229+nabeelmd-eGov@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:00:17 +0530 Subject: [PATCH 01/11] Core ui version fix (#1176) Co-authored-by: nabeelmd-eGov --- micro-ui/web/micro-ui-internals/example/package.json | 2 +- micro-ui/web/micro-ui-internals/example/public/index.html | 2 +- micro-ui/web/micro-ui-internals/packages/css/package.json | 2 +- .../packages/css/src/pages/employee/index.scss | 5 +++++ micro-ui/web/package.json | 2 +- micro-ui/web/public/index.html | 2 +- micro-ui/web/workbench/package.json | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/example/package.json b/micro-ui/web/micro-ui-internals/example/package.json index 0ebce643710..1f903f2bde4 100644 --- a/micro-ui/web/micro-ui-internals/example/package.json +++ b/micro-ui/web/micro-ui-internals/example/package.json @@ -12,7 +12,7 @@ "@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-module-core": "1.8.2-beta.7", + "@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", "@egovernments/digit-ui-module-hcmworkbench":"0.0.38", diff --git a/micro-ui/web/micro-ui-internals/example/public/index.html b/micro-ui/web/micro-ui-internals/example/public/index.html index cb302969a6c..5ace6d5947a 100644 --- a/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/micro-ui/web/micro-ui-internals/example/public/index.html @@ -17,7 +17,7 @@ - + diff --git a/micro-ui/web/micro-ui-internals/packages/css/package.json b/micro-ui/web/micro-ui-internals/packages/css/package.json index 387687e08d7..a105cd9f97c 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/package.json +++ b/micro-ui/web/micro-ui-internals/packages/css/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-css", - "version": "1.0.62-campaign", + "version": "1.0.63-campaign", "license": "MIT", "main": "dist/index.css", "author": "Jagankumar ", diff --git a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss index 0a830f434e3..db6f6a1d271 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss +++ b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss @@ -545,3 +545,8 @@ tbody { bottom: 2.25rem; } } +.table.campaign-table { + .header-dropdown-menu.showBottom { + min-width: 8.6rem; + } +} diff --git a/micro-ui/web/package.json b/micro-ui/web/package.json index f7cb38d3626..870a830d91b 100644 --- a/micro-ui/web/package.json +++ b/micro-ui/web/package.json @@ -16,7 +16,7 @@ "dependencies": { "@egovernments/digit-ui-libraries": "1.8.2-beta.5", "@egovernments/digit-ui-module-workbench": "1.0.1-beta.16", - "@egovernments/digit-ui-module-core": "1.8.2-beta.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", diff --git a/micro-ui/web/public/index.html b/micro-ui/web/public/index.html index f4499a408a4..24a43e2bba3 100644 --- a/micro-ui/web/public/index.html +++ b/micro-ui/web/public/index.html @@ -11,7 +11,7 @@ - + DIGIT diff --git a/micro-ui/web/workbench/package.json b/micro-ui/web/workbench/package.json index 81c5dcd1dd1..ff581e92e58 100644 --- a/micro-ui/web/workbench/package.json +++ b/micro-ui/web/workbench/package.json @@ -15,7 +15,7 @@ "@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-module-core": "1.8.2-beta.7", + "@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", "@egovernments/digit-ui-module-hcmworkbench":"0.0.38", From e86a4dcb10dda9210ce4be75977502af7df366f6 Mon Sep 17 00:00:00 2001 From: ashish-egov <137176738+ashish-egov@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:59:25 +0530 Subject: [PATCH 02/11] Ashish egov patch 2 (#1178) * Update Listener.ts * added new branch * Update Listener.ts * fixed mapping kafka error * mapping kafka fixed * fix kafka * fix kafka * Removing foreign key constraint * Producer update * Update publishProjectFactory.yml --- .../src/server/kafka/Producer.ts | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/utilities/project-factory/src/server/kafka/Producer.ts b/utilities/project-factory/src/server/kafka/Producer.ts index 10938d880fd..bba3e19ae8b 100644 --- a/utilities/project-factory/src/server/kafka/Producer.ts +++ b/utilities/project-factory/src/server/kafka/Producer.ts @@ -12,33 +12,39 @@ const kafkaClient = new KafkaClient({ // Creating a new Kafka producer instance using the Kafka client const producer = new Producer(kafkaClient, { partitionerType: 2 }); // Using partitioner type 2 -// Function to send a test message to check broker availability +// Function to check broker availability const checkBrokerAvailability = () => { - const payloads = [ - { - topic: config.kafka.KAFKA_TEST_TOPIC, - messages: JSON.stringify({ message: 'Test message to check broker availability' }), - }, - ]; - - producer.send(payloads, (err, data) => { + kafkaClient.loadMetadataForTopics([], (err, data) => { if (err) { if (err.message && err.message.toLowerCase().includes('broker not available')) { logger.error('Broker not available. Shutting down the service.'); shutdownGracefully(); } else { - logger.error('Error sending test message:', err); + logger.error('Error checking broker availability:', err); } } else { - logger.info('Test message sent successfully:', data); + logger.info('Broker is available:', data); } }); }; +// Event listener for 'ready' event, indicating that the client is ready to check broker availability +kafkaClient.on('ready', () => { + logger.info('Kafka client is ready'); // Log message indicating client is ready + checkBrokerAvailability(); // Check broker availability +}); + // Event listener for 'ready' event, indicating that the producer is ready to send messages producer.on('ready', () => { logger.info('Producer is ready'); // Log message indicating producer is ready - checkBrokerAvailability(); // Check broker availability by sending a test message + checkBrokerAvailability(); +}); + +// Event listener for 'error' event, indicating that the client encountered an error +kafkaClient.on('error', (err) => { + logger.error('Kafka client is in error state'); // Log message indicating client is in error state + console.error(err.stack || err); // Log the error stack or message + shutdownGracefully(); }); // Event listener for 'error' event, indicating that the producer encountered an error @@ -48,4 +54,4 @@ producer.on('error', (err) => { shutdownGracefully(); }); -export { producer }; // Exporting the producer instance for external use +export { producer }; // Exporting the producer instance for external use \ No newline at end of file From 96772cbb1c962a8bd5923079149d52b8cf8e8386 Mon Sep 17 00:00:00 2001 From: ashish-egov <137176738+ashish-egov@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:20:04 +0530 Subject: [PATCH 03/11] Update Producer.ts (#1182) --- .../src/server/kafka/Producer.ts | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/utilities/project-factory/src/server/kafka/Producer.ts b/utilities/project-factory/src/server/kafka/Producer.ts index bba3e19ae8b..10938d880fd 100644 --- a/utilities/project-factory/src/server/kafka/Producer.ts +++ b/utilities/project-factory/src/server/kafka/Producer.ts @@ -12,39 +12,33 @@ const kafkaClient = new KafkaClient({ // Creating a new Kafka producer instance using the Kafka client const producer = new Producer(kafkaClient, { partitionerType: 2 }); // Using partitioner type 2 -// Function to check broker availability +// Function to send a test message to check broker availability const checkBrokerAvailability = () => { - kafkaClient.loadMetadataForTopics([], (err, data) => { + const payloads = [ + { + topic: config.kafka.KAFKA_TEST_TOPIC, + messages: JSON.stringify({ message: 'Test message to check broker availability' }), + }, + ]; + + producer.send(payloads, (err, data) => { if (err) { if (err.message && err.message.toLowerCase().includes('broker not available')) { logger.error('Broker not available. Shutting down the service.'); shutdownGracefully(); } else { - logger.error('Error checking broker availability:', err); + logger.error('Error sending test message:', err); } } else { - logger.info('Broker is available:', data); + logger.info('Test message sent successfully:', data); } }); }; -// Event listener for 'ready' event, indicating that the client is ready to check broker availability -kafkaClient.on('ready', () => { - logger.info('Kafka client is ready'); // Log message indicating client is ready - checkBrokerAvailability(); // Check broker availability -}); - // Event listener for 'ready' event, indicating that the producer is ready to send messages producer.on('ready', () => { logger.info('Producer is ready'); // Log message indicating producer is ready - checkBrokerAvailability(); -}); - -// Event listener for 'error' event, indicating that the client encountered an error -kafkaClient.on('error', (err) => { - logger.error('Kafka client is in error state'); // Log message indicating client is in error state - console.error(err.stack || err); // Log the error stack or message - shutdownGracefully(); + checkBrokerAvailability(); // Check broker availability by sending a test message }); // Event listener for 'error' event, indicating that the producer encountered an error @@ -54,4 +48,4 @@ producer.on('error', (err) => { shutdownGracefully(); }); -export { producer }; // Exporting the producer instance for external use \ No newline at end of file +export { producer }; // Exporting the producer instance for external use From c69f8b45b446aa6de57a4f52b109dee1ad7cd91c Mon Sep 17 00:00:00 2001 From: Bhavya-egov <137176879+Bhavya-egov@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:11:16 +0530 Subject: [PATCH 04/11] fixed timeline issues (#1185) --- .../micro-ui-internals/example/package.json | 2 +- .../example/public/index.html | 2 +- micro-ui/web/micro-ui-internals/package.json | 2 +- .../packages/css/package.json | 2 +- .../css/src/pages/employee/campaign.scss | 5 +++++ .../modules/campaign-manager/package.json | 2 +- .../src/components/CampaignSummary.js | 2 +- .../src/components/TimelineComponent.js | 19 +++++++++++-------- micro-ui/web/package.json | 2 +- micro-ui/web/public/index.html | 2 +- micro-ui/web/workbench/package.json | 2 +- 11 files changed, 25 insertions(+), 17 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/example/package.json b/micro-ui/web/micro-ui-internals/example/package.json index 1f903f2bde4..50ad45ff778 100644 --- a/micro-ui/web/micro-ui-internals/example/package.json +++ b/micro-ui/web/micro-ui-internals/example/package.json @@ -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", diff --git a/micro-ui/web/micro-ui-internals/example/public/index.html b/micro-ui/web/micro-ui-internals/example/public/index.html index 5ace6d5947a..a69003b67f2 100644 --- a/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/micro-ui/web/micro-ui-internals/example/public/index.html @@ -17,7 +17,7 @@ - + diff --git a/micro-ui/web/micro-ui-internals/package.json b/micro-ui/web/micro-ui-internals/package.json index dec069e5b22..e11402fb30b 100644 --- a/micro-ui/web/micro-ui-internals/package.json +++ b/micro-ui/web/micro-ui-internals/package.json @@ -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", diff --git a/micro-ui/web/micro-ui-internals/packages/css/package.json b/micro-ui/web/micro-ui-internals/packages/css/package.json index a105cd9f97c..43066db29bc 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/package.json +++ b/micro-ui/web/micro-ui-internals/packages/css/package.json @@ -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 ", diff --git a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss index 4cc371900f3..4c10120e551 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss +++ b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/campaign.scss @@ -121,3 +121,8 @@ display: flex; justify-content: space-between; } +.upcoming-timeline{ + .timeline-label{ + color: #b1b4b6; + } +} diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json index 505fdeb2edf..d66e1f825f0 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/package.json @@ -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", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js index c17e2fed55a..6d84785a754 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js @@ -221,7 +221,7 @@ const CampaignSummary = (props) => { const cycleData = reverseDeliveryRemap(target, t); return { cards: [ - isPreview + isPreview === "true" ? { name: "timeline", sections: [ diff --git a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/TimelineComponent.js b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/TimelineComponent.js index f6ca3957669..741cf1852b5 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/TimelineComponent.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/TimelineComponent.js @@ -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()}`; }; @@ -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; @@ -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(()=>{ @@ -183,7 +184,9 @@ const TimelineComponent = ({campaignId, resourceId}) => { + { ) } - {userCredential && ( + {userCredential && lastCompletedProcess?.type === "campaign-creation" && (