Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Engagement module added for MFE (DPG-2240) #170

Open
wants to merge 2 commits into
base: mf-build-docker
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion micro-ui/web/lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"packages/common",
"packages/workbench",
"packages/ui-core",
"packages/app1"
"packages/app1",
"packages/engagement"
],
"command": {
"run": {
Expand Down
5 changes: 4 additions & 1 deletion micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
"packages/workbench",
"packages/common",
"packages/ui-core",
"packages/app1"
"packages/app1",
"packages/engagement"
],
"scripts": {
"build": "yarn lerna run build",
"start": "yarn lerna run start --parallel",
"build:core": "cd packages/core && yarn build",
"start:engagement": "cd packages/engagement && yarn start",
"build:common": "cd packages/common && yarn build",
"build:hrms": "cd packages/hrms && yarn build",
"build:engagement": "cd packages/engagement && yarn build",
"build:workbench": "cd packages/workbench && yarn build",
"build:dss": "cd packages/dss && yarn build",
"start:core": "cd packages/core && yarn start",
Expand Down
10 changes: 10 additions & 0 deletions micro-ui/web/packages/core/src/modules/registerRemotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ export default (queryClient) => {
// queryClient,
// },
// });
registerApplication({
name: "Engagement",
app: () => import("engagement/EngagementModule"),
activeWhen: "/workbench-ui/employee/engagement",
customProps: {
title: "Engagement is running on host",
queryClient,
},
});

start();
}


4 changes: 3 additions & 1 deletion micro-ui/web/packages/core/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ module.exports = () => {
// dashboard: "dashboard@http://localhost:8084/remoteEntry.js",
// hrms: "hrms@https://localhost:8085/remoteEntry.js",
workbench: "workbench@https://localhost:8086/remoteEntry.js",
common:"common@https://localhost:8090/remoteEntry.js"
common:"common@https://localhost:8090/remoteEntry.js",
// app1: "app1@https://localhost:8001/remoteEntry.js",
// dss: "dss@https://localhost:8087/remoteEntry.js",
// measurement : "measurement@https://localhost:8088/remoteEntry.js"
engagement: "engagement_ui@https://localhost:8089/remoteEntry.js"

},
shared: packageJson.dependencies,
}),
Expand Down
2 changes: 2 additions & 0 deletions micro-ui/web/packages/core/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module.exports = () => {
workbench : `workbench_web@${domain}/workbench/remoteEntry.js`,
// dss : `dss@${domain}/dss/remoteEntry.js`,
// measurement : `measurement@${domain}/measurement/remoteEntry.js`
engagement: `engagement_ui@${domain}/workbench/remoteEntry.js`

},
// shared: packageJson.dependencies,
}),
Expand Down
81 changes: 81 additions & 0 deletions micro-ui/web/packages/engagement/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<!-- TODO: update this -->

# digit-ui-module-engagement

## Install

```bash
npm install --save @egovernments/digit-ui-module-engagement
```

## Limitation

```bash
This Package is more specific to DIGIT-UI's can be used across mission's
```

## Usage

After adding the dependency make sure you have this dependency in

```bash
frontend/micro-ui/web/package.json
```

```json
"@egovernments/digit-ui-module-engagement":"^1.5.0",
```

then navigate to App.js

```bash
frontend/micro-ui/web/src/App.js
```


```jsx
/** add this import **/

import { initEngagementComponents } from "@egovernments/digit-ui-module-engagement";

/** inside enabledModules add this new module key **/

const enabledModules = ["Engagement"];

/** inside init Function call this function **/

const initDigitUI = () => {
initEngagementComponents();
};
```

### Changelog

```bash
1.8.0 workbench v1.0 release
1.8.0-beta workbench base version beta release
1.7.0 urban 2.9
1.6.0 urban 2.8
1.5.25 updated the readme content
1.5.24 added the readme file
1.5.23 base version
```

### Contributors

[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [vamshikrishnakole-wtt-egov]

## Documentation

Documentation Site (https://core.digit.org/guides/developer-guide/ui-developer-guide/digit-ui)

## Maintainer

- [jagankumar-egov](https://www.github.com/jagankumar-egov)


### Published from DIGIT Frontend
DIGIT Frontend Repo (https://github.com/egovernments/Digit-Frontend/tree/master)


![Logo](https://s3.ap-south-1.amazonaws.com/works-dev-asset/mseva-white-logo.png)
50 changes: 50 additions & 0 deletions micro-ui/web/packages/engagement/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "@digit-ui/digit-ui-module-engagement-mfe",
"version": "1.8.0",
"description": "",
"main": "Module.js",
"scripts": {
"predeploy": "yarn build",
"deploy": "gh-pages -d dist",
"start": "webpack serve --config webpack.dev.js",
"build": "webpack --config webpack.prod.js"
},
"homepage": "http://design-egov.github.io/auth",
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "7.12.10",
"@babel/preset-react": "7.12.10",
"babel-loader": "8.2.2",
"gh-pages": "^5.0.0",
"html-webpack-plugin": "^5.5.0",
"babel-plugin-react-html-attrs": "^3.0.5",
"css-loader": "^6.10.0",
"style-loader": "^3.3.4",
"@babel/preset-env":"7.23.9"
},
"dependencies": {
"single-spa-react": "^4.6.1",
"@digit-ui/digit-ui-libraries-mfe": "1.0.6",
"@egovernments/digit-ui-react-components": "1.4.106",
"@egovernments/digit-ui-svg-components": "0.0.8",
"@rjsf/core": "5.10.0",
"@rjsf/utils": "5.10.0",
"@rjsf/validator-ajv8": "5.10.0",
"react": "17.0.1",
"react-date-range": "1.4.0",
"react-dom": "17.0.1",
"react-hook-form": "6.15.8",
"react-i18next": "11.16.2",
"react-query": "3.6.1",
"react-router-dom": "5.2.0",
"react-select": "5.7.4",
"webpack": "^5.68.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"react-time-picker": "4.2.1",
"recharts": "^2.0.9",
"webpack-merge": "5.7.3"
}
}
89 changes: 89 additions & 0 deletions micro-ui/web/packages/engagement/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>Engagement Page</title>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigsWorkbench.js"></script> <script type="systemjs-importmap">
{
"imports": {
"react": "https://cdn.jsdelivr.net/npm/[email protected]/umd/react.production.min.js",
"react-dom": "https://cdn.jsdelivr.net/npm/[email protected]/umd/react-dom.production.min.js"
}
}
</script>
<!-- <script src="https://cdn.jsdelivr.net/npm/systemjs/dist/system.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/systemjs/dist/extras/amd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/systemjs/dist/extras/named-exports.min.js"></script> -->
<!-- <script>
var globalConfigs = (function () {
var contextPath = "workbench-ui";
var stateTenantId = "pg";
var gmaps_api_key = "AIzaSyAASfCFja6YxwDzEAzhHFc8B-17TNTCV0g";
var configModuleName = "commonUiConfig";
var centralInstanceEnabled = false;
var localeRegion = "IN";
var localeDefault = "en";
var mdmsContext = "mdms-v2";
var footerBWLogoURL =
"https://unified-dev.digit.org/egov-dev-assets/digit-footer-bw.png";
var footerLogoURL =
"https://unified-dev.digit.org/egov-dev-assets/digit-footer.png";
var digitHomeURL = "https://www.digit.org/";
var assetS3Bucket = "egov-dev-assets";
var invalidEmployeeRoles = ["CBO_ADMIN", "ORG_ADMIN", "ORG_STAFF", "SYSTEM"];

var getConfig = function (key) {
if (key === "STATE_LEVEL_TENANT_ID") {
return stateTenantId;
} else if (key === "GMAPS_API_KEY") {
return gmaps_api_key;
} else if (key === "ENABLE_SINGLEINSTANCE") {
return centralInstanceEnabled;
} else if (key === "DIGIT_FOOTER_BW") {
return footerBWLogoURL;
} else if (key === "DIGIT_FOOTER") {
return footerLogoURL;
} else if (key === "DIGIT_HOME_URL") {
return digitHomeURL;
} else if (key === "S3BUCKET") {
return assetS3Bucket;
} else if (key === "CONTEXT_PATH") {
return contextPath;
} else if (key === "UICONFIG_MODULENAME") {
return configModuleName;
} else if (key === "LOCALE_REGION") {
return localeRegion;
} else if (key === "LOCALE_DEFAULT") {
return localeDefault;
} else if (key === "MDMS_CONTEXT_PATH") {
return mdmsContext;
} else if (key === "INVALIDROLES") {
return invalidEmployeeRoles;
}
};

return {
getConfig,
};
})();
</script> -->
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />

<link href="https://fonts.googleapis.com/css2?family=Oxygen:wght@400;700&display=swap" rel="stylesheet" />
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Oxygen", sans-serif;
}
</style>
</head>

<body>
<div id="engagement-module-root"></div>

</body>

</html>
20 changes: 20 additions & 0 deletions micro-ui/web/packages/engagement/src/EngagementWrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import { QueryClientProvider } from "react-query";
import { Switch, useLocation, BrowserRouter as Router } from "react-router-dom";
import { initEngagementComponents } from "./Module";
import { EmployeeApp } from "./Module";

const App = ({ queryClient, title }) => {
initEngagementComponents();
//make way to do this job in container while registering remotes

return (
<QueryClientProvider client={queryClient}>
<Router>
<EmployeeApp path={"/digit-ui/employee/engagement/"} />
</Router>
</QueryClientProvider>
);
};

export default App;
Loading